diff --git a/.gitignore b/.gitignore index 15d1198..12d7ea5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ .clangd compile_commands.json TouchGFX/build +/Middlewares/ST/touchgfx_backup/ +/TouchGFX/screenshots +/TouchGFX/*_backup.touchgfx +/steering-wheel.ioc_bkp diff --git a/AZURE_RTOS/App/app_azure_rtos.c b/AZURE_RTOS/App/app_azure_rtos.c index c5641e8..795a34a 100644 --- a/AZURE_RTOS/App/app_azure_rtos.c +++ b/AZURE_RTOS/App/app_azure_rtos.c @@ -21,12 +21,12 @@ /* Includes ------------------------------------------------------------------*/ #include "app_azure_rtos.h" -#include "leds.h" #include "stm32h7xx.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "app.h" +#include "leds.h" #include "main.h" #include "ui.h" #include "vehicle.h" diff --git a/Core/Inc/RTE_Components.h b/Core/Inc/RTE_Components.h index 4085434..f5a8327 100644 --- a/Core/Inc/RTE_Components.h +++ b/Core/Inc/RTE_Components.h @@ -24,7 +24,7 @@ /* Defines ------------------------------------------------------------------*/ /* STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0 */ #define THREADX_ENABLED -/* STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2 */ +/* STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0 */ #define TOUCHGFX_APP #endif /* __RTE_COMPONENTS_H__ */ diff --git a/Makefile b/Makefile index 660ad5d..eca9c9a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.19.2] date: [Fri Mar 24 19:11:35 CET 2023] +# File automatically-generated by tool: [projectgenerator] version: [4.1.0] date: [Mon Jul 24 18:47:29 CEST 2023] ########################################################################################################################## # ------------------------------------------------ diff --git a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a index f8de481..9b72679 100644 Binary files a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a and b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a differ diff --git a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a index 3e4692c..aee1cda 100644 Binary files a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a and b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a differ diff --git a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll index 0cce66b..29c540e 100644 Binary files a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll and b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll differ diff --git a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib index eb328e7..bb204ea 100644 Binary files a/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib and b/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib differ diff --git a/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp b/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp index 369487f..e967426 100644 --- a/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp b/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp index e4c015e..9d4f150 100644 --- a/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp +++ b/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp b/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp index 26e40ab..93651fe 100644 --- a/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp b/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp index 65cbdc3..83b8b65 100644 --- a/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp +++ b/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp b/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp index 1a12b34..b5a0208 100644 --- a/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp +++ b/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp b/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp index d82faf4..f2f5510 100644 --- a/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp b/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp index f804faa..f7bb717 100644 --- a/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp b/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp index 580d74f..337f53c 100644 --- a/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp +++ b/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp b/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp index fa165e5..0aaf09d 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp index 3295767..598be96 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp index b0918bb..5948a9c 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp index bf88eba..b263342 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -284,6 +284,32 @@ public: */ void enableTextureMapperA4_NearestNeighbor(); + /** + * Enables all the decompressors available for L8 images (L4, RLE and LZW9). + * This allows drawing L4, RLE and LZW9 compressed L8 images. + * + * @see enableDecompressorL8_L4, enableDecompressorL8_RLE, enableDecompressorL8_LZW9 + */ + void enableDecompressorL8_All(); + + /** + * Enables the decompressor for L8 images compressed with the L4 algorithm. + * This allows drawing L4 compressed L8 images. + */ + void enableDecompressorL8_L4(); + + /** + * Enables the decompressor for L8 images compressed with the RLE algorithm. + * This allows drawing RLE compressed L8 images. + */ + void enableDecompressorL8_RLE(); + + /** + * Enables the decompressor for L8 images compressed with the LZW9 algorithm. + * This allows drawing LZW9 compressed L8 images. + */ + void enableDecompressorL8_LZW9(); + protected: virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); @@ -361,7 +387,7 @@ protected: * @param alpha The alpha value to use for blending applied to the whole image (255 = * solid, no blending) */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); /** * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per @@ -837,6 +863,61 @@ private: FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapStride, const uint8_t UFrac, const uint8_t VFrac) const; void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; }; + + class DecompressorL8Base + { + public: + virtual ~DecompressorL8Base() + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + }; + + class DecompressorL8_L4 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + uint16_t blendPixelRGB565(uint16_t imagePixel, uint16_t fbPixel, int alpha, int ialpha) const; + uint16_t blendPixelARGB8888(uint32_t imagePixel, uint16_t fbPixel, int alpha, uint8_t alphapix) const; + uint16_t blendPixelRGB888(const uint8_t* imagePixel, uint16_t fbPixel, uint8_t alpha, uint8_t ialpha) const; + }; + + class DecompressorL8_RLE : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t BLOCK_SIZE = 1024U; + }; + + class DecompressorL8_LZW9 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t MAX_DICT_SIZE = 512U; + static const uint16_t BLOCK_SIZE = 1024U; + + LZW9DictionaryEntry lzw9Dictionary[MAX_DICT_SIZE]; + uint8_t entryBuffer[64]; // Having 64byte max entry sizes entails 1 + 2 + ... + 63 + 64 = 2080px size image blocks + }; + + DecompressorL8Base* decompressorL8_L4; + DecompressorL8Base* decompressorL8_RLE; + DecompressorL8Base* decompressorL8_LZW9; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp index 57a6c27..b2b9de3 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -289,6 +289,32 @@ public: */ void enableTextureMapperA4_NearestNeighbor(); + /** + * Enables all the decompressors available for L8 images (L4, RLE and LZW9). + * This allows drawing L4, RLE and LZW9 compressed L8 images. + * + * @see enableDecompressorL8_L4, enableDecompressorL8_RLE, enableDecompressorL8_LZW9 + */ + void enableDecompressorL8_All(); + + /** + * Enables the decompressor for L8 images compressed with the L4 algorithm. + * This allows drawing L4 compressed L8 images. + */ + void enableDecompressorL8_L4(); + + /** + * Enables the decompressor for L8 images compressed with the RLE algorithm. + * This allows drawing RLE compressed L8 images. + */ + void enableDecompressorL8_RLE(); + + /** + * Enables the decompressor for L8 images compressed with the LZW9 algorithm. + * This allows drawing LZW9 compressed L8 images. + */ + void enableDecompressorL8_LZW9(); + protected: virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); @@ -812,6 +838,109 @@ private: FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapWidth, const uint8_t UFrac, const uint8_t VFrac) const; void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; }; + + class FlashDataProvider + { + public: + FlashDataProvider(FlashDataReader& _flashReader); + + void initialize(const uint8_t* _sourceData, uint32_t _maxBytesToRead); + bool addressIsAddressable(const void* address) const; + void increment(); + + uint8_t getCurrent() const + { + return *currentBytePtr; + } + + private: + void readFromFlash(); + + FlashDataReader& flashReader; + const uint8_t* sourceData; + uint32_t maxBytesToRead; + uint32_t bytesToRead; + const uint8_t* bufferEnd; + const uint8_t* currentBytePtr; + bool isAddressable; + + static const uint16_t MAX_BYTES_TO_READ = 64; + }; + + class DecompressorL8Base + { + public: + virtual ~DecompressorL8Base() + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + }; + + class DecompressorL8_L4 : public DecompressorL8Base + { + public: + DecompressorL8_L4(FlashDataReader& _flashReader) + : flashReader(_flashReader) + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + uint16_t blendPixelRGB565(uint16_t imagePixel, uint16_t fbPixel, int alpha, int ialpha) const; + uint16_t blendPixelARGB8888(uint32_t imagePixel, uint16_t fbPixel, int alpha, uint8_t alphapix) const; + FlashDataReader& flashReader; + }; + + class DecompressorL8_RLE : public DecompressorL8Base + { + public: + DecompressorL8_RLE(FlashDataReader& _flashReader) + : flashDataProvider(_flashReader) + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + FlashDataProvider flashDataProvider; + static const uint16_t BLOCK_SIZE = 1024U; + }; + + class DecompressorL8_LZW9 : public DecompressorL8Base + { + public: + DecompressorL8_LZW9(FlashDataReader& _flashReader) + : flashDataProvider(_flashReader) + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + FlashDataProvider flashDataProvider; + static const uint16_t MAX_DICT_SIZE = 512U; + static const uint16_t BLOCK_SIZE = 1024U; + + struct LZW9DictionaryEntry + { + uint8_t character; // Current character of the entry + uint8_t length; // Remaining length of the entry + uint16_t prefixIndex; // Index to previous character + }; + + LZW9DictionaryEntry lzw9Dictionary[MAX_DICT_SIZE]; + uint8_t entryBuffer[64]; // Having 64byte max entry sizes entails 1 + 2 + ... + 63 + 64 = 2080px size image blocks + }; + + DecompressorL8Base* decompressorL8_L4; + DecompressorL8Base* decompressorL8_RLE; + DecompressorL8Base* decompressorL8_LZW9; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp index 146a60b..69d6028 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -263,14 +263,14 @@ private: uint8_t getNextHalfByte() { + assert(data != 0 && "class bwRLEdata not properly initialized"); if (firstHalfByte) // Start of new byte, read data from BW_RLE stream { - assert(data); rleByte = *data++; } - uint8_t len = rleByte & 0xF; // Read lower half - rleByte >>= 4; // Shift upper half down to make it ready - firstHalfByte = !firstHalfByte; // Toggle 'start of byte' + const uint8_t len = rleByte & 0xF; // Read lower half + rleByte >>= 4; // Shift upper half down to make it ready + firstHalfByte = !firstHalfByte; // Toggle 'start of byte' return len; } diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp index f0c7504..3450f10 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -26,6 +26,8 @@ namespace touchgfx { +struct GlyphNode; + /** * This class contains the various low-level drawing routines for drawing bitmaps, texts and * rectangles on 16 bits per pixel displays. @@ -213,6 +215,32 @@ public: */ void enableTextureMapperA4_NearestNeighbor(); + /** + * Enables all the decompressors available for L8 images (L4, RLE and LZW9). + * This allows drawing L4, RLE and LZW9 compressed L8 images. + * + * @see enableDecompressorL8_L4, enableDecompressorL8_RLE, enableDecompressorL8_LZW9 + */ + void enableDecompressorL8_All(); + + /** + * Enables the decompressor for L8 images compressed with the L4 algorithm. + * This allows drawing L4 compressed L8 images. + */ + void enableDecompressorL8_L4(); + + /** + * Enables the decompressor for L8 images compressed with the RLE algorithm. + * This allows drawing RLE compressed L8 images. + */ + void enableDecompressorL8_RLE(); + + /** + * Enables the decompressor for L8 images compressed with the LZW9 algorithm. + * This allows drawing LZW9 compressed L8 images. + */ + void enableDecompressorL8_LZW9(); + protected: virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); @@ -278,7 +306,7 @@ protected: * @param alpha The alpha value to use for blending applied to the whole image (255 = * solid, no blending) */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); /** * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per @@ -580,6 +608,63 @@ private: FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; }; + + class DecompressorL8Base + { + public: + virtual ~DecompressorL8Base() + { + } + + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + }; + + class DecompressorL8_L4 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + void blendPixelRGB888(const uint8_t* imagePixel, uint8_t* const fbPixel, int alpha) const; + void blendPixelARGB8888(const uint8_t* imagePixel, uint8_t* const fbPixel, int alpha, uint8_t alphapix) const; + }; + + class DecompressorL8_RLE : public DecompressorL8Base + { + public: + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t BLOCK_SIZE = 1024U; + }; + + class DecompressorL8_LZW9 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t MAX_DICT_SIZE = 512U; + static const uint16_t BLOCK_SIZE = 1024U; + + struct LZW9DictionaryEntry + { + uint8_t character; // Current character of the entry + uint8_t length; // Remaining length of the entry + uint16_t prefixIndex; // Index to previous character + }; + + LZW9DictionaryEntry lzw9Dictionary[MAX_DICT_SIZE]; + uint8_t entryBuffer[64]; // Having 64byte max entry sizes entails 1 + 2 + ... + 63 + 64 = 2080px size image blocks + }; + + DecompressorL8Base* decompressorL8_L4; + DecompressorL8Base* decompressorL8_RLE; + DecompressorL8Base* decompressorL8_LZW9; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp index 697f2bf..da1802d 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp index 3b351ee..130da60 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -279,6 +279,32 @@ public: */ void enableTextureMapperA4_NearestNeighbor(); + /** + * Enables all the decompressors available for L8 images (L4, RLE and LZW9). + * This allows drawing L4, RLE and LZW9 compressed L8 images. + * + * @see enableDecompressorL8_L4, enableDecompressorL8_RLE, enableDecompressorL8_LZW9 + */ + void enableDecompressorL8_All(); + + /** + * Enables the decompressor for L8 images compressed with the L4 algorithm. + * This allows drawing L4 compressed L8 images. + */ + void enableDecompressorL8_L4(); + + /** + * Enables the decompressor for L8 images compressed with the RLE algorithm. + * This allows drawing RLE compressed L8 images. + */ + void enableDecompressorL8_RLE(); + + /** + * Enables the decompressor for L8 images compressed with the LZW9 algorithm. + * This allows drawing LZW9 compressed L8 images. + */ + void enableDecompressorL8_LZW9(); + protected: virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); @@ -344,7 +370,7 @@ protected: * @param alpha The alpha value to use for blending applied to the whole image (255 = * solid, no blending) */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); /** * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per @@ -897,6 +923,61 @@ private: FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; }; + + class DecompressorL8Base + { + public: + virtual ~DecompressorL8Base() + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + }; + + class DecompressorL8_L4 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + void blendPixelRGB565(const uint16_t imagePixel, uint32_t* fbPixel, const uint8_t alpha) const; + void blendPixelARGB8888(const uint8_t* imagePixel, uint32_t* fbPixel, const uint8_t alpha, const uint8_t alphapix) const; + void blendPixelRGB888(const uint8_t* imagePixel, uint32_t* fbPixel, const uint8_t alpha) const; + }; + + class DecompressorL8_RLE : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t BLOCK_SIZE = 1024U; + }; + + class DecompressorL8_LZW9 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t MAX_DICT_SIZE = 512U; + static const uint16_t BLOCK_SIZE = 1024U; + + LZW9DictionaryEntry lzw9Dictionary[MAX_DICT_SIZE]; + uint8_t entryBuffer[64]; // Having 64byte max entry sizes entails 1 + 2 + ... + 63 + 64 = 2080px size image blocks + }; + + DecompressorL8Base* decompressorL8_L4; + DecompressorL8Base* decompressorL8_RLE; + DecompressorL8Base* decompressorL8_LZW9; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp index 487bba6..9d35198 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -381,6 +381,32 @@ public: return blendRGBwithXrgb8888(r | (r >> 5), g | (g >> 6), b | (b >> 5), bgXRGB8888, fgAlpha, bgAlpha); } + /** + * Enables all the decompressors available for L8 images (L4, RLE and LZW9). + * This allows drawing L4, RLE and LZW9 compressed L8 images. + * + * @see enableDecompressorL8_L4, enableDecompressorL8_RLE, enableDecompressorL8_LZW9 + */ + void enableDecompressorL8_All(); + + /** + * Enables the decompressor for L8 images compressed with the L4 algorithm. + * This allows drawing L4 compressed L8 images. + */ + void enableDecompressorL8_L4(); + + /** + * Enables the decompressor for L8 images compressed with the RLE algorithm. + * This allows drawing RLE compressed L8 images. + */ + void enableDecompressorL8_RLE(); + + /** + * Enables the decompressor for L8 images compressed with the LZW9 algorithm. + * This allows drawing LZW9 compressed L8 images. + */ + void enableDecompressorL8_LZW9(); + protected: virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); @@ -446,7 +472,7 @@ protected: * @param alpha The alpha value to use for blending applied to the whole image (255 = * solid, no blending) */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); /** * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per @@ -884,6 +910,61 @@ private: FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; }; + + class DecompressorL8Base + { + public: + virtual ~DecompressorL8Base() + { + } + + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0; + }; + + class DecompressorL8_L4 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + void blendPixelRGB565(const uint16_t imagePixel, uint32_t* fbPixel, const uint8_t alpha, const uint8_t ialpha) const; + void blendPixelARGB8888(const uint8_t* imagePixel, uint32_t* fbPixel, const uint8_t alpha) const; + void blendPixelRGB888(const uint8_t* imagePixel, uint32_t* fbPixel, const uint8_t alpha, const uint8_t ialpha) const; + }; + + class DecompressorL8_RLE : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t BLOCK_SIZE = 1024U; + }; + + class DecompressorL8_LZW9 : public DecompressorL8Base + { + public: + virtual void blitCopyRGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); + + private: + static const uint16_t MAX_DICT_SIZE = 512U; + static const uint16_t BLOCK_SIZE = 1024U; + + LZW9DictionaryEntry lzw9Dictionary[MAX_DICT_SIZE]; + uint8_t entryBuffer[64]; // Having 64byte max entry sizes entails 1 + 2 + ... + 63 + 64 = 2080px size image blocks + }; + + DecompressorL8Base* decompressorL8_L4; + DecompressorL8Base* decompressorL8_RLE; + DecompressorL8Base* decompressorL8_LZW9; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp index ddf2e0c..bc10016 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp index 69cf329..387a658 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp index f68748f..d20c1d6 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp index df4aafd..746dd79 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp index 34a5d80..56d55f2 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp index a6a5fda..4c39028 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp index 42febbe..3979b46 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp index abb063b..bd2ece7 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp index d965648..c8c95e9 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp index 805f659..d1e3dd1 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp b/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp index b96d8f1..1343c55 100644 --- a/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp +++ b/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp index 9aa3671..bbc70a3 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -284,17 +284,29 @@ public: /** * Invalidates the entire screen. - * - * @param area The area to invalidate. */ - void invalidate(); + virtual void invalidate(); /** * Invalidates the given area. * * @param area The area to invalidate. */ - void invalidateArea(Rect area); + virtual void invalidateArea(Rect area); + + /** + * Get list of the invalidated areas in the current frame. + * The list is cleared in the beginning of HAL::tick. + * + * The list can be usefull on some platforms where the information + * can be used to reduce the amount of pixels sent to the display. + * + * @return Const reference to the list. + */ + const Vector& getInvalidatedAreas() + { + return cachedDirtyAreas; + } protected: /** Protected constructor. */ diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp index e682eb4..42398d7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -71,6 +71,15 @@ public: CUSTOM ///< Non-standard platform specific format }; + /** Algorithms used for L8 images compression can be stored in the following formats. */ + enum Compression + { + COMPRESSION_L8_NONE = 0, ///< No compression applied on the L8 image + COMPRESSION_L8_L4 = 1, ///< L4 compression applied on the L8 image + COMPRESSION_L8_RLE = 2, ///< RLE compression applied on the L8 image + COMPRESSION_L8_LZW9 = 3 ///< LZW9 compression applied on the L8 image + }; + /** Data of a bitmap. */ struct BitmapData { @@ -314,6 +323,23 @@ public: /** Clears the cached bitmaps from RAM. */ static void clearCache(); + /** + * Decompress a compressed bitmap into the bitmap cache. The + * decompressed bitmap will automatically be used by all Widgets. + * + * Only compressed L8 images can be decompressed. The decompressed + * bitmap will be L8 with an unchanged palette. + * + * When decompressing L8 bitmaps compressed with LZW an array of + * size 2048 bytes (16 bit aligned) must be supplied. The array is + * only used during decompressing. + * + * @param id The id of the Bitmap to decompress. + * @param buffer Pointer to a buffer for LZW decompression. + * @return true if the bitmap was decompressed. + */ + static bool decompress(BitmapId id, uint16_t* buffer = 0); + /** * Create a dynamic Bitmap. The clutFormat parameter is ignored for bitmaps not in L8 format * (consider using dynamicBitmapCreateL8 instead). Creation of a new dynamic bitmap may cause @@ -536,10 +562,13 @@ private: static uint32_t getSizeOfBitmap(BitmapId id); static uint32_t getSizeOfBitmapData(BitmapId id); static uint32_t getSizeOfBitmapExtraData(BitmapId id); - static bool cacheInternal(BitmapId id, uint32_t size); + static bool cacheInternal(BitmapId id, uint32_t size, bool doCopy = true); static bool isCustomDynamicBitmap(BitmapId id); static bool copyBitmapToCache(BitmapId id, uint8_t* const dst); static uint32_t firstFreeDynamicBitmapId(); + static uint32_t decompressL8_L4(uint8_t* dst, BitmapId id); + static uint32_t decompressL8_RLE(uint8_t* dst, BitmapId id); + static uint32_t decompressL8_LZW9(uint8_t* dst, BitmapId id, uint16_t* buffer = 0); BitmapId bitmapId; static const BitmapData* bitmaps; @@ -553,6 +582,8 @@ private: static uint16_t numberOfBitmaps; static uint16_t numberOfDynamicBitmaps; static uint16_t uncachedCount; ///< Uncached images, sort of ... + + static const uint16_t RLE_BLOCK_SIZE = 1024U; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp index 39bd5b5..e42bc06 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp index 5e972fb..6698a69 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp index 11d91d8..75486e6 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp index ba1dd74..19a1be2 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp index 2b18cb5..0cb63c0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp index 52e2ee7..24106da 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp index bec49fe..8783075 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -321,13 +321,12 @@ public: TOUCHGFX_DEPRECATED("Please use getBaseline() instead.", virtual uint16_t getFontHeight() const); /** - * Returns the position of the baseline of this font. The returned value corresponds to the - * maximum height occupied by a character in the font. + * Returns the position of the baseline of this font in pixels from the top of the line. * - * @return The height in pixels of this font. + * @return The baseline position. * * @note It is not sufficient to allocate text areas with this height. Use - * getMinimumTextHeight for this. + * getHeight for this. */ FORCE_INLINE_FUNCTION virtual uint16_t getBaseline() const { diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp index 8f83415..49417fd 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp index 9fa25c8..dc35e4d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp index 27ce0ef..2251cfc 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp index a105512..b5e6882 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp index f03e496..9afb8d4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp index 56d3524..ac48f5a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp index abd88af..580b036 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp index 7f608da..976c49e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp index 205c4a9..902c304 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp index 2d2a453..c3be147 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp index cea8d19..0e18c23 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp index 3af9834..1cdf93f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -467,9 +467,9 @@ public: static uint16_t toUTF8(const UnicodeChar* unicode, uint8_t* utf8, uint16_t maxbytes); private: - static void composeString(const UnicodeChar*& bufptr, UnicodeChar sign, UnicodeChar formatChar, bool hasPrecision, bool zeroPrefix, int precision, bool hasWidth, int width, bool alignLeft, int& charNumber, uint16_t dstSize, UnicodeChar* dst); + static void composeString(const UnicodeChar*& bufptr, UnicodeChar numberSign, UnicodeChar formatChar, bool hasPrecision, bool zeroPrefix, int precision, bool hasWidth, int width, bool alignLeft, int& charNumber, uint16_t dstSize, UnicodeChar* dst); - static void parseFlagsAndPrecision(const UnicodeChar*& ucFormat, const char*& cFormat, UnicodeChar& sign, bool& alignLeft, bool& forceDecimalPoint, bool& zeroPrefix, bool& hasWidth, int& width, bool& hasPrecision, int& precision); + static void parseFlagsAndPrecision(const UnicodeChar*& ucFormat, const char*& cFormat, UnicodeChar& numberSign, bool& alignLeft, bool& forceDecimalPoint, bool& zeroPrefix, bool& hasWidth, int& width, bool& hasPrecision, int& precision); static const UnicodeChar* skip_spaces(const UnicodeChar* str); static const UnicodeChar* skip_whitespace(const UnicodeChar* str); diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp index b1e3dda..61e0e93 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp index 30d4f57..6cedd8d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -13,9 +13,9 @@ #ifndef TOUCHGFX_VERSION_HPP #define TOUCHGFX_VERSION_HPP -#define TOUCHGFX_VERSION 42102 +#define TOUCHGFX_VERSION 42200 #define TOUCHGFX_VERSION_MAJOR 4 -#define TOUCHGFX_VERSION_MINOR 21 -#define TOUCHGFX_VERSION_PATCH 2 +#define TOUCHGFX_VERSION_MINOR 22 +#define TOUCHGFX_VERSION_PATCH 0 #endif // TOUCHGFX_VERSION_HPP diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp index 83d2a5b..63a731c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -70,7 +70,6 @@ public: * @return Size of memory area used internally by Outline. */ static unsigned int getOutlineBufferSize(); - /// @endcond #ifdef SIMULATOR /** diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp index 9e6de65..aec6cef 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp index 62a17a7..55f0bcb 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp index 64821a2..2058505 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp index e5e7cd7..e6ba8c5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp index 62493c9..9c7b5ab 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp index 983c38c..5ae9c5e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp index 3764571..3fdaf3e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp index 0dd1f37..d3469d6 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp index 2b8df29..a06d56f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp index 117f50f..b2b4b27 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -139,7 +139,7 @@ public: * @note The x and y position of the Slider will either be the left/top of the background or * the left/top of the indicator in its minimum x coordinate. */ - virtual void setupHorizontalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorY, uint16_t indicatorMinX, uint16_t indicatorMaxX); + virtual void setupHorizontalSlider(int16_t backgroundX, int16_t backgroundY, int16_t indicatorY, int16_t indicatorMinX, int16_t indicatorMaxX); /** * Sets up the slider in vertical mode with the range going from the bottom to top. @@ -167,7 +167,7 @@ public: * @note The x and y position of the Slider will either be the left/top of the background or * the left/top of the indicator in its minimum y coordinate. */ - virtual void setupVerticalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorX, uint16_t indicatorMinY, uint16_t indicatorMaxY); + virtual void setupVerticalSlider(int16_t backgroundX, int16_t backgroundY, int16_t indicatorX, int16_t indicatorMinY, int16_t indicatorMaxY); /** * Gets indicator minimum previously set using setupHorizontalSlider() or @@ -177,7 +177,7 @@ public: * * @see setupHorizontalSlider, setupVerticalSlider, getIndicatorMax */ - virtual uint16_t getIndicatorMin() const + virtual int16_t getIndicatorMin() const { return indicatorMinPosition; } @@ -190,7 +190,7 @@ public: * * @see setupHorizontalSlider, setupVerticalSlider, getIndicatorMin */ - virtual uint16_t getIndicatorMax() const + virtual int16_t getIndicatorMax() const { return indicatorMaxPosition; } @@ -208,7 +208,7 @@ public: * @note If the range is larger than the number of pixels specified for the indicator min and * max some values will not be represented by the slider. */ - virtual void setValueRange(int minValue, int maxValue, int newValue); + virtual void setValueRange(int16_t minValue, int16_t maxValue, int16_t newValue); /** * Gets the minimum value previously set using setValueRange(). @@ -217,7 +217,7 @@ public: * * @see setValueRange, getMaxValue */ - virtual uint16_t getMinValue() const + virtual int16_t getMinValue() const { return valueRangeMin; } @@ -229,7 +229,7 @@ public: * * @see setValueRange, getMinValue */ - virtual uint16_t getMaxValue() const + virtual int16_t getMaxValue() const { return valueRangeMax; } @@ -247,7 +247,7 @@ public: * @note If the range is larger than the number of pixels specified for the indicator min and * indicator max, some values will not be represented by the slider. */ - virtual void setValueRange(int minValue, int maxValue); + virtual void setValueRange(int16_t minValue, int16_t maxValue); /** * Places the indicator at the specified value relative to the specified value range. @@ -263,7 +263,7 @@ public: * thus is not possible to set with this method. In this case the value will be * rounded to the nearest value that is represented in the current setting. */ - virtual void setValue(int value); + virtual void setValue(int16_t value); /** * Gets the current value represented by the indicator. @@ -289,10 +289,10 @@ protected: SliderOrientation sliderOrientation; ///< The selected slider orientation - int currentValue; ///< The current value represented by the slider + int16_t currentValue; ///< The current value represented by the slider - int valueRangeMin; ///< The value range min - int valueRangeMax; ///< The value range max + int16_t valueRangeMin; ///< The value range min + int16_t valueRangeMax; ///< The value range max Image background; ///< The background image Image backgroundSelected; ///< The backgroundSelected image @@ -340,7 +340,7 @@ protected: * * @return The the indicator radius. */ - virtual uint16_t getIndicatorRadius() const; + virtual int16_t getIndicatorRadius() const; /** * Gets the indicator position range, i.e. the difference between max and min for the diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp index 69f78f3..5852aa1 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -29,8 +29,8 @@ namespace touchgfx { /** - * A SwipeContainer is a Container with a horizontally laid out list of identically sized Drawables. The bottom of - * the SwipeContainer shows a page indicator to indicate the position in the horizontal + * A SwipeContainer is a Container with a horizontally laid out list of identically sized Drawables. + * The bottom of the SwipeContainer shows a page indicator to indicate the position in the horizontal * list of items in the SwipeContainer. * * @see ListLayout diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp index 2bfba07..e944319 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp index 56fc3cf..b88cd47 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp index d13cde9..6e3fdd3 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp index a892f19..30c951a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp index ca8abcf..88edd0a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp index 181fe77..08b1050 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp index eea1f8d..64a1b34 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp index 1f0c238..367550c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp index 7a7c312..0e0ed1e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp index 6bb1069..005290b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp index 08662a3..00bf4ca 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp index 1483393..bf39d04 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp index 05e9ae8..d3d421c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp index 8e8ce24..8ac437e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp index 26bdcfb..1d30adb 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp index 9cccdee..6137d0d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp index 8d42679..f919a0a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp index 3d85f29..ebf0867 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp index b1bc749..f444576 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp index b6fa1f8..01a22e9 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp index 44d1566..c153fe5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp index 3ff737c..4da3149 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp index b93e144..66887f5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp index c858d7e..274e9ee 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp index dfef9f4..beb13f2 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp index 85ffbc3..4a88456 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp index 3df6123..b053036 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp index 30208ed..4b29ff7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp index 640d16c..512d623 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp index 8998699..3bf864c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp index d07ff75..415ba0d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -152,8 +152,8 @@ public: virtual void initialize() { ScrollWheelBase::initialize(); - list1.refreshDrawables(); - list2.refreshDrawables(); + listCenter.refreshDrawables(); + listAfter.refreshDrawables(); } protected: @@ -168,8 +168,8 @@ protected: void refreshDrawableListsLayout(); int16_t drawablesInFirstList; ///< List of drawables in firsts - DrawableList list1; ///< The center list - DrawableList list2; ///< The list for items not in the center + DrawableList listCenter; ///< The center list + DrawableList listAfter; ///< The list of items after the center int16_t extraSizeBeforeSelectedItem; ///< The distance before selected item int16_t extraSizeAfterSelectedItem; ///< The distance after selected item int16_t marginBeforeSelectedItem; ///< The distance before selected item diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp index 93efb1c..adc6a62 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp index 9165914..db1402c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp index 4188002..0aa88c6 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp index a16b701..bc4309c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp index 945c4ea..eb58f1b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp index 88f8ce2..9358c79 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp index 83c88b8..3caecc7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp index be7e5e4..8d09163 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -36,6 +36,7 @@ #define LOCATION_PRAGMA_NOLOAD(name) #define LOCATION_ATTRIBUTE(name) #define LOCATION_ATTRIBUTE_NOLOAD(name) +#define LOCATION_ALIGN_8BYTES(buf) #define FORCE_INLINE_FUNCTION inline #if defined(__GNUC__) #define TOUCHGFX_DEPRECATED(message, decl) decl __attribute__((deprecated(message))) @@ -53,6 +54,7 @@ #define LOCATION_PRAGMA_NOLOAD(name) #define LOCATION_ATTRIBUTE(name) __attribute__((section(STR(name)))) __attribute__((aligned(4))) #define LOCATION_ATTRIBUTE_NOLOAD(name) __attribute__((section(STR(name)))) __attribute__((aligned(4))) +#define LOCATION_ALIGN_8BYTES(buf) buf __attribute__((aligned(8))) #define FORCE_INLINE_FUNCTION __attribute__((always_inline)) inline #define TOUCHGFX_DEPRECATED(message, decl) [[deprecated(message)]] decl @@ -63,6 +65,7 @@ #define LOCATION_PRAGMA_NOLOAD(name) _Pragma(STR(location = name)) #define LOCATION_ATTRIBUTE(name) #define LOCATION_ATTRIBUTE_NOLOAD(name) +#define LOCATION_ALIGN_8BYTES(buf) _Pragma(STR(data_alignment = 8)) buf #define FORCE_INLINE_FUNCTION _Pragma("inline=forced") #if __IAR_SYSTEMS_ICC__ >= 9 #define TOUCHGFX_DEPRECATED(message, decl) [[deprecated(message)]] decl @@ -78,6 +81,7 @@ #define LOCATION_PRAGMA_NOLOAD(name) #define LOCATION_ATTRIBUTE(name) __attribute__((section(name))) __attribute__((aligned(4))) #define LOCATION_ATTRIBUTE_NOLOAD(name) __attribute__((section(name), zero_init)) __attribute__((aligned(4))) +#define LOCATION_ALIGN_8BYTES(buf) buf __attribute__((aligned(8))) #define FORCE_INLINE_FUNCTION inline #if __ARMCC_VERSION >= 6000000 // Only newer Keil support message to be given @@ -93,6 +97,7 @@ #define LOCATION_PRAGMA_NOLOAD(name) #define LOCATION_ATTRIBUTE(name) #define LOCATION_ATTRIBUTE_NOLOAD(name) +#define LOCATION_ALIGN_8BYTES(buf) #define FORCE_INLINE_FUNCTION #define TOUCHGFX_DEPRECATED(message, decl) decl diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp index d897ad8..87fa4e0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -177,6 +177,28 @@ public: return isAllowed; } + /** + * Sets whether or not a DMA operation is reserved by rendering. Used to allow/disallow + * other users of DMA2D whom are drawing into the framebuffer, e.g. video thread. + * + * @param reserved true if DMA is reserved by rendering. + */ + void setReserved(bool reserved) + { + isReserved = reserved; + } + + /** + * Gets whether a DMA operation is reserved by rendering. Used to allow/disallow + * other users of DMA2D whom are drawing into the framebuffer, e.g. video thread. + * + * @return true if DMA is reserved by rendering, false if not. + */ + bool getReserved() const + { + return isReserved; + } + /** Signals that DMA transfers can start. If any elements are in the queue, start it. */ virtual void start(); @@ -282,9 +304,10 @@ protected: */ virtual void waitForFrameBufferSemaphore(); - DMA_Queue& queue; ///< Reference to the DMA queue - bool isRunning; ///< true if a DMA transfer is currently ongoing. - volatile bool isAllowed; ///< true if DMA transfers are currently allowed. + DMA_Queue& queue; ///< Reference to the DMA queue + bool isRunning; ///< true if a DMA transfer is currently ongoing. + volatile bool isAllowed; ///< true if DMA transfers are currently allowed. + volatile bool isReserved; ///< true if DMA is reserved for for HW rendering }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp index 329f001..8c90418 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp index 1e932ab..4825fae 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp index 1c0cb5f..1a716f5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp index d5bf4cc..67aedcf 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp index d8d2989..3a192a4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -71,6 +71,7 @@ public: frameBufferUpdatedThisFrame(false), auxiliaryLCD(0), partialFrameBufferRect(), + useAuxiliaryLCD(false), listener(0), lastX(0), lastY(0), @@ -86,7 +87,6 @@ public: cc_begin(0), requestedOrientation(ORIENTATION_LANDSCAPE), displayOrientationChangeRequested(false), - useAuxiliaryLCD(false), useDMAAcceleration(true), lastRenderMethod(HARDWARE) { @@ -1219,6 +1219,7 @@ protected: bool frameBufferUpdatedThisFrame; ///< True if something was drawn in the current frame. LCD* auxiliaryLCD; ///< Auxiliary LCD class used to render Drawables into dynamic bitmaps. Rect partialFrameBufferRect; ///< The region of the screen covered by the partial framebuffer. + bool useAuxiliaryLCD; ///< True if using another LCD than the hardware framebuffer private: UIEventListener* listener; @@ -1237,7 +1238,6 @@ private: uint32_t cc_begin; DisplayOrientation requestedOrientation; bool displayOrientationChangeRequested; - bool useAuxiliaryLCD; bool useDMAAcceleration; RenderingMethod lastRenderMethod; diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp index 56e92a4..5336985 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp index dbdf6c0..b2f50e7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp index 1f42ad1..191f334 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -18,30 +18,135 @@ #ifndef TOUCHGFX_PAINT_HPP #define TOUCHGFX_PAINT_HPP -#include +#include namespace touchgfx { namespace paint { -void setL8Pallette(const uint8_t* const data); +/** + * Sets L8 palette to be used by the painter. The content pointed to be parameter data depends + * on the actual L8 format. L8RGB8888 assumes data points to three bytes per palette index,. L8ARGB8888 assumes four bytes per palette index. + * + * @param data The palette data. + */ +void setL8Palette(const uint8_t* const data); + +/** Tear down painter - wait for pending draw operations to finish. */ void tearDown(void); namespace rgb565 { +/** + * Draw a horizontal line (one pixel high) using the given color. + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param count Number of pixels to draw. + * @param color The color. + * @param alpha The alpha. + * @param color565 The color565 (same as 'color' but in native format for speed reasons). + */ void lineFromColor(uint16_t* const ptr, const unsigned count, const uint32_t color, const uint8_t alpha, const uint32_t color565); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (RGB565 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The RGB5656 data. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromRGB565(uint16_t* const ptr, const uint16_t* const data, const unsigned count, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (ARGB8888 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The ARGB8888 data. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromARGB8888(uint16_t* const ptr, const uint32_t* const data, const unsigned count, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (L8RGB888 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The palette indices. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromL8RGB888(uint16_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (L8ARGB8888 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The palette indices. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromL8ARGB8888(uint16_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); } // namespace rgb565 namespace rgb888 { +/** + * Draw a horizontal line (one pixel high) using the given color. + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param count Number of pixels to draw. + * @param color The color. + * @param alpha The alpha. + */ void lineFromColor(uint8_t* const ptr, const unsigned count, const uint32_t color, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (RGB565 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The RGB888 data. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromRGB888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (ARGB8888 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The ARGB8888 data. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromARGB8888(uint8_t* const ptr, const uint32_t* const data, const unsigned count, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (L8RGB888 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The palette indices. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromL8RGB888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); + +/** + * Draw a horizontal line (one pixel high) using pixels from the given data pointer (L8ARGB8888 + * data). + * + * @param [in] ptr The pointer to the position in the framebuffer. + * @param data The palette indices. + * @param count Number of pixels to draw. + * @param alpha The alpha. + */ void lineFromL8ARGB8888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); } // namespace rgb888 diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp index 5377e49..341cfea 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -29,7 +29,7 @@ namespace const uint8_t* blendL8CLUT = 0; } //namespace -void setL8Pallette(const uint8_t* const data) +void setL8Palette(const uint8_t* const data) { blendL8CLUT = data; } diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp index 2ac3a2f..fa87f2b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -18,7 +18,9 @@ #ifndef TOUCHGFX_PAINTRGB565IMPL_HPP #define TOUCHGFX_PAINTRGB565IMPL_HPP +#include #include +#include namespace touchgfx { diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp index 2b46006..bac8efb 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -18,7 +18,9 @@ #ifndef TOUCHGFX_PAINTRGB888IMPL_HPP #define TOUCHGFX_PAINTRGB888IMPL_HPP +#include #include +#include namespace touchgfx { diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp index 0c817f5..1cc4247 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp index 5651c1f..a1d4f47 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -778,6 +778,16 @@ enum VectorPrimitives VECTOR_PRIM_BEZIER_CUBIC = 6 ///< Cubic Bezier (2 control points) curve to a point from the current position }; +/** + * Dictionary entry used in LZW decompression. + */ +struct LZW9DictionaryEntry +{ + uint8_t character; ///< Current character of the entry + uint8_t length; ///< Remaining length of the entry + uint16_t prefixIndex; ///< Index to previous character +}; + } // namespace touchgfx #endif // TOUCHGFX_TYPES_HPP diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp index 627e117..c19463c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp index 277b843..da9e049 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -33,8 +33,7 @@ namespace touchgfx * SVG images. * * Implementations draw the path given (in drawPath) using the last - * color or gradient supplied with setColor, setLinearGradient, or - * setRadialGradient. + * color or gradient supplied with setColor or setLinearGradient. */ class VectorRenderer { diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp index bd7864d..e0dede0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp index 76ede80..2bb6096 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp index 8a07bd3..af12087 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp index b0bc8e3..34c9976 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp index c2f5740..159eb1d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp index 9616fff..2d6b582 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp index 705fc67..84c65ef 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp index ff35a92..b8a3db5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp index f46dbb0..8502a3c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp index a429f61..8d63aa0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp index 7f8d803..b7b453d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp index 319a543..77505ed 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp index aadba58..ba671ee 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp index cf36b7c..e1d65ed 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp index 6b43700..c0f7cd4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp index 05495f5..a736f9f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp index b76563c..13fd02a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp index 77c75ef..2b72f90 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp index 26a7ae0..41c9361 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp index aff3633..bdacb4d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp index 47e7d54..bdc2e18 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp index 7ac5103..c37ef5e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -34,8 +34,6 @@ class BlockTransition : public Transition public: /** * Initializes a new instance of the BlockTransition class. - * - * @param transitionSteps (Optional) Number of steps in the transition animation. */ BlockTransition() : Transition(), diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp index 08f6b30..682fe5e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp index 27243bc..e8e3ef5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp index 598fa49..c4e3fa2 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp index f221225..5d701b4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp index 9b44b1d..54d4dfc 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp index 9661555..15c69a0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp index a0d2e9b..6a476c3 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp index dbd89f3..1f85bc4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -98,7 +98,7 @@ public: virtual void startAnimation(); /** - * Cancel move animation. Stops any running animation at the current position regardless + * Cancel the animation. Stops any running animation at the current position regardless * of the progress made so far. Disables all animation parameters set using * setupAnimation and mark the animation as stopped. */ diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp index af547bf..14c3971 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp index 69110f4..0cfc901 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp index a7d5890..0e2a470 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp index 14367aa..2a1104b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp index e3d10fb..e7a38b2 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp index b72ad72..b54cc5f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp index ef2057b..41c7487 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp index 80cf001..f11eb48 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp index 07ba4e2..6a99ba0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp index bb24587..e9bb8ce 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp index db0a9e4..f6ee3bb 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp index 16a9e21..edb9dcd 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp index 53c6a3d..9154179 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp index 3188f14..01630c9 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp index 31047e6..0974f29 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp index c5aa1fe..9f25a9d 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp index edbc02c..193cef2 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp index 2e1c204..f787cb1 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp index 02cc21f..d9425e6 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp index f475db4..e7dfa51 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp index f369913..5e7d225 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp index aaa5336..43580a1 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp index 4932d00..ad44c07 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp index 8470be5..07a36b4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp index 0107c73..24805cd 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp index 6e3e814..deda3d7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp index d08595f..a7dd39a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp index ac23bfd..db190ff 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp index bed9c23..2a592ed 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp index ad6c54a..61325da 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp index 2ec63dd..bac95cd 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp index fde2be8..288e604 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp index 345f5d6..688b3e6 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp index ab8a068..04d9a65 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp index 9169168..ea24eb9 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp index db50b0e..8cba6c5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp index bffdb99..fbb3aa6 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp index c32c9b4..17e1a69 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp index a52b21c..6fa9839 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp index 8ab33c6..bb56b8e 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -154,25 +154,6 @@ public: bool solid, const uint32_t* palette); - /** - * Set a radial gradient used for future drawings. - * The radial gradient is transformed using the current - * transformation matrix. - * Multiple colors (stops) can be specified for the gradient. The - * stop positions are given in the range [0;1]. - * - * @param cx X-coordinate for the gradient center - * @param cy Y-coordinate for the gradient center - * @param radius Radius of the gradient - * @param stops Number of stops - * @param stopPositions Positions of the stops on the line - * @param stopColors Colors of the stops - */ - virtual void setRadialGradient(float cx, float cy, float radius, - uint32_t stops, - const float* stopPositions, - const colortype* stopColors); - /** * Sets the transformation matrix used for future drawings. * The transformation is reset when setup is called. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp index 3ec65fd..f7de54c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp index 7565a4e..8a0bda0 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp index ec7ddfd..0efa49b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp index a971d2e..29275b5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp index f49fc90..17e11be 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp index 55a6fd6..dbe091b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp index ad1f9b7..eb254ff 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp index 58f1248..2af03f9 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp index 4e5a66e..722729f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp index 3505a53..f94c24b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp index f7d7205..dbe001b 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp index 6ec052e..0dd2538 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp index 38af41e..a72b7fe 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp index 501eeca..c558cf4 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp index 9589d5a..76fa69f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp index ada3f8e..8590e39 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp index 0b87b7b..6b810dd 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp index 9f08684..75d5208 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp index 9dac5a5..88b4303 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp index 6ba7287..558762c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp index ab1a39c..6e8ad01 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp index d1a9c22..fd2292f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp index efad0d5..16bfe4a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp index d32a2cc..f2b887c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp index 69bb8cf..2c40778 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp index 59baa74..fc1d1c7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp index 31cbc62..aed201a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp index 85aad53..c2a8daf 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp index f86b7d6..3c3440f 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp index b40c560..a21bac5 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp index 5504d33..5f2135a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp index 34a5e7c..9c4b585 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp index 771e829..0433207 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp index 5461183..97560ba 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp index 10f8963..7d5c69c 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp index ab4f9f3..86dadf9 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp index 63c6e1b..ee1bac7 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp index 03cccf8..80b89e2 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp index 0abe59a..1bb294a 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp index a63accd..7e11d83 100644 --- a/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp +++ b/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp b/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp index 4242c6a..bdde091 100644 --- a/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp +++ b/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp b/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp index 7bbb52b..4c97b34 100644 --- a/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp +++ b/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp b/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp index 5d5a926..4eb4b96 100644 --- a/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp +++ b/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp b/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp index cf4751e..2c3117f 100644 --- a/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp +++ b/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp index c0ced80..71fd6ed 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -27,7 +27,7 @@ CacheableContainer::CacheableContainer() void CacheableContainer::setCacheBitmap(BitmapId bitmapId) { - Bitmap bitmap(bitmapId); + const Bitmap bitmap(bitmapId); cachedBitmapId = BITMAP_INVALID; @@ -98,7 +98,7 @@ void CacheableContainer::setupDrawChain(const Rect& invalidatedArea, Drawable** { if (isCachedMode && (cachedBitmapId != BITMAP_INVALID) && isVisible()) { - Rect r = getAbsoluteRect(); + const Rect r = getAbsoluteRect(); cachedImage.setPosition(r.x, r.y, r.width, r.height); cachedImage.setupDrawChain(invalidatedArea, nextPreviousElement); } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp index fd2e291..81f0ae3 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -125,7 +125,7 @@ void Container::draw(const Rect& invalidatedArea) const return; } - Rect tmp = invalidatedArea; + const Rect tmp = invalidatedArea; Drawable* d = firstChild; while (d) { @@ -162,8 +162,8 @@ void Container::getLastChild(int16_t x, int16_t y, Drawable** last) // Iterate over children. if (d->isVisible() && d->getRect().intersect(x, y)) { - int16_t xadj = x - d->getX(); - int16_t yadj = y - d->getY(); + const int16_t xadj = x - d->getX(); + const int16_t yadj = y - d->getY(); d->getLastChild(xadj, yadj, last); } d = d->nextSibling; @@ -190,9 +190,9 @@ void Container::getLastChildNear(int16_t x, int16_t y, Drawable** last, int16_t* { // Touched a drawable, but perhaps there is a better alternative previous = *last; - Rect absRect = (*last)->getAbsoluteRect(); - int dx = (x + meAbsRect.x) - (absRect.x + (absRect.width / 2)); - int dy = (y + meAbsRect.y) - (absRect.y + (absRect.height / 2)); + const Rect absRect = (*last)->getAbsoluteRect(); + const int dx = (x + meAbsRect.x) - (absRect.x + (absRect.width / 2)); + const int dy = (y + meAbsRect.y) - (absRect.y + (absRect.height / 2)); bestDistance = dx * dx + dy * dy; } @@ -203,12 +203,12 @@ void Container::getLastChildNear(int16_t x, int16_t y, Drawable** last, int16_t* for (int ring = 0; ring < numRings; ring++) { // For each 'ring' "distance" increases up to "fingerSize": - int distance = fingerSize * (ring + 1) / numRings; + const int distance = fingerSize * (ring + 1) / numRings; for (int sampleIndex = 0; sampleIndex < 4; sampleIndex++) { const int* xy = samplePoints[ring % 2][sampleIndex]; - int16_t deltaX = xy[0] * distance; - int16_t deltaY = xy[1] * distance; + const int16_t deltaX = xy[0] * distance; + const int16_t deltaY = xy[1] * distance; if (rect.intersect(x + deltaX, y + deltaY)) { Drawable* drawable = 0; @@ -216,11 +216,11 @@ void Container::getLastChildNear(int16_t x, int16_t y, Drawable** last, int16_t* if (drawable && drawable != previous) { previous = drawable; - Rect absRect = drawable->getAbsoluteRect(); + const Rect absRect = drawable->getAbsoluteRect(); // Find distance to center of drawable - int dx = (x + meAbsRect.x) - (absRect.x + (absRect.width / 2)); - int dy = (y + meAbsRect.y) - (absRect.y + (absRect.height / 2)); - uint32_t dist = dx * dx + dy * dy; + const int dx = (x + meAbsRect.x) - (absRect.x + (absRect.width / 2)); + const int dy = (y + meAbsRect.y) - (absRect.y + (absRect.height / 2)); + const uint32_t dist = dx * dx + dy * dy; // Check if this drawable center is closer than the previous if (dist < bestDistance) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp index 8da7ab2..3f93d5f 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -98,10 +98,10 @@ public: } } +private: int16_t insertedCoord; bool newElementPassed; - -private: + friend class ListLayout; Drawable* newElement; Direction direction; }; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp index b1d838d..3c9f8f3 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -26,8 +26,8 @@ ModalWindow::ModalWindow() { ModalWindow::setWidthHeight(HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT); - int defaultShadeAlpha = 96; - colortype defaultShadeColor = Color::getColorFromRGB(0x0, 0x0, 0x0); + const int defaultShadeAlpha = 96; + const colortype defaultShadeColor = Color::getColorFromRGB(0x0, 0x0, 0x0); backgroundShade.setPosition(0, 0, getWidth(), getHeight()); backgroundShade.setColor(defaultShadeColor); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp index 8798b15..c432165 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -84,9 +84,9 @@ void ScrollableContainer::handleClickEvent(const ClickEvent& event) hasIssuedCancelEvent = false; pressedX = event.getX(); pressedY = event.getY(); - Rect r = pressedDrawable->getAbsoluteRect(); - Rect me = getAbsoluteRect(); - ClickEvent relative(event.getType(), event.getX() + fingerAdjustmentX - (r.x - me.x), event.getY() + fingerAdjustmentY - (r.y - me.y)); + const Rect r = pressedDrawable->getAbsoluteRect(); + const Rect me = getAbsoluteRect(); + const ClickEvent relative(event.getType(), event.getX() + fingerAdjustmentX - (r.x - me.x), event.getY() + fingerAdjustmentY - (r.y - me.y)); pressedDrawable->handleClickEvent(relative); lastDraggableChild = pressedDrawable; } @@ -99,9 +99,9 @@ void ScrollableContainer::handleClickEvent(const ClickEvent& event) { if (pressedDrawable) { - Rect r = pressedDrawable->getAbsoluteRect(); - Rect me = getAbsoluteRect(); - ClickEvent relative(event.getType(), event.getX() + fingerAdjustmentX - (r.x - me.x), event.getY() + fingerAdjustmentY - (r.y - me.y)); + const Rect r = pressedDrawable->getAbsoluteRect(); + const Rect me = getAbsoluteRect(); + const ClickEvent relative(event.getType(), event.getX() + fingerAdjustmentX - (r.x - me.x), event.getY() + fingerAdjustmentY - (r.y - me.y)); pressedDrawable->handleClickEvent(relative); } @@ -130,18 +130,18 @@ void ScrollableContainer::handleDragEvent(const DragEvent& event) if ((pressedDrawable != 0) && (pressedDrawable != this)) { // Also send this drag event to the appropriate child widget - Rect r = pressedDrawable->getAbsoluteRect(); - Rect me = getAbsoluteRect(); - int16_t oldX = event.getOldX() + fingerAdjustmentX - (r.x - me.x); - int16_t oldY = event.getOldY() + fingerAdjustmentY - (r.y - me.y); - int16_t newX = canScrollX ? oldX : event.getNewX() + fingerAdjustmentX - (r.x - me.x); - int16_t newY = canScrollY ? oldY : event.getNewY() + fingerAdjustmentY - (r.y - me.y); + const Rect r = pressedDrawable->getAbsoluteRect(); + const Rect me = getAbsoluteRect(); + const int16_t oldX = event.getOldX() + fingerAdjustmentX - (r.x - me.x); + const int16_t oldY = event.getOldY() + fingerAdjustmentY - (r.y - me.y); + const int16_t newX = canScrollX ? oldX : event.getNewX() + fingerAdjustmentX - (r.x - me.x); + const int16_t newY = canScrollY ? oldY : event.getNewY() + fingerAdjustmentY - (r.y - me.y); // but only in the direction(s) where the scrollable container itself // cannot scroll. if ((!canScrollX && newX != oldX) || (!canScrollY && newY != oldY)) { - DragEvent relative(DragEvent::DRAGGED, oldX, oldY, newX, newY); + const DragEvent relative(DragEvent::DRAGGED, oldX, oldY, newX, newY); pressedDrawable->handleDragEvent(relative); } } @@ -187,7 +187,7 @@ void ScrollableContainer::handleDragEvent(const DragEvent& event) Container::getLastChild(event.getNewX() + fingerAdjustmentX, event.getNewY() + fingerAdjustmentY, &child); if (pressedDrawable != child) { - ClickEvent ce(ClickEvent::CANCEL, 0, 0); + const ClickEvent ce(ClickEvent::CANCEL, 0, 0); pressedDrawable->handleClickEvent(ce); hasIssuedCancelEvent = true; } @@ -199,7 +199,7 @@ void ScrollableContainer::handleDragEvent(const DragEvent& event) // Send cancel events to child in focus if (pressedDrawable && !hasIssuedCancelEvent) { - ClickEvent ce(ClickEvent::CANCEL, 0, 0); + const ClickEvent ce(ClickEvent::CANCEL, 0, 0); pressedDrawable->handleClickEvent(ce); hasIssuedCancelEvent = true; } @@ -297,7 +297,7 @@ void ScrollableContainer::handleGestureEvent(const GestureEvent& event) if (pressedDrawable && !hasIssuedCancelEvent) { - ClickEvent ce(ClickEvent::CANCEL, 0, 0); + const ClickEvent ce(ClickEvent::CANCEL, 0, 0); pressedDrawable->handleClickEvent(ce); hasIssuedCancelEvent = true; } @@ -309,20 +309,20 @@ Rect ScrollableContainer::getXScrollbar() const Rect res; if (scrollableX) { - Rect contained = getContainedArea(); + const Rect contained = getContainedArea(); const int scrollSpace = (scrollableY && (contained.height > rect.height)) ? (2 * scrollbarPadding + scrollbarWidth + SCROLLBAR_LINE) : 0; if (contained.width > rect.width) { int leftPadding = (-1 * contained.x * rect.width) / contained.width; - int rightPadding = ((contained.right() - rect.width) * rect.width) / contained.width; + const int rightPadding = ((contained.right() - rect.width) * rect.width) / contained.width; const int startWidth = rect.width - (2 * scrollbarPadding + 2 * SCROLLBAR_LINE + scrollSpace); int width = startWidth; width -= (leftPadding + rightPadding); if (width < scrollbarWidth * 2) { // If the contained area is very large, the scrollbar width may become zero or even negative. - int diff = scrollbarWidth * 2 - width; + const int diff = scrollbarWidth * 2 - width; width = scrollbarWidth * 2; // Force scrollbar width to a minimum // Distribute the deviation error based on current scrollbar X position (the amount subtracted from scrollbar xpos increases gradually). leftPadding -= (diff * leftPadding) / startWidth; @@ -338,20 +338,20 @@ Rect ScrollableContainer::getYScrollbar() const Rect res; if (scrollableY) { - Rect contained = getContainedArea(); + const Rect contained = getContainedArea(); const int scrollSpace = (scrollableX && (contained.width > rect.width)) ? (2 * scrollbarPadding + scrollbarWidth + SCROLLBAR_LINE) : 0; if (contained.height > rect.height) { int topPadding = (-1 * contained.y * rect.height) / contained.height; - int bottomPadding = ((contained.bottom() - rect.height) * rect.height) / contained.height; + const int bottomPadding = ((contained.bottom() - rect.height) * rect.height) / contained.height; const int startHeight = rect.height - (2 * scrollbarPadding + 2 * SCROLLBAR_LINE + scrollSpace); int height = startHeight; height -= (topPadding + bottomPadding); if (height < scrollbarWidth * 2) { // If the contained area is very large, the scrollbar height may become zero or even negative. - int diff = scrollbarWidth * 2 - height; + const int diff = scrollbarWidth * 2 - height; height = scrollbarWidth * 2; // Force scrollbar height to a minimum // Distribute the deviation error based on current scrollbar Y position (the amount subtracted from scrollbar ypos increases gradually). topPadding -= (diff * topPadding) / startHeight; @@ -386,8 +386,8 @@ Rect ScrollableContainer::getYBorder(const Rect& xBar, const Rect& yBar) const void ScrollableContainer::invalidateScrollbars() { - Rect xBar = getXScrollbar(); - Rect yBar = getYScrollbar(); + const Rect xBar = getXScrollbar(); + const Rect yBar = getYScrollbar(); Rect xBorder = getXBorder(xBar, yBar); Rect yBorder = getYBorder(xBar, yBar); @@ -430,7 +430,7 @@ bool ScrollableContainer::doScroll(int16_t deltaX, int16_t deltaY) return false; } bool couldScroll = false; - Rect contained = getContainedArea(); + const Rect contained = getContainedArea(); if (contained.width > rect.width) { if (deltaX > 0) @@ -489,7 +489,7 @@ void ScrollableContainer::childGeometryChanged() { int deltaX = 0; int deltaY = 0; - Rect contained = getChildrenContainedArea(); + const Rect contained = getChildrenContainedArea(); if (contained.y > 0) { // Make sure we haven't scrolled above the top @@ -597,8 +597,8 @@ void ScrollableContainer::handleTickEvent() } // Convert to delta value relative to current X or Y - int16_t scrollX = (accelDirection == GestureEvent::SWIPE_VERTICAL) ? 0 : (calculatedValue - getContainedArea().x); - int16_t scrollY = (accelDirection == GestureEvent::SWIPE_HORIZONTAL) ? 0 : (calculatedValue - getContainedArea().y); + const int16_t scrollX = (accelDirection == GestureEvent::SWIPE_VERTICAL) ? 0 : (calculatedValue - getContainedArea().x); + const int16_t scrollY = (accelDirection == GestureEvent::SWIPE_HORIZONTAL) ? 0 : (calculatedValue - getContainedArea().y); // Perform the actual animation step, stop animation if // scrolling was not possible (doScroll invalidates children) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp index 6b96f7e..a84a9a5 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -101,7 +101,7 @@ void SlideMenu::setup(ExpandDirection newExpandDirection, const Bitmap& backgrou background.setBitmap(backgroundBMP); background.setXY(backgroundX, backgroundY); - Rect boundingRect = background.getRect(); + const Rect boundingRect = background.getRect(); // boundingRect.expandToFit(background.getRect()); menuContainer.setWidth(boundingRect.right()); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp index 9ae659c..952b150 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -11,6 +11,7 @@ *******************************************************************************/ #include +#include #include namespace touchgfx @@ -20,7 +21,7 @@ Slider::Slider() sliderOrientation(HORIZONTAL), currentValue(0), valueRangeMin(0), - valueRangeMax(1), + valueRangeMax(100), background(), backgroundSelected(), indicator(), @@ -43,7 +44,7 @@ Slider::Slider() Container::add(indicator); // Default value range - Slider::setValueRange(0, 100); + Slider::updateIndicatorPosition(indicatorMinPosition); } void Slider::setBitmaps(const Bitmap& sliderBackground, const Bitmap& sliderBackgroundSelected, const Bitmap& indicatorBitmap) @@ -52,10 +53,19 @@ void Slider::setBitmaps(const Bitmap& sliderBackground, const Bitmap& sliderBack sliderBackground.getHeight() == sliderBackgroundSelected.getHeight() && "Slider::setBitmaps - background and backgroundFilled must have same dimensions"); + // Invalidate before and after in case size changes from previous bitmaps + background.invalidate(); // Redraw slider + indicator.invalidate(); // Redraw indicator + background.setBitmap(sliderBackground); backgroundSelected.setBitmap(sliderBackgroundSelected); indicator.setBitmap(indicatorBitmap); backgroundSelectedViewPort.setWidthHeight(backgroundSelected); + + setValue(currentValue); // Update size of backgroundSelectedViewPort + + background.invalidate(); // Redraw slider + indicator.invalidate(); // Redraw indicator } void Slider::setBitmaps(const BitmapId sliderBackground, const BitmapId sliderBackgroundSelected, const BitmapId indicatorBitmap) @@ -63,24 +73,24 @@ void Slider::setBitmaps(const BitmapId sliderBackground, const BitmapId sliderBa setBitmaps(Bitmap(sliderBackground), Bitmap(sliderBackgroundSelected), Bitmap(indicatorBitmap)); } -void Slider::setupHorizontalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorY, uint16_t indicatorMinX, uint16_t indicatorMaxX) +void Slider::setupHorizontalSlider(int16_t backgroundX, int16_t backgroundY, int16_t indicatorY, int16_t indicatorMinX, int16_t indicatorMaxX) { assert(indicatorMinX < indicatorMaxX && "Slider::setupHorizontalSlider - indicatorMinX must be smaller than indicatorMaxX"); sliderOrientation = HORIZONTAL; background.setXY(backgroundX, backgroundY); - backgroundSelectedViewPort.setXY(backgroundX, backgroundY); + backgroundSelectedViewPort.setPosition(background); backgroundSelected.setXY(0, 0); indicator.setY(indicatorY); - uint16_t backgroundWidth = backgroundX + static_cast(background.getWidth()); - uint16_t indicatorWidth = indicatorMaxX + static_cast(indicator.getWidth()); - int16_t newWidth = static_cast(MAX(backgroundWidth, indicatorWidth)); + const int16_t backgroundWidth = backgroundX + background.getWidth(); + const int16_t indicatorWidth = indicatorMaxX + indicator.getWidth(); + const int16_t newWidth = MAX(backgroundWidth, indicatorWidth); - uint16_t backgroundHeight = backgroundY + static_cast(background.getHeight()); - uint16_t indicatorHeight = indicatorY + static_cast(indicator.getHeight()); - int16_t newHeight = static_cast(MAX(backgroundHeight, indicatorHeight)); + const int16_t backgroundHeight = backgroundY + background.getHeight(); + const int16_t indicatorHeight = indicatorY + indicator.getHeight(); + const int16_t newHeight = MAX(backgroundHeight, indicatorHeight); indicatorMinPosition = indicatorMinX; indicatorMaxPosition = indicatorMaxX; @@ -90,23 +100,23 @@ void Slider::setupHorizontalSlider(uint16_t backgroundX, uint16_t backgroundY, u setValue(currentValue); } -void Slider::setupVerticalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorX, uint16_t indicatorMinY, uint16_t indicatorMaxY) +void Slider::setupVerticalSlider(int16_t backgroundX, int16_t backgroundY, int16_t indicatorX, int16_t indicatorMinY, int16_t indicatorMaxY) { assert(indicatorMinY < indicatorMaxY && "Slider::setupVerticalSlider - indicatorMinY must be smaller than indicatorMaxY"); sliderOrientation = VERTICAL; background.setXY(backgroundX, backgroundY); - backgroundSelectedViewPort.setXY(backgroundX, backgroundY); + backgroundSelectedViewPort.setPosition(background); indicator.setX(indicatorX); - uint16_t backgroundWidth = backgroundX + static_cast(background.getWidth()); - uint16_t indicatorWidth = indicatorX + static_cast(indicator.getWidth()); - int16_t newWidth = static_cast(MAX(backgroundWidth, indicatorWidth)); + const int16_t backgroundWidth = backgroundX + background.getWidth(); + const int16_t indicatorWidth = indicatorX + indicator.getWidth(); + const int16_t newWidth = MAX(backgroundWidth, indicatorWidth); - uint16_t backgroundHeight = backgroundY + static_cast(background.getHeight()); - uint16_t indicatorHeight = indicatorMaxY + static_cast(indicator.getHeight()); - int16_t newHeight = static_cast(MAX(backgroundHeight, indicatorHeight)); + const int16_t backgroundHeight = backgroundY + background.getHeight(); + const int16_t indicatorHeight = indicatorMaxY + indicator.getHeight(); + const int16_t newHeight = MAX(backgroundHeight, indicatorHeight); indicatorMinPosition = indicatorMinY; indicatorMaxPosition = indicatorMaxY; @@ -116,7 +126,7 @@ void Slider::setupVerticalSlider(uint16_t backgroundX, uint16_t backgroundY, uin setValue(currentValue); } -void Slider::setValue(int value) +void Slider::setValue(int16_t value) { updateIndicatorPosition(valueToPosition(value)); } @@ -131,14 +141,7 @@ void Slider::handleClickEvent(const ClickEvent& event) startValueCallback->execute(*this, currentValue); } - if (sliderOrientation == HORIZONTAL) - { - updateIndicatorPosition(event.getX() - getIndicatorRadius()); - } - else - { - updateIndicatorPosition(event.getY() - getIndicatorRadius()); - } + updateIndicatorPosition((sliderOrientation == HORIZONTAL ? event.getX() : event.getY()) - getIndicatorRadius()); // Communicate the stop value if a listener is registered if ((event.getType() == ClickEvent::RELEASED) && (stopValueCallback != 0) && stopValueCallback->isValid()) @@ -150,63 +153,23 @@ void Slider::handleClickEvent(const ClickEvent& event) void Slider::handleDragEvent(const DragEvent& event) { - if (sliderOrientation == HORIZONTAL) - { - updateIndicatorPosition(event.getNewX() - getIndicatorRadius()); - } - else - { - updateIndicatorPosition(event.getNewY() - getIndicatorRadius()); - } + updateIndicatorPosition((sliderOrientation == HORIZONTAL ? event.getNewX() : event.getNewY()) - getIndicatorRadius()); } int16_t Slider::valueToPosition(int value) const { value = MIN(valueRangeMax, value); value = MAX(value, valueRangeMin); - - int coordinateOffset = ((value - valueRangeMin) * (getIndicatorPositionRangeSize() + 1)) / getValueRangeSize(); - - int result = indicatorMinPosition + coordinateOffset; - - if (sliderOrientation == VERTICAL) - { - // Vertical slider grows as the position decreases so invert the coordinate - result = indicatorMinPosition + (indicatorMaxPosition - result); - } - - return result; + const int16_t relativePosition = muldiv(value - valueRangeMin, getIndicatorPositionRangeSize(), getValueRangeSize()); + return sliderOrientation == VERTICAL ? indicatorMaxPosition - relativePosition : indicatorMinPosition + relativePosition; } int Slider::positionToValue(int16_t position) const { - int result; - - if (position == indicatorMinPosition) - { - // Ensure that min coordinate always results in min value - result = valueRangeMin; - } - else if (position == indicatorMaxPosition) - { - // Ensure that max coordinate always results in max value - result = valueRangeMax; - } - else - { - int rounding = getIndicatorPositionRangeSize() / 2; - int valueOffset = (((position - indicatorMinPosition) * getValueRangeSize()) + rounding) / getIndicatorPositionRangeSize(); - - result = valueRangeMin + valueOffset; - } - - if (sliderOrientation == VERTICAL) - { - // Vertical slider grows as the position decreases so invert the value - result = valueRangeMin + (valueRangeMax - result); - } - - return result; + position = MIN(indicatorMaxPosition, position); + position = MAX(position, indicatorMinPosition); + const int16_t relativePosition = sliderOrientation == VERTICAL ? indicatorMaxPosition - position : position - indicatorMinPosition; + return valueRangeMin + muldiv(relativePosition, getValueRangeSize(), getIndicatorPositionRangeSize()); } void Slider::updateIndicatorPosition(int16_t position) @@ -228,7 +191,7 @@ void Slider::updateIndicatorPosition(int16_t position) indicator.moveTo(indicator.getX(), position); backgroundSelectedViewPort.invalidate(); - int16_t newViewPortHeight = background.getRect().bottom() - (position + getIndicatorRadius()); + const int16_t newViewPortHeight = background.getRect().bottom() - (position + getIndicatorRadius()); backgroundSelectedViewPort.setPosition(backgroundSelectedViewPort.getX(), position + getIndicatorRadius(), backgroundSelectedViewPort.getWidth(), newViewPortHeight); backgroundSelected.setY(-(backgroundSelected.getHeight() - newViewPortHeight)); backgroundSelectedViewPort.invalidate(); @@ -243,23 +206,12 @@ void Slider::updateIndicatorPosition(int16_t position) } } -uint16_t Slider::getIndicatorRadius() const +int16_t Slider::getIndicatorRadius() const { - uint16_t result; - - if (sliderOrientation == HORIZONTAL) - { - result = indicator.getWidth() / 2; - } - else - { - result = indicator.getHeight() / 2; - } - - return result; + return (sliderOrientation == HORIZONTAL ? indicator.getWidth() : indicator.getHeight()) / 2; } -void Slider::setValueRange(int minValue, int maxValue, int newValue) +void Slider::setValueRange(int16_t minValue, int16_t maxValue, int16_t newValue) { assert(minValue < maxValue && "Slider::setValueRange - minValue must be smaller than maxValue"); @@ -269,19 +221,9 @@ void Slider::setValueRange(int minValue, int maxValue, int newValue) setValue(newValue); } -void Slider::setValueRange(int minValue, int maxValue) +void Slider::setValueRange(int16_t minValue, int16_t maxValue) { - int newValue = currentValue; - - if (currentValue < minValue) - { - newValue = minValue; - } - else if (currentValue > maxValue) - { - newValue = maxValue; - } - + const int16_t newValue = currentValue < minValue ? minValue : (currentValue > maxValue ? maxValue : currentValue); setValueRange(minValue, maxValue, newValue); } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp index 78b7485..3dce345 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -75,14 +75,13 @@ void SwipeContainer::remove(Drawable& page) const uint8_t numPages = getNumberOfPages(); if (numPages == 0) { + invalidate(); setWidthHeight(0, 0); } else { - pageIndicator.invalidateContent(); const uint8_t curPage = getSelectedPage(); setSelectedPage(MIN(curPage, numPages - 1)); - pageIndicator.invalidateContent(); } return; } @@ -261,11 +260,11 @@ void SwipeContainer::adjustPages() void SwipeContainer::animateSwipeCancelledLeft() { - uint8_t duration = 14; + const uint8_t duration = 14; if (animationCounter <= duration) { - int16_t delta = EasingEquations::backEaseOut(animationCounter, 0, -animateDistance, duration); + const int16_t delta = EasingEquations::backEaseOut(animationCounter, 0, -animateDistance, duration); dragX = animateDistance + delta; adjustPages(); @@ -283,11 +282,11 @@ void SwipeContainer::animateSwipeCancelledLeft() void SwipeContainer::animateSwipeCancelledRight() { - uint8_t duration = 14; + const uint8_t duration = 14; if (animationCounter <= duration) { - int16_t delta = EasingEquations::backEaseOut(animationCounter, 0, animateDistance, duration); + const int16_t delta = EasingEquations::backEaseOut(animationCounter, 0, animateDistance, duration); dragX = animateDistance - delta; adjustPages(); @@ -305,11 +304,11 @@ void SwipeContainer::animateSwipeCancelledRight() void SwipeContainer::animateLeft() { - uint8_t duration = 10; + const uint8_t duration = 10; if (animationCounter <= duration) { - int16_t delta = EasingEquations::cubicEaseOut(animationCounter, 0, getWidth() + animateDistance, duration); + const int16_t delta = EasingEquations::cubicEaseOut(animationCounter, 0, getWidth() + animateDistance, duration); dragX = animateDistance - delta; } else @@ -326,11 +325,11 @@ void SwipeContainer::animateLeft() void SwipeContainer::animateRight() { - uint8_t duration = 10; + const uint8_t duration = 10; if (animationCounter <= duration) { - int16_t delta = EasingEquations::cubicEaseOut(animationCounter, 0, getWidth() - animateDistance, duration); + const int16_t delta = EasingEquations::cubicEaseOut(animationCounter, 0, getWidth() - animateDistance, duration); dragX = animateDistance + delta; } else @@ -363,18 +362,16 @@ void SwipeContainer::PageIndicator::setNumberOfPages(uint8_t size) { numberOfPages = size; - assert(numberOfPages > 0 && "At least one dot is needed"); - if (unselectedPages.getBitmapId() != BITMAP_INVALID) { - int dotWidth = Bitmap(unselectedPages.getBitmap()).getWidth(); + const int dotWidth = Bitmap(unselectedPages.getBitmap()).getWidth(); unselectedPages.setWidth(dotWidth * size); // adjust size of container according to the actual bitmaps + invalidate(); setWidthHeight(unselectedPages); setCurrentPage(MIN(size, currentPage)); - - invalidateContent(); + invalidate(); } } @@ -403,7 +400,7 @@ void SwipeContainer::PageIndicator::setCurrentPage(uint8_t page) if (page < numberOfPages && page != currentPage) { currentPage = page; - int dotWidth = Bitmap(unselectedPages.getBitmap()).getWidth(); + const int dotWidth = Bitmap(unselectedPages.getBitmap()).getWidth(); selectedPage.moveTo(page * dotWidth, selectedPage.getY()); } } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp index d8a3179..d22884e 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -87,10 +87,10 @@ void ZoomAnimationImage::handleTickEvent() if (animationCounter >= zoomAnimationDelay) { // Adjust the used animationCounter for the startup delay - uint16_t actualAnimationCounter = animationCounter - zoomAnimationDelay; + const uint16_t actualAnimationCounter = animationCounter - zoomAnimationDelay; - int16_t deltaWidth = zoomAnimationWidthEquation(actualAnimationCounter, 0, zoomAnimationEndWidth - zoomAnimationStartWidth, animationDuration); - int16_t deltaHeight = zoomAnimationHeightEquation(actualAnimationCounter, 0, zoomAnimationEndHeight - zoomAnimationStartHeight, animationDuration); + const int16_t deltaWidth = zoomAnimationWidthEquation(actualAnimationCounter, 0, zoomAnimationEndWidth - zoomAnimationStartWidth, animationDuration); + const int16_t deltaHeight = zoomAnimationHeightEquation(actualAnimationCounter, 0, zoomAnimationEndHeight - zoomAnimationStartHeight, animationDuration); setWidthHeight(zoomAnimationStartWidth + deltaWidth, zoomAnimationStartHeight + deltaHeight); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp index 4305b79..85f2769 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp index c13f41c..fbf59cb 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -99,7 +99,7 @@ void AnalogClock::initializeTime24Hour(uint8_t hour, uint8_t minute, uint8_t sec lastSecond = 255; // Disable animation and set time - uint16_t tempAnimationDuration = animationDuration; + const uint16_t tempAnimationDuration = animationDuration; animationDuration = 1; setTime24Hour(hour, minute, second); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp index 7a27bf5..26bcc0b 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp index 9548b80..6c7393f 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp index 74be65f..d1c299c 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -165,9 +165,9 @@ uint16_t AbstractProgressIndicator::getProgress(uint16_t range /*= 100*/) const } int32_t remainder; // Not used here // Find out at what step the current value is. - int32_t step = rangeStepsMin + muldiv(currentValue - rangeMin, rangeSteps - rangeStepsMin, rangeMax - rangeMin, remainder); + const int32_t step = rangeStepsMin + muldiv(currentValue - rangeMin, rangeSteps - rangeStepsMin, rangeMax - rangeMin, remainder); // Scale the step up to [0..range] - int32_t prog = muldiv(step, range, rangeSteps, remainder); + const int32_t prog = muldiv(step, range, rangeSteps, remainder); return (uint16_t)prog; } @@ -183,7 +183,7 @@ void AbstractProgressIndicator::handleTickEvent() return; } animationStep++; - int16_t delta = (int16_t)equation(animationStep, 0, animationEndValue - animationStartValue, animationDuration); + const int16_t delta = (int16_t)equation(animationStep, 0, animationEndValue - animationStartValue, animationDuration); setValue(animationStartValue + delta); if (animationStep >= animationDuration) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp index df2fc86..b2e66b7 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -63,36 +63,36 @@ void BoxProgress::setValue(int value) { case RIGHT: { - int16_t oldWidth = box.getWidth(); + const int16_t oldWidth = box.getWidth(); box.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); - int16_t newWidth = box.getWidth(); + const int16_t newWidth = box.getWidth(); Rect r(MIN(oldWidth, newWidth), 0, abs(oldWidth - newWidth), box.getHeight()); progressIndicatorContainer.invalidateRect(r); break; } case LEFT: { - int16_t oldX = box.getX(); + const int16_t oldX = box.getX(); box.setPosition(getWidth() - progress, 0, progress, progressIndicatorContainer.getHeight()); - int16_t newX = box.getX(); + const int16_t newX = box.getX(); Rect r(MIN(oldX, newX), 0, abs(oldX - newX), box.getHeight()); progressIndicatorContainer.invalidateRect(r); break; } case DOWN: { - int16_t oldHeight = box.getHeight(); + const int16_t oldHeight = box.getHeight(); box.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - int16_t newHeight = box.getHeight(); + const int16_t newHeight = box.getHeight(); Rect r(0, MIN(oldHeight, newHeight), box.getWidth(), abs(oldHeight - newHeight)); progressIndicatorContainer.invalidateRect(r); break; } case UP: { - int16_t oldY = box.getY(); + const int16_t oldY = box.getY(); box.setPosition(0, progressIndicatorContainer.getHeight() - progress, progressIndicatorContainer.getWidth(), progress); - int16_t newY = box.getY(); + const int16_t newY = box.getY(); Rect r(0, MIN(oldY, newY), box.getWidth(), abs(oldY - newY)); progressIndicatorContainer.invalidateRect(r); break; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp index a4f54e5..6c7944a 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -102,10 +102,10 @@ void CircleProgress::setValue(int value) { AbstractProgressIndicator::setValue(value); CWRUtil::Q5 startAngle; - CWRUtil::Q5 endAngle = CWRUtil::toQ5(circleEndAngle); + CWRUtil::Q5 const endAngle = CWRUtil::toQ5(circleEndAngle); circle.getArcStart(startAngle); - uint16_t rangeAngleSteps = endAngle < startAngle ? (int)(startAngle - endAngle) : (int)(endAngle - startAngle); - CWRUtil::Q5 progress = CWRUtil::Q5(AbstractProgressIndicator::getProgress(rangeAngleSteps)); + const uint16_t rangeAngleSteps = endAngle < startAngle ? (int)(startAngle - endAngle) : (int)(endAngle - startAngle); + CWRUtil::Q5 const progress = CWRUtil::Q5(AbstractProgressIndicator::getProgress(rangeAngleSteps)); if (endAngle < startAngle) { circle.updateArcEnd(startAngle - progress); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp index 457a481..df30f69 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -60,47 +60,47 @@ void ImageProgress::setValue(int value) { AbstractDirectionProgress::setValue(value); const uint16_t maxProgress = (progressDirection == RIGHT || progressDirection == LEFT) ? progressIndicatorContainer.getWidth() : progressIndicatorContainer.getHeight(); - int16_t progress = AbstractDirectionProgress::getProgress(maxProgress); + const int16_t progress = AbstractDirectionProgress::getProgress(maxProgress); if (fixedPosition) { switch (progressDirection) { case RIGHT: { - int16_t oldWidth = container.getWidth(); + const int16_t oldWidth = container.getWidth(); container.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); image.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); - int16_t newWidth = container.getWidth(); + const int16_t newWidth = container.getWidth(); Rect r(MIN(oldWidth, newWidth), 0, abs(oldWidth - newWidth), container.getHeight()); progressIndicatorContainer.invalidateRect(r); break; } case LEFT: { - int16_t oldX = container.getX(); + const int16_t oldX = container.getX(); container.setPosition(getWidth() - progress, 0, progress, progressIndicatorContainer.getHeight()); image.setPosition(-container.getX(), 0, progressIndicatorContainer.getWidth(), progressIndicatorContainer.getHeight()); - int16_t newX = container.getX(); + const int16_t newX = container.getX(); Rect r(MIN(oldX, newX), 0, abs(oldX - newX), container.getHeight()); progressIndicatorContainer.invalidateRect(r); break; } case DOWN: { - int16_t oldHeight = container.getHeight(); + const int16_t oldHeight = container.getHeight(); container.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); image.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - int16_t newHeight = container.getHeight(); + const int16_t newHeight = container.getHeight(); Rect r(0, MIN(oldHeight, newHeight), container.getWidth(), abs(oldHeight - newHeight)); progressIndicatorContainer.invalidateRect(r); break; } case UP: { - int16_t oldY = container.getY(); + const int16_t oldY = container.getY(); container.setPosition(0, progressIndicatorContainer.getHeight() - progress, progressIndicatorContainer.getWidth(), progress); image.setPosition(0, -container.getY(), progressIndicatorContainer.getWidth(), progressIndicatorContainer.getHeight()); - int16_t newY = container.getY(); + const int16_t newY = container.getY(); Rect r(0, MIN(oldY, newY), container.getWidth(), abs(oldY - newY)); progressIndicatorContainer.invalidateRect(r); break; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp index 37f00bc..6d4ba47 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -91,11 +91,11 @@ void LineProgress::setValue(int value) if (rangeSteps > 0) { AbstractProgressIndicator::setValue(value); - int progress = (int)AbstractProgressIndicator::getProgress(rangeSteps); - CWRUtil::Q5 r(rangeSteps); - CWRUtil::Q5 p(progress); - CWRUtil::Q5 x = startX + ((endX - startX) / r) * p; - CWRUtil::Q5 y = startY + ((endY - startY) / r) * p; + const int progress = (int)AbstractProgressIndicator::getProgress(rangeSteps); + CWRUtil::Q5 const r(rangeSteps); + CWRUtil::Q5 const p(progress); + CWRUtil::Q5 const x = startX + ((endX - startX) / r) * p; + CWRUtil::Q5 const y = startY + ((endY - startY) / r) * p; line.updateEnd(x, y); } } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp index bdd81bc..56cbaef 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -60,8 +60,8 @@ void TextProgress::setValue(int value) { textArea.invalidateContent(); AbstractProgressIndicator::setValue(value); - int range[3] = { 1, 10, 100 }; - uint16_t progress = AbstractProgressIndicator::getProgress(100 * range[decimals]); + const int range[3] = { 1, 10, 100 }; + const uint16_t progress = AbstractProgressIndicator::getProgress(100 * range[decimals]); if (decimals > 0) { Unicode::snprintf(textBuffer, 8, "%d.%0*d", progress / range[decimals], decimals, progress % range[decimals]); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp index fb31dfb..d3632e2 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -138,7 +138,7 @@ int16_t DrawableList::getRequiredNumberOfDrawables() const } } - int16_t numberOfDrawables = drawableItems->getNumberOfDrawables(); + const int16_t numberOfDrawables = drawableItems->getNumberOfDrawables(); return MIN((numberOfDrawables - firstDrawableIndex), requiredDrawables); } @@ -160,13 +160,13 @@ void DrawableList::setOffset(int32_t ofs) int16_t newFirstItem = 0; if (ofs > 0) { - int numberOfItems = ofs / itemSize + 1; + const int numberOfItems = ofs / itemSize + 1; newFirstItem -= numberOfItems; ofs -= numberOfItems * itemSize; } if (ofs <= -itemSize) { - int numberOfItems = ofs / itemSize; + const int numberOfItems = ofs / itemSize; newFirstItem -= numberOfItems; ofs -= numberOfItems * itemSize; } @@ -188,7 +188,7 @@ void DrawableList::setOffset(int32_t ofs) } else if (newFirstItem + numDrawables > numItems) { - int x = numItems - (newFirstItem + numDrawables); + const int x = numItems - (newFirstItem + numDrawables); ofs += x * itemSize; newFirstItem += x; } @@ -224,7 +224,7 @@ void DrawableList::setOffset(int32_t ofs) for (int i = 0; i < numDrawables; i++) { - int drawableIndex = (firstDrawable + i) % numDrawables; + const int drawableIndex = (firstDrawable + i) % numDrawables; Drawable* drawable = drawableItems->getDrawable(drawableIndex + firstDrawableIndex); if (isHorizontal) { @@ -325,7 +325,7 @@ int16_t DrawableList::getDrawableIndex(int16_t itemIndex, int16_t prevDrawableIn } if (itemIndex == currentItemIndex) { - int16_t drawableIndex = (firstDrawable + i) % numDrawables; + const int16_t drawableIndex = (firstDrawable + i) % numDrawables; return drawableIndex; } } @@ -343,18 +343,13 @@ void DrawableList::refreshDrawables() // Remove everything Container::removeAll(); // Add the itemDrawables + const int16_t w = isHorizontal ? itemSize - 2 * itemMargin : getWidth(); + const int16_t h = isHorizontal ? getHeight() : itemSize - 2 * itemMargin; for (int drawableIndex = 0; drawableIndex < numDrawables; drawableIndex++) { Drawable* drawable = drawableItems->getDrawable(drawableIndex + firstDrawableIndex); // Resize the drawables, X/Y ignored for now. - if (isHorizontal) - { - drawable->setPosition(0, 0, itemSize - 2 * itemMargin, getHeight()); - } - else - { - drawable->setPosition(0, 0, getWidth(), itemSize - 2 * itemMargin); - } + drawable->setPosition(0, 0, w, h); // Add each drawable for later positioning if (drawable->getParent() != 0) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp index 589c1ab..c27ee67 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -175,7 +175,7 @@ void ScrollBase::allowVerticalDrag(bool enable) void ScrollBase::animateToItem(int16_t itemIndex, int16_t animationSteps /*= -1*/) { - int32_t position = getPositionForItem(itemIndex); + const int32_t position = getPositionForItem(itemIndex); animateToPosition(position, animationSteps); } @@ -222,13 +222,13 @@ void ScrollBase::handleGestureEvent(const GestureEvent& event) { if (event.getType() == (getHorizontal() ? GestureEvent::SWIPE_HORIZONTAL : GestureEvent::SWIPE_VERTICAL)) { - int16_t velocity = abs(event.getVelocity()); - int16_t direction = event.getVelocity() < 0 ? -1 : 1; + const int16_t velocity = abs(event.getVelocity()); + const int16_t direction = event.getVelocity() < 0 ? -1 : 1; int16_t steps = MAX(1, velocity - 4) * 7; int32_t newOffset = getOffset() + direction * steps * swipeAcceleration / 10; if (maxSwipeItems > 0) { - int32_t maxDistance = maxSwipeItems * itemSize; + const int32_t maxDistance = maxSwipeItems * itemSize; newOffset = MIN(newOffset, initialSwipeOffset + maxDistance); newOffset = MAX(newOffset, initialSwipeOffset - maxDistance); } @@ -243,7 +243,7 @@ void ScrollBase::handleTickEvent() if (currentAnimationState == ANIMATING_GESTURE) { gestureStep++; - int newPosition = gestureStart + easingEquation(gestureStep, 0, gestureEnd - gestureStart, gestureStepsTotal); + const int newPosition = gestureStart + easingEquation(gestureStep, 0, gestureEnd - gestureStart, gestureStepsTotal); setOffset(newPosition); if (gestureStep > gestureStepsTotal) { @@ -280,12 +280,12 @@ int32_t ScrollBase::getOffset() const int ScrollBase::getNormalizedOffset(int offset) const { - int16_t numItems = getNumberOfItems(); + const int16_t numItems = getNumberOfItems(); if (numItems == 0 || itemSize == 0) { return offset; } - int32_t listSize = numItems * itemSize; + const int32_t listSize = numItems * itemSize; offset %= listSize; return offset > 0 ? offset - listSize : offset; } @@ -310,7 +310,7 @@ int32_t ScrollBase::getNearestAlignedOffset(int32_t offset) const void ScrollBase::animateToPosition(int32_t position, int16_t steps) { - int32_t currentPosition = getOffset(); + const int32_t currentPosition = getOffset(); position = getNearestAlignedOffset(position); if (steps < 0) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp index d035118..5c84a12 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -70,7 +70,7 @@ void ScrollList::setWindowSize(int16_t items) void ScrollList::setPadding(int16_t paddingBefore, int16_t paddingAfter) { - int32_t currentOffset = getOffset(); + const int32_t currentOffset = getOffset(); distanceBeforeAlignedItem = paddingBefore; paddingAfterLastItem = paddingAfter; setOffset(currentOffset); @@ -103,12 +103,12 @@ bool ScrollList::getSnapping() const int32_t ScrollList::getPositionForItem(int16_t itemIndex) { - int32_t currentOffset = getNormalizedOffset(getOffset()); + const int32_t currentOffset = getNormalizedOffset(getOffset()); if (itemIndex < 0 || itemIndex >= list.getNumberOfItems() || itemSize == 0) { return currentOffset; } - int32_t itemOffset = -itemIndex * itemSize; + const int32_t itemOffset = -itemIndex * itemSize; // Get the visible size const int16_t widgetSize = getHorizontal() ? getWidth() : getHeight(); const int16_t activeWidgetSize = widgetSize - (distanceBeforeAlignedItem + paddingAfterLastItem); @@ -118,20 +118,20 @@ int32_t ScrollList::getPositionForItem(int16_t itemIndex) // Important this is a do-while of visibleSize < itemSize in which case we need to check at least one time do { - int16_t i = (-getNormalizedOffset(offset)) / itemSize; // Item index of first + const int16_t i = (-getNormalizedOffset(offset)) / itemSize; // Item index of first if (itemIndex == i) { return currentOffset; } offset -= itemSize; } while (offset >= currentOffset - (activeWidgetSize - itemSize)); - int32_t allItemsSize = list.getNumberOfItems() * itemSize; + const int32_t allItemsSize = list.getNumberOfItems() * itemSize; // Either scroll left from the first item or right from the last item. Find out which is closest int32_t leftScrollDistance = itemOffset - currentOffset; - int32_t leftScrollDistance2 = (itemOffset + allItemsSize) - currentOffset; - int32_t rightItemOffset = getNormalizedOffset(currentOffset - (activeWidgetSize - itemSize)); + const int32_t leftScrollDistance2 = (itemOffset + allItemsSize) - currentOffset; + const int32_t rightItemOffset = getNormalizedOffset(currentOffset - (activeWidgetSize - itemSize)); int32_t rightScrollDistance = rightItemOffset - itemOffset; - int32_t rightScrollDistance2 = rightItemOffset - (itemOffset - allItemsSize); + const int32_t rightScrollDistance2 = rightItemOffset - (itemOffset - allItemsSize); if (abs(leftScrollDistance2) < abs(leftScrollDistance)) { leftScrollDistance = leftScrollDistance2; @@ -183,9 +183,9 @@ void ScrollList::handleClickEvent(const ClickEvent& event) setOffset(getNearestAlignedOffset(initialSwipeOffset)); if (itemPressedCallback && itemPressedCallback->isValid()) { - int16_t click = (getHorizontal() ? xClick : yClick); + const int16_t click = (getHorizontal() ? xClick : yClick); int32_t offset = click - getOffset(); - int32_t listSize = getNumberOfItems() * itemSize; + const int32_t listSize = getNumberOfItems() * itemSize; if (getCircular()) { offset += listSize; @@ -193,7 +193,7 @@ void ScrollList::handleClickEvent(const ClickEvent& event) } if (offset >= 0 && offset < listSize) { - int16_t item = offset / itemSize; + const int16_t item = offset / itemSize; itemPressedCallback->execute(item); } } @@ -206,9 +206,9 @@ void ScrollList::handleClickEvent(const ClickEvent& event) setOffset(getNearestAlignedOffset(getOffset())); if (itemSelectedCallback && itemSelectedCallback->isValid()) { - int16_t click = (getHorizontal() ? xClick : yClick); + const int16_t click = (getHorizontal() ? xClick : yClick); int32_t offset = click - getOffset(); - int32_t listSize = getNumberOfItems() * itemSize; + const int32_t listSize = getNumberOfItems() * itemSize; if (getCircular()) { offset += listSize; @@ -220,7 +220,7 @@ void ScrollList::handleClickEvent(const ClickEvent& event) } if (offset >= 0 && offset < listSize) { - int16_t item = offset / itemSize; + const int16_t item = offset / itemSize; itemSelectedCallback->execute(item); } } @@ -249,7 +249,7 @@ int32_t ScrollList::keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) if (!getCircular()) { newOffset = MIN(newOffset, overShoot); - int maxOffToTheStart = windowSize < getNumberOfItems() ? getNumberOfItems() - windowSize : 0; + const int maxOffToTheStart = windowSize < getNumberOfItems() ? getNumberOfItems() - windowSize : 0; newOffset = MAX(newOffset, -(itemSize * maxOffToTheStart) - overShoot); } return newOffset; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp index 1bd17da..be39095 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp index 90ec82a..e3d98a4 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -26,7 +26,7 @@ ScrollWheelBase::ScrollWheelBase() void ScrollWheelBase::setSelectedItemOffset(int16_t offset) { - int32_t currentOffset = getOffset(); + const int32_t currentOffset = getOffset(); distanceBeforeAlignedItem = offset; setOffset(currentOffset); } @@ -42,8 +42,8 @@ int32_t ScrollWheelBase::getPositionForItem(int16_t itemIndex) if (getCircular()) { // Check if it is closer to scroll backwards - int32_t otherOffset = newOffset + getNumberOfItems() * itemSize; - int32_t offset = getOffset(); + const int32_t otherOffset = newOffset + getNumberOfItems() * itemSize; + const int32_t offset = getOffset(); if (abs(otherOffset - offset) < abs(newOffset - offset)) { newOffset = otherOffset; @@ -54,14 +54,13 @@ int32_t ScrollWheelBase::getPositionForItem(int16_t itemIndex) void ScrollWheelBase::animateToPosition(int32_t position, int16_t steps) { - if (itemSize == 0) + if (itemSize <= 0) { return; } - if (animateToCallback && animateToCallback->isValid() && itemSize > 0) + if (animateToCallback && animateToCallback->isValid()) { - position = getNearestAlignedOffset(position); - int16_t itemIndex = (-position) / itemSize; + const int16_t itemIndex = ((itemSize / 2) - getNearestAlignedOffset(position)) / itemSize; animateToCallback->execute(itemIndex); } ScrollBase::animateToPosition(position, steps); @@ -73,12 +72,9 @@ int ScrollWheelBase::getSelectedItem() const { return 0; } - if (currentAnimationState == ANIMATING_GESTURE) - { - // Scroll in progress, get the destination value - return (-getNormalizedOffset(gestureEnd)) / itemSize; - } - return (-getNormalizedOffset(getOffset())) / itemSize; + // If Scroll in progress, get the destination value + const int ofs = currentAnimationState == ANIMATING_GESTURE ? gestureEnd : getOffset(); + return ((itemSize / 2) - getNormalizedOffset(ofs)) / itemSize; } int32_t ScrollWheelBase::keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) const @@ -86,7 +82,7 @@ int32_t ScrollWheelBase::keepOffsetInsideLimits(int32_t newOffset, int16_t overS if (!getCircular()) { newOffset = MIN(newOffset, overShoot); - int16_t numberOfItems = getNumberOfItems(); + const int16_t numberOfItems = getNumberOfItems(); newOffset = MAX(newOffset, -(itemSize * (numberOfItems - 1)) - overShoot); } return newOffset; @@ -98,7 +94,7 @@ void ScrollWheelBase::handleClickEvent(const ClickEvent& event) { return; } - int32_t offset = getOffset(); + const int32_t offset = getOffset(); if (event.getType() == ClickEvent::PRESSED) { xClick = event.getX(); @@ -114,7 +110,7 @@ void ScrollWheelBase::handleClickEvent(const ClickEvent& event) { if (currentAnimationState == NO_ANIMATION) { - int16_t click = getHorizontal() ? xClick : yClick; + const int16_t click = getHorizontal() ? xClick : yClick; // Click => move to clicked position if (click < distanceBeforeAlignedItem) { @@ -146,12 +142,7 @@ void ScrollWheelBase::handleDragEvent(const DragEvent& event) { currentAnimationState = ANIMATING_DRAG; int newOffset = getOffset() + (getHorizontal() ? event.getDeltaX() : event.getDeltaY()) * dragAcceleration / 10; - if (!getCircular()) - { - newOffset = MIN(newOffset, itemSize * 3 / 4); - int16_t numberOfItems = getNumberOfItems(); - newOffset = MAX(newOffset, -(itemSize * (numberOfItems - 1)) - itemSize * 3 / 4); - } + newOffset = keepOffsetInsideLimits(newOffset, overshootPercentage); setOffset(newOffset); } @@ -162,7 +153,7 @@ void ScrollWheelBase::handleGestureEvent(const GestureEvent& event) int32_t newOffset = getOffset() + event.getVelocity() * swipeAcceleration / 10; if (maxSwipeItems > 0) { - int32_t maxDistance = maxSwipeItems * itemSize; + const int32_t maxDistance = maxSwipeItems * itemSize; newOffset = MIN(newOffset, initialSwipeOffset + maxDistance); newOffset = MAX(newOffset, initialSwipeOffset - maxDistance); } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp index 07c720e..1748e3e 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -17,8 +17,8 @@ namespace touchgfx ScrollWheelWithSelectionStyle::ScrollWheelWithSelectionStyle() : ScrollWheelBase(), drawablesInFirstList(0), - list1(), - list2(), + listCenter(), + listAfter(), extraSizeBeforeSelectedItem(0), extraSizeAfterSelectedItem(0), marginBeforeSelectedItem(0), @@ -28,8 +28,8 @@ ScrollWheelWithSelectionStyle::ScrollWheelWithSelectionStyle() originalUpdateDrawableCallback(0), originalUpdateCenterDrawableCallback(0) { - ScrollWheelBase::add(list2); - ScrollWheelBase::add(list1); // Put center list at top of the first/last list. + ScrollWheelBase::add(listAfter); + ScrollWheelBase::add(listCenter); // Put center list at top of the first/last list. } void ScrollWheelWithSelectionStyle::setWidth(int16_t width) @@ -53,16 +53,16 @@ void ScrollWheelWithSelectionStyle::setHeight(int16_t height) void ScrollWheelWithSelectionStyle::setHorizontal(bool horizontal) { ScrollWheelBase::setHorizontal(horizontal); - list1.setHorizontal(horizontal); - list2.setHorizontal(horizontal); + listCenter.setHorizontal(horizontal); + listAfter.setHorizontal(horizontal); refreshDrawableListsLayout(); } void ScrollWheelWithSelectionStyle::setCircular(bool circular) { ScrollWheelBase::setCircular(circular); - list1.setCircular(circular); - list2.setCircular(circular); + listCenter.setCircular(circular); + listAfter.setCircular(circular); } void ScrollWheelWithSelectionStyle::setNumberOfItems(int16_t numberOfItems) @@ -70,8 +70,8 @@ void ScrollWheelWithSelectionStyle::setNumberOfItems(int16_t numberOfItems) if (numberOfItems != getNumberOfItems()) { ScrollWheelBase::setNumberOfItems(numberOfItems); - list1.setNumberOfItems(numberOfItems); - list2.setNumberOfItems(numberOfItems); + listCenter.setNumberOfItems(numberOfItems); + listAfter.setNumberOfItems(numberOfItems); } } @@ -125,8 +125,8 @@ void ScrollWheelWithSelectionStyle::setSelectedItemPosition(int16_t offset, int1 void ScrollWheelWithSelectionStyle::setDrawableSize(int16_t drawableSize, int16_t drawableMargin) { ScrollWheelBase::setDrawableSize(drawableSize, drawableMargin); - list1.setDrawableSize(drawableSize, drawableMargin); - list2.setDrawableSize(drawableSize, drawableMargin); + listCenter.setDrawableSize(drawableSize, drawableMargin); + listAfter.setDrawableSize(drawableSize, drawableMargin); // Resize the three lists setSelectedItemOffset(distanceBeforeAlignedItem); @@ -154,47 +154,47 @@ void ScrollWheelWithSelectionStyle::setDrawables(DrawableListItemsInterface& dra void ScrollWheelWithSelectionStyle::setOffset(int32_t offset) { ScrollWheelBase::setOffset(offset); - list1.setOffset((distanceBeforeAlignedItem - (distanceBeforeAlignedItem - extraSizeBeforeSelectedItem)) + offset); - list2.setOffset((distanceBeforeAlignedItem - (distanceBeforeAlignedItem + itemSize + extraSizeAfterSelectedItem + marginAfterSelectedItem)) + offset); + listCenter.setOffset((distanceBeforeAlignedItem - (distanceBeforeAlignedItem - extraSizeBeforeSelectedItem)) + offset); + listAfter.setOffset((distanceBeforeAlignedItem - (distanceBeforeAlignedItem + itemSize + extraSizeAfterSelectedItem + marginAfterSelectedItem)) + offset); } void ScrollWheelWithSelectionStyle::itemChanged(int itemIndex) { ScrollWheelBase::itemChanged(itemIndex); - list1.itemChanged(itemIndex); - list2.itemChanged(itemIndex); + listCenter.itemChanged(itemIndex); + listAfter.itemChanged(itemIndex); } void ScrollWheelWithSelectionStyle::refreshDrawableListsLayout() { if (drawables != 0 && centerDrawables != 0) { - int32_t currentOffset = getOffset(); + const int32_t currentOffset = getOffset(); - int16_t list1Pos = distanceBeforeAlignedItem - extraSizeBeforeSelectedItem; - int16_t list2Pos = distanceBeforeAlignedItem + itemSize + (extraSizeAfterSelectedItem + marginAfterSelectedItem); - int16_t list0Size = list1Pos - marginBeforeSelectedItem; - int16_t list1Size = itemSize + extraSizeBeforeSelectedItem + extraSizeAfterSelectedItem; + const int16_t listCenterPos = distanceBeforeAlignedItem - extraSizeBeforeSelectedItem; + const int16_t listAfterPos = distanceBeforeAlignedItem + itemSize + (extraSizeAfterSelectedItem + marginAfterSelectedItem); + const int16_t listBeforeSize = listCenterPos - marginBeforeSelectedItem; + const int16_t listCenterSize = itemSize + extraSizeBeforeSelectedItem + extraSizeAfterSelectedItem; if (getHorizontal()) { - int16_t list2Size = getWidth() - list2Pos; - list.setPosition(0, 0, list0Size, getHeight()); - list1.setPosition(list1Pos, 0, list1Size, getHeight()); - list2.setPosition(list2Pos, 0, list2Size, getHeight()); + const int16_t listAfterSize = getWidth() - listAfterPos; + list.setPosition(0, 0, listBeforeSize, getHeight()); + listCenter.setPosition(listCenterPos, 0, listCenterSize, getHeight()); + listAfter.setPosition(listAfterPos, 0, listAfterSize, getHeight()); } else { - int16_t list2Size = getHeight() - list2Pos; - list.setPosition(0, 0, getWidth(), list0Size); - list1.setPosition(0, list1Pos, getWidth(), list1Size); - list2.setPosition(0, list2Pos, getWidth(), list2Size); + const int16_t listAfterSize = getHeight() - listAfterPos; + list.setPosition(0, 0, getWidth(), listBeforeSize); + listCenter.setPosition(0, listCenterPos, getWidth(), listCenterSize); + listAfter.setPosition(0, listAfterPos, getWidth(), listAfterSize); } list.setDrawables(*drawables, 0, *originalUpdateDrawableCallback); drawablesInFirstList = list.getNumberOfDrawables(); - list1.setDrawables(*centerDrawables, 0, *originalUpdateCenterDrawableCallback); - list2.setDrawables(*drawables, drawablesInFirstList, *originalUpdateDrawableCallback); + listCenter.setDrawables(*centerDrawables, 0, *originalUpdateCenterDrawableCallback); + listAfter.setDrawables(*drawables, drawablesInFirstList, *originalUpdateDrawableCallback); setOffset(keepOffsetInsideLimits(currentOffset, 0)); } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp index 139ca70..57da6af 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -16,7 +16,7 @@ namespace touchgfx { void AbstractButton::handleClickEvent(const ClickEvent& event) { - bool wasPressed = pressed; + const bool wasPressed = pressed; pressed = (event.getType() == ClickEvent::PRESSED); if ((pressed && !wasPressed) || (!pressed && wasPressed)) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp index c553f2f..54a60dd 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp index 653e1bf..3cbb756 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -119,7 +119,7 @@ void AnimationTextureMapper::handleTickEvent() if (animationCounter >= animations[i].animationDelay) { // Adjust the used animationCounter for the startup delay - uint32_t actualAnimationCounter = animationCounter - animations[i].animationDelay; + const uint32_t actualAnimationCounter = animationCounter - animations[i].animationDelay; int directionModifier; int16_t distance; @@ -135,7 +135,7 @@ void AnimationTextureMapper::handleTickEvent() distance = (int16_t)((animations[i].animationStart - animations[i].animationEnd) * 1000); } - float delta = (float)directionModifier * (animations[i].animationProgressionEquation(actualAnimationCounter, 0, distance, animations[i].animationDuration) / 1000.f); + const float delta = (float)directionModifier * (animations[i].animationProgressionEquation(actualAnimationCounter, 0, distance, animations[i].animationDuration) / 1000.f); switch ((AnimationParameter)i) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp index 21665e7..196a8c5 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp index 808f0fa..185bc8e 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -28,7 +28,7 @@ void BoxWithBorder::draw(const Rect& area) const return; } - Rect dirty = area & centerRect; + const Rect dirty = area & centerRect; Box::draw(dirty); if (borderSize == 0) @@ -36,7 +36,7 @@ void BoxWithBorder::draw(const Rect& area) const return; } - Rect borders[4] = { + const Rect borders[4] = { Rect(0, 0, getWidth(), borderSize), // Upper Rect(0, getHeight() - borderSize, getWidth(), borderSize), // lower Rect(0, borderSize, borderSize, getHeight() - (2 * borderSize)), // left diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp index e7e5262..c67d687 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -19,7 +19,7 @@ namespace touchgfx { void Button::draw(const Rect& invalidatedArea) const { - Bitmap bmp(pressed ? down : up); + const Bitmap bmp(pressed ? down : up); Rect dirty(0, 0, bmp.getWidth(), bmp.getHeight()); dirty &= invalidatedArea; if ((bmp.getId() != BITMAP_INVALID) && !dirty.isEmpty()) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp index 35effd8..69b6e95 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -42,8 +42,8 @@ void ButtonWithIcon::draw(const Rect& invalidatedArea) const { Button::draw(invalidatedArea); - Bitmap bmp(pressed ? iconPressed : iconReleased); - Rect iconRect(iconX, iconY, bmp.getWidth(), bmp.getHeight()); + const Bitmap bmp(pressed ? iconPressed : iconReleased); + const Rect iconRect(iconX, iconY, bmp.getWidth(), bmp.getHeight()); Rect dirty = invalidatedArea & iconRect; if ((bmp.getId() != BITMAP_INVALID) && !dirty.isEmpty()) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp index 302e328..210c998 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -30,7 +30,7 @@ void ButtonWithLabel::draw(const Rect& area) const if (typedText.hasValidId()) { const Font* fontToDraw = typedText.getFont(); // Never return 0 - int16_t height = textHeightIncludingSpacing; + const int16_t height = textHeightIncludingSpacing; int16_t offset; Rect labelRect; switch (rotation) @@ -59,7 +59,7 @@ void ButtonWithLabel::draw(const Rect& area) const dirty.x -= labelRect.x; dirty.y -= labelRect.y; translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, pressed ? colorPressed : color, alpha, typedText.getAlignment(), 0, rotation, typedText.getTextDirection(), 0, WIDE_TEXT_NONE); + const LCD::StringVisuals visuals(fontToDraw, pressed ? colorPressed : color, alpha, typedText.getAlignment(), 0, rotation, typedText.getTextDirection(), 0, WIDE_TEXT_NONE); HAL::lcd().drawString(labelRect, dirty, visuals, typedText.getText()); } } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp index 17c9608..2d58f66 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -139,7 +139,7 @@ void Gauge::setValue(int value) { needle.setRenderingAlgorithm(algorithmMoving); } - uint16_t progress = AbstractProgressIndicator::getProgress(abs(needleEndAngle - needleStartAngle)); + const uint16_t progress = AbstractProgressIndicator::getProgress(abs(needleEndAngle - needleStartAngle)); if (needleEndAngle < needleStartAngle) { needle.updateZAngle(((float)(needleStartAngle - progress) / 180.0f) * PI); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp index eebc6a8..143ea2d 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -30,7 +30,7 @@ void Image::draw(const Rect& invalidatedArea) const translateRectToAbsolute(meAbs); // To find our x and y coords in absolute. // Calculate intersection between bitmap rect and invalidated area. - Rect dirtyBitmapArea = bitmap.getRect() & invalidatedArea; + const Rect dirtyBitmapArea = bitmap.getRect() & invalidatedArea; if (!dirtyBitmapArea.isEmpty()) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp index bf0dfdf..b405526 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -67,7 +67,7 @@ void Keyboard::setTextIndentation() { if (layout != 0) { - uint8_t indentation = layout->textAreaFont.getFont()->getMaxPixelsLeft(); + const uint8_t indentation = layout->textAreaFont.getFont()->getMaxPixelsLeft(); enteredText.setPosition(layout->textAreaPosition.x - indentation, layout->textAreaPosition.y, layout->textAreaPosition.width + indentation * 2, layout->textAreaPosition.height); enteredText.setIndentation(indentation); @@ -127,20 +127,20 @@ void Keyboard::draw(const Rect& invalidatedArea) const // String with room for a single character Unicode::UnicodeChar character[2] = { 0, 0 }; // The last is important as string terminator. - uint16_t fontHeight = font->getHeight(); + const uint16_t fontHeight = font->getHeight(); for (uint8_t i = 0; i < layout->numberOfKeys; i++) { const Key& key = layout->keyArray[i]; if (key.keyArea.intersect(invalidatedArea)) { - uint8_t keyId = key.keyId; - Unicode::UnicodeChar c = getCharForKey(keyId); + const uint8_t keyId = key.keyId; + const Unicode::UnicodeChar c = getCharForKey(keyId); if (c != 0) { // Get a copy of the keyArea and v-center the area for the character Rect keyArea = key.keyArea; - uint16_t offset = (keyArea.height - fontHeight) / 2; + const uint16_t offset = (keyArea.height - fontHeight) / 2; keyArea.y += offset; keyArea.height -= offset; // Calculate the invalidated area relative to the key @@ -160,14 +160,14 @@ void Keyboard::draw(const Rect& invalidatedArea) const void Keyboard::handleClickEvent(const ClickEvent& event) { - ClickEvent::ClickEventType type = event.getType(); + const ClickEvent::ClickEventType type = event.getType(); if (type == ClickEvent::RELEASED && cancelIsEmitted) { cancelIsEmitted = false; return; } - int16_t x = event.getX(); - int16_t y = event.getY(); + const int16_t x = event.getX(); + const int16_t y = event.getY(); Rect toDraw; Keyboard::CallbackArea callbackArea = getCallbackAreaForCoordinates(x, y); @@ -193,7 +193,7 @@ void Keyboard::handleClickEvent(const ClickEvent& event) } else { - Keyboard::Key key = getKeyForCoordinates(x, y); + const Keyboard::Key key = getKeyForCoordinates(x, y); if (type == ClickEvent::PRESSED) { @@ -211,7 +211,7 @@ void Keyboard::handleClickEvent(const ClickEvent& event) { if (key.keyId != 0 && buffer) { - Unicode::UnicodeChar c = getCharForKey(key.keyId); + const Unicode::UnicodeChar c = getCharForKey(key.keyId); if (c != 0 && bufferPosition < (bufferSize - 1)) { enteredText.invalidateContent(); @@ -245,7 +245,7 @@ void Keyboard::handleDragEvent(const DragEvent& event) if (highlightImage.isVisible() && (!highlightImage.getRect().intersect(static_cast(event.getNewX()), static_cast(event.getNewY()))) && (!cancelIsEmitted)) { // Send a CANCEL click event, if user has dragged out of currently pressed/highlighted key. - ClickEvent cancelEvent(ClickEvent::CANCEL, static_cast(event.getOldX()), static_cast(event.getOldY())); + const ClickEvent cancelEvent(ClickEvent::CANCEL, static_cast(event.getOldX()), static_cast(event.getOldY())); handleClickEvent(cancelEvent); } } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp index 5eb12de..caa550f 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp index 5e3070a..46dbc17 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -19,14 +19,14 @@ namespace touchgfx { void RadioButton::draw(const Rect& invalidatedArea) const { - Bitmap bitmap = getCurrentlyDisplayedBitmap(); + const Bitmap bitmap = getCurrentlyDisplayedBitmap(); if (bitmap.getId() != BITMAP_INVALID) { Rect meAbs; translateRectToAbsolute(meAbs); // To find our x and y coords in absolute. // Calculate intersection between bitmap rect and invalidated area. - Rect dirtyBitmapArea = bitmap.getRect() & invalidatedArea; + const Rect dirtyBitmapArea = bitmap.getRect() & invalidatedArea; if (!dirtyBitmapArea.isEmpty()) { @@ -37,7 +37,7 @@ void RadioButton::draw(const Rect& invalidatedArea) const void RadioButton::handleClickEvent(const ClickEvent& event) { - bool wasPressed = pressed; + const bool wasPressed = pressed; pressed = (event.getType() == ClickEvent::PRESSED); if ((pressed && !wasPressed) || (!pressed && wasPressed)) { @@ -78,7 +78,7 @@ Rect RadioButton::getSolidRect() const void RadioButton::setSelected(bool newSelected) { - bool wasSelected = selected; + const bool wasSelected = selected; selected = newSelected; if (wasSelected && !newSelected) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp index 5c9961f..01eedf2 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp index 9a0e0a5..cdebcdd 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -109,7 +109,7 @@ void SVGImage::draw(const Rect& invalidatedArea) const renderer->setup(*this, invalidatedArea); - Matrix3x3 matrix = getTransformationMatrix(); + const Matrix3x3 matrix = getTransformationMatrix(); for (const VGShape* shape = image.shape; shape != 0; shape = shape->next) { Matrix3x3 shapeMatrix; @@ -133,7 +133,7 @@ void SVGImage::draw(const Rect& invalidatedArea) const const int16_t x_max = static_cast(ceilf(MAX(MAX(p1.x, p2.x), MAX(p3.x, p4.x)))); const int16_t y_min = static_cast(floorf(MIN(MIN(p1.y, p2.y), MIN(p3.y, p4.y)))); const int16_t y_max = static_cast(ceilf(MAX(MAX(p1.y, p2.y), MAX(p3.y, p4.y)))); - Rect shapeBox(x_min, y_min, (x_max - x_min) + 1, (y_max - y_min) + 1); + const Rect shapeBox(x_min, y_min, (x_max - x_min) + 1, (y_max - y_min) + 1); if (shapeBox.intersect(invalidatedArea)) { renderer->setTransformationMatrix(shapeMatrix); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp index 28a5e2a..8564bef 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -74,18 +74,18 @@ void ScalableImage::drawQuad(const Rect& invalidatedArea, uint16_t* fb, const fl DisplayTransformation::transformDisplayToFrameBuffer(x3, y3, this->getRect()); Point3D vertices[4]; - Point3D point0 = { floatToFixed28_4(x0), floatToFixed28_4(y0), (float)(triangleZs[0]), (float)(triangleUs[0]), (float)(triangleVs[0]) }; - Point3D point1 = { floatToFixed28_4(x1), floatToFixed28_4(y1), (float)(triangleZs[1]), (float)(triangleUs[1]), (float)(triangleVs[1]) }; - Point3D point2 = { floatToFixed28_4(x2), floatToFixed28_4(y2), (float)(triangleZs[2]), (float)(triangleUs[2]), (float)(triangleVs[2]) }; - Point3D point3 = { floatToFixed28_4(x3), floatToFixed28_4(y3), (float)(triangleZs[3]), (float)(triangleUs[3]), (float)(triangleVs[3]) }; + const Point3D point0 = { floatToFixed28_4(x0), floatToFixed28_4(y0), (float)(triangleZs[0]), (float)(triangleUs[0]), (float)(triangleVs[0]) }; + const Point3D point1 = { floatToFixed28_4(x1), floatToFixed28_4(y1), (float)(triangleZs[1]), (float)(triangleUs[1]), (float)(triangleVs[1]) }; + const Point3D point2 = { floatToFixed28_4(x2), floatToFixed28_4(y2), (float)(triangleZs[2]), (float)(triangleUs[2]), (float)(triangleVs[2]) }; + const Point3D point3 = { floatToFixed28_4(x3), floatToFixed28_4(y3), (float)(triangleZs[3]), (float)(triangleUs[3]), (float)(triangleVs[3]) }; vertices[0] = point0; vertices[1] = point1; vertices[2] = point2; vertices[3] = point3; - DrawingSurface dest = { fb, HAL::FRAME_BUFFER_WIDTH }; - TextureSurface src = { textmap, bitmap.getExtraData(), bitmap.getWidth(), bitmap.getHeight(), bitmap.getWidth() }; + const DrawingSurface dest = { fb, HAL::FRAME_BUFFER_WIDTH }; + const TextureSurface src = { textmap, bitmap.getExtraData(), bitmap.getWidth(), bitmap.getHeight(), bitmap.getWidth() }; HAL::lcd().drawTextureMapQuad(dest, vertices, src, absoluteRect, dirtyAreaAbsolute, lookupRenderVariant(), alpha, 0xFFFF); } @@ -118,14 +118,14 @@ void ScalableImage::draw(const Rect& invalidatedArea) const float triangleUs[4]; float triangleVs[4]; - float imageX0 = 0; - float imageY0 = 0; - float imageX1 = imageX0 + getWidth(); - float imageY1 = imageY0; - float imageX2 = imageX1; - float imageY2 = imageY0 + getHeight(); - float imageX3 = imageX0; - float imageY3 = imageY2; + const float imageX0 = 0; + const float imageY0 = 0; + const float imageX1 = imageX0 + getWidth(); + const float imageY1 = imageY0; + const float imageX2 = imageX1; + const float imageY2 = imageY0 + getHeight(); + const float imageX3 = imageX0; + const float imageY3 = imageY2; triangleZs[0] = 100.f; triangleZs[1] = 100.f; @@ -133,8 +133,8 @@ void ScalableImage::draw(const Rect& invalidatedArea) const triangleZs[3] = 100.f; // Setup texture coordinates - float right = (float)(bitmap.getWidth()); - float bottom = (float)(bitmap.getHeight()); + const float right = (float)(bitmap.getWidth()); + const float bottom = (float)(bitmap.getHeight()); float textureU0 = 0.0f; float textureV0 = 0.0f; float textureU1 = right; @@ -179,10 +179,19 @@ void ScalableImage::draw(const Rect& invalidatedArea) const Rect ScalableImage::getSolidRect() const { // If original image is completely solid the scaled image will also be - if (alpha == 255 && bitmap.getSolidRect().width == bitmap.getWidth() && bitmap.getSolidRect().height == bitmap.getHeight()) + // Return the unscaled solid rect limited to the widget + // TextureMapper may not fill solid pixels in the whole widget due to antialiasing + if (alpha == 255) { - return bitmap.getSolidRect(); + const Rect bmpSolid = bitmap.getSolidRect(); + if (bmpSolid.width == bitmap.getWidth() && bmpSolid.height == bitmap.getHeight()) + { + const Rect widgetRect(0, 0, getWidth(), getHeight()); + return bmpSolid & widgetRect; + } } + + // Return empty rect otherwise return Rect(); } } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp index de5cd0c..c47c570 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -52,7 +52,7 @@ void SnapshotWidget::makeSnapshot(const BitmapId bmp) { Rect visRect(0, 0, rect.width, rect.height); getVisibleRect(visRect); - Rect absRect = getAbsoluteRect(); + const Rect absRect = getAbsoluteRect(); bitmapId = (HAL::lcd().copyFrameBufferRegionToMemory(visRect, absRect, bmp)) ? bmp : BITMAP_INVALID; } } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp index 352bad1..b200b27 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -51,7 +51,7 @@ void TextArea::draw(const Rect& area) const const Font* fontToDraw = typedText.getFont(); if (fontToDraw != 0) { - LCD::StringVisuals visuals(fontToDraw, color, alpha, getAlignment(), linespace, rotation, typedText.getTextDirection(), indentation, wideTextAction); + const LCD::StringVisuals visuals(fontToDraw, color, alpha, getAlignment(), linespace, rotation, typedText.getTextDirection(), indentation, wideTextAction); HAL::lcd().drawString(getAbsoluteRect(), rectToDraw, visuals, typedText.getText(), getWildcard1(), getWildcard2()); } } @@ -74,8 +74,8 @@ void TextArea::resizeToCurrentText() { if (typedText.hasValidId()) { - uint16_t w = getTextWidth(); - uint16_t h = getTextHeight(); + const uint16_t w = getTextWidth(); + const uint16_t h = getTextHeight(); if (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) { setWidthHeight(w, h); @@ -91,16 +91,16 @@ void TextArea::resizeToCurrentTextWithAlignment() { if (typedText.hasValidId()) { - Alignment alignment = getAlignment(); - uint16_t text_width = getTextWidth(); - uint16_t text_height = getTextHeight(); + const Alignment alignment = getAlignment(); + const uint16_t text_width = getTextWidth(); + const uint16_t text_height = getTextHeight(); if (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) { // (rotate-0 && left-align) or (rotate-180 && right-align) places text to the left if (!((rotation == TEXT_ROTATE_0 && alignment == LEFT) || (rotation == TEXT_ROTATE_180 && alignment == RIGHT))) { - uint16_t old_width = getWidth(); - uint16_t old_x = getX(); + const uint16_t old_width = getWidth(); + const uint16_t old_x = getX(); if (alignment == CENTER) { setX(old_x + (old_width - text_width) / 2); @@ -112,8 +112,8 @@ void TextArea::resizeToCurrentTextWithAlignment() } if (rotation == TEXT_ROTATE_180) { - uint16_t old_height = getHeight(); - uint16_t old_y = getY(); + const uint16_t old_height = getHeight(); + const uint16_t old_y = getY(); setY(old_y + (old_height - text_height)); } setWidthHeight(text_width, text_height); @@ -123,8 +123,8 @@ void TextArea::resizeToCurrentTextWithAlignment() // 90+left or 270+right places text at the same y coordinate if (!((rotation == TEXT_ROTATE_90 && alignment == LEFT) || (rotation == TEXT_ROTATE_270 && alignment == RIGHT))) { - uint16_t old_height = getHeight(); - uint16_t old_y = getY(); + const uint16_t old_height = getHeight(); + const uint16_t old_y = getY(); if (alignment == CENTER) { setY(old_y + (old_height - text_width) / 2); @@ -136,8 +136,8 @@ void TextArea::resizeToCurrentTextWithAlignment() } if (rotation == TEXT_ROTATE_90) { - uint16_t old_width = getWidth(); - uint16_t old_x = getX(); + const uint16_t old_width = getWidth(); + const uint16_t old_x = getX(); setX(old_x + (old_width - text_height)); } setWidthHeight(text_height, text_width); @@ -149,7 +149,7 @@ void TextArea::resizeHeightToCurrentText() { if (typedText.hasValidId()) { - uint16_t h = getTextHeight(); + const uint16_t h = getTextHeight(); if (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) { setHeight(h); @@ -165,7 +165,7 @@ void TextArea::resizeHeightToCurrentTextWithRotation() { if (typedText.hasValidId()) { - uint16_t h = getTextHeight(); + const uint16_t h = getTextHeight(); switch (rotation) { case TEXT_ROTATE_0: @@ -197,16 +197,15 @@ int16_t TextArea::calculateTextHeight(const Unicode::UnicodeChar* format, ...) c va_start(pArg, format); const Font* fontToDraw = typedText.getFont(); - int16_t textHeight = fontToDraw->getHeight(); + const int16_t textHeight = fontToDraw->getHeight(); TextProvider textProvider; textProvider.initialize(format, pArg, fontToDraw->getGSUBTable(), fontToDraw->getContextualFormsTable()); - int16_t numLines = LCD::getNumLines(textProvider, wideTextAction, typedText.getTextDirection(), typedText.getFont(), getWidth() - indentation); + const int16_t numLines = LCD::getNumLines(textProvider, wideTextAction, typedText.getTextDirection(), typedText.getFont(), getWidth() - indentation); va_end(pArg); - return (textHeight + linespace > 0) ? (numLines * textHeight + (numLines - 1) * linespace) : (numLines > 0) ? (textHeight) - : 0; + return textHeight + linespace > 0 ? numLines * textHeight + (numLines - 1) * linespace : (numLines > 0 ? textHeight : 0); } void TextArea::invalidateContent() const diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp index 126df70..00a5463 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -24,7 +24,7 @@ void TextAreaWithWildcardBase::draw(const Rect& area) const const Font* fontToDraw = typedText.getFont(); if (fontToDraw != 0) { - LCD::StringVisuals visuals(fontToDraw, color, alpha, typedText.getAlignment(), linespace, rotation, typedText.getTextDirection(), indentation, wideTextAction); + const LCD::StringVisuals visuals(fontToDraw, color, alpha, typedText.getAlignment(), linespace, rotation, typedText.getTextDirection(), indentation, wideTextAction); HAL::lcd().drawString(getAbsoluteRect(), area, visuals, typedText.getText(), getWildcard1(), getWildcard2()); } } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp index d176f8d..a803c3c 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -63,10 +63,10 @@ void TextureMapper::applyTransformation() { const uint8_t n = 4; - int imgWidth = Bitmap(bitmap).getWidth() + 1; - int imgHeight = Bitmap(bitmap).getHeight() + 1; + const int imgWidth = Bitmap(bitmap).getWidth() + 1; + const int imgHeight = Bitmap(bitmap).getHeight() + 1; - Point4 vertices[n] = { + const Point4 vertices[n] = { Point4(xBitmapPosition - 1, yBitmapPosition - 1, cameraDistance), Point4((xBitmapPosition - 1) + imgWidth, yBitmapPosition - 1, cameraDistance), Point4((xBitmapPosition - 1) + imgWidth, (yBitmapPosition - 1) + imgHeight, cameraDistance), @@ -74,7 +74,7 @@ void TextureMapper::applyTransformation() }; Point4 transformed[n]; - Vector4 tm_center(xOrigo, yOrigo, zOrigo); + const Vector4 tm_center(xOrigo, yOrigo, zOrigo); Matrix4x4 translateToCenter; translateToCenter.concatenateXTranslation(-tm_center.getX()).concatenateYTranslation(-tm_center.getY()).concatenateZTranslation(-tm_center.getZ()); @@ -130,7 +130,7 @@ Rect TextureMapper::getBoundingRect() const float minXf = MIN(imageX0, imageX1); minXf = MIN(minXf, imageX2); minXf = floorf(MIN(minXf, imageX3)); - int16_t minX = (int16_t)(MAX(0, minXf)); + const int16_t minX = (int16_t)(MAX(0, minXf)); float maxXf = MAX(imageX0, imageX1); maxXf = MAX(maxXf, imageX2); @@ -141,7 +141,7 @@ Rect TextureMapper::getBoundingRect() const float minYf = MIN(imageY0, imageY1); minYf = MIN(minYf, imageY2); minYf = floorf(MIN(minYf, imageY3)); - int16_t minY = (int16_t)(MAX(0, minYf)); + const int16_t minY = (int16_t)(MAX(0, minYf)); float maxYf = MAX(imageY0, imageY1); maxYf = MAX(maxYf, imageY2); @@ -197,8 +197,8 @@ void TextureMapper::draw(const Rect& invalidatedArea) const uint16_t* fb = 0; // Setup texture coordinates - float right = (float)(bitmap.getWidth()); - float bottom = (float)(bitmap.getHeight()); + const float right = (float)(bitmap.getWidth()); + const float bottom = (float)(bitmap.getHeight()); float textureU0 = -1.0f; float textureV0 = -1.0f; float textureU1 = right; @@ -227,8 +227,8 @@ void TextureMapper::draw(const Rect& invalidatedArea) const // Determine winding order Vector4 zeroToOne(imageX1 - imageX0, imageY1 - imageY0, imageZ1 - imageZ0); - Vector4 zeroToTwo(imageX2 - imageX0, imageY2 - imageY0, imageZ2 - imageZ0); - Vector4 normal = zeroToOne.crossProduct(zeroToTwo); + const Vector4 zeroToTwo(imageX2 - imageX0, imageY2 - imageY0, imageZ2 - imageZ0); + const Vector4 normal = zeroToOne.crossProduct(zeroToTwo); if (normal.getZ() > 0) { @@ -328,8 +328,8 @@ void TextureMapper::drawQuad(const Rect& invalidatedArea, uint16_t* fb, const fl const Point3D vertices[4] = { point0, point1, point2, point3 }; - DrawingSurface dest = { fb, HAL::FRAME_BUFFER_WIDTH }; - TextureSurface src = { textmap, bitmap.getExtraData(), bitmap.getWidth(), bitmap.getHeight(), bitmap.getWidth() }; + const DrawingSurface dest = { fb, HAL::FRAME_BUFFER_WIDTH }; + const TextureSurface src = { textmap, bitmap.getExtraData(), bitmap.getWidth(), bitmap.getHeight(), bitmap.getWidth() }; uint16_t subDivs = subDivisionSize; if (point0.Z == point1.Z && point1.Z == point2.Z) //lint !e777 diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp index e76ff76..ffbf81f 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -74,8 +74,8 @@ int16_t TiledImage::getYOffset() void TiledImage::draw(const Rect& invalidatedArea) const { - int16_t bitmapWidth = bitmap.getWidth(); - int16_t bitmapHeight = bitmap.getHeight(); + const int16_t bitmapWidth = bitmap.getWidth(); + const int16_t bitmapHeight = bitmap.getHeight(); if (bitmapWidth == 0 || bitmapHeight == 0) { @@ -120,7 +120,7 @@ Rect TiledImage::getSolidRect() const solidRect2.x += bitmap.getWidth(); if (solidRect.x < 0) { - int16_t right = solidRect.right(); + const int16_t right = solidRect.right(); solidRect.width = MAX(right, 0); solidRect.x = 0; } @@ -144,7 +144,7 @@ Rect TiledImage::getSolidRect() const solidRect2.y += bitmap.getHeight(); if (solidRect.y < 0) { - int16_t bottom = solidRect.bottom(); + const int16_t bottom = solidRect.bottom(); solidRect.height = MAX(bottom, 0); solidRect.y = 0; } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp index bb03006..0110f6d 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -41,7 +41,7 @@ void ToggleButton::handleClickEvent(const ClickEvent& event) { if (pressed && (event.getType() == ClickEvent::RELEASED)) { - Bitmap tmp = up; + const Bitmap tmp = up; up = down; down = tmp; } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp index 32bc4cf..f908817 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp index 4a182d9..31bf62e 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -164,7 +164,7 @@ void VideoWidget::readVideoInformation() VideoController::getInstance().getVideoInformation(handle, &videoInformation); videoWidth = (int16_t)videoInformation.frame_width; videoHeight = (int16_t)videoInformation.frame_height; - uint32_t videoFramesIn1000ms = 1000 / videoInformation.ms_between_frames; + const uint32_t videoFramesIn1000ms = 1000 / videoInformation.ms_between_frames; setFrameRate(60, videoFramesIn1000ms); } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp index d864236..da75792 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -28,7 +28,7 @@ AbstractShape::AbstractShape() bool AbstractShape::drawCanvasWidget(const Rect& invalidatedArea) const { - int numPoints = getNumPoints(); + const int numPoints = getNumPoints(); if (numPoints == 0) { return true; @@ -51,19 +51,22 @@ bool AbstractShape::drawCanvasWidget(const Rect& invalidatedArea) const void AbstractShape::updateAbstractShapeCache() { - int numPoints = getNumPoints(); + const int numPoints = getNumPoints(); int xMin = 0; int xMax = 0; int yMin = 0; int yMax = 0; + const CWRUtil::Q15 cos = CWRUtil::cosine(shapeAngle); + const CWRUtil::Q15 sin = CWRUtil::sine(shapeAngle); + for (int i = 0; i < numPoints; i++) { - CWRUtil::Q5 xCorner = getCornerX(i); - CWRUtil::Q5 yCorner = getCornerY(i); + CWRUtil::Q5 const xCorner = getCornerX(i); + CWRUtil::Q5 const yCorner = getCornerY(i); - CWRUtil::Q5 xCache = dx + ((CWRUtil::mulQ5(xCorner, xScale) * CWRUtil::cosine(shapeAngle))) - ((CWRUtil::mulQ5(yCorner, yScale) * CWRUtil::sine(shapeAngle))); + CWRUtil::Q5 const xCache = dx + ((CWRUtil::mulQ5(xCorner, xScale) * cos)) - ((CWRUtil::mulQ5(yCorner, yScale) * sin)); if (i == 0 || xCache.to() > xMax) { xMax = xCache.to(); @@ -72,7 +75,7 @@ void AbstractShape::updateAbstractShapeCache() { xMin = xCache.to(); } - CWRUtil::Q5 yCache = dy + ((CWRUtil::mulQ5(yCorner, yScale) * CWRUtil::cosine(shapeAngle))) + ((CWRUtil::mulQ5(xCorner, xScale) * CWRUtil::sine(shapeAngle))); + CWRUtil::Q5 const yCache = dy + ((CWRUtil::mulQ5(yCorner, yScale) * cos)) + ((CWRUtil::mulQ5(xCorner, xScale) * sin)); if (i == 0 || yCache.to() > yMax) { yMax = yCache.to(); diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp index 5c7e19b..b4423be 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -446,14 +446,6 @@ void CWRVectorRenderer::setLinearGradient(float x0, float y0, float x1, float y1 proxyWidget.setPainter(linearPainter); } -void CWRVectorRenderer::setRadialGradient(float /* cx */, float /* cy */, float /* radius */, - uint32_t /* stops */, - const float* /* stopPositions */, - const colortype* /* stopColors */) -{ - assert(!"CWRVectorRenderer does not support radial gradient!"); -} - void CWRVectorRenderer::setTransformationMatrix(const Matrix3x3& m) { matrix = m; @@ -469,8 +461,8 @@ void CWRVectorRenderer::StrokeCanvas::strokeMoveTo(float x, float y) void CWRVectorRenderer::StrokeCanvas::strokeLineTo(float x, float y) { - float dx = x - lastX; - float dy = y - lastY; + const float dx = x - lastX; + const float dy = y - lastY; float len = sqrtf(dx * dx + dy * dy); if (len > 0.0f) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp index 8296313..fff6a70 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -182,7 +182,7 @@ bool Canvas::render(uint8_t customAlpha) // Create the rendering buffer uint8_t* RESTRICT framebuffer = reinterpret_cast(HAL::getInstance()->lockFrameBufferForRenderingMethod(widget->getPainter()->getRenderingMethod())); - int stride = HAL::lcd().framebufferStride(); + const int stride = HAL::lcd().framebufferStride(); uint8_t xAdjust = 0; switch (HAL::lcd().framebufferFormat()) { @@ -220,6 +220,7 @@ bool Canvas::render(uint8_t customAlpha) assert(false && "Unsupported bit depth"); } const bool result = rasterizer.render(widget->getPainter(), framebuffer, stride, xAdjust, alpha); + widget->getPainter()->tearDown(); HAL::getInstance()->unlockFrameBuffer(); return result; } @@ -228,7 +229,7 @@ void Canvas::transformFrameBufferToDisplay(CWRUtil::Q5& x, CWRUtil::Q5& y) const { if (HAL::DISPLAY_ROTATION == rotate90) { - CWRUtil::Q5 tmpY = y; + CWRUtil::Q5 const tmpY = y; y = CWRUtil::toQ5(widget->getWidth()) - x; x = tmpY; } @@ -251,16 +252,16 @@ void Canvas::recursiveQuadraticBezier(const float x1, const float y1, const floa // Calculate all the mid-points of the line segments //---------------------- - float x12 = (x1 + x2) / 2; - float y12 = (y1 + y2) / 2; - float x23 = (x2 + x3) / 2; - float y23 = (y2 + y3) / 2; - float x123 = (x12 + x23) / 2; - float y123 = (y12 + y23) / 2; + const float x12 = (x1 + x2) / 2; + const float y12 = (y1 + y2) / 2; + const float x23 = (x2 + x3) / 2; + const float y23 = (y2 + y3) / 2; + const float x123 = (x12 + x23) / 2; + const float y123 = (y12 + y23) / 2; float dx = x3 - x1; float dy = y3 - y1; - float d = abs(((x2 - x3) * dy - (y2 - y3) * dx)); + const float d = abs(((x2 - x3) * dy - (y2 - y3) * dx)); if (d > curve_collinearity_epsilon) { @@ -325,18 +326,18 @@ void Canvas::recursiveCubicBezier(const float x1, const float y1, const float x2 // Calculate all the mid-points of the line segments //---------------------- - float x12 = (x1 + x2) / 2; - float y12 = (y1 + y2) / 2; - float x23 = (x2 + x3) / 2; - float y23 = (y2 + y3) / 2; - float x34 = (x3 + x4) / 2; - float y34 = (y3 + y4) / 2; - float x123 = (x12 + x23) / 2; - float y123 = (y12 + y23) / 2; - float x234 = (x23 + x34) / 2; - float y234 = (y23 + y34) / 2; - float x1234 = (x123 + x234) / 2; - float y1234 = (y123 + y234) / 2; + const float x12 = (x1 + x2) / 2; + const float y12 = (y1 + y2) / 2; + const float x23 = (x2 + x3) / 2; + const float y23 = (y2 + y3) / 2; + const float x34 = (x3 + x4) / 2; + const float y34 = (y3 + y4) / 2; + const float x123 = (x12 + x23) / 2; + const float y123 = (y12 + y23) / 2; + const float x234 = (x23 + x34) / 2; + const float y234 = (y23 + y34) / 2; + const float x1234 = (x123 + x234) / 2; + const float y1234 = (y123 + y234) / 2; if (level > 0) // Enforce subdivision first time { @@ -345,8 +346,8 @@ void Canvas::recursiveCubicBezier(const float x1, const float y1, const float x2 float dx = x4 - x1; float dy = y4 - y1; - float d2 = abs(((x2 - x4) * dy - (y2 - y4) * dx)); - float d3 = abs(((x3 - x4) * dy - (y3 - y4) * dx)); + const float d2 = abs(((x2 - x4) * dy - (y2 - y4) * dx)); + const float d3 = abs(((x3 - x4) * dy - (y3 - y4) * dx)); float da1, da2; @@ -369,7 +370,7 @@ void Canvas::recursiveCubicBezier(const float x1, const float y1, const float x2 // Angle & Cusp Condition //---------------------- - float a23 = atan2f(y3 - y2, x3 - x2); + const float a23 = atan2f(y3 - y2, x3 - x2); da1 = abs(a23 - atan2f(y2 - y1, x2 - x1)); da2 = abs(atan2f(y4 - y3, x4 - x3) - a23); if (da1 >= PI) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp index 9571059..139c449 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -105,7 +105,6 @@ void CanvasWidget::draw(const Rect& invalidatedArea) const } break; } - canvasPainter->tearDown(); } void CanvasWidget::invalidate() const diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp index 89adcf6..96f9485 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -66,12 +66,12 @@ bool Circle::drawCanvasWidget(const Rect& invalidatedArea) const CWRUtil::Q5 arcStart = circleArcAngleStart; CWRUtil::Q5 arcEnd = circleArcAngleEnd; - CWRUtil::Q5 _360 = CWRUtil::toQ5(360); + CWRUtil::Q5 const _360 = CWRUtil::toQ5(360); // Put start before end by swapping if (arcStart > arcEnd) { - CWRUtil::Q5 tmp = arcStart; + CWRUtil::Q5 const tmp = arcStart; arcStart = arcEnd; arcEnd = tmp; } @@ -132,7 +132,7 @@ bool Circle::drawCanvasWidget(const Rect& invalidatedArea) const } CWRUtil::Q5 arc = arcStart; - CWRUtil::Q5 circleArcIncrementQ5 = CWRUtil::toQ5(circleArcIncrement); + CWRUtil::Q5 const circleArcIncrementQ5 = CWRUtil::toQ5(circleArcIncrement); moveToAngleRadius2(canvas, arc, (radius * 2) + lineWidth); CWRUtil::Q5 nextArc = CWRUtil::Q5(ROUNDUP((int)(arc + CWRUtil::toQ5(1)), (int)circleArcIncrementQ5)); while (nextArc <= arcEnd) @@ -163,13 +163,13 @@ bool Circle::drawCanvasWidget(const Rect& invalidatedArea) const return false; } - CWRUtil::Q5 circleCapArcIncrementQ5 = CWRUtil::toQ5(circleCapArcIncrement); - CWRUtil::Q5 _180 = CWRUtil::toQ5(180); + CWRUtil::Q5 const circleCapArcIncrementQ5 = CWRUtil::toQ5(circleCapArcIncrement); + CWRUtil::Q5 const _180 = CWRUtil::toQ5(180); if (arcEnd - arcStart < _360) { // Draw the circle cap - CWRUtil::Q5 capX = circleCenterX + (radius * CWRUtil::sine(arcEnd)); - CWRUtil::Q5 capY = circleCenterY - (radius * CWRUtil::cosine(arcEnd)); + CWRUtil::Q5 const capX = circleCenterX + (radius * CWRUtil::sine(arcEnd)); + CWRUtil::Q5 const capY = circleCenterY - (radius * CWRUtil::cosine(arcEnd)); for (CWRUtil::Q5 capAngle = arcEnd + circleCapArcIncrementQ5; capAngle < arcEnd + _180; capAngle += circleCapArcIncrementQ5) { lineToXYAngleRadius2(canvas, capX, capY, capAngle, lineWidth); @@ -198,8 +198,8 @@ bool Circle::drawCanvasWidget(const Rect& invalidatedArea) const if (arcEnd - arcStart < _360) { // Draw the circle cap - CWRUtil::Q5 capX = circleCenterX + (radius * CWRUtil::sine(arcStart)); - CWRUtil::Q5 capY = circleCenterY - (radius * CWRUtil::cosine(arcStart)); + CWRUtil::Q5 const capX = circleCenterX + (radius * CWRUtil::sine(arcStart)); + CWRUtil::Q5 const capY = circleCenterY - (radius * CWRUtil::cosine(arcStart)); for (CWRUtil::Q5 capAngle = (arcStart - _180) + circleCapArcIncrementQ5; capAngle < arcStart; capAngle += circleCapArcIncrementQ5) { lineToXYAngleRadius2(canvas, capX, capY, capAngle, lineWidth); @@ -233,14 +233,14 @@ void Circle::updateArc(CWRUtil::Q5 setStartAngleQ5, CWRUtil::Q5 setEndAngleQ5) // Make sure old start < end if (circleArcAngleStart > circleArcAngleEnd) { - CWRUtil::Q5 tmp = circleArcAngleStart; + CWRUtil::Q5 const tmp = circleArcAngleStart; circleArcAngleStart = circleArcAngleEnd; circleArcAngleEnd = tmp; } // Make sure new start < end if (startAngleQ5 > endAngleQ5) { - CWRUtil::Q5 tmp = startAngleQ5; + CWRUtil::Q5 const tmp = startAngleQ5; startAngleQ5 = endAngleQ5; endAngleQ5 = tmp; } @@ -251,13 +251,13 @@ void Circle::updateArc(CWRUtil::Q5 setStartAngleQ5, CWRUtil::Q5 setEndAngleQ5) // Get old circle range start in [0..360[ if (circleArcAngleStart >= _360) { - int x = (circleArcAngleStart / _360).to(); + const int x = (circleArcAngleStart / _360).to(); circleArcAngleStart -= _360 * x; circleArcAngleEnd -= _360 * x; } else if (circleArcAngleStart < 0) { - int x = 1 + ((-circleArcAngleStart) / _360).to(); + const int x = 1 + ((-circleArcAngleStart) / _360).to(); circleArcAngleStart += _360 * x; circleArcAngleEnd += _360 * x; } @@ -270,13 +270,13 @@ void Circle::updateArc(CWRUtil::Q5 setStartAngleQ5, CWRUtil::Q5 setEndAngleQ5) // Get new circle range start in [0..360[ if (startAngleQ5 >= _360) { - int x = (startAngleQ5 / _360).to(); + const int x = (startAngleQ5 / _360).to(); startAngleQ5 -= _360 * x; endAngleQ5 -= _360 * x; } else if (startAngleQ5 < 0) { - int x = 1 + (-startAngleQ5 / _360).to(); + const int x = 1 + (-startAngleQ5 / _360).to(); startAngleQ5 += _360 * x; endAngleQ5 += _360 * x; } @@ -344,13 +344,13 @@ void Circle::calculateMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd, CWRU // Put start before end by swapping if (arcStart > arcEnd) { - CWRUtil::Q5 tmp = arcStart; + CWRUtil::Q5 const tmp = arcStart; arcStart = arcEnd; arcEnd = tmp; } - CWRUtil::Q5 _90 = CWRUtil::toQ5(90); - CWRUtil::Q5 _360 = CWRUtil::toQ5(360); + CWRUtil::Q5 const _90 = CWRUtil::toQ5(90); + CWRUtil::Q5 const _360 = CWRUtil::toQ5(360); if ((arcEnd - arcStart) >= _360) { @@ -400,7 +400,7 @@ Rect Circle::getMinimalRectForUpdatedStartAngle(const CWRUtil::Q5& startAngleQ5) { CWRUtil::Q5 minAngle = CWRUtil::Q5(0); // Unused default value CWRUtil::Q5 maxAngle = CWRUtil::Q5(0); // Unused default value - int circleArcIncrementQ5int = (int)CWRUtil::toQ5(circleArcIncrement); + const int circleArcIncrementQ5int = (int)CWRUtil::toQ5(circleArcIncrement); if (circleArcAngleStart < circleArcAngleEnd) { // start is smaller than end @@ -456,7 +456,7 @@ Rect Circle::getMinimalRectForUpdatedEndAngle(const CWRUtil::Q5& endAngleQ5) con { CWRUtil::Q5 minAngle = CWRUtil::Q5(0); // Unused default value CWRUtil::Q5 maxAngle = CWRUtil::Q5(0); // Unused default value - int circleArcIncrementQ5int = (int)CWRUtil::toQ5(circleArcIncrement); + const int circleArcIncrementQ5int = (int)CWRUtil::toQ5(circleArcIncrement); if (circleArcAngleStart < circleArcAngleEnd) { // start is smaller than end diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp index fbb5845..e27c382 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -167,7 +167,7 @@ void Line::updateCachedShape() // We want to hit as close to the limit inside 32bits. // sqrt(0x7FFFFFFF / 2) = 46340, which is roughly toQ5(1448) static const int32_t MAXVAL = 46340; - int32_t common_divisor = gcd(abs((int32_t)dxQ5), abs((int32_t)dyQ5)); + const int32_t common_divisor = gcd(abs((int32_t)dxQ5), abs((int32_t)dyQ5)); // First try to scale down if (common_divisor != 1) { @@ -303,10 +303,10 @@ void Line::invalidateContent() const return; } - int16_t center_x = ((startXQ5 + endXQ5) / 2).to(); - int16_t center_y = ((startYQ5 + endYQ5) / 2).to(); + const int16_t center_x = ((startXQ5 + endXQ5) / 2).to(); + const int16_t center_y = ((startYQ5 + endYQ5) / 2).to(); // The following should be "lineWidth/sqrt(2)" but to speed up we take the slightly larger "lineWidth/1.3333"="(lineWidth*3)/4" - int16_t extra_width = ((CWRUtil::Q5)(((int)(lineWidthQ5)*3 + 3) >> 2)).ceil(); + const int16_t extra_width = ((CWRUtil::Q5)(((int)(lineWidthQ5)*3 + 3) >> 2)).ceil(); #define same_sign(x, y) (((x) < 0 && (y) < 0) || ((x) > 0 && (y) > 0)) if (smallRect.width < smallRect.height) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp index 4fb22e7..1b8bac2 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp index c393a94..9f1b3ca 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp index eb2824f..ad329cb 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp index ef9ca4c..6d73d70 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp index 6b598c9..ea05408 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -19,7 +19,7 @@ void PainterARGB8888::paint(uint8_t* destination, int16_t offset, int16_t /*widg { uint32_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; const uint32_t* const lineEnd = framebuffer + count; - uint32_t color = (painterColor & 0x00FFFFFF) | (alpha << 24); + const uint32_t color = (painterColor & 0x00FFFFFF) | (alpha << 24); if (alpha == 0xFF) { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp index c2aeff5..a4e0d8c 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp index 9e2371c..e908326 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -129,7 +129,7 @@ void PainterARGB8888L8Bitmap::paint(uint8_t* destination, int16_t offset, int16_ count -= length; do { - uint32_t src = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; + const uint32_t src = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; const uint8_t srcAlpha = src >> 24; const uint8_t a = LCD::div255(alpha * srcAlpha); if (a == 0xFF) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp index 1a1e9eb..b24c266 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp index f004c24..8499157 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp index fa99f42..0b1ec30 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -22,7 +22,7 @@ void PainterBW::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, { do { - unsigned pixel = 1 << (7 - (offset % 8)); + const unsigned pixel = 1 << (7 - (offset % 8)); if (painterBW) { *framebuffer |= pixel; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp index 1b91e2f..4bd8a87 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -45,8 +45,8 @@ void PainterBWBitmap::paint(uint8_t* destination, int16_t offset, int16_t widget count -= length; do { - uint32_t bw_length = bw_rle.getLength(); - uint32_t bitsToDraw = MIN(bw_length, length); + const uint32_t bw_length = bw_rle.getLength(); + const uint32_t bitsToDraw = MIN(bw_length, length); fillBits(destination, offset, 0, 0 /* not used */, bitsToDraw, bw_rle.getColor()); offset += bitsToDraw; @@ -68,8 +68,8 @@ void PainterBWBitmap::paint(uint8_t* destination, int16_t offset, int16_t widget const uint8_t* src = bitmapPointer + widgetX / 8; uint8_t* RESTRICT dst = destination + (offset / 8); - uint16_t srcBitX = widgetX % 8; // & 7 - uint16_t dstBitX = offset % 8; // & 7 + uint16_t srcBitX = widgetX % 8; // & 7 + const uint16_t dstBitX = offset % 8; // & 7 uint16_t remainingBits = length; @@ -115,7 +115,7 @@ void PainterBWBitmap::paint(uint8_t* destination, int16_t offset, int16_t widget // dstX is now word aligned (or we have transferred everything of a narrow image and remainingBits==0) if (remainingBits >= 8) { - uint16_t bytesPerLine = remainingBits / 8; + const uint16_t bytesPerLine = remainingBits / 8; if (srcBitX == 0) { HAL::getInstance()->blockCopy(dst, src, bytesPerLine); @@ -124,7 +124,7 @@ void PainterBWBitmap::paint(uint8_t* destination, int16_t offset, int16_t widget } else { - uint16_t _remainingBits = remainingBits; + const uint16_t _remainingBits = remainingBits; remainingBits = _remainingBits; while (remainingBits >= 8) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp index 128ff14..5aef79f 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp index a717a36..cccfb40 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp index e3a7bb4..3272b7b 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp index f654eb7..42f34a0 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp index 2eaaaee..ebbf013 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp index 0cb9be4..d1ce9f2 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp index 44e2fa9..f8fec9b 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -107,7 +107,7 @@ bool PainterRGB565L8Bitmap::setup(const Rect& widgetRect) const updateBitmapOffsets(widgetWidth); if (bitmap.getId() != BITMAP_INVALID) { - paint::setL8Pallette(bitmapCLUT); + paint::setL8Palette(bitmapCLUT); return true; } return false; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp index 1f62005..858e90e 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -149,7 +149,7 @@ void PainterRGB565LinearGradient::paint(uint8_t* destination, int16_t offset, in if (x <= vx0) // All pixels up to first gradient line { // Starting before gradient - int pixels = (int)(MIN(vx0 + 1 - x, count)); + const int pixels = (int)(MIN(vx0 + 1 - x, count)); // Start in correct end of palette depending on direction const uint32_t colorStart = texture[deltaColor > 0 ? 0 : 1023]; uint16_t* const p_end = p + pixels; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp index 964859e..42dae42 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp index e1771b6..1e65523 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp index cf2f274..033fd55 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -79,7 +79,7 @@ bool PainterRGB888L8Bitmap::setup(const Rect& widgetRect) const updateBitmapOffsets(widgetWidth); if (bitmap.getId() != BITMAP_INVALID) { - paint::setL8Pallette(bitmapCLUT); + paint::setL8Palette(bitmapCLUT); return true; } return false; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp index 10fd50a..42a1a63 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -91,7 +91,7 @@ void PainterRGB888LinearGradient::paint(uint8_t* destination, int16_t offset, in if (x <= vx0) { // Starting before gradient - int pixels = (int)(MIN(vx0 + 1 - x, count)); + const int pixels = (int)(MIN(vx0 + 1 - x, count)); // Start in correct end of palette depending on direction const uint32_t colorStart = texture[deltaColor > 0 ? 0 : 1023]; uint8_t* const p_end = p + pixels * 3; diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp index b4eb0f9..73af594 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp index 4cb2508..a441645 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp index 55fd08e..48a1a27 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp index ec5ec67..e298de3 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp index f1a0fec..83a083b 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -116,7 +116,7 @@ void PainterXRGB8888L8Bitmap::paint(uint8_t* destination, int16_t offset, int16_ count -= length; do { - uint32_t src = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; + const uint32_t src = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; const uint8_t srcAlpha = src >> 24; const uint8_t a = LCD::div255(alpha * srcAlpha); if (a == 0xFF) diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp index 545b24f..2d102b7 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -134,12 +134,13 @@ bool AbstractDataGraph::getNearestIndexForScreenXY(int16_t x, int16_t y, int16_t bool AbstractDataGraph::getNearestIndexForScreenX(int16_t x, int16_t& index) const { + index = 0; if (usedCapacity == 0) { return false; } - uint32_t bestDist = 0xFFFFFFFF; - for (int16_t ix = 0; ix < usedCapacity; ix++) + uint32_t bestDist = abs(indexToScreenX(index) - x); + for (int16_t ix = 1; ix < usedCapacity; ix++) { const uint32_t dist = abs(indexToScreenX(ix) - x); if (dist < bestDist) @@ -165,7 +166,7 @@ void AbstractDataGraph::handleClickEvent(const ClickEvent& event) { if (clickAction && clickAction->isValid()) { - GraphClickEvent graphClickEvent(index, event); + const GraphClickEvent graphClickEvent(index, event); clickAction->execute(*this, graphClickEvent); } } @@ -182,7 +183,7 @@ void AbstractDataGraph::handleDragEvent(const DragEvent& event) { if (dragAction && dragAction->isValid()) { - GraphDragEvent graphDragEvent(index, event); + const GraphDragEvent graphDragEvent(index, event); dragAction->execute(*this, graphDragEvent); } } @@ -328,8 +329,8 @@ void DynamicDataGraph::setGraphRangeYAutoScaled(bool showXaxis, int margin) { return; } - int indexMin = getGraphRangeXMin(); - int indexMax = getGraphRangeXMax(); + int16_t indexMin = (int16_t)getGraphRangeXMin(); + int16_t indexMax = (int16_t)getGraphRangeXMax(); if (indexMin > indexMax) { const int tmp = indexMin; @@ -344,7 +345,7 @@ void DynamicDataGraph::setGraphRangeYAutoScaled(bool showXaxis, int margin) int yMax = showXaxis ? -margin : yValues[indexMin]; for (int i = indexMin; i < indexMax; i++) { - int y = yValues[i]; + const int y = yValues[i]; if (yMin > y) { yMin = y; @@ -505,7 +506,7 @@ void StaticDataGraph::setGraphRangeYAutoScaled(bool showXaxis /*= true*/, int ma // Go through all points where x is in the visible range while (xValues[index] < xValueMax && index < usedCapacity) { - int y = yValues[index++]; + const int y = yValues[index++]; yMin = MIN(yMin, y); yMax = MAX(yMax, y); } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp index 479dfd1..e2f805c 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp index 1c9a2a8..758b530 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -214,7 +214,7 @@ bool GraphElementArea::drawCanvasWidget(const Rect& invalidatedArea) const } } - Rect invalidRect = Rect(graph->getGraphAreaPaddingLeft(), graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidth(), graph->getGraphAreaHeight()) & invalidatedArea; + const Rect invalidRect = Rect(graph->getGraphAreaPaddingLeft(), graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidth(), graph->getGraphAreaHeight()) & invalidatedArea; Canvas canvas(this, invalidRect); canvas.moveTo(roundQ5(indexToScreenXQ5(graph, indexMin)), screenYbaseQ5); for (int16_t index = indexMin; index <= indexMax; index++) @@ -283,7 +283,7 @@ bool GraphElementLine::drawCanvasWidget(const Rect& invalidatedArea) const return true; // Nothing to draw, everything is fine! } - Rect invalidRect = Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()) & invalidatedArea; + const Rect invalidRect = Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()) & invalidatedArea; Canvas canvas(this, invalidRect); const int16_t gapIndex = graph->getGapBeforeIndex(); if (gapIndex <= 0 || gapIndex <= indexMin || gapIndex > indexMax) @@ -301,16 +301,16 @@ bool GraphElementLine::drawCanvasWidget(const Rect& invalidatedArea) const void GraphElementLine::invalidateGraphPointAt(int16_t index) { const AbstractDataGraph* graph = getGraph(); - CWRUtil::Q5 lineWidthQ5 = CWRUtil::toQ5(lineWidth); + CWRUtil::Q5 const lineWidthQ5 = CWRUtil::toQ5(lineWidth); Rect dirty(rectAround(indexToScreenXQ5(graph, index), indexToScreenYQ5(graph, index), lineWidthQ5)); if (index > 0) { - Rect other(rectAround(indexToScreenXQ5(graph, index - 1), indexToScreenYQ5(graph, index - 1), lineWidthQ5)); + const Rect other(rectAround(indexToScreenXQ5(graph, index - 1), indexToScreenYQ5(graph, index - 1), lineWidthQ5)); dirty.expandToFit(other); } if (index < graph->getUsedCapacity() - 1) { - Rect other(rectAround(indexToScreenXQ5(graph, index + 1), indexToScreenYQ5(graph, index + 1), lineWidthQ5)); + const Rect other(rectAround(indexToScreenXQ5(graph, index + 1), indexToScreenYQ5(graph, index + 1), lineWidthQ5)); dirty.expandToFit(other); } dirty &= Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()); @@ -426,7 +426,7 @@ void GraphElementHistogram::draw(const Rect& invalidatedArea) const return; // Nothing to draw, everything is fine! } - Rect invalidRect = Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()) & invalidatedArea; + const Rect invalidRect = Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()) & invalidatedArea; for (int16_t index = indexMin; index <= indexMax; index++) { const int16_t screenX = (indexToScreenXQ5(graph, index) + barOffsetQ5 - barWidthHalfQ5).round(); @@ -517,8 +517,8 @@ bool GraphElementDots::drawCanvasWidget(const Rect& invalidatedArea) const const CWRUtil::Q5 dotWidthQ5 = CWRUtil::toQ5(dotWidth); const CWRUtil::Q5 dotWidth3Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(3), CWRUtil::toQ5(10)); const CWRUtil::Q5 dotWidth4Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(4), CWRUtil::toQ5(10)); - const CWRUtil::Q5 dotWidth5Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(5), CWRUtil::toQ5(26)); - const CWRUtil::Q5 dotWidth12Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(12), CWRUtil::toQ5(26)); + const CWRUtil::Q5 dotWidth7Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(7), CWRUtil::toQ5(50)); + const CWRUtil::Q5 dotWidth24Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(24), CWRUtil::toQ5(50)); const CWRUtil::Q5 dotWidth2Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(1), CWRUtil::toQ5(2)); const uint16_t dotWidthHalf = CWRUtil::Q5(((int)dotWidthQ5 + 1) / 2).ceil(); // Round up int16_t indexMin; @@ -538,31 +538,31 @@ bool GraphElementDots::drawCanvasWidget(const Rect& invalidatedArea) const } const CWRUtil::Q5 screenXcenterQ5 = roundQ5(indexToScreenXQ5(graph, index)); const CWRUtil::Q5 screenYcenterQ5 = roundQ5(indexToScreenYQ5(graph, index)); - Rect dirty(rectAround(screenXcenterQ5, screenYcenterQ5, dotWidthQ5) & invalidatedArea); + const Rect dirty(rectAround(screenXcenterQ5, screenYcenterQ5, dotWidthQ5) & invalidatedArea); if (!dirty.isEmpty()) { if (bigDots) { canvas.moveTo(screenXcenterQ5 - dotWidth2Q5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5 - dotWidth12Q5, screenYcenterQ5 - dotWidth5Q5); + canvas.lineTo(screenXcenterQ5 - dotWidth24Q5, screenYcenterQ5 - dotWidth7Q5); canvas.lineTo(screenXcenterQ5 - dotWidth4Q5, screenYcenterQ5 - dotWidth3Q5); canvas.lineTo(screenXcenterQ5 - dotWidth3Q5, screenYcenterQ5 - dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth5Q5, screenYcenterQ5 - dotWidth12Q5); + canvas.lineTo(screenXcenterQ5 - dotWidth7Q5, screenYcenterQ5 - dotWidth24Q5); canvas.lineTo(screenXcenterQ5, screenYcenterQ5 - dotWidth2Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth5Q5, screenYcenterQ5 - dotWidth12Q5); + canvas.lineTo(screenXcenterQ5 + dotWidth7Q5, screenYcenterQ5 - dotWidth24Q5); canvas.lineTo(screenXcenterQ5 + dotWidth3Q5, screenYcenterQ5 - dotWidth4Q5); canvas.lineTo(screenXcenterQ5 + dotWidth4Q5, screenYcenterQ5 - dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth12Q5, screenYcenterQ5 - dotWidth5Q5); + canvas.lineTo(screenXcenterQ5 + dotWidth24Q5, screenYcenterQ5 - dotWidth7Q5); canvas.lineTo(screenXcenterQ5 + dotWidth2Q5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5 + dotWidth12Q5, screenYcenterQ5 + dotWidth5Q5); + canvas.lineTo(screenXcenterQ5 + dotWidth24Q5, screenYcenterQ5 + dotWidth7Q5); canvas.lineTo(screenXcenterQ5 + dotWidth4Q5, screenYcenterQ5 + dotWidth3Q5); canvas.lineTo(screenXcenterQ5 + dotWidth3Q5, screenYcenterQ5 + dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth5Q5, screenYcenterQ5 + dotWidth12Q5); + canvas.lineTo(screenXcenterQ5 + dotWidth7Q5, screenYcenterQ5 + dotWidth24Q5); canvas.lineTo(screenXcenterQ5, screenYcenterQ5 + dotWidth2Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth5Q5, screenYcenterQ5 + dotWidth12Q5); + canvas.lineTo(screenXcenterQ5 - dotWidth7Q5, screenYcenterQ5 + dotWidth24Q5); canvas.lineTo(screenXcenterQ5 - dotWidth3Q5, screenYcenterQ5 + dotWidth4Q5); canvas.lineTo(screenXcenterQ5 - dotWidth4Q5, screenYcenterQ5 + dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth12Q5, screenYcenterQ5 + dotWidth5Q5); + canvas.lineTo(screenXcenterQ5 - dotWidth24Q5, screenYcenterQ5 + dotWidth7Q5); } else { diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp index 9d2e10e..9b87063 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -254,7 +254,7 @@ void GraphLabelsX::drawString(const Rect& invalidatedArea, const Font* fontToDra dirty.x -= labelRect.x; dirty.y -= labelRect.y; translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, color, a, labelTypedText.getAlignment(), 0, labelRotation, labelTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); + const LCD::StringVisuals visuals(fontToDraw, color, a, labelTypedText.getAlignment(), 0, labelRotation, labelTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); HAL::lcd().drawString(labelRect, dirty, visuals, text, wildcard, 0); } } @@ -292,7 +292,7 @@ void GraphLabelsY::drawString(const Rect& invalidatedArea, const Font* fontToDra dirty.x -= labelRect.x; dirty.y -= labelRect.y; translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, color, a, labelTypedText.getAlignment(), 0, labelRotation, labelTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); + const LCD::StringVisuals visuals(fontToDraw, color, a, labelTypedText.getAlignment(), 0, labelRotation, labelTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); HAL::lcd().drawString(labelRect, dirty, visuals, text, wildcard, 0); } } @@ -336,7 +336,7 @@ void GraphTitle::draw(const Rect& invalidatedArea) const dirty.x -= labelRect.x; dirty.y -= labelRect.y; translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, getColor(), a, titleTypedText.getAlignment(), 0, titleRotation, titleTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); + const LCD::StringVisuals visuals(fontToDraw, getColor(), a, titleTypedText.getAlignment(), 0, titleRotation, titleTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); HAL::lcd().drawString(labelRect, dirty, visuals, titleTypedText.getText(), 0, 0); } } diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp index 826117e..e311d3e 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp index 0d9a7f1..c38eda0 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp index f96857e..248018b 100644 --- a/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp +++ b/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2018(-2023) STMicroelectronics. * All rights reserved. * -* This file is part of the TouchGFX 4.21.2 distribution. +* This file is part of the TouchGFX 4.22.0 distribution. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. @@ -39,8 +39,8 @@ void GraphWrapAndOverwriteData::beforeAddValue() { if (current == 0 && usedCapacity >= maxCapacity) { - int xMin = getGraphRangeXMin(); - int xMax = getGraphRangeXMax(); + const int xMin = getGraphRangeXMin(); + const int xMax = getGraphRangeXMax(); for (int i = xMin; i < 0; i++) { invalidateXAxisPointAt(i); @@ -74,8 +74,8 @@ int16_t GraphWrapAndOverwriteData::addValue(int value) } if (index == 0 && usedCapacity >= maxCapacity) { - int xMin = getGraphRangeXMin(); - int xMax = getGraphRangeXMax(); + const int xMin = getGraphRangeXMin(); + const int xMax = getGraphRangeXMax(); for (int i = xMin; i < 0; i++) { invalidateXAxisPointAt(i); diff --git a/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out b/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out index a9f6b47..843d3a5 100644 Binary files a/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out and b/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out differ diff --git a/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out b/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out index e13d041..2957a56 100644 Binary files a/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out and b/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out differ diff --git a/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out b/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out old mode 100755 new mode 100644 index a889fe4..f137b65 Binary files a/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out and b/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out differ diff --git a/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe b/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe old mode 100644 new mode 100755 index 461c8eb..bea2341 Binary files a/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe and b/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe differ diff --git a/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out b/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out index 461c8eb..bea2341 100644 Binary files a/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out and b/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out differ diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp index 52f6ebf..687a32b 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp @@ -49,6 +49,7 @@ public: virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const; void setFontCache(FontCache& cache); + FontId getFontId() const { return fontId; diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp index 88da8ea..0b78936 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp @@ -28,7 +28,7 @@ void FontCache::clear(bool keepGsubOrContextTable /* = false */) gsubStart = memory + memorySize; // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); + gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(sizeof(void*) - 1)); } } @@ -100,13 +100,11 @@ void FontCache::initializeCachedFont(TypedText t, CachedFont* font, bool loadGsu if (top + sizeOfGSUB < gsubStart) // Room for this GSUB table { - uint8_t* const gsubPosition = gsubStart - sizeOfGSUB; + // Round down to aligned address + uint8_t* const gsubPosition = (uint8_t*)((uintptr_t)(gsubStart - sizeOfGSUB) & ~(sizeof(void*) - 1)); readData(gsubPosition, sizeOfGSUB); font->setGSUBTable(reinterpret_cast(gsubPosition)); - gsubStart -= sizeOfGSUB; - - // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); + gsubStart = gsubPosition; } else { @@ -125,7 +123,7 @@ void FontCache::initializeCachedFont(TypedText t, CachedFont* font, bool loadGsu // Allocate FontContextualFormsTable first gsubStart -= sizeof(FontContextualFormsTable); // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); + gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(sizeof(void*) - 1)); FontContextualFormsTable* table = (FontContextualFormsTable*)gsubStart; font->setContextualFormsTable(table); @@ -194,7 +192,8 @@ bool FontCache::cacheSortedString(TypedText t) readData(&numGlyphs, sizeof(uint16_t)); // numberOfGlyphs FontId fontId = t.getFontId(); // Get font index from typed text - uint32_t bpp = t.getFont()->getBitsPerPixel(); // Get BPP from standard font + bpp = t.getFont()->getBitsPerPixel(); // Get BPP from standard font + byteAlignRow = t.getFont()->getByteAlignRow(); // Get ByteAlign from font setPosition(glyphNodeOffset); // Go to glyph nodes for font currentFileGlyphNumber = 0; @@ -211,7 +210,7 @@ bool FontCache::cacheSortedString(TypedText t) { if (!contains(ch, fontId)) { - insert(ch, fontId, bpp, outOfMemory); + insert(ch, fontId, outOfMemory); if (outOfMemory) { break; @@ -226,7 +225,7 @@ bool FontCache::cacheSortedString(TypedText t) string++; } - cacheData(bpp, firstNewGlyph); + cacheData(firstNewGlyph); return !outOfMemory; } @@ -245,11 +244,11 @@ bool FontCache::contains(Unicode::UnicodeChar unicode, FontId font) const return false; } -void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory) +void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory) { // Insert new glyphnode and glyph after last for font. uint8_t* oldTop = top; - top = copyGlyph(top, unicode, font, bpp, outOfMemory); + top = copyGlyph(top, unicode, font, outOfMemory); if (top == oldTop) { @@ -273,7 +272,7 @@ void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, } } -uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory) +uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory) { while (currentFileGlyphNumber < numGlyphs && currentFileGlyphNode.unicode < unicode) { @@ -287,9 +286,10 @@ uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId } // GlyphNode found - uint32_t glyphSize = ((currentFileGlyphNode.width() + 1) & ~1) * currentFileGlyphNode.height() * bpp / 8; - glyphSize = (glyphSize + 3) & ~0x03; - uint32_t requiredMem = SizeGlyphNode + 4 + glyphSize; // GlyphNode + next ptr + glyph + uint32_t glyphSize = getGlyphSize(¤tFileGlyphNode); + const int alignment = sizeof(void*); + glyphSize = (glyphSize + (alignment - 1)) & ~(alignment - 1); + uint32_t requiredMem = SizeGlyphNode + sizeof(void*) + glyphSize; // GlyphNode + next ptr + glyph // Is space available before sortedString if (top + requiredMem > (uint8_t*)sortedString) @@ -307,7 +307,7 @@ uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId return top; } -void FontCache::cacheData(uint32_t bpp, GlyphNode* first) +void FontCache::cacheData(GlyphNode* first) { GlyphNode* gn = first; while (gn) @@ -317,12 +317,11 @@ void FontCache::cacheData(uint32_t bpp, GlyphNode* first) { p += SizeGlyphNode; // Next pointer - p += 4; + p += sizeof(void*); // Seek and copy setPosition(glyphDataOffset + gn->dataOffset); - uint32_t glyphSize = ((gn->width() + 1) & ~1) * gn->height() * bpp / 8; - readData(p, glyphSize); + readData(p, getGlyphSize(gn)); // Mark glyphNode as cached gn->dataOffset = 0xFFFFFFFF; diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp index a9ad16c..153d33d 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp @@ -18,6 +18,7 @@ public: virtual ~FontDataReader() { } + virtual void open() = 0; virtual void close() = 0; virtual void setPosition(uint32_t position) = 0; @@ -36,6 +37,7 @@ public: bool cacheLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string); const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, FontId font) const; + uint32_t getMemoryUsage() { return memorySize - (gsubStart - top); @@ -46,8 +48,9 @@ public: static inline const uint8_t* getPixelData(const GlyphNode* glyph) { - return ((const uint8_t*)glyph) + SizeGlyphNode + 4; + return ((const uint8_t*)glyph) + SizeGlyphNode + sizeof(void*); } + static inline bool isCached(const GlyphNode* g) { return g->dataOffset == 0xFFFFFFFF; @@ -57,10 +60,10 @@ private: static const uint32_t SizeGlyphNode = 16; bool contains(Unicode::UnicodeChar unicode, FontId font) const; - void insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory); - uint8_t* copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory); + void insert(Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory); + uint8_t* copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory); - void cacheData(uint32_t bpp, GlyphNode* first); + void cacheData(GlyphNode* first); bool cacheSortedString(TypedText t); bool createSortedString(const Unicode::UnicodeChar* string); bool createSortedLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string, ...); @@ -69,6 +72,17 @@ private: void setPosition(uint32_t position); void readData(void* out, uint32_t numberOfBytes); + uint32_t getGlyphSize(const GlyphNode* gn) + { + if (byteAlignRow) + { + // Round up line width to byte boundary and multiply by height + return (gn->width() * bpp + 7) / 8 * gn->height(); + } + // Calculate number of pixels and round up to byte bounday + return (gn->width() * gn->height() * bpp + 7) / 8; + } + struct { uint8_t* first; // First GlyphNode, glyph in cache; @@ -89,6 +103,8 @@ private: uint32_t glyphDataOffset; uint16_t numGlyphs; uint16_t currentFileGlyphNumber; + uint8_t bpp; + uint8_t byteAlignRow; GlyphNode currentFileGlyphNode; }; } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp index acbef86..2080709 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp @@ -41,4 +41,19 @@ int8_t GeneratedFont::getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* } return 0; } + +const GlyphNode* FusedFont::getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const +{ + if (unicode < 0xAC00 || unicode > 0xD7A3) + { + return GeneratedFont::getGlyph(unicode, pixelData, bitsPerPixel); + } + else + { + fusedNode.unicode = unicode; + bitsPerPixel = 1; + pixelData = 0; + return const_cast(&fusedNode); + } +} } // namespace touchgfx diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp index 3a5088f..9b2d9cd 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp @@ -42,6 +42,21 @@ protected: const FontContextualFormsTable* arabicTable; ///< Contextual forms }; +class FusedFont : public GeneratedFont +{ +public: + FusedFont(const GlyphNode* glyphs, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* const* glyphDataInternalFlash, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar, const uint16_t* const gsubData, const FontContextualFormsTable* formsTable, GlyphNode& fontFusedNode) + : GeneratedFont(glyphs, numGlyphs, height, baseline, pixAboveTop, pixBelowBottom, bitsPerPixel, byteAlignRow, + maxLeft, maxRight, glyphDataInternalFlash, kerningList, fallbackChar, ellipsisChar, + gsubData, formsTable), fusedNode(fontFusedNode) + { } + + using GeneratedFont::getGlyph; + virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const; +private: + GlyphNode& fusedNode; +}; + struct BinaryFontData { uint32_t fontIndex; // The font index (as used by TypedTextDatabase) @@ -110,6 +125,7 @@ protected: private: typedef const Unicode::UnicodeChar (*array5ptr)[5]; typedef const Unicode::UnicodeChar (*array4ptr)[4]; + void setupContextualTable(const struct touchgfx::BinaryFontData* data) { const uint16_t* const base = (const uint16_t*)(((const uint8_t*)data) + data->offsetToArabicTable); diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp index dafd4d7..0faee81 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp @@ -4,8 +4,8 @@ #ifndef TOUCHGFX_TYPEDTEXTDATABASE_HPP #define TOUCHGFX_TYPEDTEXTDATABASE_HPP -#include #include +#include namespace TypedTextDatabase { diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp index 41969e1..4f260ea 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp @@ -107,6 +107,7 @@ protected: : Font(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), glyphList(0), unicodes(0), glyphDataList(0), kerningData(0), gsubTable(0) { } + int lookupUnicode(uint16_t unicode) const; const GlyphNode* glyphList; ///< The list of glyphs diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb index 6ed89ab..07105ce 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb index 63f21aa..7d49a45 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb index 2cbce63..e9d505b 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb index 1c76077..3b51832 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb index e4349f1..8f7b78d 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb index 21ff33f..e5cc1fb 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb index 4a99b11..af48651 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -13,7 +13,7 @@ class FontsCpp @@font_convert = font_convert end - def initialize(text_entries, typographies, languages, output_directory, font_asset_path, autohint_setting, data_format, generate_binary_fonts, generate_font_format) + def initialize(text_entries, typographies, languages, output_directory, font_asset_path, autohint_setting, data_format, generate_binary_fonts, generate_font_format, korean_fusion_fonts) @typographies = typographies @languages = languages @output_directory = output_directory @@ -22,6 +22,7 @@ class FontsCpp @data_format = data_format @generate_binary_fonts = generate_binary_fonts @generate_font_format = generate_font_format + @korean_fusion_fonts = korean_fusion_fonts end def run unique_typographies = @typographies.map{ |t| Typography.new("", t.font_file, t.font_size, t.bpp, t.fallback_character, t.ellipsis_character) }.uniq @@ -77,6 +78,21 @@ class FontsCpp #generate contextual forms table for font if not already done generate_contextual_table = context_tables_is_generated[typography.cpp_name] ? "no" : "yes" context_tables_is_generated[typography.cpp_name] = true #set done for next font with this name + fontname = "#{typography.cpp_name}_#{typography.font_size}_#{typography.bpp}bpp" + fusion = "0" + @korean_fusion_fonts.each do |fontmap| + if fontmap.keys.any?(fontname) + width = fontmap[fontname]["width"] + height = fontmap[fontname]["height"] + baseline = fontmap[fontname]["baseline"] + advance = fontmap[fontname]["advance"] + fail "ERROR: \"width\" is unspecified for fused font #{fontname}" if width.nil? + fail "ERROR: \"height\" is unspecified for fused font #{fontname}" if height.nil? + fail "ERROR: \"baseline\" is unspecified for fused font #{fontname}" if baseline.nil? + fail "ERROR: \"advance\" is unspecified for fused font #{fontname}" if advance.nil? + fusion = "1 #{width} #{height} #{baseline} #{advance}" + end + end cmd = "\"#{@@font_convert}\" \ -f \"#{font_file}\" \ -i #{font_index} \ @@ -91,6 +107,7 @@ class FontsCpp -ct #{generate_contextual_table} \ -bf #{@generate_binary_fonts} \ -ff #{@generate_font_format} \ +-ffu #{fusion} \ #{autohint} \ #{byte_align}" output = `#{cmd}`.force_encoding('iso-8859-1') @@ -100,7 +117,7 @@ class FontsCpp fail "ERROR: While generating font from #{font_file}" else puts "Command: #{cmd}" if ENV['DEBUG'] - puts output + puts output if output.length > 0 end end end diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb index c6ab69c..77fa6f7 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb index f9968a4..f6e76a0 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb index 0c4b3d4..1a41251 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb index a5a2f6a..46b3a26 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb index ac36572..7b5b8c2 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb index 791da45..62ffc25 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb index e986e08..4e3f0ce 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb index f95e9c8..0b9daa5 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb index a7a7aee..a34c9fa 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb index 0e8d7a3..4151a15 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb index 42bd816..e8d8b5e 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb index d444094..b76aa40 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb index bad8722..f5f09d8 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb index 5df7396..ef31705 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb index 5767537..23fc4a5 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -16,12 +16,12 @@ require 'lib/xml_reader' require 'lib/xml_validator' class Generator - def run(xml_file_name, output_path, text_output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, framebuffer_bpp, generate_font_format) + def run(xml_file_name, output_path, text_output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, framebuffer_bpp, generate_font_format, korean_fusion_fonts) xml_doc = XMLReader.new.read(xml_file_name) XMLValidator.new.validate(xml_file_name) languages, typographies, text_entries = TextDatabaseParser.new(xml_doc).run Sanitizer.new(text_entries, typographies, languages, framebuffer_bpp).run string_indices, characters = StringCollector.new(text_entries, languages, typographies).run(remap_global == "yes") - Outputter.new(string_indices, characters, text_entries, typographies, languages, text_output_path, output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, generate_font_format).run + Outputter.new(string_indices, characters, text_entries, typographies, languages, text_output_path, output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, generate_font_format, korean_fusion_fonts).run end end diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb index d45de2a..7d6376b 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -30,7 +30,7 @@ require 'lib/emitters/typed_text_database_hpp' require 'lib/emitters/typed_text_database_cpp' class Outputter - def initialize(string_indices, characters, text_entries, typographies, languages, localization_output_directory, fonts_output_directory, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, generate_font_format) + def initialize(string_indices, characters, text_entries, typographies, languages, localization_output_directory, fonts_output_directory, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, generate_font_format, korean_fusion_fonts) @string_indices = string_indices #dictionary of all string indices into the characters array @characters = characters #one array of the needed strings in optimal order @text_entries = text_entries @@ -45,10 +45,10 @@ class Outputter @generate_binary_translations = generate_binary_translations @generate_binary_fonts = generate_binary_fonts @generate_font_format = generate_font_format + @korean_fusion_fonts = korean_fusion_fonts end def run - [ GeneratedFontHpp, GeneratedFontCpp, UnmappedDataFontHpp, @@ -71,11 +71,12 @@ class Outputter LanguagesCpp.new(@string_indices, @characters, @text_entries, @languages, @localization_output_directory, @remap_global, @generate_binary_translations).run - FontsCpp.new(@text_entries, @typographies, @languages, @fonts_output_directory, @font_asset_path, @autohint_setting, @data_format, @generate_binary_fonts, @generate_font_format).run + FontsCpp.new(@text_entries, @typographies, @languages, @fonts_output_directory, @font_asset_path, @autohint_setting, @data_format, @generate_binary_fonts, @generate_font_format, @korean_fusion_fonts).run if @generate_binary_translations.downcase == 'yes' [ LanguagesBin ].each { |template| template.new(@text_entries, @typographies, @languages, @localization_output_directory).run } end + end end diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb index 21c56a1..d511e93 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb index 236cab3..f9f30b9 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb index ac79bfe..476d99b 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -19,7 +19,7 @@ class ParserBase protected def empty_to_nil(str) - str ? str.strip.empty? ? nil : str.strip : nil + str ? str.empty? ? nil : str : nil end end diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb index 062381d..83c4ac8 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb index d0481db..19f2422 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb index e884bda..7b10c74 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb index 6168772..c4c3a2b 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -29,7 +29,7 @@ class TextDatabaseValidator case version when '4.18.0', '4.18.1' @typographies, @text_entries = TextDatabaseParser_4_18.new(xml_doc).run - when '4.19.0', '4.19.1', '4.20.0', '4.21.0', '4.21.1', '4.21.2' + when '4.19.0', '4.19.1', '4.20.0', '4.21.0', '4.21.1', '4.21.2', '4.21.3', '4.21.4', '4.22.0' @languages, @typographies, @text_entries = TextDatabaseParser.new(xml_doc).run else fail "ERROR: Unknown text database version: #{version}" diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb index 0c03736..4c6a78f 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb index 7f2e75e..6dbf27f 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -148,13 +148,15 @@ class TranslationIO # Find the language with the correct capitalization orig_lang = existing_languages.find { |l| l.upcase == lang_upcase } # Fail if all languages should be imported AND the language from the spreadsheet is illegal - fail "ERROR: Text Database does not contain language \"#{lang_cell}\", create the language in the TouchGFX Designer" if languages.empty? && !orig_lang + fail "ERROR: Text Database does not contain language \"#{lang_cell}\", create the language in the TouchGFX Designer" if languages.empty? && !orig_lang && text_id_column # if no languages specified, import all. Otherwise only import if language is wanted if languages.empty? || languages.any? { |l| l.upcase == lang_upcase } import_columns += [ column ] end + puts "header: #{header}" + puts "orig: #{orig_lang}" fail "ERROR: Multiple columns contain translations for language \"#{orig_lang}\"" if header.include?(orig_lang) - header << orig_lang + header << orig_lang if not orig_lang.nil? end end end diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb index e6c6eb0..38f766c 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb index 9086219..3fe4e95 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -10,4 +10,4 @@ ###############################################################################/ # Current version -TOUCHGFX_VERSION = "4.21.2" +TOUCHGFX_VERSION = "4.22.0" diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb index 48ee9ca..9e26ca2 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb index 126be1e..d02e499 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb index 3d44c05..3ee0015 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb index 0a239b4..e351b83 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. @@ -94,6 +94,8 @@ UPGRADE generate_font_format = "0" # 0 = normal font format, 1 = unmapped_flash_font_format + korean_fusion_fonts = [] + require 'json' application_config = File.join($calling_path, "application.config") @@ -151,6 +153,11 @@ UPGRADE puts "Font format #{font_format} not correct, using default: \"0\"" end end + + fusion_fonts = text_conf["korean_fusion_fonts"] + if fusion_fonts + korean_fusion_fonts = fusion_fonts + end end remap_global ||= "no" @@ -215,7 +222,8 @@ UPGRADE :binary_translations => generate_binary_translations, :binary_fonts => generate_binary_fonts, :font_format => generate_font_format, - :framebuffer_bpp => framebuffer_bpp }.to_json + :framebuffer_bpp => framebuffer_bpp, + :fusion_fonts => fusion_fonts }.to_json if (options != new_options) force_run = true @@ -246,7 +254,7 @@ UPGRADE require 'lib/emitters/fonts_cpp' require 'lib/generator' FontsCpp.font_convert = font_convert_path - Generator.new.run(file_name, @fonts_output_path, @localization_output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, framebuffer_bpp, generate_font_format) + Generator.new.run(file_name, @fonts_output_path, @localization_output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, framebuffer_bpp, generate_font_format, korean_fusion_fonts) #touch the cache compile time that we rely on in the makefile FileUtils.touch "#{@localization_output_path}/cache/compile_time.cache" diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb index 8bb1c74..db66489 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb @@ -2,7 +2,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb b/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb index d0dec01..337e3f3 100644 --- a/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb +++ b/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb @@ -2,7 +2,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb b/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb index 306e345..66082ce 100644 --- a/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb +++ b/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb @@ -2,7 +2,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb b/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb index de188de..591f883 100644 --- a/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb +++ b/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb @@ -1,7 +1,7 @@ # Copyright (c) 2018(-2023) STMicroelectronics. # All rights reserved. # -# This file is part of the TouchGFX 4.21.2 distribution. +# This file is part of the TouchGFX 4.22.0 distribution. # # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a index 0ec91f3..6237381 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a index 35728cf..77b4ea3 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR9.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR9.x/touchgfx_core.a new file mode 100644 index 0000000..e062931 Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR9.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR9.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR9.x/touchgfx_core_release.a new file mode 100644 index 0000000..9f9ccb3 Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR9.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib index 50d70a1..298cf36 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib index e12c365..0f52b69 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib index 1e8ec8c..48183c7 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a b/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a index d8bf907..73a2d95 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a index 751f960..88dabd9 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a index a9a17f7..a213825 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR9.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR9.x/touchgfx_core.a new file mode 100644 index 0000000..86fb153 Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR9.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR9.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR9.x/touchgfx_core_release.a new file mode 100644 index 0000000..1c860ee Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR9.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib index ab70b96..c228046 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib index f795ac7..9850c38 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a b/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a index 13a9ac2..bbbcc4e 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a b/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a index c04eba6..f7ec6a8 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a index db50e22..c3a28f2 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a index b87eb2c..ea30437 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR9.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR9.x/touchgfx_core.a new file mode 100644 index 0000000..94a328b Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR9.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR9.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR9.x/touchgfx_core_release.a new file mode 100644 index 0000000..49c67ca Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR9.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib index a90491c..ade49d1 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib index 669aef1..6ec1b88 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib index d84a9d6..d5642a4 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a index 66b1ef8..cf5107b 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a index e399fb0..fb4ea30 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m55/IAR9.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m55/IAR9.x/touchgfx_core.a new file mode 100644 index 0000000..44e0078 Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m55/IAR9.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m55/IAR9.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m55/IAR9.x/touchgfx_core_release.a new file mode 100644 index 0000000..2111301 Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m55/IAR9.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core.a deleted file mode 100644 index c374196..0000000 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core.a and /dev/null differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core_release.a deleted file mode 100644 index b943a92..0000000 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core_release.a and /dev/null differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a index 7c2cde8..579dfc5 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a index 2d3d74b..3a03541 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR9.x/touchgfx_core.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR9.x/touchgfx_core.a new file mode 100644 index 0000000..7ae7534 Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR9.x/touchgfx_core.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR9.x/touchgfx_core_release.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR9.x/touchgfx_core_release.a new file mode 100644 index 0000000..58257ac Binary files /dev/null and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR9.x/touchgfx_core_release.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib index a49fac8..1c656a3 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib index d265cab..e23a1a4 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib b/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib index b8f39d6..3260297 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a index 2287104..fbd5275 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a differ diff --git a/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a b/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a index 8d04516..4d2b7c0 100644 Binary files a/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a and b/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a differ diff --git a/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a b/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a index 08e0922..26ba46f 100644 Binary files a/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a and b/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a differ diff --git a/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a b/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a index 92b63de..93a95ee 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a and b/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib index a4a9f68..11c5d52 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib index 98627f9..8cd0b88 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib index dff44fe..f2db5ae 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib index 5fa0570..2c3f4ea 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib index f78cd06..7ab05b0 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib index 58a8c92..ce06062 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib index e41e972..9805bdd 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib index af04eae..397e5a5 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib index c3cb011..0a338b0 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib index 65b6bef..c54075d 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib index c3cb011..0a338b0 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib index 65b6bef..c54075d 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib index c3cb011..0a338b0 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib differ diff --git a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib index 65b6bef..c54075d 100644 Binary files a/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib and b/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib differ diff --git a/STM32-for-VSCode.config.yaml b/STM32-for-VSCode.config.yaml index 84b7685..b80b6ed 100644 --- a/STM32-for-VSCode.config.yaml +++ b/STM32-for-VSCode.config.yaml @@ -67,7 +67,7 @@ libraries: # Library directories. Folders can be added here that contain custom libraries. libraryDirectories: - - TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc + - Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc # Files or folders that will be excluded from compilation. # Glob patterns (https://www.wikiwand.com/en/Glob_(programming)) can be used. @@ -100,7 +100,7 @@ includeDirectories: - Core/Src/** - Core/Lib/** # - TouchGFX/** - - TouchGFX/Middlewares/ST/touchgfx/framework/include + - Middlewares/ST/touchgfx/framework/include - TouchGFX/gui/include - TouchGFX/generated/fonts/include - TouchGFX/generated/gui_generated/include diff --git a/STM32H7A3ZITx_FLASH.ld b/STM32H7A3ZITx_FLASH.ld index be5f170..09e27aa 100644 --- a/STM32H7A3ZITx_FLASH.ld +++ b/STM32H7A3ZITx_FLASH.ld @@ -164,14 +164,6 @@ SECTIONS __bss_end__ = _ebss; } >DTCMRAM - ._threadx_heap : - { - . = ALIGN(8); - __RAM_segment_used_end__ = .; - . = . + 64K; - . = ALIGN(8); - } >RAM_D1 AT> RAM_D1 - /* User_heap_stack section, used to check that there is enough RAM left */ ._user_heap_stack : { diff --git a/STM32Make.make b/STM32Make.make index 36679e3..b220341 100644 --- a/STM32Make.make +++ b/STM32Make.make @@ -241,96 +241,6 @@ Utilities/JPEG/jpeg_utils.c CPP_SOURCES = \ Core/Src/STWButtonController.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp \ -TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp \ TouchGFX/generated/fonts/src/ApplicationFontProvider.cpp \ TouchGFX/generated/fonts/src/CachedFont.cpp \ TouchGFX/generated/fonts/src/FontCache.cpp \ @@ -508,8 +418,8 @@ C_INCLUDES = \ -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy \ -IMiddlewares/ST/threadx/common/inc/ \ -IMiddlewares/ST/threadx/ports/cortex_m7/gnu/inc/ \ +-IMiddlewares/ST/touchgfx/framework/include \ -ITouchGFX/App \ --ITouchGFX/Middlewares/ST/touchgfx/framework/include \ -ITouchGFX/generated/fonts/include \ -ITouchGFX/generated/gui_generated/include \ -ITouchGFX/generated/images/include \ @@ -552,7 +462,7 @@ LDSCRIPT = STM32H7A3ZITx_FLASH_nocube.ld # libraries LIBS = -lc -lm -lnosys -ltouchgfx-float-abi-hard LIBDIR = \ --LTouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc +-LMiddlewares/ST/touchgfx/lib/core/cortex_m7/gcc # Additional LD Flags from config file diff --git a/TouchGFX/App/app_touchgfx.c b/TouchGFX/App/app_touchgfx.c index 73cdf93..d57e704 100644 --- a/TouchGFX/App/app_touchgfx.c +++ b/TouchGFX/App/app_touchgfx.c @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : app_touchgfx.c ****************************************************************************** - * This file was created by TouchGFX Generator 4.21.2. This file is only + * This file was created by TouchGFX Generator 4.22.0. This file is only * generated once! Delete this file from your project and re-generate code * using STM32CubeMX or change this file manually to update it. ****************************************************************************** diff --git a/TouchGFX/App/app_touchgfx.h b/TouchGFX/App/app_touchgfx.h index f840ac1..31f7546 100644 --- a/TouchGFX/App/app_touchgfx.h +++ b/TouchGFX/App/app_touchgfx.h @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : app_touchgfx.h ****************************************************************************** - * This file was created by TouchGFX Generator 4.21.2. This file is only + * This file was created by TouchGFX Generator 4.22.0. This file is only * generated once! Delete this file from your project and re-generate code * using STM32CubeMX or change this file manually to update it. ****************************************************************************** diff --git a/TouchGFX/ApplicationTemplate.touchgfx.part b/TouchGFX/ApplicationTemplate.touchgfx.part index 790ae23..1ecff9f 100644 --- a/TouchGFX/ApplicationTemplate.touchgfx.part +++ b/TouchGFX/ApplicationTemplate.touchgfx.part @@ -24,7 +24,7 @@ "OptionalComponents": [ ], "AdditionalFeatures": [ - ], + ] }, - "Version": "4.21.2" + "Version": "4.22.0" } diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/README b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/README deleted file mode 100644 index 0a23c19..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/README +++ /dev/null @@ -1,351 +0,0 @@ -The Independent JPEG Group's JPEG software -========================================== - -README for release 8d of 15-Jan-2012 -==================================== - -This distribution contains the eighth public release of the Independent JPEG -Group's free JPEG software. You are welcome to redistribute this software and -to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. - -This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, -Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, -Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, -and other members of the Independent JPEG Group. - -IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee -(also known as JPEG, together with ITU-T SG16). - - -DOCUMENTATION ROADMAP -===================== - -This file contains the following sections: - -OVERVIEW General description of JPEG and the IJG software. -LEGAL ISSUES Copyright, lack of warranty, terms of distribution. -REFERENCES Where to learn more about JPEG. -ARCHIVE LOCATIONS Where to find newer versions of this software. -ACKNOWLEDGMENTS Special thanks. -FILE FORMAT WARS Software *not* to get. -TO DO Plans for future IJG releases. - -Other documentation files in the distribution are: - -User documentation: - install.txt How to configure and install the IJG software. - usage.txt Usage instructions for cjpeg, djpeg, jpegtran, - rdjpgcom, and wrjpgcom. - *.1 Unix-style man pages for programs (same info as usage.txt). - wizard.txt Advanced usage instructions for JPEG wizards only. - change.log Version-to-version change highlights. -Programmer and internal documentation: - libjpeg.txt How to use the JPEG library in your own programs. - example.c Sample code for calling the JPEG library. - structure.txt Overview of the JPEG library's internal structure. - filelist.txt Road map of IJG files. - coderules.txt Coding style rules --- please read if you contribute code. - -Please read at least the files install.txt and usage.txt. Some information -can also be found in the JPEG FAQ (Frequently Asked Questions) article. See -ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. - -If you want to understand how the JPEG code works, we suggest reading one or -more of the REFERENCES, then looking at the documentation files (in roughly -the order listed) before diving into the code. - - -OVERVIEW -======== - -This package contains C software to implement JPEG image encoding, decoding, -and transcoding. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and gray-scale images. - -This software implements JPEG baseline, extended-sequential, and progressive -compression processes. Provision is made for supporting all variants of these -processes, although some uncommon parameter settings aren't implemented yet. -We have made no provision for supporting the hierarchical or lossless -processes defined in the standard. - -We provide a set of library routines for reading and writing JPEG image files, -plus two sample applications "cjpeg" and "djpeg", which use the library to -perform conversion between JPEG and some other popular image file formats. -The library is intended to be reused in other applications. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out of the -library if not required for a particular application. - -We have also included "jpegtran", a utility for lossless transcoding between -different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple -applications for inserting and extracting textual comments in JFIF files. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) Rather, it is intended to -be reliable, portable, industrial-strength code. We do not claim to have -achieved that goal in every aspect of the software, but we strive for it. - -We welcome the use of this software as a component of commercial products. -No royalty is required, but we do ask for an acknowledgement in product -documentation, as described under LEGAL ISSUES. - - -LEGAL ISSUES -============ - -In plain English: - -1. We don't promise that this software works. (But if you find any bugs, - please let us know!) -2. You can use this software for whatever you want. You don't have to pay us. -3. You may not pretend that you wrote this software. If you use it in a - program, you must acknowledge somewhere in your documentation that - you've used the IJG code. - -In legalese: - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -These conditions apply to any software derived from or based on the IJG code, -not just to the unmodified library. If you use our work, you ought to -acknowledge us. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - - -ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, -sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. -ansi2knr.c is NOT covered by the above copyright and conditions, but instead -by the usual distribution terms of the Free Software Foundation; principally, -that you must include source code if you redistribute it. (See the file -ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part -of any program generated from the IJG code, this does not limit you more than -the foregoing paragraphs do. - -The Unix configuration script "configure" was produced with GNU Autoconf. -It is copyright by the Free Software Foundation but is freely distributable. -The same holds for its supporting scripts (config.guess, config.sub, -ltmain.sh). Another support script, install-sh, is copyright by X Consortium -but is also freely distributable. - -The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent, GIF reading support has -been removed altogether, and the GIF writer has been simplified to produce -"uncompressed GIFs". This technique does not use the LZW algorithm; the -resulting GIF files are larger than usual, but are readable by all standard -GIF decoders. - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - - -REFERENCES -========== - -We recommend reading one or more of these references before trying to -understand the innards of the JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PostScript file containing a revised version of Wallace's article is -available at http://www.ijg.org/files/wallace.ps.gz. The file (actually -a preprint for an article that appeared in IEEE Trans. Consumer Electronics) -omits the sample images that appeared in CACM, but it includes corrections -and some added material. Note: the Wallace article is copyright ACM and IEEE, -and it may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by -M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides -good explanations and example C code for a multitude of compression methods -including JPEG. It is an excellent source if you are comfortable reading C -code but don't know much about data compression in general. The book's JPEG -sample code is far from industrial-strength, but when you are ready to look -at a full implementation, you've got one here... - -The best currently available description of JPEG is the textbook "JPEG Still -Image Data Compression Standard" by William B. Pennebaker and Joan L. -Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. -Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG -standards (DIS 10918-1 and draft DIS 10918-2). -Although this is by far the most detailed and comprehensive exposition of -JPEG publicly available, we point out that it is still missing an explanation -of the most essential properties and algorithms of the underlying DCT -technology. -If you think that you know about DCT-based JPEG after reading this book, -then you are in delusion. The real fundamentals and corresponding potential -of DCT-based JPEG are not publicly known so far, and that is the reason for -all the mistaken developments taking place in the image coding domain. - -The original JPEG standard is divided into two parts, Part 1 being the actual -specification, while Part 2 covers compliance testing methods. Part 1 is -titled "Digital Compression and Coding of Continuous-tone Still Images, -Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS -10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of -Continuous-tone Still Images, Part 2: Compliance testing" and has document -numbers ISO/IEC IS 10918-2, ITU-T T.83. -IJG JPEG 8 introduces an implementation of the JPEG SmartScale extension -which is specified in two documents: A contributed document at ITU and ISO -with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced -Image Coding", April 2006, Geneva, Switzerland. The latest version of this -document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N -5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany. - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report -and thus received a formal publication status. It is available as a free -download in PDF format from -http://www.ecma-international.org/publications/techreports/E-TR-098.htm. -A PostScript version of the JFIF document is available at -http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at -http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. - -The TIFF 6.0 file format specification can be obtained by FTP from -ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme -found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. -IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). -Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 -(Compression tag 7). Copies of this Note can be obtained from -http://www.ijg.org/files/. It is expected that the next revision -of the TIFF spec will replace the 6.0 JPEG design with the Note's design. -Although IJG's own code does not support TIFF/JPEG, the free libtiff library -uses our library to implement TIFF/JPEG per the Note. - - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is www.ijg.org. -The most recent released version can always be found there in -directory "files". This particular version will be archived as -http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible -"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip. - -The JPEG FAQ (Frequently Asked Questions) article is a source of some -general information about JPEG. -It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ -and other news.answers archive sites, including the official news.answers -archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. -If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu -with body - send usenet/news.answers/jpeg-faq/part1 - send usenet/news.answers/jpeg-faq/part2 - - -ACKNOWLEDGMENTS -=============== - -Thank to Juergen Bruder for providing me with a copy of the common DCT -algorithm article, only to find out that I had come to the same result -in a more direct and comprehensible way with a more generative approach. - -Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the -ITU JPEG (Study Group 16) meeting in Geneva, Switzerland. - -Thank to Thomas Wiegand and Gary Sullivan for inviting me to the -Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland. - -Thank to Thomas Richter and Daniel Lee for inviting me to the -ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16) -meeting in Berlin, Germany. - -Thank to John Korejwa and Massimo Ballerini for inviting me to -fruitful consultations in Boston, MA and Milan, Italy. - -Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther -Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel -for corresponding business development. - -Thank to Nico Zschach and Dirk Stelling of the technical support team -at the Digital Images company in Halle for providing me with extra -equipment for configuration tests. - -Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful -communication about JPEG configuration in Sigma Photo Pro software. - -Thank to Andrew Finkenstadt for hosting the ijg.org site. - -Last but not least special thank to Thomas G. Lane for the original -design and development of this singular software package. - - -FILE FORMAT WARS -================ - -The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together -with ITU-T SG16) currently promotes different formats containing the name -"JPEG" which is misleading because these formats are incompatible with -original DCT-based JPEG and are based on faulty technologies. -IJG therefore does not and will not support such momentary mistakes -(see REFERENCES). -There exist also distributions under the name "OpenJPEG" promoting such -kind of formats which is misleading because they don't support original -JPEG images. -We have no sympathy for the promotion of inferior formats. Indeed, one of -the original reasons for developing this free software was to help force -convergence on common, interoperable format standards for JPEG files. -Don't use an incompatible file format! -(In any case, our decoder will remain capable of reading existing JPEG -image files indefinitely.) - -Furthermore, the ISO committee pretends to be "responsible for the popular -JPEG" in their public reports which is not true because they don't respond to -actual requirements for the maintenance of the original JPEG specification. - -There are currently distributions in circulation containing the name -"libjpeg" which claim to be a "derivative" or "fork" of the original -libjpeg, but don't have the features and are incompatible with formats -supported by actual IJG libjpeg distributions. Furthermore, they -violate the license conditions as described under LEGAL ISSUES above. -We have no sympathy for the release of misleading and illegal -distributions derived from obsolete code bases. -Don't use an obsolete code base! - - -TO DO -===== - -Version 8 is the first release of a new generation JPEG standard -to overcome the limitations of the original JPEG specification. -More features are being prepared for coming releases... - -Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/cderror.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/cderror.h deleted file mode 100644 index e19c475..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/cderror.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * cderror.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the cjpeg/djpeg - * applications. These strings are not needed as part of the JPEG library - * proper. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef CDERROR_H -#define CDERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* CDERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */ - -#ifdef BMP_SUPPORTED -JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format") -JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported") -JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length") -JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1") -JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB") -JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported") -JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image") -JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM") -JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image") -JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image") -JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image") -JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image") -#endif /* BMP_SUPPORTED */ - -#ifdef GIF_SUPPORTED -JMESSAGE(JERR_GIF_BUG, "GIF output got confused") -JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d") -JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB") -JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file") -JMESSAGE(JERR_GIF_NOT, "Not a GIF file") -JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image") -JMESSAGE(JTRC_GIF_BADVERSION, - "Warning: unexpected GIF version number '%c%c%c'") -JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x") -JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input") -JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file") -JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring") -JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image") -JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits") -#endif /* GIF_SUPPORTED */ - -#ifdef PPM_SUPPORTED -JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB") -JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file") -JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file") -JMESSAGE(JTRC_PGM, "%ux%u PGM image") -JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image") -JMESSAGE(JTRC_PPM, "%ux%u PPM image") -JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image") -#endif /* PPM_SUPPORTED */ - -#ifdef RLE_SUPPORTED -JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library") -JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB") -JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE") -JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file") -JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header") -JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header") -JMESSAGE(JERR_RLE_NOT, "Not an RLE file") -JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE") -JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup") -JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file") -JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d") -JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file") -JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d") -JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d") -#endif /* RLE_SUPPORTED */ - -#ifdef TARGA_SUPPORTED -JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format") -JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file") -JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB") -JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image") -JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image") -JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image") -#else -JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled") -#endif /* TARGA_SUPPORTED */ - -JMESSAGE(JERR_BAD_CMAP_FILE, - "Color map file is invalid or of unsupported format") -JMESSAGE(JERR_TOO_MANY_COLORS, - "Output file format cannot handle %d colormap entries") -JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed") -#ifdef TARGA_SUPPORTED -JMESSAGE(JERR_UNKNOWN_FORMAT, - "Unrecognized input file format --- perhaps you need -targa") -#else -JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format") -#endif -JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format") - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTADDONCODE -} ADDON_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/cdjpeg.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/cdjpeg.h deleted file mode 100644 index ed024ac..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/cdjpeg.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * cdjpeg.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains common declarations for the sample applications - * cjpeg and djpeg. It is NOT used by the core JPEG library. - */ - -#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */ -#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */ -#include "jinclude.h" -#include "jpeglib.h" -#include "jerror.h" /* get library error codes too */ -#include "cderror.h" /* get application-specific error codes */ - - -/* - * Object interface for cjpeg's source file decoding modules - */ - -typedef struct cjpeg_source_struct * cjpeg_source_ptr; - -struct cjpeg_source_struct { - JMETHOD(void, start_input, (j_compress_ptr cinfo, - cjpeg_source_ptr sinfo)); - JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo, - cjpeg_source_ptr sinfo)); - JMETHOD(void, finish_input, (j_compress_ptr cinfo, - cjpeg_source_ptr sinfo)); - - FILE *input_file; - - JSAMPARRAY buffer; - JDIMENSION buffer_height; -}; - - -/* - * Object interface for djpeg's output file encoding modules - */ - -typedef struct djpeg_dest_struct * djpeg_dest_ptr; - -struct djpeg_dest_struct { - /* start_output is called after jpeg_start_decompress finishes. - * The color map will be ready at this time, if one is needed. - */ - JMETHOD(void, start_output, (j_decompress_ptr cinfo, - djpeg_dest_ptr dinfo)); - /* Emit the specified number of pixel rows from the buffer. */ - JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo, - djpeg_dest_ptr dinfo, - JDIMENSION rows_supplied)); - /* Finish up at the end of the image. */ - JMETHOD(void, finish_output, (j_decompress_ptr cinfo, - djpeg_dest_ptr dinfo)); - - /* Target file spec; filled in by djpeg.c after object is created. */ - FILE * output_file; - - /* Output pixel-row buffer. Created by module init or start_output. - * Width is cinfo->output_width * cinfo->output_components; - * height is buffer_height. - */ - JSAMPARRAY buffer; - JDIMENSION buffer_height; -}; - - -/* - * cjpeg/djpeg may need to perform extra passes to convert to or from - * the source/destination file format. The JPEG library does not know - * about these passes, but we'd like them to be counted by the progress - * monitor. We use an expanded progress monitor object to hold the - * additional pass count. - */ - -struct cdjpeg_progress_mgr { - struct jpeg_progress_mgr pub; /* fields known to JPEG library */ - int completed_extra_passes; /* extra passes completed */ - int total_extra_passes; /* total extra */ - /* last printed percentage stored here to avoid multiple printouts */ - int percent_done; -}; - -typedef struct cdjpeg_progress_mgr * cd_progress_ptr; - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jinit_read_bmp jIRdBMP -#define jinit_write_bmp jIWrBMP -#define jinit_read_gif jIRdGIF -#define jinit_write_gif jIWrGIF -#define jinit_read_ppm jIRdPPM -#define jinit_write_ppm jIWrPPM -#define jinit_read_rle jIRdRLE -#define jinit_write_rle jIWrRLE -#define jinit_read_targa jIRdTarga -#define jinit_write_targa jIWrTarga -#define read_quant_tables RdQTables -#define read_scan_script RdScnScript -#define set_quality_ratings SetQRates -#define set_quant_slots SetQSlots -#define set_sample_factors SetSFacts -#define read_color_map RdCMap -#define enable_signal_catcher EnSigCatcher -#define start_progress_monitor StProgMon -#define end_progress_monitor EnProgMon -#define read_stdin RdStdin -#define write_stdout WrStdout -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* Module selection routines for I/O modules. */ - -EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo)); -EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo, - boolean is_os2)); -EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo)); -EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo)); -EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo)); -EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo)); -EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo)); -EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo)); -EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo)); -EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo)); - -/* cjpeg support routines (in rdswitch.c) */ - -EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename, - boolean force_baseline)); -EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename)); -EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg, - boolean force_baseline)); -EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg)); -EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg)); - -/* djpeg support routines (in rdcolmap.c) */ - -EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile)); - -/* common support routines (in cdjpeg.c) */ - -EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo)); -EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo, - cd_progress_ptr progress)); -EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo)); -EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars)); -EXTERN(FILE *) read_stdin JPP((void)); -EXTERN(FILE *) write_stdout JPP((void)); - -/* miscellaneous useful macros */ - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#define WRITE_BINARY "w" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#define WRITE_BINARY "wb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#define WRITE_BINARY "wb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif -#ifndef EXIT_WARNING -#ifdef VMS -#define EXIT_WARNING 1 /* VMS is very nonstandard */ -#else -#define EXIT_WARNING 2 -#endif -#endif diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jconfig.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jconfig.h deleted file mode 100644 index 966b1d5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jconfig.h +++ /dev/null @@ -1,54 +0,0 @@ -/* jconfig.h. Generated from jconfig.cfg by configure. */ -/* jconfig.cfg --- source file edited by configure script */ -/* see jconfig.txt for explanations */ - -#define HAVE_PROTOTYPES 1 -#define HAVE_UNSIGNED_CHAR 1 -#define HAVE_UNSIGNED_SHORT 1 -/* #undef void */ -/* #undef const */ -/* #undef CHAR_IS_UNSIGNED */ -#define HAVE_STDDEF_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_LOCALE_H 1 -/* #undef NEED_BSD_STRINGS */ -/* #undef NEED_SYS_TYPES_H */ -/* #undef NEED_FAR_POINTERS */ -/* #undef NEED_SHORT_EXTERNAL_NAMES */ -/* Define this if you get warnings about undefined structures. */ -/* #undef INCOMPLETE_TYPES_BROKEN */ - -/* Define "boolean" as unsigned char, not int, on Windows systems. */ -#ifdef _WIN32 -#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ -typedef unsigned char boolean; -#endif -#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ -#endif - -#ifdef JPEG_INTERNALS - -/* #undef RIGHT_SHIFT_IS_UNSIGNED */ -#define INLINE __inline__ -/* These are for configuring the JPEG memory manager. */ -/* #undef DEFAULT_MAX_MEM */ -/* #undef NO_MKTEMP */ - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -/* #undef RLE_SUPPORTED */ -#define TARGA_SUPPORTED /* Targa image file format */ - -/* #undef TWO_FILE_COMMANDLINE */ -/* #undef NEED_SIGNAL_CATCHER */ -/* #undef DONT_USE_B_MODE */ - -/* Define this if you want percent-done progress reports from cjpeg/djpeg. */ -/* #undef PROGRESS_REPORT */ - -#endif /* JPEG_CJPEG_DJPEG */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jdct.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jdct.h deleted file mode 100644 index 360dec8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jdct.h +++ /dev/null @@ -1,393 +0,0 @@ -/* - * jdct.h - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file contains common declarations for the forward and - * inverse DCT modules. These declarations are private to the DCT managers - * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. - * The individual DCT algorithms are kept in separate files to ease - * machine-dependent tuning (e.g., assembly coding). - */ - - -/* - * A forward DCT routine is given a pointer to an input sample array and - * a pointer to a work area of type DCTELEM[]; the DCT is to be performed - * in-place in that buffer. Type DCTELEM is int for 8-bit samples, INT32 - * for 12-bit samples. (NOTE: Floating-point DCT implementations use an - * array of type FAST_FLOAT, instead.) - * The input data is to be fetched from the sample array starting at a - * specified column. (Any row offset needed will be applied to the array - * pointer before it is passed to the FDCT code.) - * Note that the number of samples fetched by the FDCT routine is - * DCT_h_scaled_size * DCT_v_scaled_size. - * The DCT outputs are returned scaled up by a factor of 8; they therefore - * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This - * convention improves accuracy in integer implementations and saves some - * work in floating-point ones. - * Quantization of the output coefficients is done by jcdctmgr.c. - */ - -#if BITS_IN_JSAMPLE == 8 -typedef int DCTELEM; /* 16 or 32 bits is fine */ -#else -typedef INT32 DCTELEM; /* must have 32 bits */ -#endif - -typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data, - JSAMPARRAY sample_data, - JDIMENSION start_col)); -typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data, - JSAMPARRAY sample_data, - JDIMENSION start_col)); - - -/* - * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer - * to an output sample array. The routine must dequantize the input data as - * well as perform the IDCT; for dequantization, it uses the multiplier table - * pointed to by compptr->dct_table. The output data is to be placed into the - * sample array starting at a specified column. (Any row offset needed will - * be applied to the array pointer before it is passed to the IDCT code.) - * Note that the number of samples emitted by the IDCT routine is - * DCT_h_scaled_size * DCT_v_scaled_size. - */ - -/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ - -/* - * Each IDCT routine has its own ideas about the best dct_table element type. - */ - -typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ -#if BITS_IN_JSAMPLE == 8 -typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ -#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ -#else -typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ -#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ -#endif -typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ - - -/* - * Each IDCT routine is responsible for range-limiting its results and - * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could - * be quite far out of range if the input data is corrupt, so a bulletproof - * range-limiting step is required. We use a mask-and-table-lookup method - * to do the combined operations quickly. See the comments with - * prepare_range_limit_table (in jdmaster.c) for more info. - */ - -#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) - -#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_fdct_islow jFDislow -#define jpeg_fdct_ifast jFDifast -#define jpeg_fdct_float jFDfloat -#define jpeg_fdct_7x7 jFD7x7 -#define jpeg_fdct_6x6 jFD6x6 -#define jpeg_fdct_5x5 jFD5x5 -#define jpeg_fdct_4x4 jFD4x4 -#define jpeg_fdct_3x3 jFD3x3 -#define jpeg_fdct_2x2 jFD2x2 -#define jpeg_fdct_1x1 jFD1x1 -#define jpeg_fdct_9x9 jFD9x9 -#define jpeg_fdct_10x10 jFD10x10 -#define jpeg_fdct_11x11 jFD11x11 -#define jpeg_fdct_12x12 jFD12x12 -#define jpeg_fdct_13x13 jFD13x13 -#define jpeg_fdct_14x14 jFD14x14 -#define jpeg_fdct_15x15 jFD15x15 -#define jpeg_fdct_16x16 jFD16x16 -#define jpeg_fdct_16x8 jFD16x8 -#define jpeg_fdct_14x7 jFD14x7 -#define jpeg_fdct_12x6 jFD12x6 -#define jpeg_fdct_10x5 jFD10x5 -#define jpeg_fdct_8x4 jFD8x4 -#define jpeg_fdct_6x3 jFD6x3 -#define jpeg_fdct_4x2 jFD4x2 -#define jpeg_fdct_2x1 jFD2x1 -#define jpeg_fdct_8x16 jFD8x16 -#define jpeg_fdct_7x14 jFD7x14 -#define jpeg_fdct_6x12 jFD6x12 -#define jpeg_fdct_5x10 jFD5x10 -#define jpeg_fdct_4x8 jFD4x8 -#define jpeg_fdct_3x6 jFD3x6 -#define jpeg_fdct_2x4 jFD2x4 -#define jpeg_fdct_1x2 jFD1x2 -#define jpeg_idct_islow jRDislow -#define jpeg_idct_ifast jRDifast -#define jpeg_idct_float jRDfloat -#define jpeg_idct_7x7 jRD7x7 -#define jpeg_idct_6x6 jRD6x6 -#define jpeg_idct_5x5 jRD5x5 -#define jpeg_idct_4x4 jRD4x4 -#define jpeg_idct_3x3 jRD3x3 -#define jpeg_idct_2x2 jRD2x2 -#define jpeg_idct_1x1 jRD1x1 -#define jpeg_idct_9x9 jRD9x9 -#define jpeg_idct_10x10 jRD10x10 -#define jpeg_idct_11x11 jRD11x11 -#define jpeg_idct_12x12 jRD12x12 -#define jpeg_idct_13x13 jRD13x13 -#define jpeg_idct_14x14 jRD14x14 -#define jpeg_idct_15x15 jRD15x15 -#define jpeg_idct_16x16 jRD16x16 -#define jpeg_idct_16x8 jRD16x8 -#define jpeg_idct_14x7 jRD14x7 -#define jpeg_idct_12x6 jRD12x6 -#define jpeg_idct_10x5 jRD10x5 -#define jpeg_idct_8x4 jRD8x4 -#define jpeg_idct_6x3 jRD6x3 -#define jpeg_idct_4x2 jRD4x2 -#define jpeg_idct_2x1 jRD2x1 -#define jpeg_idct_8x16 jRD8x16 -#define jpeg_idct_7x14 jRD7x14 -#define jpeg_idct_6x12 jRD6x12 -#define jpeg_idct_5x10 jRD5x10 -#define jpeg_idct_4x8 jRD4x8 -#define jpeg_idct_3x6 jRD3x8 -#define jpeg_idct_2x4 jRD2x4 -#define jpeg_idct_1x2 jRD1x2 -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* Extern declarations for the forward and inverse DCT routines. */ - -EXTERN(void) jpeg_fdct_islow - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_ifast - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_float - JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_7x7 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_6x6 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_5x5 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_4x4 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_3x3 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_2x2 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_1x1 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_9x9 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_10x10 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_11x11 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_12x12 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_13x13 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_14x14 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_15x15 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_16x16 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_16x8 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_14x7 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_12x6 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_10x5 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_8x4 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_6x3 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_4x2 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_2x1 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_8x16 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_7x14 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_6x12 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_5x10 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_4x8 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_3x6 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_2x4 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); -EXTERN(void) jpeg_fdct_1x2 - JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); - -EXTERN(void) jpeg_idct_islow - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_ifast - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_float - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_7x7 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_6x6 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_5x5 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_4x4 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_3x3 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_2x2 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_1x1 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_9x9 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_10x10 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_11x11 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_12x12 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_13x13 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_14x14 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_15x15 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_16x16 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_16x8 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_14x7 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_12x6 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_10x5 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_8x4 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_6x3 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_4x2 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_2x1 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_8x16 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_7x14 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_6x12 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_5x10 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_4x8 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_3x6 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_2x4 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_1x2 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); - - -/* - * Macros for handling fixed-point arithmetic; these are used by many - * but not all of the DCT/IDCT modules. - * - * All values are expected to be of type INT32. - * Fractional constants are scaled left by CONST_BITS bits. - * CONST_BITS is defined within each module using these macros, - * and may differ from one module to the next. - */ - -#define ONE ((INT32) 1) -#define CONST_SCALE (ONE << CONST_BITS) - -/* Convert a positive real constant to an integer scaled by CONST_SCALE. - * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, - * thus causing a lot of useless floating-point operations at run time. - */ - -#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) - -/* Descale and correctly round an INT32 value that's scaled by N bits. - * We assume RIGHT_SHIFT rounds towards minus infinity, so adding - * the fudge factor is correct for either sign of X. - */ - -#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * This macro is used only when the two inputs will actually be no more than - * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a - * full 32x32 multiply. This provides a useful speedup on many machines. - * Unfortunately there is no way to specify a 16x16->32 multiply portably - * in C, but some C compilers will do the right thing if you provide the - * correct combination of casts. - */ - -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) -#endif -#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const))) -#endif - -#ifndef MULTIPLY16C16 /* default definition */ -#define MULTIPLY16C16(var,const) ((var) * (const)) -#endif - -/* Same except both inputs are variables. */ - -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) -#endif - -#ifndef MULTIPLY16V16 /* default definition */ -#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) -#endif diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jerror.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jerror.h deleted file mode 100644 index 1cfb2b1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jerror.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * jerror.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 1997-2009 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the JPEG library. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - * A set of error-reporting macros are defined too. Some applications using - * the JPEG library may wish to include this file to get the error codes - * and/or the macros. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef JERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* JERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ - -/* For maintenance convenience, list is alphabetical by message code name */ -JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") -JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") -JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") -JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") -JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") -JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") -JMESSAGE(JERR_BAD_DROP_SAMPLING, - "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") -JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") -JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") -JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") -JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") -JMESSAGE(JERR_BAD_LIB_VERSION, - "Wrong JPEG library version: library is %d, caller expects %d") -JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") -JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") -JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") -JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") -JMESSAGE(JERR_BAD_STRUCT_SIZE, - "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") -JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") -JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") -JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") -JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") -JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") -JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") -JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") -JMESSAGE(JERR_FILE_READ, "Input file read error") -JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") -JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") -JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") -JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") -JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") -JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") -JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") -JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") -JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") -JMESSAGE(JERR_NOTIMPL, "Not implemented yet") -JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") -JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") -JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") -JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") -JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") -JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") -JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") -JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") -JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") -JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") -JMESSAGE(JERR_TFILE_WRITE, - "Write failed on temporary file --- out of disk space?") -JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") -JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") -JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") -JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) -JMESSAGE(JMSG_VERSION, JVERSION) -JMESSAGE(JTRC_16BIT_TABLES, - "Caution: quantization tables are too coarse for baseline JPEG") -JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") -JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") -JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") -JMESSAGE(JTRC_JFIF_EXTENSION, - "JFIF extension marker: type 0x%02x, length %u") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") -JMESSAGE(JTRC_SMOOTH_NOTIMPL, - "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") -JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") -JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") -JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") -JMESSAGE(JTRC_THUMB_JPEG, - "JFIF extension marker: JPEG-compressed thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_PALETTE, - "JFIF extension marker: palette thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_RGB, - "JFIF extension marker: RGB thumbnail image, length %u") -JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") -JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") -JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") -JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") -JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") -JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") -JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") -JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") -JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") -JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") -JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE - - -#ifndef JERROR_H -#define JERROR_H - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is either type of cinfo pointer */ - -/* Fatal errors (print message and exit) */ -#define ERREXIT(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT3(cinfo,code,p1,p2,p3) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (cinfo)->err->msg_parm.i[4] = (p5), \ - (cinfo)->err->msg_parm.i[5] = (p6), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXITS(cinfo,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) - -#define MAKESTMT(stuff) do { stuff } while (0) - -/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ -#define WARNMS(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) - -/* Informational/debugging messages */ -#define TRACEMS(cinfo,lvl,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS1(cinfo,lvl,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS2(cinfo,lvl,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMSS(cinfo,lvl,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) - -#endif /* JERROR_H */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jinclude.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jinclude.h deleted file mode 100644 index 0a4f151..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jinclude.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jinclude.h - * - * Copyright (C) 1991-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file exists to provide a single place to fix any problems with - * including the wrong system include files. (Common problems are taken - * care of by the standard jconfig symbols, but on really weird systems - * you may have to edit this file.) - * - * NOTE: this file is NOT intended to be included by applications using the - * JPEG library. Most applications need only include jpeglib.h. - */ - - -/* Include auto-config file to find out which system include files we need. */ - -#include "jconfig.h" /* auto configuration options */ -#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ - -/* - * We need the NULL macro and size_t typedef. - * On an ANSI-conforming system it is sufficient to include . - * Otherwise, we get them from or ; we may have to - * pull in as well. - * Note that the core JPEG library does not require ; - * only the default error handler and data source/destination modules do. - * But we must pull it in because of the references to FILE in jpeglib.h. - * You can remove those references if you want to compile without . - */ - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef NEED_SYS_TYPES_H -#include -#endif - -#include - -/* - * We need memory copying and zeroing functions, plus strncpy(). - * ANSI and System V implementations declare these in . - * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). - * Some systems may declare memset and memcpy in . - * - * NOTE: we assume the size parameters to these functions are of type size_t. - * Change the casts in these macros if not! - */ - -#ifdef NEED_BSD_STRINGS - -#include -#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) -#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) - -#else /* not BSD, assume ANSI/SysV string lib */ - -#include -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) - -#endif - -/* - * In ANSI C, and indeed any rational implementation, size_t is also the - * type returned by sizeof(). However, it seems there are some irrational - * implementations out there, in which sizeof() returns an int even though - * size_t is defined as long or unsigned long. To ensure consistent results - * we always use this SIZEOF() macro in place of using sizeof() directly. - */ - -#define SIZEOF(object) ((size_t) sizeof(object)) - -/* - * The modules that use fread() and fwrite() always invoke them through - * these macros. On some systems you may need to twiddle the argument casts. - * CAUTION: argument order is different from underlying functions! - */ - -#define JFREAD(file,buf,sizeofbuf) \ - ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) -#define JFWRITE(file,buf,sizeofbuf) \ - ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jmemsys.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jmemsys.h deleted file mode 100644 index 6c3c6d3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jmemsys.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * jmemsys.h - * - * Copyright (C) 1992-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file defines the interface between the system-independent - * and system-dependent portions of the JPEG memory manager. No other - * modules need include it. (The system-independent portion is jmemmgr.c; - * there are several different versions of the system-dependent portion.) - * - * This file works as-is for the system-dependent memory managers supplied - * in the IJG distribution. You may need to modify it if you write a - * custom memory manager. If system-dependent changes are needed in - * this file, the best method is to #ifdef them based on a configuration - * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR - * and USE_MAC_MEMMGR. - */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_get_small jGetSmall -#define jpeg_free_small jFreeSmall -#define jpeg_get_large jGetLarge -#define jpeg_free_large jFreeLarge -#define jpeg_mem_available jMemAvail -#define jpeg_open_backing_store jOpenBackStore -#define jpeg_mem_init jMemInit -#define jpeg_mem_term jMemTerm -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* - * These two functions are used to allocate and release small chunks of - * memory. (Typically the total amount requested through jpeg_get_small is - * no more than 20K or so; this will be requested in chunks of a few K each.) - * Behavior should be the same as for the standard library functions malloc - * and free; in particular, jpeg_get_small must return NULL on failure. - * On most systems, these ARE malloc and free. jpeg_free_small is passed the - * size of the object being freed, just in case it's needed. - * On an 80x86 machine using small-data memory model, these manage near heap. - */ - -EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); -EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object, - size_t sizeofobject)); - -/* - * These two functions are used to allocate and release large chunks of - * memory (up to the total free space designated by jpeg_mem_available). - * The interface is the same as above, except that on an 80x86 machine, - * far pointers are used. On most other machines these are identical to - * the jpeg_get/free_small routines; but we keep them separate anyway, - * in case a different allocation strategy is desirable for large chunks. - */ - -EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo, - size_t sizeofobject)); -EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, - size_t sizeofobject)); - -/* - * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may - * be requested in a single call to jpeg_get_large (and jpeg_get_small for that - * matter, but that case should never come into play). This macro is needed - * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. - * On those machines, we expect that jconfig.h will provide a proper value. - * On machines with 32-bit flat address spaces, any large constant may be used. - * - * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type - * size_t and will be a multiple of sizeof(align_type). - */ - -#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ -#define MAX_ALLOC_CHUNK 1000000000L -#endif - -/* - * This routine computes the total space still available for allocation by - * jpeg_get_large. If more space than this is needed, backing store will be - * used. NOTE: any memory already allocated must not be counted. - * - * There is a minimum space requirement, corresponding to the minimum - * feasible buffer sizes; jmemmgr.c will request that much space even if - * jpeg_mem_available returns zero. The maximum space needed, enough to hold - * all working storage in memory, is also passed in case it is useful. - * Finally, the total space already allocated is passed. If no better - * method is available, cinfo->mem->max_memory_to_use - already_allocated - * is often a suitable calculation. - * - * It is OK for jpeg_mem_available to underestimate the space available - * (that'll just lead to more backing-store access than is really necessary). - * However, an overestimate will lead to failure. Hence it's wise to subtract - * a slop factor from the true available space. 5% should be enough. - * - * On machines with lots of virtual memory, any large constant may be returned. - * Conversely, zero may be returned to always use the minimum amount of memory. - */ - -EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo, - long min_bytes_needed, - long max_bytes_needed, - long already_allocated)); - - -/* - * This structure holds whatever state is needed to access a single - * backing-store object. The read/write/close method pointers are called - * by jmemmgr.c to manipulate the backing-store object; all other fields - * are private to the system-dependent backing store routines. - */ - -#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ - - -#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ - -typedef unsigned short XMSH; /* type of extended-memory handles */ -typedef unsigned short EMSH; /* type of expanded-memory handles */ - -typedef union { - short file_handle; /* DOS file handle if it's a temp file */ - XMSH xms_handle; /* handle if it's a chunk of XMS */ - EMSH ems_handle; /* handle if it's a chunk of EMS */ -} handle_union; - -#endif /* USE_MSDOS_MEMMGR */ - -#ifdef USE_MAC_MEMMGR /* Mac-specific junk */ -#include -#endif /* USE_MAC_MEMMGR */ - - -typedef struct backing_store_struct * backing_store_ptr; - -typedef struct backing_store_struct { - /* Methods for reading/writing/closing this backing-store object */ - JMETHOD(void, read_backing_store, (j_common_ptr cinfo, - backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count)); - JMETHOD(void, write_backing_store, (j_common_ptr cinfo, - backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count)); - JMETHOD(void, close_backing_store, (j_common_ptr cinfo, - backing_store_ptr info)); - - /* Private fields for system-dependent backing-store management */ -#ifdef USE_MSDOS_MEMMGR - /* For the MS-DOS manager (jmemdos.c), we need: */ - handle_union handle; /* reference to backing-store storage object */ - char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ -#else -#ifdef USE_MAC_MEMMGR - /* For the Mac manager (jmemmac.c), we need: */ - short temp_file; /* file reference number to temp file */ - FSSpec tempSpec; /* the FSSpec for the temp file */ - char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ -#else - /* For a typical implementation with temp files, we need: */ - FILE * temp_file; /* stdio reference to temp file */ - char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ -#endif -#endif -} backing_store_info; - - -/* - * Initial opening of a backing-store object. This must fill in the - * read/write/close pointers in the object. The read/write routines - * may take an error exit if the specified maximum file size is exceeded. - * (If jpeg_mem_available always returns a large value, this routine can - * just take an error exit.) - */ - -EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo, - backing_store_ptr info, - long total_bytes_needed)); - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. jpeg_mem_init will be called before anything is - * allocated (and, therefore, nothing in cinfo is of use except the error - * manager pointer). It should return a suitable default value for - * max_memory_to_use; this may subsequently be overridden by the surrounding - * application. (Note that max_memory_to_use is only important if - * jpeg_mem_available chooses to consult it ... no one else will.) - * jpeg_mem_term may assume that all requested memory has been freed and that - * all opened backing-store objects have been closed. - */ - -EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jmorecfg.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jmorecfg.h deleted file mode 100644 index 1e6ffbf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jmorecfg.h +++ /dev/null @@ -1,369 +0,0 @@ -/* - * jmorecfg.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2011 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains additional configuration options that customize the - * JPEG software for special applications or support machine-dependent - * optimizations. Most users will not need to touch this file. - */ - - -/* - * Define BITS_IN_JSAMPLE as either - * 8 for 8-bit sample values (the usual setting) - * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. - */ - -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ - - -/* - * Maximum number of components (color channels) allowed in JPEG image. - * To meet the letter of the JPEG spec, set this to 255. However, darn - * few applications need more than 4 channels (maybe 5 for CMYK + alpha - * mask). We recommend 10 as a reasonable compromise; use 4 if you are - * really short on memory. (Each allowed component costs a hundred or so - * bytes of storage, whether actually used in an image or not.) - */ - -#define MAX_COMPONENTS 10 /* maximum number of image components */ - - -/* - * Basic data types. - * You may need to change these if you have a machine with unusual data - * type sizes; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* Representation of a single sample (pixel element value). - * We frequently allocate large arrays of these, so it's important to keep - * them small. But if you have memory to burn and access to char or short - * arrays is very slow on your hardware, you might want to change these. - */ - -#if BITS_IN_JSAMPLE == 8 -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JSAMPLE; -#ifdef CHAR_IS_UNSIGNED -#define GETJSAMPLE(value) ((int) (value)) -#else -#define GETJSAMPLE(value) ((int) (value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* BITS_IN_JSAMPLE == 8 */ - - -#if BITS_IN_JSAMPLE == 12 -/* JSAMPLE should be the smallest type that will hold the values 0..4095. - * On nearly all machines "short" will do nicely. - */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* BITS_IN_JSAMPLE == 12 */ - - -/* Representation of a DCT frequency coefficient. - * This should be a signed value of at least 16 bits; "short" is usually OK. - * Again, we allocate large arrays of these, but you can change to int - * if you have memory to burn and "short" is really slow. - */ - -typedef short JCOEF; - - -/* Compressed datastreams are represented as arrays of JOCTET. - * These must be EXACTLY 8 bits wide, at least once they are written to - * external storage. Note that when using the stdio data source/destination - * managers, this is also the data type passed to fread/fwrite. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JOCTET; -#define GETJOCTET(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JOCTET; -#ifdef CHAR_IS_UNSIGNED -#define GETJOCTET(value) (value) -#else -#define GETJOCTET(value) ((value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - - -/* These typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED -typedef char UINT8; -#else /* not CHAR_IS_UNSIGNED */ -typedef short UINT8; -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -/* INT32 must hold at least signed 32-bit values. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ -#ifndef _BASETSD_H /* MinGW is slightly different */ -#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ -typedef long INT32; -#endif -#endif -#endif -#endif - -/* Datatype used for image dimensions. The JPEG standard only supports - * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore - * "unsigned int" is sufficient on all machines. However, if you need to - * handle larger images and you don't mind deviating from the spec, you - * can change this datatype. - */ - -typedef unsigned int JDIMENSION; - -#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ - - -/* These macros are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions; - * in particular, you'll need to do that to make the library a Windows DLL. - * Another application is to make all functions global for use with debuggers - * or code profilers that require it. - */ - -/* a function called through method pointers: */ -#define METHODDEF(type) static type -/* a function used only in its module: */ -#define LOCAL(type) static type -/* a function referenced thru EXTERNs: */ -#define GLOBAL(type) type -/* a reference to a GLOBAL function: */ -#define EXTERN(type) extern type - - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - * Again, you can customize this if you need special linkage keywords. - */ - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname) () -#endif - - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifndef FAR -#ifdef NEED_FAR_POINTERS -#define FAR far -#else -#define FAR -#endif -#endif - - -/* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -#ifndef HAVE_BOOLEAN -typedef int boolean; -#endif -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif - - -/* - * The remaining options affect code selection within the JPEG library, - * but they don't need to be visible to most applications using the library. - * To minimize application namespace pollution, the symbols won't be - * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. - */ - -#ifdef JPEG_INTERNALS -#define JPEG_INTERNAL_OPTIONS -#endif - -#ifdef JPEG_INTERNAL_OPTIONS - - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * library. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -/* Capability options common to encoder and decoder: */ - -#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ -#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ - -/* Encoder capability options: */ - -#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - * The exact same statements apply for progressive JPEG: the default tables - * don't work for progressive mode. (This may get fixed, however.) - */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ - -/* Decoder capability options: */ - -#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ -#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ -#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ -#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ -#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ -#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ - -/* more capability options later, no doubt */ - - -/* - * Ordering of RGB data in scanlines passed to or from the application. - * If your application wants to deal with data in the order B,G,R, just - * change these macros. You can also deal with formats such as R,G,B,X - * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing - * the offsets will also change the order in which colormap data is organized. - * RESTRICTIONS: - * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. - * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE - * is not 3 (they don't understand about dummy color components!). So you - * can't use color quantization if you change that value. - */ - -#define RGB_RED 2 /* Offset of Red in an RGB scanline element */ -#define RGB_GREEN 1 /* Offset of Green */ -#define RGB_BLUE 0 /* Offset of Blue */ -#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ - - -/* Definitions for speed-related optimizations. */ - - -/* If your compiler supports inline functions, define INLINE - * as the inline keyword; otherwise define it as empty. - */ - -#ifndef INLINE -#ifdef __GNUC__ /* for instance, GNU C knows about inline */ -#define INLINE __inline__ -#endif -#ifndef INLINE -#define INLINE /* default is to define it as empty */ -#endif -#endif - - -/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying - * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER - * as short on such a machine. MULTIPLIER must be at least 16 bits wide. - */ - -#ifndef MULTIPLIER -#define MULTIPLIER int /* type for fastest integer multiply */ -#endif - - -/* FAST_FLOAT should be either float or double, whichever is done faster - * by your compiler. (Note that this type is only used in the floating point - * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) - * Typically, float is faster in ANSI C compilers, while double is faster in - * pre-ANSI compilers (because they insist on converting to double anyway). - * The code below therefore chooses float if we have ANSI-style prototypes. - */ - -#ifndef FAST_FLOAT -#ifdef HAVE_PROTOTYPES -#define FAST_FLOAT float -#else -#define FAST_FLOAT double -#endif -#endif - -#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jpegint.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jpegint.h deleted file mode 100644 index c0d5c14..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jpegint.h +++ /dev/null @@ -1,426 +0,0 @@ -/* - * jpegint.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2011 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides common declarations for the various JPEG modules. - * These declarations are considered internal to the JPEG library; most - * applications using the library shouldn't need to include this file. - */ - - -/* Declarations for both compression & decompression */ - -typedef enum { /* Operating modes for buffer controllers */ - JBUF_PASS_THRU, /* Plain stripwise operation */ - /* Remaining modes require a full-image buffer to have been created */ - JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ - JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ - JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ -} J_BUF_MODE; - -/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ -#define CSTATE_START 100 /* after create_compress */ -#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ -#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ -#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ -#define DSTATE_START 200 /* after create_decompress */ -#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ -#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ -#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ -#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ -#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ -#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ -#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ -#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ -#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ -#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ - - -/* Declarations for compression modules */ - -/* Master control module */ -struct jpeg_comp_master { - JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); - JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); - JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); - - /* State variables made visible to other modules */ - boolean call_pass_startup; /* True if pass_startup must be called */ - boolean is_last_pass; /* True during last pass */ -}; - -/* Main buffer control (downsampled-data buffer) */ -struct jpeg_c_main_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, process_data, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail)); -}; - -/* Compression preprocessing (downsampling input buffer control) */ -struct jpeg_c_prep_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, - JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, - JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail)); -}; - -/* Coefficient buffer control */ -struct jpeg_c_coef_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, - JSAMPIMAGE input_buf)); -}; - -/* Colorspace conversion */ -struct jpeg_color_converter { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - JMETHOD(void, color_convert, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows)); -}; - -/* Downsampling */ -struct jpeg_downsampler { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - JMETHOD(void, downsample, (j_compress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_index, - JSAMPIMAGE output_buf, - JDIMENSION out_row_group_index)); - - boolean need_context_rows; /* TRUE if need rows above & below */ -}; - -/* Forward DCT (also controls coefficient quantization) */ -typedef JMETHOD(void, forward_DCT_ptr, - (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY sample_data, JBLOCKROW coef_blocks, - JDIMENSION start_row, JDIMENSION start_col, - JDIMENSION num_blocks)); - -struct jpeg_forward_dct { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - /* It is useful to allow each component to have a separate FDCT method. */ - forward_DCT_ptr forward_DCT[MAX_COMPONENTS]; -}; - -/* Entropy encoding */ -struct jpeg_entropy_encoder { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics)); - JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data)); - JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); -}; - -/* Marker writing */ -struct jpeg_marker_writer { - JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); - JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); - /* These routines are exported to allow insertion of extra markers */ - /* Probably only COM and APPn markers should be written this way */ - JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker, - unsigned int datalen)); - JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val)); -}; - - -/* Declarations for decompression modules */ - -/* Master control module */ -struct jpeg_decomp_master { - JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); - - /* State variables made visible to other modules */ - boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ -}; - -/* Input control module */ -struct jpeg_input_controller { - JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); - JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); - JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); - - /* State variables made visible to other modules */ - boolean has_multiple_scans; /* True if file has multiple scans */ - boolean eoi_reached; /* True when EOI has been consumed */ -}; - -/* Main buffer control (downsampled-data buffer) */ -struct jpeg_d_main_controller { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, process_data, (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -}; - -/* Coefficient buffer control */ -struct jpeg_d_coef_controller { - JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); - JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); - JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); - JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, - JSAMPIMAGE output_buf)); - /* Pointer to array of coefficient virtual arrays, or NULL if none */ - jvirt_barray_ptr *coef_arrays; -}; - -/* Decompression postprocessing (color quantization buffer control) */ -struct jpeg_d_post_controller { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, - JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -}; - -/* Marker reading & parsing */ -struct jpeg_marker_reader { - JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); - /* Read markers until SOS or EOI. - * Returns same codes as are defined for jpeg_consume_input: - * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - */ - JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); - /* Read a restart marker --- exported for use by entropy decoder only */ - jpeg_marker_parser_method read_restart_marker; - - /* State of marker reader --- nominally internal, but applications - * supplying COM or APPn handlers might like to know the state. - */ - boolean saw_SOI; /* found SOI? */ - boolean saw_SOF; /* found SOF? */ - int next_restart_num; /* next restart number expected (0-7) */ - unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ -}; - -/* Entropy decoding */ -struct jpeg_entropy_decoder { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); -}; - -/* Inverse DCT (also performs dequantization) */ -typedef JMETHOD(void, inverse_DCT_method_ptr, - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col)); - -struct jpeg_inverse_dct { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - /* It is useful to allow each component to have a separate IDCT method. */ - inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; -}; - -/* Upsampling (note that upsampler must also call color converter) */ -struct jpeg_upsampler { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, upsample, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, - JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); - - boolean need_context_rows; /* TRUE if need rows above & below */ -}; - -/* Colorspace conversion */ -struct jpeg_color_deconverter { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, color_convert, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows)); -}; - -/* Color quantization or color precision reduction */ -struct jpeg_color_quantizer { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); - JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, - int num_rows)); - JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); -}; - - -/* Miscellaneous useful macros */ - -#undef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#undef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - - -/* We assume that right shift corresponds to signed division by 2 with - * rounding towards minus infinity. This is correct for typical "arithmetic - * shift" instructions that shift in copies of the sign bit. But some - * C compilers implement >> with an unsigned shift. For these machines you - * must define RIGHT_SHIFT_IS_UNSIGNED. - * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. - * It is only applied with constant shift counts. SHIFT_TEMPS must be - * included in the variables of any routine using RIGHT_SHIFT. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define SHIFT_TEMPS INT32 shift_temp; -#define RIGHT_SHIFT(x,shft) \ - ((shift_temp = (x)) < 0 ? \ - (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ - (shift_temp >> (shft))) -#else -#define SHIFT_TEMPS -#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jinit_compress_master jICompress -#define jinit_c_master_control jICMaster -#define jinit_c_main_controller jICMainC -#define jinit_c_prep_controller jICPrepC -#define jinit_c_coef_controller jICCoefC -#define jinit_color_converter jICColor -#define jinit_downsampler jIDownsampler -#define jinit_forward_dct jIFDCT -#define jinit_huff_encoder jIHEncoder -#define jinit_arith_encoder jIAEncoder -#define jinit_marker_writer jIMWriter -#define jinit_master_decompress jIDMaster -#define jinit_d_main_controller jIDMainC -#define jinit_d_coef_controller jIDCoefC -#define jinit_d_post_controller jIDPostC -#define jinit_input_controller jIInCtlr -#define jinit_marker_reader jIMReader -#define jinit_huff_decoder jIHDecoder -#define jinit_arith_decoder jIADecoder -#define jinit_inverse_dct jIIDCT -#define jinit_upsampler jIUpsampler -#define jinit_color_deconverter jIDColor -#define jinit_1pass_quantizer jI1Quant -#define jinit_2pass_quantizer jI2Quant -#define jinit_merged_upsampler jIMUpsampler -#define jinit_memory_mgr jIMemMgr -#define jdiv_round_up jDivRound -#define jround_up jRound -#define jzero_far jZeroFar -#define jcopy_sample_rows jCopySamples -#define jcopy_block_row jCopyBlocks -#define jpeg_zigzag_order jZIGTable -#define jpeg_natural_order jZAGTable -#define jpeg_natural_order7 jZAG7Table -#define jpeg_natural_order6 jZAG6Table -#define jpeg_natural_order5 jZAG5Table -#define jpeg_natural_order4 jZAG4Table -#define jpeg_natural_order3 jZAG3Table -#define jpeg_natural_order2 jZAG2Table -#define jpeg_aritab jAriTab -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays - * and coefficient-block arrays. This won't work on 80x86 because the arrays - * are FAR and we're assuming a small-pointer memory model. However, some - * DOS compilers provide far-pointer versions of memcpy() and memset() even - * in the small-model libraries. These will be used if USE_FMEM is defined. - * Otherwise, the routines in jutils.c do it the hard way. - */ - -#ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */ -#define FMEMZERO(target,size) MEMZERO(target,size) -#else /* 80x86 case */ -#ifdef USE_FMEM -#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) -#else -EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero)); -#define FMEMZERO(target,size) jzero_far(target, size) -#endif -#endif - - -/* Compression module initialization routines */ -EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, - boolean transcode_only)); -EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); -EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); -EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); -EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); -/* Decompression module initialization routines */ -EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); -EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); -EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); -EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); -/* Memory manager initialization */ -EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo)); - -/* Utility routines in jutils.c */ -EXTERN(long) jdiv_round_up JPP((long a, long b)); -EXTERN(long) jround_up JPP((long a, long b)); -EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, JDIMENSION num_cols)); -EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, - JDIMENSION num_blocks)); -/* Constant tables in jutils.c */ -#if 0 /* This table is not actually needed in v6a */ -extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ -#endif -extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ -extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */ -extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */ -extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */ -extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */ -extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */ -extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */ - -/* Arithmetic coding probability estimation tables in jaricom.c */ -extern const INT32 jpeg_aritab[]; - -/* Suppress undefined-structure complaints if necessary. */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -#endif -#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jpeglib.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jpeglib.h deleted file mode 100644 index 1327cff..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jpeglib.h +++ /dev/null @@ -1,1160 +0,0 @@ -/* - * jpeglib.h - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2011 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "jconfig.h" /* widely used configuration options */ -#endif -#include "jmorecfg.h" /* seldom changed options */ - - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -extern "C" { -#endif -#endif - -/* Version IDs for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80". - */ - -#define JPEG_LIB_VERSION 80 /* Compatibility version 8.0 */ -#define JPEG_LIB_VERSION_MAJOR 8 -#define JPEG_LIB_VERSION_MINOR 4 - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This array gives the coefficient quantizers in natural array order - * (not the zigzag order in which they are stored in a JPEG DQT marker). - * CAUTION: IJG versions prior to v6a kept this array in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples, - * reflecting any scaling we choose to apply during the DCT step. - * Values from 1 to 16 are supported. - * Note that different components may receive different DCT scalings. - */ - int DCT_h_scaled_size; - int DCT_v_scaled_size; - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface); - * DCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) - * and similarly for height. - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is currently used only for decompression. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - -/* The decompressor can save APPn and COM markers in a list of these: */ - -typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; /* next in list, or NULL */ - UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ - unsigned int original_length; /* # bytes of data in the file */ - unsigned int data_length; /* # bytes of data saved at data[] */ - JOCTET FAR * data; /* the data contained in the marker */ - /* the marker length word is not counted in data_length or original_length */ -}; - -/* Known color spaces. */ - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ -} J_COLOR_SPACE; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - void * client_data; /* Available for use by application */\ - boolean is_decompressor; /* So common code can tell which is which */\ - int global_state /* For checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - JDIMENSION jpeg_width; /* scaled JPEG image width */ - JDIMENSION jpeg_height; /* scaled JPEG image height */ - /* Dimensions of actual JPEG image that will be written to file, - * derived from input dimensions by scaling factors above. - * These fields are computed by jpeg_start_compress(). - * You can also use jpeg_calc_jpeg_dimensions() to determine these values - * in advance of calling jpeg_start_compress(). - */ - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - int q_scale_factor[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined, - * and corresponding scale factors (percentage, initialized 100). - */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - UINT8 JFIF_major_version; /* What to write for the JFIF version number */ - UINT8 JFIF_minor_version; - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) */ - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ - int script_space_size; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - double output_gamma; /* image gamma wanted in output */ - - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ - UINT8 JFIF_major_version; /* JFIF version number */ - UINT8 JFIF_minor_version; - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Aside from the specific data retained from APPn markers known to the - * library, the uninterpreted contents of any or all APPn and COM markers - * can be saved in a list for examination by the application. - */ - jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* These fields are derived from Se of first SOS marker. - */ - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array for entropy decode */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; - - /* Maximum allocation request accepted by alloc_large. */ - long max_alloc_chunk; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_CreateCompress jCreaCompress -#define jpeg_CreateDecompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#define jpeg_mem_dest jMemDest -#define jpeg_mem_src jMemSrc -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#define jpeg_default_qtables jDefQTables -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#define jpeg_calc_jpeg_dimensions jCjpegDimensions -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_m_header jWrtMHeader -#define jpeg_write_m_byte jWrtMByte -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#define jpeg_core_output_dimensions jCoreDimensions -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_save_markers jSaveMarkers -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN(struct jpeg_error_mgr *) jpeg_std_error - JPP((struct jpeg_error_mgr * err)); - -/* Initialization of JPEG compression objects. - * jpeg_create_compress() and jpeg_create_decompress() are the exported - * names that applications should call. These expand to calls on - * jpeg_CreateCompress and jpeg_CreateDecompress with additional information - * passed for version mismatch checking. - * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. - */ -#define jpeg_create_compress(cinfo) \ - jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_compress_struct)) -#define jpeg_create_decompress(cinfo) \ - jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_decompress_struct)) -EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, - int version, size_t structsize)); -EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, - int version, size_t structsize)); -/* Destruction of JPEG compression objects */ -EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); - -/* Data source and destination managers: memory buffers. */ -EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, - unsigned char ** outbuffer, - unsigned long * outsize)); -EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, - unsigned char * inbuffer, - unsigned long insize)); - -/* Default parameter setup for compression */ -EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - boolean force_baseline)); -EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo, - boolean force_baseline)); -EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - boolean force_baseline)); -EXTERN(int) jpeg_quality_scaling JPP((int quality)); -EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); -EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); -EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -/* Precalculate JPEG dimensions for current compression parameters. */ -EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo)); - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.txt concerning safe usage. */ -EXTERN(void) jpeg_write_marker - JPP((j_compress_ptr cinfo, int marker, - const JOCTET * dataptr, unsigned int datalen)); -/* Same, but piecemeal. */ -EXTERN(void) jpeg_write_m_header - JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); -EXTERN(void) jpeg_write_m_byte - JPP((j_compress_ptr cinfo, int val)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Control saving of COM and APPn markers into marker_list. */ -EXTERN(void) jpeg_save_markers - JPP((j_decompress_ptr cinfo, int marker_code, - unsigned int length_limit)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN(void) jpeg_set_marker_processor - JPP((j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -} -#endif -#endif - -#endif /* JPEGLIB_H */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jversion.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jversion.h deleted file mode 100644 index 5d49151..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/jversion.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * jversion.h - * - * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains software version identification. - */ - - -#define JVERSION "8d 15-Jan-2012" - -#define JCOPYRIGHT "Copyright (C) 2012, Thomas G. Lane, Guido Vollbeding" diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/transupp.h b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/transupp.h deleted file mode 100644 index 9aa0af3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/include/transupp.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * transupp.h - * - * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains declarations for image transformation routines and - * other utility code used by the jpegtran sample application. These are - * NOT part of the core JPEG library. But we keep these routines separate - * from jpegtran.c to ease the task of maintaining jpegtran-like programs - * that have other user interfaces. - * - * NOTE: all the routines declared here have very specific requirements - * about when they are to be executed during the reading and writing of the - * source and destination files. See the comments in transupp.c, or see - * jpegtran.c for an example of correct usage. - */ - -/* If you happen not to want the image transform support, disable it here */ -#ifndef TRANSFORMS_SUPPORTED -#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */ -#endif - -/* - * Although rotating and flipping data expressed as DCT coefficients is not - * hard, there is an asymmetry in the JPEG format specification for images - * whose dimensions aren't multiples of the iMCU size. The right and bottom - * image edges are padded out to the next iMCU boundary with junk data; but - * no padding is possible at the top and left edges. If we were to flip - * the whole image including the pad data, then pad garbage would become - * visible at the top and/or left, and real pixels would disappear into the - * pad margins --- perhaps permanently, since encoders & decoders may not - * bother to preserve DCT blocks that appear to be completely outside the - * nominal image area. So, we have to exclude any partial iMCUs from the - * basic transformation. - * - * Transpose is the only transformation that can handle partial iMCUs at the - * right and bottom edges completely cleanly. flip_h can flip partial iMCUs - * at the bottom, but leaves any partial iMCUs at the right edge untouched. - * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched. - * The other transforms are defined as combinations of these basic transforms - * and process edge blocks in a way that preserves the equivalence. - * - * The "trim" option causes untransformable partial iMCUs to be dropped; - * this is not strictly lossless, but it usually gives the best-looking - * result for odd-size images. Note that when this option is active, - * the expected mathematical equivalences between the transforms may not hold. - * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim - * followed by -rot 180 -trim trims both edges.) - * - * We also offer a lossless-crop option, which discards data outside a given - * image region but losslessly preserves what is inside. Like the rotate and - * flip transforms, lossless crop is restricted by the JPEG format: the upper - * left corner of the selected region must fall on an iMCU boundary. If this - * does not hold for the given crop parameters, we silently move the upper left - * corner up and/or left to make it so, simultaneously increasing the region - * dimensions to keep the lower right crop corner unchanged. (Thus, the - * output image covers at least the requested region, but may cover more.) - * The adjustment of the region dimensions may be optionally disabled. - * - * We also provide a lossless-resize option, which is kind of a lossless-crop - * operation in the DCT coefficient block domain - it discards higher-order - * coefficients and losslessly preserves lower-order coefficients of a - * sub-block. - * - * Rotate/flip transform, resize, and crop can be requested together in a - * single invocation. The crop is applied last --- that is, the crop region - * is specified in terms of the destination image after transform/resize. - * - * We also offer a "force to grayscale" option, which simply discards the - * chrominance channels of a YCbCr image. This is lossless in the sense that - * the luminance channel is preserved exactly. It's not the same kind of - * thing as the rotate/flip transformations, but it's convenient to handle it - * as part of this package, mainly because the transformation routines have to - * be aware of the option to know how many components to work on. - */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jtransform_parse_crop_spec jTrParCrop -#define jtransform_request_workspace jTrRequest -#define jtransform_adjust_parameters jTrAdjust -#define jtransform_execute_transform jTrExec -#define jtransform_perfect_transform jTrPerfect -#define jcopy_markers_setup jCMrkSetup -#define jcopy_markers_execute jCMrkExec -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* - * Codes for supported types of image transformations. - */ - -typedef enum { - JXFORM_NONE, /* no transformation */ - JXFORM_FLIP_H, /* horizontal flip */ - JXFORM_FLIP_V, /* vertical flip */ - JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */ - JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */ - JXFORM_ROT_90, /* 90-degree clockwise rotation */ - JXFORM_ROT_180, /* 180-degree rotation */ - JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */ -} JXFORM_CODE; - -/* - * Codes for crop parameters, which can individually be unspecified, - * positive or negative for xoffset or yoffset, - * positive or forced for width or height. - */ - -typedef enum { - JCROP_UNSET, - JCROP_POS, - JCROP_NEG, - JCROP_FORCE -} JCROP_CODE; - -/* - * Transform parameters struct. - * NB: application must not change any elements of this struct after - * calling jtransform_request_workspace. - */ - -typedef struct { - /* Options: set by caller */ - JXFORM_CODE transform; /* image transform operator */ - boolean perfect; /* if TRUE, fail if partial MCUs are requested */ - boolean trim; /* if TRUE, trim partial MCUs as needed */ - boolean force_grayscale; /* if TRUE, convert color image to grayscale */ - boolean crop; /* if TRUE, crop source image */ - - /* Crop parameters: application need not set these unless crop is TRUE. - * These can be filled in by jtransform_parse_crop_spec(). - */ - JDIMENSION crop_width; /* Width of selected region */ - JCROP_CODE crop_width_set; /* (forced disables adjustment) */ - JDIMENSION crop_height; /* Height of selected region */ - JCROP_CODE crop_height_set; /* (forced disables adjustment) */ - JDIMENSION crop_xoffset; /* X offset of selected region */ - JCROP_CODE crop_xoffset_set; /* (negative measures from right edge) */ - JDIMENSION crop_yoffset; /* Y offset of selected region */ - JCROP_CODE crop_yoffset_set; /* (negative measures from bottom edge) */ - - /* Internal workspace: caller should not touch these */ - int num_components; /* # of components in workspace */ - jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */ - JDIMENSION output_width; /* cropped destination dimensions */ - JDIMENSION output_height; - JDIMENSION x_crop_offset; /* destination crop offsets measured in iMCUs */ - JDIMENSION y_crop_offset; - int iMCU_sample_width; /* destination iMCU size */ - int iMCU_sample_height; -} jpeg_transform_info; - - -#if TRANSFORMS_SUPPORTED - -/* Parse a crop specification (written in X11 geometry style) */ -EXTERN(boolean) jtransform_parse_crop_spec - JPP((jpeg_transform_info *info, const char *spec)); -/* Request any required workspace */ -EXTERN(boolean) jtransform_request_workspace - JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info)); -/* Adjust output image parameters */ -EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters - JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - jvirt_barray_ptr *src_coef_arrays, - jpeg_transform_info *info)); -/* Execute the actual transformation, if any */ -EXTERN(void) jtransform_execute_transform - JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - jvirt_barray_ptr *src_coef_arrays, - jpeg_transform_info *info)); -/* Determine whether lossless transformation is perfectly - * possible for a specified image and transformation. - */ -EXTERN(boolean) jtransform_perfect_transform - JPP((JDIMENSION image_width, JDIMENSION image_height, - int MCU_width, int MCU_height, - JXFORM_CODE transform)); - -/* jtransform_execute_transform used to be called - * jtransform_execute_transformation, but some compilers complain about - * routine names that long. This macro is here to avoid breaking any - * old source code that uses the original name... - */ -#define jtransform_execute_transformation jtransform_execute_transform - -#endif /* TRANSFORMS_SUPPORTED */ - - -/* - * Support for copying optional markers from source to destination file. - */ - -typedef enum { - JCOPYOPT_NONE, /* copy no optional markers */ - JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */ - JCOPYOPT_ALL /* copy all optional markers */ -} JCOPY_OPTION; - -#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */ - -/* Setup decompression object to save desired markers in memory */ -EXTERN(void) jcopy_markers_setup - JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option)); -/* Copy markers saved in the given source object to the destination object */ -EXTERN(void) jcopy_markers_execute - JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - JCOPY_OPTION option)); diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a deleted file mode 100644 index f8de481..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a deleted file mode 100644 index 3e4692c..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll deleted file mode 100644 index 0cce66b..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.dll and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib b/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib deleted file mode 100644 index eb328e7..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/3rdparty/libjpeg/lib/win32/libjpeg-8.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp deleted file mode 100644 index 369487f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/AbstractPartition.hpp +++ /dev/null @@ -1,224 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file common/AbstractPartition.hpp - * - * Declares the touchgfx::AbstractPartition class. - */ -#ifndef TOUCHGFX_ABSTRACTPARTITION_HPP -#define TOUCHGFX_ABSTRACTPARTITION_HPP - -#include - -namespace touchgfx -{ -/** - * This type defines an abstract interface to a storage partition for allocating memory slots of - * equal size. The "partition" is not aware of the actual types stored in the partition - * memory, hence it provides no mechanism for deleting C++ objects when clear()'ed. - */ -class AbstractPartition -{ -public: - /** Finalizes an instance of the AbstractPartition class. */ - virtual ~AbstractPartition(); - - /** - * Gets the address of the next available storage slot. The slot size is compared with - * the specified size. - * - * @param size The size. - * - * @return The address of an empty storage slot which contains minimum 'size' bytes. - * - * @note Asserts if 'size' is too large, or the storage is depleted. - */ - virtual void* allocate(uint16_t size); - - /** - * Gets the address of the specified index. - * - * @param index Zero-based index of the. - * @param size The size. - * - * @return The address of the appropriate storage slot which contains minimum 'size' - * bytes. - * - * @note Asserts if 'size' is too large. - */ - virtual void* allocateAt(uint16_t index, uint16_t size); - - /** - * Gets allocation count. - * - * @return The currently allocated storage slots. - */ - virtual uint16_t getAllocationCount() const; - - /** - * Determines index of previously allocated location. Since the Partition concept is - * loosely typed this method shall be used with care. The method does not guarantee that - * the found object at the returned index is a valid object. It only tests whether or - * not the object is within the bounds of the current partition allocations. - * - * @param address The location address to lookup. - * - * @return An uint16_t. - */ - virtual uint16_t indexOf(const void* address); - - /** - * Prepares the Partition for new allocations. Any objects present in the Partition - * shall not be used after invoking this method. - */ - virtual void clear(); - - /** - * Gets the capacity, i.e. the maximum allocation count. - * - * @return The maximum allocation count. - */ - virtual uint16_t capacity() const = 0; - - /** - * Gets the address of the next available storage slot. The slot size is determined from - * the size of type T. - * - * @tparam T Generic type parameter. - * - * @return The address of an empty storage slot. - * - * @note Asserts if T is too large, or the storage is depleted. - */ - template - void* allocate() - { - return allocate(static_cast(sizeof(T))); - } - - /** - * Gets the address of the specified storage slot. The slot size is determined from the - * size of type T. - * - * @tparam T Generic type parameter. - * @param index Zero-based index of the. - * - * @return The address of the appropriate storage slot. - * - * @note Asserts if T is too large. - */ - template - void* allocateAt(uint16_t index) - { - return allocateAt(index, static_cast(sizeof(T))); - } - - /** - * Gets the object at the specified index. - * - * @tparam T Generic type parameter. - * @param index The index into the Partition storage where the returned object is located. - * - * @return A typed reference to the object at the specified index. - */ - template - T& at(const uint16_t index) - { - return *static_cast(element(index)); - } - - /** - * const version of at(). - * - * @tparam T Generic type parameter. - * @param index Zero-based index of the. - * - * @return A T& - */ - template - const T& at(const uint16_t index) const - { - return *static_cast(element(index)); - } - - /** - * Determines if the specified object could have been previously allocated in the - * partition. Since the Partition concept is loosely typed this method shall be used - * with care. The method does not guarantee that the found object at the returned index - * is a valid object. It only tests whether or not the object is within the bounds of - * the current partition allocations. - * - * @tparam T Generic type parameter. - * @param pT Pointer to the object to look up. - * - * @return If the object seems to be allocated in the Partition, a Pair object - * containing a typed pointer to the object and an index into the Partition - * storage is returned. Otherwise, a Pair<0, 0> is returned. - */ - template - Pair find(const void* pT) - { - uint16_t index = indexOf(pT); - if (0 < getAllocationCount() && index < getAllocationCount()) - { - return Pair(&at(index), index); - } - - return Pair(0, (uint16_t)-1); - } - - /** Decreases number of allocations. */ - void dec() - { - if (allocations) - { - allocations--; - } - } - - /** - * Access to concrete element-size. Used internally. - * - * @return An uint32_t. - */ - virtual uint32_t element_size() = 0; - -protected: - /** - * Access to stored element. Used internally. - * - * @param index Zero-based index of the. - * - * @return null if it fails, else a void*. - */ - virtual void* element(uint16_t index) = 0; - - /** - * Access to stored element, const version. - * - * @param index Zero-based index of the. - * - * @return null if it fails, else a void*. - */ - virtual const void* element(uint16_t index) const = 0; - - /** Initializes a new instance of the AbstractPartition class. */ - AbstractPartition(); - -private: - uint16_t allocations; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPARTITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp deleted file mode 100644 index e4c015e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/Meta.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file common/Meta.hpp - * - * Declares the touchgfx::meta namespace. - */ -#ifndef TOUCHGFX_META_HPP -#define TOUCHGFX_META_HPP - -namespace touchgfx -{ -/** - * Template meta-programming tools are grouped in this namespace - */ -namespace meta -{ -/** Nil-type, indicates the end of a TypeList. */ -struct Nil -{ -}; - -/** - * TypeList, used for generating compile-time lists of types. - * - * @tparam First Type of the first. - * @tparam Next Type of the next. - */ -template -struct TypeList -{ - typedef First first; ///< The first element in the TypeList - typedef Next next; ///< Remainder of the TypeList -}; - -/** - * Meta-function, selects the "maximum" type, i.e. the largest type. - * - * @tparam T1 Generic type parameter. - * @tparam T2 Generic type parameter. - * @tparam choose1 True if sizeof(T1) is larger than sizeof(T2). - * @param parameter1 The first parameter. - */ -template sizeof(T2))> -struct type_max -{ - typedef T1 type; ///< The resulting type (default case: sizeof(T1)>sizeof(T2)) -}; - -/** - * Specialization for the case where sizeof(T2) >= sizeof(T1). - * - * @tparam T1 Generic type parameter. - * @tparam T2 Generic type parameter. - */ -template -struct type_max -{ - typedef T2 type; ///< The resulting type (default case: sizeof(T2)>=sizeof(T1)) -}; - -/** - * Meta-function signature, selects maximum type from TypeList. - * - * @tparam T Generic type parameter. - */ -template -struct select_type_maxsize; - -/** - * Specialization to dive into the list (inherits result from type_max). - * - * @tparam First Type of the first. - * @tparam Next Type of the next. - */ -template -struct select_type_maxsize > : public type_max::type> -{ -}; - -/** - * Specialization for loop termination (when type Nil encountered). - * - * @tparam First Type of the first. - */ -template -struct select_type_maxsize > -{ - typedef First type; -}; - -/** - * Meta-function signature, joins typelist with type (or another typelist). - * - * @tparam TList Type of the list. - * @tparam T Generic type parameter. - */ -template -struct list_join; - -/** Specialization for termination. */ -template <> -struct list_join -{ - typedef Nil result; -}; - -/** - * Specialization for "end-of-LHS", with RHS as type. - * - * @tparam T Generic type parameter. - */ -template -struct list_join -{ - typedef TypeList result; -}; - -/** - * Specialization for "end-of-LHS", with RHS as a TypeList. - * - * @tparam First Type of the first. - * @tparam Next Type of the next. - */ -template -struct list_join > -{ - typedef TypeList result; -}; - -/** - * Recursively joins a typelist (LHS) with a type or a type-list (RHS). - * - * @tparam First Type of the first. - * @tparam Next Type of the next. - * @tparam T Generic type parameter. - */ -template -struct list_join, T> -{ - typedef TypeList::result> result; -}; - -} // namespace meta - -} // namespace touchgfx - -#endif // TOUCHGFX_META_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp deleted file mode 100644 index 26e40ab..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/Partition.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file common/Partition.hpp - * - * Declares the touchgfx::Partition class. - */ -#ifndef TOUCHGFX_PARTITION_HPP -#define TOUCHGFX_PARTITION_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * This type provides a concrete Partition of memory-slots capable of holding any of the - * specified list of types. - * - * The Partition is not aware of the types stored in the Partition memory, hence it - * provides no mechanism for deleting C++ objects when the Partition is clear()'ed. - * - * This class implements AbstractPartition. - * - * @tparam ListOfTypes Type of the list of types. - * @tparam NUMBER_OF_ELEMENTS Type of the number of elements. - * - * @see AbstractPartition - */ -template -class Partition : public AbstractPartition -{ -public: - /** Provides a generic public type containing the list of supported types. */ - typedef ListOfTypes SupportedTypesList; - - /** - * Compile-time generated constants specifying the "element" or "slot" size used by this - * partition. - */ - enum - { - INTS_PR_ELEMENT = (sizeof(typename meta::select_type_maxsize::type) + sizeof(int) - 1) / sizeof(int), - SIZE_OF_ELEMENT = INTS_PR_ELEMENT * sizeof(int) - }; - - virtual uint16_t capacity() const - { - return NUMBER_OF_ELEMENTS; - } - - virtual uint32_t element_size() - { - return sizeof(stBlocks[0]); - } - -protected: - virtual void* element(uint16_t index) - { - return &stBlocks[index]; - } - - virtual const void* element(uint16_t index) const - { - return &stBlocks[index]; - } - -private: - /** Internal type used for storage, in order to ensure "natural" alignment of elements. */ - struct Block - { - int filler[INTS_PR_ELEMENT]; - }; - - Block stBlocks[NUMBER_OF_ELEMENTS]; ///< Actual memory storage -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PARTITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp deleted file mode 100644 index 65cbdc3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/common/TouchGFXInit.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file common/TouchGFXInit.hpp - * - * Declares the touch graphics generic initialization function. - */ -#ifndef TOUCHGFX_TOUCHGFXINIT_HPP -#define TOUCHGFX_TOUCHGFXINIT_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static ApplicationFontProvider fontProvider; ///< The font provider - -/** - * The global touchgfx namespace. All TouchGFX framework classes and global functions are placed in this namespace. - */ -namespace touchgfx -{ -/// @cond - -static Texts texts; ///< The texts - -template -HAL& getHAL(DMA_Interface& dma, LCD& display, TouchController& tc, int16_t width, int16_t height) -{ - static T hal(dma, display, tc, width, height); - return hal; -} - -/// @endcond - -/** - * @globalfn - */ - -/** - * TouchGFX generic initialize. - * - * @tparam HALType The class type of the HAL subclass used for this port. - * @param [in] dma Reference to the DMA implementation object to use. Can be of - * type NoDMA to disable the use of DMA for rendering. - * @param [in] display Reference to the LCD renderer implementation (subclass of - * LCD). Could be either LCD16bpp for RGB565 UIs, or - * LCD1bpp for monochrome UIs or LCD24bpp for 24bit - * displays using RGB888 UIs. - * @param [in] tc Reference to the touch controller driver (or - * NoTouchController to disable touch input). - * @param width The \a native display width of the actual display, in pixels. - * This value is irrespective of whether the concrete UI - * should be portrait or landscape mode. It must match - * what the display itself is configured as. - * @param height The \a native display height of the actual display, in - * pixels. This value is irrespective of whether the - * concrete UI should be portrait or landscape mode. It - * must match what the display itself is configured as. - * @param [in] bitmapCache Optional pointer to starting address of a memory region in - * which to place the bitmap cache. Usually in external - * RAM. Pass 0 if bitmap caching is not used. - * @param bitmapCacheSize Size of bitmap cache in bytes. Pass 0 if bitmap cache is not - * used. - * @param numberOfDynamicBitmaps (Optional) Number of dynamic bitmaps. - * - * @return A reference to the allocated (and initialized) HAL object. - */ -template -HAL& touchgfx_generic_init(DMA_Interface& dma, LCD& display, TouchController& tc, int16_t width, int16_t height, - uint16_t* bitmapCache, uint32_t bitmapCacheSize, uint32_t numberOfDynamicBitmaps = 0) -{ - HAL& hal = getHAL(dma, display, tc, width, height); - hal.initialize(); - - Bitmap::registerBitmapDatabase(BitmapDatabase::getInstance(), - BitmapDatabase::getInstanceSize(), - bitmapCache, - bitmapCacheSize, - numberOfDynamicBitmaps); - - TypedText::registerTexts(&texts); - Texts::setLanguage(0); - - FontManager::setFontProvider(&fontProvider); - - FrontendHeap::getInstance(); // We need to initialize the frontend heap. - - hal.registerEventListener(*(Application::getInstance())); - - return hal; -} - -} // namespace touchgfx - -#endif // TOUCHGFX_TOUCHGFXINIT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp deleted file mode 100644 index 1a12b34..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp +++ /dev/null @@ -1,186 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file mvp/MVPApplication.hpp - * - * Declares the touchgfx::MVPApplication class. - */ -#ifndef TOUCHGFX_MVPAPPLICATION_HPP -#define TOUCHGFX_MVPAPPLICATION_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -class Presenter; - -/** - * A specialization of the TouchGFX Application class that provides the necessary glue for - * transitioning between presenter/view pairs. - * - * It maintains a callback for transitioning and evaluates this at each tick. - * - * @see Application - */ -class MVPApplication : public Application -{ -public: - /** Initializes a new instance of the MVPApplication class. */ - MVPApplication() - : currentPresenter(0), - pendingScreenTransitionCallback(0) - { - instance = this; - } - - /** - * Handles the pending screen transition. - * - * Delegates the work to evaluatePendingScreenTransition() - */ - virtual void handlePendingScreenTransition() - { - evaluatePendingScreenTransition(); - } - -protected: - Presenter* currentPresenter; ///< Pointer to the currently active presenter. - - GenericCallback<>* pendingScreenTransitionCallback; ///< Callback for screen transitions. Will be set to something valid when a transition request is made. - - /** - * Evaluates the pending Callback instances. If a callback is valid, it is executed and - * a Screen transition is executed. - */ - void evaluatePendingScreenTransition() - { - if (pendingScreenTransitionCallback && pendingScreenTransitionCallback->isValid()) - { - pendingScreenTransitionCallback->execute(); - pendingScreenTransitionCallback = 0; - } - } -}; - -/** - * Prepare screen transition. Private helper function for makeTransition. Do not use. - * - * @param [in] currentScreen If non-null, the current screen. - * @param [in] currentPresenter If non-null, the current presenter. - * @param [in] currentTrans If non-null, the current transaction. - */ -FORCE_INLINE_FUNCTION static void prepareTransition(Screen** currentScreen, Presenter** currentPresenter, Transition** currentTrans) -{ - Application::getInstance()->clearAllTimerWidgets(); - - if (*currentTrans) - { - (*currentTrans)->tearDown(); - } - if (*currentTrans) - { - (*currentTrans)->~Transition(); - } - if (*currentScreen) - { - (*currentScreen)->tearDownScreen(); - } - if (*currentPresenter) - { - (*currentPresenter)->deactivate(); - } - if (*currentScreen) - { - (*currentScreen)->~Screen(); - } - if (*currentPresenter) - { - (*currentPresenter)->~Presenter(); - } -} - -/** - * Finalize screen transition. Private helper function for makeTransition. Do not use. - * - * @param [in] newScreen If non-null, the new screen. - * @param [in] newPresenter If non-null, the new presenter. - * @param [in] newTransition If non-null, the new transition. - */ -FORCE_INLINE_FUNCTION static void finalizeTransition(Screen* newScreen, Presenter* newPresenter, Transition* newTransition) -{ - newScreen->setupScreen(); - newPresenter->activate(); - newScreen->bindTransition(*newTransition); - newTransition->init(); - newTransition->invalidate(); -} - -/** - * Function for effectuating a screen transition (i.e. makes the requested new presenter/view - * pair active). Once this function has returned, the new screen has been transitioned - * to. Due to the memory allocation strategy of using the same memory area for all - * screens, the old view/presenter will no longer exist when this function returns. - * - * Will properly clean up old screen (tearDownScreen, Presenter::deactivate) and call - * setupScreen/activate on new view/presenter pair. Will also make sure the view, - * presenter and model are correctly bound to each other. - * - * @tparam ScreenType Class type for the View. - * @tparam PresenterType Class type for the Presenter. - * @tparam TransType Class type for the Transition. - * @tparam ModelType Class type for the Model. - * @param [in] currentScreen Pointer to pointer to the current view. - * @param [in] currentPresenter Pointer to pointer to the current presenter. - * @param [in] heap Reference to the heap containing the memory storage in which - * to allocate. - * @param [in] currentTrans Pointer to pointer to the current transition. - * @param [in] model Pointer to model. - * - * @return Pointer to the new Presenter of the requested type. Incidentally it will be the same - * value as the old presenter due to memory reuse. - */ -template -PresenterType* makeTransition(Screen** currentScreen, Presenter** currentPresenter, MVPHeap& heap, Transition** currentTrans, ModelType* model) -{ - assert(sizeof(ScreenType) <= heap.screenStorage.element_size() && "View allocation error: Check that all views are added to FrontendHeap::ViewTypes"); - assert(sizeof(PresenterType) <= heap.presenterStorage.element_size() && "Presenter allocation error: Check that all presenters are added to FrontendHeap::PresenterTypes"); - assert(sizeof(TransType) <= heap.transitionStorage.element_size() && "Transition allocation error: Check that all transitions are added to FrontendHeap::TransitionTypes"); - - prepareTransition(currentScreen, currentPresenter, currentTrans); - - TransType* newTransition = new (&heap.transitionStorage.at(0)) TransType; - ScreenType* newScreen = new (&heap.screenStorage.at(0)) ScreenType; - PresenterType* newPresenter = new (&heap.presenterStorage.at(0)) PresenterType(*newScreen); - *currentTrans = newTransition; - *currentPresenter = newPresenter; - *currentScreen = newScreen; - model->bind(newPresenter); - newPresenter->bind(model); - newScreen->bind(*newPresenter); - - finalizeTransition((Screen*)newScreen, (Presenter*)newPresenter, (Transition*)newTransition); - - return newPresenter; -} - -} // namespace touchgfx - -#endif // TOUCHGFX_MVPAPPLICATION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp deleted file mode 100644 index d82faf4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/MVPHeap.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file mvp/MVPHeap.hpp - * - * Declares the touchgfx::MVPHeap class. - */ -#ifndef TOUCHGFX_MVPHEAP_HPP -#define TOUCHGFX_MVPHEAP_HPP - -#include "common/AbstractPartition.hpp" - -namespace touchgfx -{ -class AbstractPartition; -class MVPApplication; - -/** - * Generic heap class for MVP applications. Serves as a way of obtaining the memory storage - * areas for presenters, screens, transitions and the concrete application. - * - * Subclassed by an application-specific heap which provides the actual storage areas. - * This generic interface is used only in makeTransition. - */ -class MVPHeap -{ -public: - /** - * Initializes a new instance of the MVPHeap class. - * - * @param [in] pres A memory partition containing enough memory to hold the largest - * presenter. - * @param [in] scr A memory partition containing enough memory to hold the largest view. - * @param [in] tra A memory partition containing enough memory to hold the largest - * transition. - * @param [in] app A reference to the MVPApplication instance. - */ - MVPHeap(AbstractPartition& pres, - AbstractPartition& scr, - AbstractPartition& tra, - MVPApplication& app) - : presenterStorage(pres), - screenStorage(scr), - transitionStorage(tra), - frontendApplication(app) - { - } - - /** Finalizes an instance of the MVPHeap class. */ - virtual ~MVPHeap() - { - } - - AbstractPartition& presenterStorage; ///< A memory partition containing enough memory to hold the largest presenter. - AbstractPartition& screenStorage; ///< A memory partition containing enough memory to hold the largest view. - AbstractPartition& transitionStorage; ///< A memory partition containing enough memory to hold the largest transition. - MVPApplication& frontendApplication; ///< A reference to the MVPApplication instance. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_MVPHEAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp deleted file mode 100644 index f804faa..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/Presenter.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file mvp/Presenter.hpp - * - * Declares the touchgfx::Presenter class. - */ -#ifndef TOUCHGFX_PRESENTER_HPP -#define TOUCHGFX_PRESENTER_HPP - -namespace touchgfx -{ -/** - * The Presenter base class that all application-specific presenters should derive from. Only - * contains activate and deactivate virtual functions which are called automatically - * during screen transition. - */ -class Presenter -{ -public: - /** - * Place initialization code for the Presenter here. - * - * The activate function is called automatically when a screen transition causes this - * Presenter to become active. Place initialization code for the Presenter here. - */ - virtual void activate() - { - } - - /** - * Place cleanup code for the Presenter here. - * - * The deactivate function is called automatically when a screen transition causes this - * Presenter to become inactive. Place cleanup code for the Presenter here. - */ - virtual void deactivate() - { - } - - /** Finalizes an instance of the Presenter class. */ - virtual ~Presenter() - { - } - -protected: - /** Initializes a new instance of the Presenter class. */ - Presenter() - { - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PRESENTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp deleted file mode 100644 index 580d74f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/mvp/View.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file mvp/View.hpp - * - * Declares the touchgfx::View class. - */ -#ifndef TOUCHGFX_VIEW_HPP -#define TOUCHGFX_VIEW_HPP - -#include - -namespace touchgfx -{ -/** - * This is a generic touchgfx::Screen specialization for normal applications. It provides a link - * to the Presenter class. - * - * @tparam T The type of Presenter associated with this view. - * - * @see Screen - * - * @note All views in the application must be a subclass of this type. - */ -template -class View : public Screen -{ -public: - View() - : presenter(0) - { - } - - /** - * Binds an instance of a specific Presenter type (subclass) to the View instance. This function - * is called automatically when a new presenter/view pair is activated. - * - * @param [in] newPresenter The specific Presenter to be associated with the View. - */ - void bind(T& newPresenter) - { - presenter = &newPresenter; - } - -protected: - T* presenter; ///< Pointer to the Presenter associated with this view. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_VIEW_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp deleted file mode 100644 index fa165e5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/core/MCUInstrumentation.hpp - * - * Declares the touchgfx::MCUInstrumentation interface class. - */ -#ifndef TOUCHGFX_MCUINSTRUMENTATION_HPP -#define TOUCHGFX_MCUINSTRUMENTATION_HPP - -#include - -namespace touchgfx -{ -/** Interface for instrumenting processors to measure MCU load via measured CPU cycles. */ -class MCUInstrumentation -{ -public: - /** Initializes a new instance of the MCUInstrumentation class. */ - MCUInstrumentation() - : cc_consumed(0), - cc_in(0) - { - } - - /** Initialize. */ - virtual void init() = 0; - - /** Finalizes an instance of the MCUInstrumentation class. */ - virtual ~MCUInstrumentation() - { - } - - /** - * Gets elapsed microseconds based on clock frequency. - * - * @param start Start time. - * @param now Current time. - * @param clockfrequency Clock frequency of the system expressed in MHz. - * - * @return Elapsed microseconds start and now. - */ - virtual unsigned int getElapsedUS(unsigned int start, unsigned int now, unsigned int clockfrequency) = 0; - - /** - * Gets CPU cycles from register. - * - * @return CPU cycles. - */ - virtual unsigned int getCPUCycles(void) = 0; - - /** - * Sets MCU activity high. - * - * @param active if True, inactive otherwise. - */ - virtual void setMCUActive(bool active) - { - if (active) // Idle task sched out - { - uint32_t cc_temp = getCPUCycles() - cc_in; - cc_consumed += cc_temp; - } - else // Idle task sched in - { - cc_in = getCPUCycles(); - } - } - - /** - * Gets number of consumed clock cycles. - * - * @return clock cycles. - */ - virtual uint32_t getCCConsumed() - { - return cc_consumed; - } - - /** - * Sets number of consumed clock cycles. - * - * @param val number of clock cycles. - */ - virtual void setCCConsumed(uint32_t val) - { - cc_consumed = val; - } - -protected: - volatile uint32_t cc_consumed; ///< Amount of consumed CPU cycles. - volatile uint32_t cc_in; ///< Current CPU cycles. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_MCUINSTRUMENTATION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp deleted file mode 100644 index 3295767..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/button/ButtonController.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/button/ButtonController.hpp - * - * Declares the touchgfx::ButtonController interface class. - */ -#ifndef TOUCHGFX_BUTTONCONTROLLER_HPP -#define TOUCHGFX_BUTTONCONTROLLER_HPP - -#include - -namespace touchgfx -{ -/** Interface for sampling external key events. */ -class ButtonController -{ -public: - /** Finalizes an instance of the ButtonController class. */ - virtual ~ButtonController() - { - } - - /** Initializes button controller. */ - virtual void init() = 0; - - /** - * Sample external key events. - * - * @param [out] key Output parameter that will be set to the key value if a keypress was - * detected. - * - * @return True if a keypress was detected and the "key" parameter is set to a value. - */ - virtual bool sample(uint8_t& key) = 0; - - /** Resets button controller. Does nothing in the default implementation. */ - virtual void reset() - { - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BUTTONCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp deleted file mode 100644 index b0918bb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/i2c/I2C.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/i2c/I2C.hpp - * - * Declares the touchfgx::I2C interface class. - */ -#ifndef TOUCHGFX_I2C_HPP -#define TOUCHGFX_I2C_HPP - -#include - -namespace touchgfx -{ -/** Platform independent interface for I2C drivers. */ -class I2C -{ -public: - /** - * Initializes a new instance of the I2C class. Stores the channel of the I2C bus to be - * configured. - * - * @param ch I2C channel. - */ - I2C(uint8_t ch) - : channel(ch) - { - } - - /** Finalizes an instance of the I2C class. */ - virtual ~I2C() - { - } - - /** Initializes the I2C driver. */ - virtual void init() = 0; - - /** - * Reads the specified register on the device with the specified address. - * - * @param addr The I2C device address. - * @param reg The register. - * @param [out] data Pointer to buffer in which to place the result. - * @param cnt Size of buffer in bytes. - * - * @return true on success, false otherwise. - */ - virtual bool readRegister(uint8_t addr, uint8_t reg, uint8_t* data, uint32_t cnt) = 0; - - /** - * Writes the specified value in a register. - * - * @param addr The I2C device address. - * @param reg The register. - * @param val The new value. - * - * @return true on success, false otherwise. - */ - virtual bool writeRegister(uint8_t addr, uint8_t reg, uint8_t val) = 0; - -protected: - uint8_t channel; ///< I2c channel is stored in order to initialize and recover a specific I2C channel -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_I2C_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp deleted file mode 100644 index bf88eba..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bpp.hpp +++ /dev/null @@ -1,844 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD16bpp.hpp - * - * Declares the touchgfx::LCD16bpp class. - */ -#ifndef TOUCHGFX_LCD16BPP_HPP -#define TOUCHGFX_LCD16BPP_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -struct GlyphNode; - -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD16bpp : public LCD -{ -public: - LCD16bpp(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 16; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::RGB565; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH * 2; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param red Value of the red part (0-255). - * @param green Value of the green part (0-255). - * @param blue Value of the blue part (0-255). - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint16_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return ((red << 8) & 0xF800) | ((green << 3) & 0x07E0) | ((blue >> 3) & 0x001F); - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint16_t getNativeColor(colortype color) - { - return ((color >> 8) & 0xF800) | ((color >> 5) & 0x07E0) | ((color >> 3) & 0x001F); - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB565_BilinearInterpolation, - * enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_BilinearInterpolation - */ - void enableTextureMapperL8_RGB565_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB888_BilinearInterpolation, - * enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_BilinearInterpolation - */ - void enableTextureMapperL8_RGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_ARGB8888_BilinearInterpolation, - * enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_BilinearInterpolation - */ - void enableTextureMapperL8_ARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB565 image format. This allows drawing RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperRGB565_Opaque_BilinearInterpolation, - * enableTextureMapperRGB565_Opaque_NearestNeighbor, - * enableTextureMapperRGB565_NonOpaque_BilinearInterpolation, - * enableTextureMapperRGB565_NonOpaque_NearestNeighbor - */ - void enableTextureMapperRGB565(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_Opaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_NonOpaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_Opaque_NearestNeighbor(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_NonOpaque_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified. If ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32 bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D source-array to the framebuffer never performing alpha-blending per pixel as - * because it is assumed that all pixels in the bitmap are solid (i.e. alpha for each pixel is - * 255). - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32 bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - */ - void blitCopyARGB8888Solid(const uint32_t* sourceData, const Rect& source, const Rect& blitRect) const; - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified. - * If RGB888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 24 bits RGB888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if indexed format is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (ARGB8888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_ARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB565 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 16- - * bits (RGB565) format. If the source have per pixel alpha - * channel, then alpha channel data will be following the clut - * entries data. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (ARGB8888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified. Always performs a software blend. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 16- bits RGB565 values. - * @param alphaData The alpha channel array pointer (points to the beginning of the data) - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData, const uint8_t* alphaData, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_NoGA; - - FORCE_INLINE_FUNCTION static uint32_t expandRgb565(uint16_t c) - { - return ((c & 0x07E0) << 16) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t compactRgb565(uint32_t c) - { - return ((c >> 16) & 0x07E0) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint16_t c01, uint16_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - uint32_t a01 = expandRgb565(c01); - uint32_t a11 = expandRgb565(c11); - - uint8_t xy = (x * y) >> 3; - return compactRgb565((a00 * (32 - 2 * y - 2 * x + xy) + a10 * (2 * x - xy) + a01 * (2 * y - xy) + a11 * xy) >> 5); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint8_t x) - { - assert(x < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - - return compactRgb565((a00 * (32 - 2 * x) + a10 * (2 * x)) >> 5); - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint32_t div31rb(uint16_t val, uint8_t factor) - { - uint32_t val32 = (val & 0xF81F) * (factor >> 3); - return ((val32 + 0x0801 + ((val32 >> 5) & 0xF81F)) >> 5) & 0xF81F; - } - - FORCE_INLINE_FUNCTION static uint32_t div31g(uint16_t val, uint8_t factor) - { - uint32_t val32 = (val & 0x07E0) * factor; - return ((val32 + 0x0020 + (val32 >> 8)) >> 8) & 0x07E0; - } - - FORCE_INLINE_FUNCTION static uint32_t div255_565(uint16_t val, uint8_t factor) - { - return div31rb(val, factor) | div31g(val, factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_565_FFcheck(uint16_t val, uint8_t factor) - { - return factor < 0xFF ? div31rb(val, factor) | div31g(val, factor) : val; - } - - class DrawTextureMapScanLineBase16 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint16_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint16_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const alphaBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const alphaBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t a) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapStride, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapStride, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD16BPP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp deleted file mode 100644 index 57a6c27..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD16bppSerialFlash.hpp +++ /dev/null @@ -1,819 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD16bppSerialFlash.hpp - * - * Declares the touchgfx::LCD16bppSerialFlash class. - */ -#ifndef TOUCHGFX_LCD16BPPSERIALFLASH_HPP -#define TOUCHGFX_LCD16BPPSERIALFLASH_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD16bppSerialFlash : public LCD -{ -public: - /** - * Creates a LCD16bppSerialFlash object. The FlashDataReader object is used to fetch - * data from the external flash. - * - * @param [in] flashReader Reference to a FlashDataReader object. - */ - LCD16bppSerialFlash(FlashDataReader& flashReader); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 16; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::RGB565; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH * 2; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param red Value of the red part (0-255). - * @param green Value of the green part (0-255). - * @param blue Value of the blue part (0-255). - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint16_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return ((red << 8) & 0xF800) | ((green << 3) & 0x07E0) | ((blue >> 3) & 0x001F); - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint16_t getNativeColor(colortype color) - { - return ((color >> 8) & 0xF800) | ((color >> 5) & 0x07E0) | ((color >> 3) & 0x001F); - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB565_BilinearInterpolation, - * enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_BilinearInterpolation - */ - void enableTextureMapperL8_RGB565_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation and NearestNeighbor algorithms. - * - * @see enableTextureMapperL8_RGB888_BilinearInterpolation, - * enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_BilinearInterpolation - */ - void enableTextureMapperL8_RGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_ARGB8888_BilinearInterpolation, - * enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_BilinearInterpolation - */ - void enableTextureMapperL8_ARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB565 image format. This allows drawing RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperRGB565_Opaque_BilinearInterpolation, - * enableTextureMapperRGB565_Opaque_NearestNeighbor, - * enableTextureMapperRGB565_NonOpaque_BilinearInterpolation, - * enableTextureMapperRGB565_NonOpaque_NearestNeighbor - */ - void enableTextureMapperRGB565(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_Opaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_NonOpaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_Opaque_NearestNeighbor(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565 - */ - void enableTextureMapperRGB565_NonOpaque_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - FlashDataReader& flashReader; ///< Flash reader. Used by routines to read pixel data from the flash. - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32 bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D source-array to the framebuffer never performing alpha-blending per pixel as - * because it is assumed that all pixels in the bitmap are solid (i.e. alpha for each pixel is - * 255). - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32 bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - */ - void blitCopyARGB8888Solid(const uint32_t* sourceData, const Rect& source, const Rect& blitRect); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified. - * If ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 24 bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if indexed format is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (ARGB8888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - void blitCopyL8_ARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB565 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 16- - * bits (RGB565) format. If the source have per pixel alpha - * channel, then alpha channel data will be following the clut - * entries data. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - void blitCopyL8_RGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_NoGA; - - FORCE_INLINE_FUNCTION static uint32_t expandRgb565(uint16_t c) - { - return ((c & 0x07E0) << 16) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t compactRgb565(uint32_t c) - { - return ((c >> 16) & 0x07E0) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint16_t c01, uint16_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - uint32_t a01 = expandRgb565(c01); - uint32_t a11 = expandRgb565(c11); - - uint8_t xy = (x * y) >> 3; - return compactRgb565((a00 * (32 - 2 * y - 2 * x + xy) + a10 * (2 * x - xy) + a01 * (2 * y - xy) + a11 * xy) >> 5); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint8_t x) - { - assert(x < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - - return compactRgb565((a00 * (32 - 2 * x) + a10 * (2 * x)) >> 5); - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint32_t div31rb(uint16_t val, uint8_t factor) - { - uint32_t val32 = (val & 0xF81F) * (factor >> 3); - return ((val32 + 0x0801 + ((val32 >> 5) & 0xF81F)) >> 5) & 0xF81F; - } - - FORCE_INLINE_FUNCTION static uint32_t div31g(uint16_t val, uint8_t factor) - { - uint32_t val32 = (val & 0x07E0) * factor; - return ((val32 + 0x0020 + (val32 >> 8)) >> 8) & 0x07E0; - } - - FORCE_INLINE_FUNCTION static uint32_t div255_565(uint16_t val, uint8_t factor) - { - return div31rb(val, factor) | div31g(val, factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_565_FFcheck(uint16_t val, uint8_t factor) - { - return factor < 0xFF ? div31rb(val, factor) | div31g(val, factor) : val; - } - - class DrawTextureMapScanLineBase16 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint16_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint16_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t* const alphaBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint8_t* const alphaBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint8_t a) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapWidth, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase16 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destBits, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapWidth, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint16_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD16BPPSERIALFLASH_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp deleted file mode 100644 index 146a60b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD1bpp.hpp +++ /dev/null @@ -1,291 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD1bpp.hpp - * - * Declares the touchfgx::LCD1bpp class. - */ -#ifndef TOUCHGFX_LCD1BPP_HPP -#define TOUCHGFX_LCD1BPP_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -struct GlyphNode; - -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 1 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD1bpp : public LCD -{ -public: - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 1; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::BW; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return (HAL::FRAME_BUFFER_WIDTH + 7) / 8; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param red Value of the red part (0-255). - * @param green Value of the green part (0-255). - * @param blue Value of the blue part (0-255). - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - // Find the GRAY value (http://en.wikipedia.org/wiki/Luma_%28video%29) rounded to nearest integer - return (red * 54 + green * 183 + blue * 19) >> 15; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return getNativeColorFromRGB(Color::getRed(color), Color::getGreen(color), Color::getBlue(color)); - } - - /** - * Enables the texture mappers for all image formats. Currently texture mapping is not - * supported on 1bpp displays, so this function does not do anything. It is merely - * included to allow function enableTextureMapperAll() to be called on any subclass of - * LCD. - */ - void enableTextureMapperAll() const; - -protected: - virtual void drawTextureMapScanLine(const DrawingSurface& /*dest*/, const Gradients& /*gradients*/, const Edge* /*leftEdge*/, const Edge* /*rightEdge*/, const TextureSurface& /*texture*/, const Rect& /*absoluteRect*/, const Rect& /*dirtyAreaAbsolute*/, RenderingVariant /*renderVariant*/, uint8_t /*alpha*/, uint16_t /*subDivisionSize*/) - { - assert(false && "Texture mapping not supported for 1bpp"); - } - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Fill memory efficiently. Try to get 32bit aligned or 16bit aligned and then copy as - * quickly as possible. - * - * @param [out] dst Pointer to memory to fill. - * @param color Color to write to memory, either 0 => 0x00000000 or 1 => - * 0xFFFFFFFF. - * @param bytesToFill Number of bytes to fill. - */ - static void fillMemory(void* RESTRICT dst, colortype color, uint16_t bytesToFill); - - /** - * Blits a run-length encoded2D source-array to the framebuffer if alpha > zero. - * - * @param _sourceData The source-array pointer (points to the beginning of the data). Data - * stored in RLE format, where each byte indicates number of - * pixels with certain color, alternating between black and - * white. First byte represents black. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending (0 = invisible, otherwise solid). - */ - virtual void blitCopyRLE(const uint16_t* _sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Copies a rectangular area from the framebuffer til a givene memory address, which is - * typically in the animation storage or a dynamic bitmap. - * - * @param srcAddress Source address (byte address). - * @param srcStride Source stride (number of bytes to advance to next line). - * @param srcPixelOffset Source pixel offset (first pixel in first source byte). - * @param [in] dstAddress If destination address (byte address). - * @param dstStride Destination stride (number of bytes to advance to next line). - * @param dstPixelOffset Destination pixel offset (first pixel in destination byte). - * @param width The width of area (in pixels). - * @param height The height of area (in pixels). - */ - void copyRect(const uint8_t* srcAddress, int16_t srcStride, uint8_t srcPixelOffset, uint8_t* RESTRICT dstAddress, int16_t dstStride, uint8_t dstPixelOffset, int16_t width, int16_t height) const; - -private: - class bwRLEdata - { - public: - bwRLEdata(const uint8_t* src = 0) - : data(src), thisHalfByte(0), nextHalfByte(0), rleByte(0), firstHalfByte(true), color(0), length(0) - { - init(src); - } - - void init(const uint8_t* src) - { - data = src; - rleByte = 0; - firstHalfByte = true; - color = ~0; // Will be flipped to 0 by first call to getNextLength() below - if (src) - { - // Read two half-bytes ahead - thisHalfByte = getNextHalfByte(); - nextHalfByte = getNextHalfByte(); - getNextLength(); - } - } - - void skipNext(int32_t skip) - { - for (;;) - { - if (length > skip) // Is the current length enough? - { - length -= skip; // Reduce the length - skip = 0; // No more to skip - break; // Done! - } - else - { - skip -= length; // Skip the entire run - getNextLength(); // Swap colors and Read length of next run - } - } - } - - uint8_t getColor() const - { - return color; - } - - int32_t getLength() const - { - return length; - } - - private: - void getNextLength() - { - length = thisHalfByte; // Length is the next byte - // Update read ahead buffer - thisHalfByte = nextHalfByte; - nextHalfByte = getNextHalfByte(); - color = ~color; // Update the color of next run - // If number after 'length' is 0 - while (thisHalfByte == 0) - { - length <<= 4; // Multiply length by 16 and - length += nextHalfByte; // add the number after 0 - // We have used the next two half bytes, read two new ones - thisHalfByte = getNextHalfByte(); - nextHalfByte = getNextHalfByte(); - } - if (length == 0) - { - getNextLength(); - } - } - - uint8_t getNextHalfByte() - { - if (firstHalfByte) // Start of new byte, read data from BW_RLE stream - { - assert(data); - rleByte = *data++; - } - uint8_t len = rleByte & 0xF; // Read lower half - rleByte >>= 4; // Shift upper half down to make it ready - firstHalfByte = !firstHalfByte; // Toggle 'start of byte' - return len; - } - - const uint8_t* data; // Pointer to compressed data (BW_RLE) - uint8_t thisHalfByte; // The next half byte from the input - uint8_t nextHalfByte; // The next half byte after 'thisHalfByte' - uint8_t rleByte; // Byte read from compressed data - bool firstHalfByte; // Are we about to process first half byte of rleByte? - uint8_t color; // Current color - int32_t length; // Number of pixels with the given color - }; - - friend class PainterBWBitmap; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD1BPP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp deleted file mode 100644 index f0c7504..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp +++ /dev/null @@ -1,587 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD24bpp.hpp - * - * Declares the touchgfx::LCD24bpp class. - */ -#ifndef TOUCHGFX_LCD24BPP_HPP -#define TOUCHGFX_LCD24BPP_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD24bpp : public LCD -{ -public: - LCD24bpp(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 24; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::RGB888; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH * 3; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB888_BilinearInterpolation, - * enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_BilinearInterpolation - */ - void enableTextureMapperL8_RGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_ARGB8888_BilinearInterpolation, - * enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_BilinearInterpolation - */ - void enableTextureMapperL8_ARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperRGB888_BilinearInterpolation, - * enableTextureMapperRGB888_NearestNeighbor - */ - void enableTextureMapperRGB888(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB888, enableTextureMapperRGB888_NearestNeighbor - */ - void enableTextureMapperRGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB888, enableTextureMapperRGB888_BilinearInterpolation - */ - void enableTextureMapperRGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blits a 2D source-array to the framebuffer. Per pixel alpha is not supported, only - * global alpha. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 16- bits RGB565 values. - * @param source The location and dimension of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyRGB565(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified if ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32- bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if indexed format is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (ARGB8888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_ARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (RGB888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_NoGA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - return (c00 * (16 - x) + c10 * x) >> 4; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint8_t x) - { - assert(x < 16); - const uint16_t xy00 = 16 - x; - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * x) >> 4) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * x) >> 4) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - class DrawTextureMapScanLineBase24 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const uint8_t* const palette, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const uint8_t* const palette, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const uint8_t* const palette, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const uint8_t* const palette, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t a4) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase24 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD24BPP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp deleted file mode 100644 index 697f2bf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD2bpp.hpp +++ /dev/null @@ -1,368 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD2bpp.hpp - * - * Declares the touchgfx::LCD2bpp class. - */ -#ifndef TOUCHGFX_LCD2BPP_HPP -#define TOUCHGFX_LCD2BPP_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -#define USE_LSB - -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 2 bits per pixel gray scale displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD2bpp : public LCD -{ -public: - LCD2bpp(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 2; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::GRAY2; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return (HAL::FRAME_BUFFER_WIDTH + 3) / 4; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param red Value of the red part (0-255). - * @param green Value of the green part (0-255). - * @param blue Value of the blue part (0-255). - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - // Find the GRAY value (http://en.wikipedia.org/wiki/Luma_%28video%29) rounded to nearest integer - return (red * 54 + green * 183 + blue * 19) >> 14; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return getNativeColorFromRGB(Color::getRed(color), Color::getGreen(color), Color::getBlue(color)); - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for GRAY2 image format. This allows drawing GRAY2 images - * using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperGRAY2_BilinearInterpolation, - * enableTextureMapperGRAY2_NearestNeighbor - */ - void enableTextureMapperGRAY2(); - - /** - * Enables the texture mappers for GRAY2 image format. This allows drawing GRAY2 images - * using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperGRAY2, enableTextureMapperGRAY2_NearestNeighbor - */ - void enableTextureMapperGRAY2_BilinearInterpolation(); - - /** - * Enables the texture mappers for GRAY2 image format. This allows drawing GRAY2 images - * using Nearest Neighbor algorithm. - * - * @see enableTextureMapperGRAY2, enableTextureMapperGRAY2_BilinearInterpolation - */ - void enableTextureMapperGRAY2_NearestNeighbor(); - - /** - * Shift value to get the right pixel in a byte. - * - * @param offset The offset. - * - * @return The shift value. - */ - FORCE_INLINE_FUNCTION static int shiftVal(int offset) - { -#ifdef USE_LSB - return (offset & 3) << 1; -#else - return (3 - (offset & 3)) << 1; -#endif - } - - /** - * Get pixel from buffer/image. - * - * @param addr The address. - * @param offset The offset. - * - * @return The pixel value. - */ - FORCE_INLINE_FUNCTION static uint8_t getPixel(const uint8_t* addr, int offset) - { - return (addr[offset >> 2] >> shiftVal(offset)) & 3; - } - - /** - * Get pixel from buffer/image. - * - * @param addr The address. - * @param offset The offset. - * - * @return The pixel value. - */ - FORCE_INLINE_FUNCTION static uint8_t getPixel(const uint16_t* addr, int offset) - { - return getPixel(reinterpret_cast(addr), offset); - } - - /** - * Set pixel in buffer. - * - * @param [in] addr The address. - * @param offset The offset. - * @param value The value. - */ - FORCE_INLINE_FUNCTION static void setPixel(uint8_t* addr, int offset, uint8_t value) - { - int shift = shiftVal(offset); - addr[offset >> 2] = (addr[offset >> 2] & ~(3 << shift)) | ((value & 3) << shift); - } - - /** - * Set pixel in buffer. - * - * @param [in] addr The address. - * @param offset The offset. - * @param value The value. - */ - FORCE_INLINE_FUNCTION static void setPixel(uint16_t* addr, int offset, uint8_t value) - { - setPixel(reinterpret_cast(addr), offset, value); - } - -protected: - static const uint8_t alphaBlend[16][4][4]; ///< The alpha lookup table to avoid arithmetics when alpha blending - - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified Performs always a software blend. - * - * @param sourceData16 The source-array pointer (points to the beginning of the - * data). The sourceData must be stored as 2bpp GRAY2 values. - * @param sourceAlphaData The alpha channel array pointer (points to the beginning of - * the data) - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole - * image (255 = solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const uint8_t* sourceAlphaData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Copies a rectangular area. - * - * @param srcAddress Source address (byte address). - * @param srcStride Source stride (number of bytes to advance to next line). - * @param srcPixelOffset Source pixel offset (first pixel in first source byte). - * @param [in] dstAddress If destination address (byte address). - * @param dstStride Destination stride (number of bytes to advance to next line). - * @param dstPixelOffset Destination pixel offset (first pixel in destination byte). - * @param width The width of area (in pixels). - * @param height The height of area (in pixels). - */ - void copyRect(const uint8_t* srcAddress, uint16_t srcStride, uint8_t srcPixelOffset, uint8_t* RESTRICT dstAddress, uint16_t dstStride, uint8_t dstPixelOffset, uint16_t width, uint16_t height) const; - -private: - DrawTextureMapScanLineBase* textureMapper_GRAY2_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_GRAY2_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_GRAY2_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_GRAY2_Opaque_BilinearInterpolation_GA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t div255_2(uint16_t value) - { - return div255(value * 0x55) >> 6; - } - - class DrawTextureMapScanLineBase2 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint32_t& destOffset, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint32_t& destOffset, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_GRAY2_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase2 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_GRAY2_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase2 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_GRAY2_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase2 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_GRAY2_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase2 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase2 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destAddress, const uint32_t destOffset, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase2 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint32_t offset, const int16_t bitmapStride, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD2BPP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp deleted file mode 100644 index 3b351ee..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp.hpp +++ /dev/null @@ -1,904 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD32bpp.hpp - * - * Declares the touchgfx::LCD32bpp class. - */ -#ifndef TOUCHGFX_LCD32BPP_HPP -#define TOUCHGFX_LCD32BPP_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -struct GlyphNode; - -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD32bpp : public LCD -{ -public: - LCD32bpp(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 32; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::ARGB8888; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH * 4; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB565_BilinearInterpolation, - * enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_BilinearInterpolation - */ - void enableTextureMapperL8_RGB565_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB888_BilinearInterpolation, - * enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_BilinearInterpolation - */ - void enableTextureMapperL8_RGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_ARGB8888_BilinearInterpolation, - * enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_BilinearInterpolation - */ - void enableTextureMapperL8_ARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB565 image format. This allows drawing RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - */ - void enableTextureMapperRGB565(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_NonOpaque_BilinearInterpolation - */ - void enableTextureMapperRGB565_Opaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_Opaque_BilinearInterpolation - */ - void enableTextureMapperRGB565_NonOpaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_NonOpaque_NearestNeighbor - */ - void enableTextureMapperRGB565_Opaque_NearestNeighbor(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_Opaque_NearestNeighbor - */ - void enableTextureMapperRGB565_NonOpaque_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperRGB888_BilinearInterpolation, - * enableTextureMapperRGB888_NearestNeighbor - */ - void enableTextureMapperRGB888(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB888, enableTextureMapperRGB888_NearestNeighbor - */ - void enableTextureMapperRGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB888, enableTextureMapperRGB888_BilinearInterpolation - */ - void enableTextureMapperRGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified. If RGB888 is not supported by the DMA a software blend is performed. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 24- bits RGB888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyRGB888(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified. If! RGB565 is not supported by the DMA a software blend is performed. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 16- bits RGB565 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyRGB565(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if indexed format is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (ARGB8888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_ARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (RGB888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB565 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 16- - * bits (RGB565) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_NoGA; - - FORCE_INLINE_FUNCTION static uint32_t expandRgb565(uint16_t c) - { - return ((c & 0x07E0) << 16) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t compactRgb565(uint32_t c) - { - return ((c >> 16) & 0x07E0) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint32_t convertRgb565toArgb8888(uint16_t rgb565) - { - uint8_t r = (rgb565 & 0xF800) >> 8; - r |= r >> 5; - uint8_t g = (rgb565 & 0x07E0) >> 3; - g |= g >> 6; - uint8_t b = rgb565 << 3; - b |= b >> 5; - return (r << 16) | (g << 8) | b; - } - - FORCE_INLINE_FUNCTION static void copy888(const uint8_t* const rgb888, uint8_t* const destBits) - { - destBits[0] = rgb888[0]; - destBits[1] = rgb888[1]; - destBits[2] = rgb888[2]; - } - - FORCE_INLINE_FUNCTION static uint8_t cap_byte_value(int value) - { - return (value > 255) ? (255) : (value >= 0 ? value : 0); - } - - FORCE_INLINE_FUNCTION static void alphaBlend888_premul(const uint8_t redFg, const uint8_t greenFg, const uint8_t blueFg, const uint8_t alpha, const uint8_t alphaFg, uint8_t* const destBits) - { - if (alphaFg == 255) - { - destBits[0] = blueFg; - destBits[1] = greenFg; - destBits[2] = redFg; - destBits[3] = 255; - } - else if (alphaFg > 0) - { - const uint8_t alphaBg = destBits[3]; - const uint8_t alphaMult = LCD::div255(alphaFg * alphaBg); - const uint8_t alphaOut = alphaFg + alphaBg - alphaMult; - - const uint8_t blueBg = destBits[0]; - destBits[0] = cap_byte_value((blueFg * alpha + blueBg * (alphaBg - alphaMult)) / alphaOut); - const uint8_t greenBg = destBits[1]; - destBits[1] = cap_byte_value((greenFg * alpha + greenBg * (alphaBg - alphaMult)) / alphaOut); - const uint8_t redBg = destBits[2]; - destBits[2] = cap_byte_value((redFg * alpha + redBg * (alphaBg - alphaMult)) / alphaOut); - destBits[3] = alphaOut; - } - } - - FORCE_INLINE_FUNCTION static void alphaBlend888_premul(const uint8_t* const rgb888, const uint8_t alpha, const uint8_t alphaFg, uint8_t* const destBits) - { - alphaBlend888_premul(rgb888[2], rgb888[1], rgb888[0], alpha, alphaFg, destBits); - } - - FORCE_INLINE_FUNCTION static void alphaBlend888(const uint8_t redFg, const uint8_t greenFg, const uint8_t blueFg, const uint8_t alphaFg, uint8_t* const destBits) - { - if (alphaFg == 255) - { - destBits[0] = blueFg; - destBits[1] = greenFg; - destBits[2] = redFg; - destBits[3] = 0xFF; - } - else if (alphaFg > 0) - { - const uint8_t alphaBg = destBits[3]; - const uint8_t alphaMult = LCD::div255(alphaFg * alphaBg); - const uint8_t alphaOut = alphaFg + alphaBg - alphaMult; - - const uint8_t blueBg = destBits[0]; - destBits[0] = (blueFg * alphaFg + blueBg * (alphaBg - alphaMult)) / alphaOut; - const uint8_t greenBg = destBits[1]; - destBits[1] = (greenFg * alphaFg + greenBg * (alphaBg - alphaMult)) / alphaOut; - const uint8_t redBg = destBits[2]; - destBits[2] = (redFg * alphaFg + redBg * (alphaBg - alphaMult)) / alphaOut; - destBits[3] = alphaOut; - } - } - - FORCE_INLINE_FUNCTION static void alphaBlend888(const uint8_t* const rgb888, const uint8_t alphaFg, uint8_t* const destBits) - { - alphaBlend888(rgb888[2], rgb888[1], rgb888[0], alphaFg, destBits); - } - - FORCE_INLINE_FUNCTION static void alphaBlend565_premul(const uint16_t rgb565, const uint8_t alpha, const uint8_t alphaFg, uint8_t* const destBits) - { - alphaBlend888_premul(Color::getRedFromRGB565(rgb565), Color::getGreenFromRGB565(rgb565), Color::getBlueFromRGB565(rgb565), alpha, alphaFg, destBits); - } - - FORCE_INLINE_FUNCTION static void alphaBlend565(const uint16_t rgb565, const uint8_t alphaFg, uint8_t* const destBits) - { - alphaBlend888(Color::getRedFromRGB565(rgb565), Color::getGreenFromRGB565(rgb565), Color::getBlueFromRGB565(rgb565), alphaFg, destBits); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint16_t c01, uint16_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - uint32_t a01 = expandRgb565(c01); - uint32_t a11 = expandRgb565(c11); - - uint8_t xy = (x * y) >> 3; - return compactRgb565((a00 * (32 - 2 * y - 2 * x + xy) + a10 * (2 * x - xy) + a01 * (2 * y - xy) + a11 * xy) >> 5); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint8_t x) - { - assert(x < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - - return compactRgb565((a00 * (32 - 2 * x) + a10 * (2 * x)) >> 5); - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint32_t div31rb(uint16_t val, uint8_t factor) - { - uint32_t val32 = (val & 0xF81F) * (factor >> 3); - return ((val32 + 0x0801 + ((val32 >> 5) & 0xF81F)) >> 5) & 0xF81F; - } - - FORCE_INLINE_FUNCTION static uint32_t div31g(uint16_t val, uint8_t factor) - { - uint32_t val32 = (val & 0x07E0) * factor; - return ((val32 + 0x0020 + (val32 >> 8)) >> 8) & 0x07E0; - } - - FORCE_INLINE_FUNCTION static uint32_t div255_565(uint16_t val, uint8_t factor) - { - return div31rb(val, factor) | div31g(val, factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_565_FFcheck(uint16_t val, uint8_t factor) - { - return factor < 0xFF ? div31rb(val, factor) | div31g(val, factor) : val; - } - - class DrawTextureMapScanLineBase32 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint32_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint32_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t a4) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD32BPP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp deleted file mode 100644 index 487bba6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD32bpp_XRGB8888.hpp +++ /dev/null @@ -1,891 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD32bpp_XRGB8888.hpp - * - * Declares the touchgfx::LCD32bpp_XRGB8888 and touchgfx::LCD32DebugPrinter classes. - */ -#ifndef TOUCHGFX_LCD32BPP_XRGB8888_HPP -#define TOUCHGFX_LCD32BPP_XRGB8888_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD32bpp_XRGB8888 : public LCD -{ -public: - LCD32bpp_XRGB8888(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 32; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::ARGB8888; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - virtual bool supportDynamicBitmapDrawing(const Bitmap::BitmapFormat /*format*/) - { - // DynamicBitmap drawing is not supported by LCD32XRGB - return false; - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH * 4; - } - - /** - * Gets blue from color. - * - * @param color The color. - * - * @return The blue from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getBlueFromColor(colortype color) - { - return color & 0xFF; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB565_BilinearInterpolation, - * enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_NearestNeighbor - */ - void enableTextureMapperL8_RGB565_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB565 image format. This allows drawing L8_RGB565 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB565, enableTextureMapperL8_RGB565_BilinearInterpolation - */ - void enableTextureMapperL8_RGB565_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_RGB888_BilinearInterpolation, - * enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_NearestNeighbor - */ - void enableTextureMapperL8_RGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_RGB888 image format. This allows drawing L8_RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_RGB888, enableTextureMapperL8_RGB888_BilinearInterpolation - */ - void enableTextureMapperL8_RGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperL8_ARGB8888_BilinearInterpolation, - * enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_NearestNeighbor - */ - void enableTextureMapperL8_ARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for L8_ARGB8888 image format. This allows drawing - * L8_ARGB8888 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperL8_ARGB8888, enableTextureMapperL8_ARGB8888_BilinearInterpolation - */ - void enableTextureMapperL8_ARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB565 image format. This allows drawing RGB565 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - */ - void enableTextureMapperRGB565(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_NonOpaque_BilinearInterpolation - */ - void enableTextureMapperRGB565_Opaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_Opaque_BilinearInterpolation - */ - void enableTextureMapperRGB565_NonOpaque_BilinearInterpolation(); - - /** - * Enables the texture mappers for Opaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_NonOpaque_NearestNeighbor - */ - void enableTextureMapperRGB565_Opaque_NearestNeighbor(); - - /** - * Enables the texture mappers for NonOpaque RGB565 image format. This allows drawing - * RGB565 images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB565, enableTextureMapperRGB565_Opaque_NearestNeighbor - */ - void enableTextureMapperRGB565_NonOpaque_NearestNeighbor(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperRGB888_BilinearInterpolation, - * enableTextureMapperRGB888_NearestNeighbor - */ - void enableTextureMapperRGB888(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGB888, enableTextureMapperRGB888_NearestNeighbor - */ - void enableTextureMapperRGB888_BilinearInterpolation(); - - /** - * Enables the texture mappers for RGB888 image format. This allows drawing RGB888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGB888, enableTextureMapperRGB888_BilinearInterpolation - */ - void enableTextureMapperRGB888_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - - /** - * Copies the 24bit color (blue, green, red) to the given 32bit destination, setting alpha to - * zero. - * - * @param rgb888 A pointer to the three bytes. - * - * @return The 24bit RGB888 converted to a 32bit color value with zero alpha. - */ - FORCE_INLINE_FUNCTION static uint32_t rgb888toXrgb8888(const uint8_t* const rgb888) - { - return (rgb888[2] << 16) | (rgb888[1] << 8) | rgb888[0]; - } - - /** - * Alpha blend R,G,B with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for R, - * G,B) and bgAlpha (for bgXRGB8888). The resulting color is returned. address. - * - * @param fgR The foreground blue. - * @param fgG The foreground green. - * @param fgB The foreground blue. - * @param bgXRGB8888 The background 32bit color. - * @param fgAlpha The foreground alpha. - * @param bgAlpha The background alpha. - * - * @return The blended value. - */ - FORCE_INLINE_FUNCTION static uint32_t blendRGBwithXrgb8888(const uint8_t fgR, const uint8_t fgG, const uint8_t fgB, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha) - { - const uint8_t b = div255(fgB * fgAlpha + (bgXRGB8888 & 0xFF) * bgAlpha); - const uint8_t g = div255(fgG * fgAlpha + ((bgXRGB8888 >> 8) & 0xFF) * bgAlpha); - const uint8_t r = div255(fgR * fgAlpha + ((bgXRGB8888 >> 16) & 0xFF) * bgAlpha); - return (r << 16) | (g << 8) | b; - } - - /** - * Alpha blend two 32bit colors using the provided fgAlpha (for fgXRGB8888) and bgAlpha (for - * bgXRGB8888). The resulting color is returned. - * - * @param fgXRGB8888 The foreground 32bit color. - * @param bgXRGB8888 The background 32bit color. - * @param fgAlpha The foreground alpha. - * @param bgAlpha The background alpha. - * - * @return The blended value. - */ - FORCE_INLINE_FUNCTION static uint32_t blendXrgb888withXrgb8888(const uint32_t fgXRGB8888, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha) - { - return blendRgb888withXrgb8888(reinterpret_cast(&fgXRGB8888), bgXRGB8888, fgAlpha, bgAlpha); - } - - /** - * Alpha blend a 24bit RGB888 with the 32bit color given in bgXRGB8888 using the provided - * fgAlpha (for fgRGB888) and bgAlpha (for bgXRGB8888). The resulting color is returned. address. - * - * @param fgRGB888 A pointer to the foreground 24bit RGB. - * @param bgXRGB8888 The background 32bit color. - * @param fgAlpha The foreground alpha. - * @param bgAlpha The background alpha. - * - * @return The blended value. - */ - FORCE_INLINE_FUNCTION static uint32_t blendRgb888withXrgb8888(const uint8_t* const fgRGB888, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha) - { - return blendRGBwithXrgb8888(fgRGB888[2], fgRGB888[1], fgRGB888[0], bgXRGB8888, fgAlpha, bgAlpha); - } - - /** - * Alpha blend a 16bit RGB565 color with the 32bit color given in bgXRGB8888 using the provided - * fgAlpha (for fgRGB565) and bgAlpha (for bgXRGB8888). The resulting color is returned. address. - * - * @param fgRGB565 A pointer to the foreground 24bit RGB. - * @param bgXRGB8888 The background 32bit color. - * @param fgAlpha The foreground alpha. - * @param bgAlpha The background alpha. - * - * @return The blended value. - */ - FORCE_INLINE_FUNCTION static uint32_t blendRgb565withXrgb8888(const uint16_t fgRGB565, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha) - { - const uint8_t r = (fgRGB565 & 0xF800) >> 8; - const uint8_t g = (fgRGB565 & 0x07E0) >> 3; - const uint8_t b = fgRGB565 << 3; - // return blendRGBwithXrgb8888(r, g, b, bgXRGB8888, fgAlpha, bgAlpha); - return blendRGBwithXrgb8888(r | (r >> 5), g | (g >> 6), b | (b >> 5), bgXRGB8888, fgAlpha, bgAlpha); - } - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified. If RGB888 is not supported by the DMA a software blend is performed. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 24- bits RGB888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyRGB888(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified. If! RGB565 is not supported by the DMA a software blend is performed. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 16- bits RGB565 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyRGB565(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if indexed format is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (ARGB8888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_ARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB888 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 32- - * bits (RGB888) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per - * pixel as specified if L8_RGB565 is not supported by the DMA a software blend is - * performed. - * - * @param sourceData The source-indexes pointer (points to the beginning of the data). The - * sourceData must be stored as 8- bits indexes. - * @param clutData The source-clut pointer (points to the beginning of the CLUT color - * format and size data followed by colors entries stored as 16- - * bits (RGB565) format. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyL8_RGB565(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB565_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGB888_Opaque_BilinearInterpolation_NoGA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_NoGA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_NoGA; - - FORCE_INLINE_FUNCTION static uint32_t expandRgb565(uint16_t c) - { - return ((c & 0x07E0) << 16) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t compactRgb565(uint32_t c) - { - return ((c >> 16) & 0x07E0) | (c & ~0x07E0); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint16_t c01, uint16_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - uint32_t a01 = expandRgb565(c01); - uint32_t a11 = expandRgb565(c11); - - uint8_t xy = (x * y) >> 3; - return compactRgb565((a00 * (32 - 2 * y - 2 * x + xy) + a10 * (2 * x - xy) + a01 * (2 * y - xy) + a11 * xy) >> 5); - } - - FORCE_INLINE_FUNCTION static uint16_t bilinearInterpolate565(uint16_t c00, uint16_t c10, uint8_t x) - { - assert(x < 16); - uint32_t a00 = expandRgb565(c00); - uint32_t a10 = expandRgb565(c10); - - return compactRgb565((a00 * (32 - 2 * x) + a10 * (2 * x)) >> 5); - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - class DrawTextureMapScanLineBase32 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint32_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint32_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint16_t* const palette16, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_L8_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint8_t* const palette8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_L8_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const uint32_t* const palette32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_NonOpaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const uint8_t* alphaBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB565_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_RGB888_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGB888_Opaque_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt) const; - }; - - class TextureMapper_RGB888_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGB888_Opaque_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint8_t* const textureBits8, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint8_t a4) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_NoGA : public DrawTextureMapScanLineBase32 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - void writePixelOnEdge(uint32_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD32BPP_XRGB8888_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp deleted file mode 100644 index ddf2e0c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD4bpp.hpp +++ /dev/null @@ -1,393 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD4bpp.hpp - * - * Declares the touchgfx::LCD4bpp class. - */ -#ifndef TOUCHGFX_LCD4BPP_HPP -#define TOUCHGFX_LCD4BPP_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -#define USE_LSB - -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 4 bits per pixel grayscale displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD4bpp : public LCD -{ -public: - LCD4bpp(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 4; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::GRAY4; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - virtual void setDefaultColor(colortype color) - { - LCD::setDefaultColor(color); - defaultColor4 = getNativeColor(color); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return (HAL::FRAME_BUFFER_WIDTH + 1) / 2; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param red Value of the red part (0-255). - * @param green Value of the green part (0-255). - * @param blue Value of the blue part (0-255). - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - // Find the GRAY value (http://en.wikipedia.org/wiki/Luma_%28video%29) rounded to nearest integer - return (red * 54 + green * 183 + blue * 19) >> 12; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return getNativeColorFromRGB(Color::getRed(color), Color::getGreen(color), Color::getBlue(color)); - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for GRAY4 image format. This allows drawing GRAY4 images - * using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperGRAY4_BilinearInterpolation, - * enableTextureMapperGRAY4_NearestNeighbor - */ - void enableTextureMapperGRAY4(); - - /** - * Enables the texture mappers for GRAY4 image format. This allows drawing GRAY4 images - * using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperGRAY4, enableTextureMapperGRAY4_NearestNeighbor - */ - void enableTextureMapperGRAY4_BilinearInterpolation(); - - /** - * Enables the texture mappers for GRAY4 image format. This allows drawing GRAY4 images - * using Nearest Neighbor algorithm. - * - * @see enableTextureMapperGRAY4, enableTextureMapperGRAY4_BilinearInterpolation - */ - void enableTextureMapperGRAY4_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - - /** - * Get pixel from buffer/image. - * - * @param addr The address. - * @param offset The offset. - * - * @return The pixel value. - */ - FORCE_INLINE_FUNCTION static uint8_t getPixel(const uint8_t* addr, int offset) - { - uint8_t data = addr[offset / 2]; -#ifdef USE_LSB - return (offset & 1) ? data >> 4 : data & 0xF; -#else - return (offset & 1) ? data & 0xF : data >> 4; -#endif - } - - /** - * Get pixel from buffer/image. - * - * @param addr The address. - * @param offset The offset. - * - * @return The pixel value. - */ - FORCE_INLINE_FUNCTION static uint8_t getPixel(const uint16_t* addr, int offset) - { - return getPixel(reinterpret_cast(addr), offset); - } - - /** - * Set pixel in buffer. - * - * @param [in] addr The address. - * @param offset The offset. - * @param value The value. - */ - FORCE_INLINE_FUNCTION static void setPixel(uint8_t* addr, int offset, uint8_t value) - { - uint8_t data = addr[offset / 2]; -#ifdef USE_LSB - addr[offset / 2] = (offset & 1) ? (data & 0x0F) | (value << 4) : (data & 0xF0) | value; -#else - addr[offset / 2] = (offset & 1) ? (data & 0xF0) | value : (data & 0x0F) | (value << 4); -#endif - } - - /** - * Set pixel in buffer. - * - * @param [in] addr The address. - * @param offset The offset. - * @param value The value. - */ - FORCE_INLINE_FUNCTION static void setPixel(uint16_t* addr, int offset, uint8_t value) - { - setPixel(reinterpret_cast(addr), offset, value); - } - -protected: - static uint8_t defaultColor4; ///< Default Color to use when displaying transparency-only elements, e.g. A4 bitmaps - - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified Performs always a software blend. - * - * @param sourceData16 The source-array pointer (points to the beginning of the - * data). The sourceData must be stored as 4bpp GRAY4 values. - * @param sourceAlphaData The alpha channel array pointer (points to the beginning of - * the data) - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole - * image (255 = solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const uint8_t* sourceAlphaData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Copies a rectangular area. - * - * @param srcAddress Source address (byte address). - * @param srcStride Source stride (number of bytes to advance to next line). - * @param srcPixelOffset Source pixel offset (first pixel in first source byte). - * @param [in] dstAddress If destination address (byte address). - * @param dstStride Destination stride (number of bytes to advance to next line). - * @param dstPixelOffset Destination pixel offset (first pixel in destination byte). - * @param width The width of area (in pixels). - * @param height The height of area (in pixels). - */ - void copyRect(const uint8_t* srcAddress, uint16_t srcStride, uint8_t srcPixelOffset, uint8_t* RESTRICT dstAddress, uint16_t dstStride, uint8_t dstPixelOffset, uint16_t width, uint16_t height) const; - -private: - DrawTextureMapScanLineBase* textureMapper_GRAY4_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_GRAY4_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_GRAY4_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_GRAY4_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - uint16_t xy10 = 16 * x; - uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - uint16_t xy11 = x * y; - uint16_t xy10 = 16 * x - xy11; - uint16_t xy01 = 16 * y - xy11; - uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t div255_4(uint16_t value) - { - return div255(value * 0x11) >> 4; - } - - class DrawTextureMapScanLineBase4 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint32_t& destOffset, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint32_t& destOffset, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_GRAY4_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase4 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_GRAY4_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase4 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_GRAY4_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase4 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint8_t* const alphaBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_GRAY4_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase4 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase4 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destAddress, const uint32_t destOffset, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase4 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint16_t* const destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint16_t* const destAddress, const uint32_t destOffset, const uint16_t* const textureBits, const uint16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD4BPP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp deleted file mode 100644 index 69cf329..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ABGR2222.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD8bpp_ABGR2222.hpp - * - * Declares the touchgfx::LCD8bpp_ABGR2222 class. - */ -#ifndef TOUCHGFX_LCD8BPP_ABGR2222_HPP -#define TOUCHGFX_LCD8BPP_ABGR2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD8bpp_ABGR2222 : public LCD -{ -public: - LCD8bpp_ABGR2222(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 8; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::ABGR2222; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH; - } - - /** - * Gets color from RGB. - * - * @param red The red. - * @param green The green. - * @param blue The blue. - * - * @return The color from RGB. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return 0xC0 | ((blue & 0xC0) >> 2) | ((green & 0xC0) >> 4) | ((red & 0xC0) >> 6); - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return 0xC0 | ((color >> 22) & 0x03) | ((color >> 12) & 0x0C) | ((color >> 2) & 0x30); - } - - /** - * Gets red from color. - * - * @param color The color. - * - * @return The red from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getRedFromNativeColor(uint8_t color) - { - return (color & 0x03) * 0x55; - } - - /** - * Gets green from color. - * - * @param color The color. - * - * @return The green from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getGreenFromNativeColor(uint8_t color) - { - return ((color >> 2) & 0x03) * 0x55; - } - - /** - * Gets blue from color. - * - * @param color The color. - * - * @return The blue from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getBlueFromNativeColor(uint8_t color) - { - return ((color >> 4) & 0x03) * 0x55; - } - - /** - * Gets alpha from color. - * - * @param color The color. - * - * @return The alpha from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getAlphaFromNativeColor(uint8_t color) - { - return ((color >> 6) & 0x03) * 0x55; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for ABGR2222 image format. This allows drawing ABGR2222 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperABGR2222_BilinearInterpolation, - * enableTextureMapperABGR2222_NearestNeighbor - */ - void enableTextureMapperABGR2222(); - - /** - * Enables the texture mappers for ABGR2222 image format. This allows drawing ABGR2222 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperABGR2222, enableTextureMapperABGR2222_NearestNeighbor - */ - void enableTextureMapperABGR2222_BilinearInterpolation(); - - /** - * Enables the texture mappers for ABGR2222 image format. This allows drawing ABGR2222 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperABGR2222, enableTextureMapperABGR2222_BilinearInterpolation - */ - void enableTextureMapperABGR2222_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified if ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32- bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified Performs always a software blend. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 8-bits ABGR2222 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_ABGR2222_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ABGR2222_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ABGR2222_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ABGR2222_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - const uint16_t xy10 = 16 * x; - const uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION uint32_t convertABGR2222toARGB8888(colortype col) const - { - return (((col & 0xC0) << 18) | ((col & 0x03) << 16) | ((col & 0x0C) << 6) | ((col & 0x30) >> 4)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint32_t convertABGR2222toRGB888(uint8_t val) - { - return (((val & 0x03) << 16) | ((val & 0x0C) << 6) | ((val & 0x30) >> 4)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint8_t convertRGB888toXBGR2222(uint32_t val) - { - val &= 0xC0C0C0; - return (val >> 2) | (val >> 12) | (val >> 22); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint8_t alphaBlend(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t alpha, const uint8_t fbr, const uint8_t fbg, const uint8_t fbb, const uint8_t ialpha) - { - return getNativeColorFromRGB(div255(r * alpha + fbr * ialpha), div255(g * alpha + fbg * ialpha), div255(b * alpha + fbb * ialpha)); - } - - class DrawTextureMapScanLineBase8 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_ABGR2222_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ABGR2222_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ABGR2222_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ABGR2222_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8BPP_ABGR2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp deleted file mode 100644 index f68748f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_ARGB2222.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD8bpp_ARGB2222.hpp - * - * Declares the touchgfx::LCD8bpp_ARGB2222 class. - */ -#ifndef TOUCHGFX_LCD8BPP_ARGB2222_HPP -#define TOUCHGFX_LCD8BPP_ARGB2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD8bpp_ARGB2222 : public LCD -{ -public: - LCD8bpp_ARGB2222(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 8; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::ARGB2222; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH; - } - - /** - * Gets color from RGB. - * - * @param red The red. - * @param green The green. - * @param blue The blue. - * - * @return The color from RGB. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return 0xC0 | ((red & 0xC0) >> 2) | ((green & 0xC0) >> 4) | ((blue & 0xC0) >> 6); - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return 0xC0 | ((color >> 18) & 0x30) | ((color >> 12) & 0x0C) | ((color >> 6) & 0x03); - } - - /** - * Gets red from color. - * - * @param color The color. - * - * @return The red from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getRedFromNativeColor(uint8_t color) - { - return ((color >> 4) & 0x03) * 0x55; - } - - /** - * Gets green from color. - * - * @param color The color. - * - * @return The green from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getGreenFromNativeColor(uint8_t color) - { - return ((color >> 2) & 0x03) * 0x55; - } - - /** - * Gets blue from color. - * - * @param color The color. - * - * @return The blue from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getBlueFromNativeColor(uint8_t color) - { - return (color & 0x03) * 0x55; - } - - /** - * Gets alpha from color. - * - * @param color The color. - * - * @return The alpha from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getAlphaFromNativeColor(uint8_t color) - { - return ((color >> 6) & 0x03) * 0x55; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for ARGB2222 image format. This allows drawing ARGB2222 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB2222_BilinearInterpolation, - * enableTextureMapperARGB2222_NearestNeighbor - */ - void enableTextureMapperARGB2222(); - - /** - * Enables the texture mappers for ARGB2222 image format. This allows drawing ARGB2222 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB2222, enableTextureMapperARGB2222_NearestNeighbor - */ - void enableTextureMapperARGB2222_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB2222 image format. This allows drawing ARGB2222 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB2222, enableTextureMapperARGB2222_BilinearInterpolation - */ - void enableTextureMapperARGB2222_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified if ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32- bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified Performs always a software blend. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 8-bits ARGB2222 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_ARGB2222_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB2222_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB2222_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB2222_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - const uint16_t xy10 = 16 * x; - const uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION uint32_t convertARGB2222toARGB8888(colortype col) const - { - return (((col & 0xC0) << 18) | ((col & 0x30) << 12) | ((col & 0x0C) << 6) | (col & 0x03)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint32_t convertARGB2222toRGB888(uint8_t val) - { - return (((val & 0x30) << 12) | ((val & 0x0C) << 6) | (val & 0x03)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint8_t convertRGB888toXRGB2222(uint32_t val) - { - val &= 0xC0C0C0; - return (val >> 6) | (val >> 12) | (val >> 18); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint8_t alphaBlend(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t alpha, const uint8_t fbr, const uint8_t fbg, const uint8_t fbb, const uint8_t ialpha) - { - return getNativeColorFromRGB(div255(r * alpha + fbr * ialpha), div255(g * alpha + fbg * ialpha), div255(b * alpha + fbb * ialpha)); - } - - class DrawTextureMapScanLineBase8 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_ARGB2222_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB2222_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB2222_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB2222_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8BPP_ARGB2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp deleted file mode 100644 index df4aafd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_BGRA2222.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD8bpp_BGRA2222.hpp - * - * Declares the touchgfx::LCD8bpp_BGRA2222 class. - */ -#ifndef TOUCHGFX_LCD8BPP_BGRA2222_HPP -#define TOUCHGFX_LCD8BPP_BGRA2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD8bpp_BGRA2222 : public LCD -{ -public: - LCD8bpp_BGRA2222(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 8; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::BGRA2222; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH; - } - - /** - * Gets color from RGB. - * - * @param red The red. - * @param green The green. - * @param blue The blue. - * - * @return The color from RGB. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return (blue & 0xC0) | ((green & 0xC0) >> 2) | ((red & 0xC0) >> 4) | 0x03; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return ((color >> 20) & 0x0C) | ((color >> 10) & 0x30) | (color & 0xC0) | 0x03; - } - - /** - * Gets red from color. - * - * @param color The color. - * - * @return The red from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getRedFromNativeColor(uint8_t color) - { - return ((color >> 2) & 0x03) * 0x55; - } - - /** - * Gets green from color. - * - * @param color The color. - * - * @return The green from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getGreenFromNativeColor(uint8_t color) - { - return ((color >> 4) & 0x03) * 0x55; - } - - /** - * Gets blue from color. - * - * @param color The color. - * - * @return The blue from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getBlueFromNativeColor(uint8_t color) - { - return ((color >> 6) & 0x03) * 0x55; - } - - /** - * Gets alpha from color. - * - * @param color The color. - * - * @return The alpha from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getAlphaFromNativeColor(uint8_t color) - { - return (color & 0x03) * 0x55; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for BGRA2222 image format. This allows drawing BGRA2222 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperBGRA2222_BilinearInterpolation, - * enableTextureMapperBGRA2222_NearestNeighbor - */ - void enableTextureMapperBGRA2222(); - - /** - * Enables the texture mappers for BGRA2222 image format. This allows drawing BGRA2222 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperBGRA2222, enableTextureMapperBGRA2222_NearestNeighbor - */ - void enableTextureMapperBGRA2222_BilinearInterpolation(); - - /** - * Enables the texture mappers for BGRA2222 image format. This allows drawing BGRA2222 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperBGRA2222, enableTextureMapperBGRA2222_BilinearInterpolation - */ - void enableTextureMapperBGRA2222_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified if ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32- bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified Performs always a software blend. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 8-bits BGRA2222 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_BGRA2222_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_BGRA2222_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_BGRA2222_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_BGRA2222_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - const uint16_t xy10 = 16 * x; - const uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION uint32_t convertBGRA2222toARGB8888(colortype col) const - { - return (((col & 0x03) << 24) | ((col & 0x0C) << 14) | ((col & 0x30) << 4) | ((col & 0xC0) >> 6)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint32_t convertBGRA2222toRGB888(uint8_t val) - { - return (((val & 0x0C) << 14) | ((val & 0x30) << 4) | ((val & 0xC0) >> 6)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint8_t convertRGB888toBGRX2222(uint32_t val) - { - val &= 0xC0C0C0; - return (val) | (val >> 10) | (val >> 20); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint8_t alphaBlend(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t alpha, const uint8_t fbr, const uint8_t fbg, const uint8_t fbb, const uint8_t ialpha) - { - return getNativeColorFromRGB(div255(r * alpha + fbr * ialpha), div255(g * alpha + fbg * ialpha), div255(b * alpha + fbb * ialpha)); - } - - class DrawTextureMapScanLineBase8 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_BGRA2222_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_BGRA2222_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_BGRA2222_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_BGRA2222_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8BPP_BGRA2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp deleted file mode 100644 index 34a5d80..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/lcd/LCD8bpp_RGBA2222.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/lcd/LCD8bpp_RGBA2222.hpp - * - * Declares the touchgfx::LCD8bppRGBA2222 class. - */ -#ifndef TOUCHGFX_LCD8BPP_RGBA2222_HPP -#define TOUCHGFX_LCD8BPP_RGBA2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles on 16 bits per pixel displays. - * - * @see LCD - * - * @note All coordinates are expected to be in absolute coordinates! - */ -class LCD8bpp_RGBA2222 : public LCD -{ -public: - LCD8bpp_RGBA2222(); - - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); - - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); - - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId); - - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight); - - virtual void copyAreaFromTFTToClientBuffer(const Rect& region); - - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); - - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha); - - virtual uint8_t bitDepth() const - { - return 8; - } - - virtual Bitmap::BitmapFormat framebufferFormat() const - { - return Bitmap::RGBA2222; - } - - virtual uint16_t framebufferStride() const - { - return getFramebufferStride(); - } - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - FORCE_INLINE_FUNCTION static uint16_t getFramebufferStride() - { - assert(HAL::FRAME_BUFFER_WIDTH > 0 && "HAL has not been initialized yet"); - return HAL::FRAME_BUFFER_WIDTH; - } - - /** - * Gets color from RGB. - * - * @param red The red. - * @param green The green. - * @param blue The blue. - * - * @return The color from RGB. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return (red & 0xC0) | ((green & 0xC0) >> 2) | ((blue & 0xC0) >> 4) | 0x03; - } - - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static uint8_t getNativeColor(colortype color) - { - return ((color >> 16) & 0xC0) | ((color >> 10) & 0x30) | ((color >> 4) & 0x0C) | 0x03; - } - - /** - * Gets red from color. - * - * @param color The color. - * - * @return The red from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getRedFromNativeColor(uint8_t color) - { - return ((color >> 6) & 0x03) * 0x55; - } - - /** - * Gets green from color. - * - * @param color The color. - * - * @return The green from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getGreenFromNativeColor(uint8_t color) - { - return ((color >> 4) & 0x03) * 0x55; - } - - /** - * Gets blue from color. - * - * @param color The color. - * - * @return The blue from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getBlueFromNativeColor(uint8_t color) - { - return ((color >> 2) & 0x03) * 0x55; - } - - /** - * Gets alpha from color. - * - * @param color The color. - * - * @return The alpha from color. - */ - FORCE_INLINE_FUNCTION static uint8_t getAlphaFromNativeColor(uint8_t color) - { - return (color & 0x03) * 0x55; - } - - /** - * Enables the texture mappers for all image formats. This allows drawing any image - * using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of - * memory for the drawing algorithms. - */ - void enableTextureMapperAll(); - - /** - * Enables the texture mappers for RGBA2222 image format. This allows drawing RGBA2222 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperRGBA2222_BilinearInterpolation, - * enableTextureMapperRGBA2222_NearestNeighbor - */ - void enableTextureMapperRGBA2222(); - - /** - * Enables the texture mappers for RGBA2222 image format. This allows drawing RGBA2222 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperRGBA2222, enableTextureMapperRGBA2222_NearestNeighbor - */ - void enableTextureMapperRGBA2222_BilinearInterpolation(); - - /** - * Enables the texture mappers for RGBA2222 image format. This allows drawing RGBA2222 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperRGBA2222, enableTextureMapperRGBA2222_BilinearInterpolation - */ - void enableTextureMapperRGBA2222_NearestNeighbor(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperARGB8888_BilinearInterpolation, - * enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Bilinear Interpolation algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_NearestNeighbor - */ - void enableTextureMapperARGB8888_BilinearInterpolation(); - - /** - * Enables the texture mappers for ARGB8888 image format. This allows drawing ARGB8888 - * images using Nearest Neighbor algorithm. - * - * @see enableTextureMapperARGB8888, enableTextureMapperARGB8888_BilinearInterpolation - */ - void enableTextureMapperARGB8888_NearestNeighbor(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation and Nearest Neighbor algorithms. - * - * @see enableTextureMapperA4_BilinearInterpolation, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Bilinear Interpolation algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_NearestNeighbor - */ - void enableTextureMapperA4_BilinearInterpolation(); - - /** - * Enables the texture mappers for A4 image format. This allows drawing A4 images using - * Nearest Neighbor algorithm. - * - * @see enableTextureMapperA4, enableTextureMapperA4_BilinearInterpolation - */ - void enableTextureMapperA4_NearestNeighbor(); - -protected: - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Find out how much to advance in the display buffer to get to the next pixel. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next pixel. - */ - static int nextPixel(bool rotatedDisplay, TextRotation textRotation); - - /** - * Find out how much to advance in the display buffer to get to the next line. - * - * @param rotatedDisplay Is the display running in portrait mode? - * @param textRotation Rotation to perform. - * - * @return How much to advance to get to the next line. - */ - static int nextLine(bool rotatedDisplay, TextRotation textRotation); - - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified if ARGB8888 is not supported by the DMA a software blend is performed. - * - * @param sourceData The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 32- bits ARGB8888 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); - - /** - * Blit a 2D source-array to the framebuffer performing alpha-blending per pixel as - * specified Performs always a software blend. - * - * @param sourceData16 The source-array pointer (points to the beginning of the data). The - * sourceData must be stored as 8-bit RGBA2222 values. - * @param source The location and dimensions of the source. - * @param blitRect A rectangle describing what region is to be drawn. - * @param alpha The alpha value to use for blending applied to the whole image (255 = - * solid, no blending) - */ - static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const Rect& source, const Rect& blitRect, uint8_t alpha); - -private: - DrawTextureMapScanLineBase* textureMapper_RGBA2222_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGBA2222_Opaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_RGBA2222_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_RGBA2222_Opaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA; - DrawTextureMapScanLineBase* textureMapper_A4_NearestNeighbor_GA; - DrawTextureMapScanLineBase* textureMapper_A4_BilinearInterpolation_GA; - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t x) - { - assert(x < 16); - const uint16_t xy10 = 16 * x; - const uint16_t xy00 = 256 - xy10; - - return (c00 * xy00 + c10 * xy10) >> 8; - } - - FORCE_INLINE_FUNCTION static uint8_t bilinearInterpolate8(uint8_t c00, uint8_t c10, uint8_t c01, uint8_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return (c00 * xy00 + c10 * xy10 + c01 * xy01 + c11 * xy11) >> 8; - } - - FORCE_INLINE_FUNCTION uint32_t convertRGBA2222toARGB8888(colortype col) const - { - return (((col & 0x03) << 24) | ((col & 0xC0) << 10) | ((col & 0x30) << 4) | ((col & 0x0C) >> 2)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint32_t convertRGBA2222toRGB888(uint8_t val) - { - return (((val & 0xC0) << 10) | ((val & 0x30) << 4) | ((val & 0x0C) >> 2)) * 0x55; - } - - FORCE_INLINE_FUNCTION static uint8_t convertRGB888toRGBX2222(uint32_t val) - { - val &= 0xC0C0C0; - return (val >> 4) | (val >> 10) | (val >> 16); - } - - FORCE_INLINE_FUNCTION static uint32_t bilinearInterpolate888(uint32_t c00, uint32_t c10, uint32_t c01, uint32_t c11, uint8_t x, uint8_t y) - { - assert(x < 16 && y < 16); - const uint16_t xy11 = x * y; - const uint16_t xy10 = 16 * x - xy11; - const uint16_t xy01 = 16 * y - xy11; - const uint16_t xy00 = 256 - (xy11 + xy10 + xy01); - - return ((((c00 & 0xFF00FF) * xy00 + (c10 & 0xFF00FF) * xy10 + (c01 & 0xFF00FF) * xy01 + (c11 & 0xFF00FF) * xy11) >> 8) & 0xFF00FF) | - ((((c00 & 0x00FF00) * xy00 + (c10 & 0x00FF00) * xy10 + (c01 & 0x00FF00) * xy01 + (c11 & 0x00FF00) * xy11) >> 8) & 0x00FF00); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888(uint32_t val, uint8_t factor) - { - return div255rb((val & 0xFF00FF) * factor) | div255g((val & 0x00FF00) * factor); - } - - FORCE_INLINE_FUNCTION static uint32_t div255_888_FFcheck(uint32_t val, uint8_t factor) - { - return factor < 0xFF ? div255_888(val, factor) : val; - } - - FORCE_INLINE_FUNCTION static uint8_t alphaBlend(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t alpha, const uint8_t fbr, const uint8_t fbg, const uint8_t fbb, const uint8_t ialpha) - { - return getNativeColorFromRGB(div255(r * alpha + fbr * ialpha), div255(g * alpha + fbg * ialpha), div255(b * alpha + fbb * ialpha)); - } - - class DrawTextureMapScanLineBase8 : public DrawTextureMapScanLineBase - { - protected: - FORCE_INLINE_FUNCTION bool overrunCheckNearestNeighbor(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - FORCE_INLINE_FUNCTION bool overrunCheckBilinearInterpolation(uint8_t*& destBits, int& pixelsToDraw, fixed16_16& U, fixed16_16& V, fixed16_16 deltaU, fixed16_16 deltaV, const int16_t maxWidth, const int16_t maxHeight) const; - }; - - class TextureMapper_RGBA2222_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGBA2222_Opaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_RGBA2222_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_RGBA2222_Opaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint8_t* const textureBits, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t alpha) const; - }; - - class TextureMapper_ARGB8888_NonOpaque_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint32_t* const textureBits32, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; - - class TextureMapper_A4_NearestNeighbor_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint8_t a4, const uint8_t alpha) const; - }; - - class TextureMapper_A4_BilinearInterpolation_GA : public DrawTextureMapScanLineBase8 - { - public: - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff); - - private: - FORCE_INLINE_FUNCTION void writePixel(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - void writePixelOnEdge(uint8_t* const destBits, const uint16_t* const textureBits, const int16_t bitmapStride, const int16_t bitmapWidth, const int16_t bitmapHeight, const int UInt, const int VInt, const uint8_t UFrac, const uint8_t VFrac, const uint8_t alpha) const; - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8BPP_RGBA2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp deleted file mode 100644 index a6a5fda..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/I2CTouchController.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/touch/I2CTouchController.hpp - * - * Declares the touchgfx::I2CTouchController interface class. - */ -#ifndef TOUCHGFX_I2CTOUCHCONTROLLER_HPP -#define TOUCHGFX_I2CTOUCHCONTROLLER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Specific I2C-enabled type of Touch Controller. - * - * @see TouchController - */ -class I2CTouchController : public TouchController -{ -public: - /** - * Constructor. Initializes I2C driver. - * - * @param [in] i2c I2C driver. - */ - I2CTouchController(I2C& i2c) - : i2c(i2c) - { - i2c.init(); - } - - virtual ~I2CTouchController() - { - } - - virtual void init() = 0; - - virtual bool sampleTouch(int32_t& x, int32_t& y) = 0; - -protected: - I2C& i2c; ///< I2C driver -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_I2CTOUCHCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp deleted file mode 100644 index 42febbe..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/NoTouchController.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/touch/NoTouchController.hpp - * - * Declares the touchgfx::NoTouchController class. - */ -#ifndef TOUCHGFX_NOTOUCHCONTROLLER_HPP -#define TOUCHGFX_NOTOUCHCONTROLLER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * Empty TouchController implementation which does nothing. Use this if your display does not - * have touch input capabilities. - */ -class NoTouchController : public TouchController -{ -public: - virtual void init() - { - } - - virtual bool sampleTouch(int32_t& x, int32_t& y) - { - return false; - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_NOTOUCHCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp deleted file mode 100644 index abb063b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDL2TouchController.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/touch/SDL2TouchController.hpp - * - * Declares the touchgfx::SDL2TouchController class. - */ -#ifndef TOUCHGFX_SDL2TOUCHCONTROLLER_HPP -#define TOUCHGFX_SDL2TOUCHCONTROLLER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * TouchController for the simulator. - * - * @see TouchController - */ -class SDL2TouchController : public TouchController -{ -public: - virtual void init(); - - virtual bool sampleTouch(int32_t& x, int32_t& y); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SDL2TOUCHCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp deleted file mode 100644 index d965648..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/SDLTouchController.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/touch/SDLTouchController.hpp - * - * Declares the touchgfx::SDLTouchController class. - */ -#ifndef TOUCHGFX_SDLTOUCHCONTROLLER_HPP -#define TOUCHGFX_SDLTOUCHCONTROLLER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * TouchController for the simulator. - * - * @see TouchController - * - * @deprecated Use SDL2TouchController - */ -class SDLTouchController : public TouchController -{ -public: - virtual void init(); - - virtual bool sampleTouch(int32_t& x, int32_t& y); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SDLTOUCHCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp deleted file mode 100644 index 805f659..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/driver/touch/TouchController.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/driver/touch/TouchController.hpp - * - * Declares the touchgfx::TouchController interface class. - */ -#ifndef TOUCHGFX_TOUCHCONTROLLER_HPP -#define TOUCHGFX_TOUCHCONTROLLER_HPP - -#include - -namespace touchgfx -{ -/** Basic Touch Controller interface. */ -class TouchController -{ -public: - /** Finalizes an instance of the TouchController class. */ - virtual ~TouchController() - { - } - - /** Initializes touch controller. */ - virtual void init() = 0; - - /** - * Checks whether the touch screen is being touched, and if so, what coordinates. - * - * @param [out] x The x position of the touch. - * @param [out] y The y position of the touch. - * - * @return True if a touch has been detected, otherwise false. - */ - virtual bool sampleTouch(int32_t& x, int32_t& y) = 0; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TOUCHCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp deleted file mode 100644 index b96d8f1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp +++ /dev/null @@ -1,512 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file platform/hal/simulator/sdl2/HALSDL2.hpp - * - * Declares the touchgfx::HALSDL2 class. - */ -#ifndef TOUCHGFX_HALSDL2_HPP -#define TOUCHGFX_HALSDL2_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** Simulator enable stdio. */ -void simulator_enable_stdio(); - -/** - * Simulator printf. - * - * @param format Describes the format to use. - * @param pArg The argument list. - */ -void simulator_printf(const char* format, va_list pArg); - -/** - * HAL implementation for the TouchGFX simulator. This particular simulator HAL implementation - * uses SDL2 to show the content of the framebuffer in a window. - * - * @see HAL - */ -class HALSDL2 : public HAL -{ -public: - /** - * Initializes a new instance of the HALSDL2 class. - * - * @param [in] dma Reference to DMA interface. - * @param [in] lcd Reference to the LCD. - * @param [in] touchCtrl Reference to Touch Controller driver. - * @param width Width of the display. - * @param height Height of the display. - */ - HALSDL2(DMA_Interface& dma, LCD& lcd, TouchController& touchCtrl, uint16_t width, uint16_t height) - : HAL(dma, lcd, touchCtrl, width, height), - portraitSkin(), - landscapeSkin(), - currentSkin(0), - isSkinActive(true), - isWindowBorderless(false), - isWindowVisible(true), - isConsoleVisible(true), - printFile(0), - windowDrag(false) - { - setVsyncInterval(30.f); // Simulate 20Hz per default for backward compatibility - updateCurrentSkin(); - } - - /** - * Main event loop. Will wait for VSYNC signal, and then process next frame. Call this - * function from your GUI task. - * - * @note This function never returns! - */ - virtual void taskEntry(); - - /** - * Sample key event from keyboard. - * - * @param [out] key Output parameter that will be set to the key value if a key press was - * detected. - * - * @return True if a key press was detected and the "key" parameter is set to a value. - */ - virtual bool sampleKey(uint8_t& key); - - /** - * This function is called whenever the framework has performed a complete draw. - * - * On some platforms, a local framebuffer needs to be pushed to the display through a - * SPI channel or similar. Implement that functionality here. This function is called - * whenever the framework has performed a complete draw. - */ - virtual void flushFrameBuffer(); - - /** - * This function is called whenever the framework has performed a partial draw. - * - * @param rect The area of the screen that has been drawn, expressed in absolute coordinates. - */ - virtual void flushFrameBuffer(const Rect& rect); - - /** - * Sets vsync interval for simulating same tick speed as the real hardware. Due to - * limitations in the granularity of SDL, the generated ticks in the simulator might not - * occur at the exact time, but accumulated over several ticks, the precision is very - * good. - * - * @param ms The milliseconds between ticks. - * - * @note That you can also use HAL::setFrameRateCompensation() in the simulator. The effect of - * this can easily be demonstrated by dragging the console output window of the - * simulator (when running from Visual Studio) as this will pause the SDL and - * generate a lot of ticks when the console window is released. Beware that - * since the missed vsyncs are accumulated in an 8 bit counter, only up to 255 - * ticks may be missed, so at VsyncInterval = 16.6667, dragging the windows for - * more than 255 * 16.6667ms = 4250ms - * = 4.25s will not generate all the ticks that were actually missed. This - * situation is, however, not very realistic, as normally just a couple of - * vsyncs are skipped. - */ - void setVsyncInterval(float ms); - - /** - * Samples the position of the mouse cursor. - * - * @param [out] x The x coordinate. - * @param [out] y The y coordinate. - * - * @return True if touch detected, false otherwise. - */ - bool doSampleTouch(int32_t& x, int32_t& y) const; - - virtual void setFrameBufferSize(uint16_t width, uint16_t height); - - /** - * Initializes SDL. - * - * @param argcount Number of arguments. - * @param [in] args Arguments. - * - * @return True if init went well, false otherwise. - */ - virtual bool sdl_init(int argcount, char** args); - - /** - * Sets window title. - * - * Sets window title of the TouchGFX simulator. - * - * @param title The title, if null the original "TouchGFX simulator" will be used. - * - * @see getWindowTitle - */ - static void setWindowTitle(const char* title); - - /** - * Gets window title. - * - * @return null "TouchGFX simulator" unless set to something else using setWindowTitle(). - * - * @see setWindowTitle - */ - static const char* getWindowTitle(); - - /** - * Loads a skin for a given display orientation that will be rendered in the simulator - * window with the the TouchGFX framebuffer placed inside the bitmap at the given - * coordinates. Different bitmaps can be loaded in landscape and portrait mode. If the - * provided bitmap cannot be loaded, the TouchGFX framebuffer will be displayed as - * normal. If the png files contain areas with alpha - * < 255, this will be used to create a shaped window. - * - * @param orientation The orientation. - * @param x The x coordinate. - * @param y The y coordinate. - * - * @note The skins must be named "portrait.png" and "landscape.png" and placed inside the - * "simulator/" folder. The build process of the simulator will automatically - * copy the skins to the folder where the executable simulator is generated. - * @note When as skin is set, the entire framebuffer is rendered through SDL whenever there is - * a change. Without a skin, only the areas with changes is rendered through SDL. - */ - void loadSkin(DisplayOrientation orientation, int x, int y); - - /** Saves a screenshot to the default folder and default filename. */ - void saveScreenshot(); - - /** - * Copy the next N screenshots to disk. On each screen update, the new screen is saved - * to disk. - * - * @param n Number of screenshots to save. These are added to any ongoing amount of - * screenshots in queue. - */ - virtual void saveNextScreenshots(int n); - - /** - * Saves a screenshot. - * - * @param [in] folder Folder name to place the screenshot in. - * @param [in] filename Filename to save the screenshot to. - */ - virtual void saveScreenshot(char* folder, char* filename); - - /** Copies the screenshot to clipboard. */ - virtual void copyScreenshotToClipboard(); - - /** - * Flash invalidated areas on/off. The area that needs to be redrawn is flashed in grey to help - * identify performance bottle necks. - * - * @param flash (Optional) True to flash the screen when updating. - */ - virtual void setFlashInvalidatedAreas(bool flash = true); - - /** - * Single stepping enable/disable. When single stepping is enabled, F10 will execute one - * tick and F9 will disable single stepping. - * - * @param singleStepping (Optional) True to pause the simulation and start single stepping. - * - * @see isSingleStepping - */ - static void setSingleStepping(bool singleStepping = true); - - /** - * Is single stepping. - * - * @return True if single stepping, false if not. - * - * @see setSingleStepping - */ - static bool isSingleStepping(); - - /** - * Single step a number of steps. Only works if single stepping is already enabled. - * - * @param steps (Optional) The steps Default is 1 step. - * - * @see setSingleStepping, isSingleStepping - */ - static void singleStep(uint16_t steps = 1); - - /** - * Terminate the application as quickly as possible - */ - static void stopApplication(); - -#ifndef __linux__ - /** - * Gets the argc and argv for a Windows program. - * - * @param [in,out] argc Pointer to where to store number of arguments. - * - * @return The argv list of arguments. - */ - static char** getArgv(int* argc); -#endif - - /** - * Scale framebuffer to 24bpp. The format of the framebuffer (src) is given in parameter - * format. The result is placed in the pre-allocated memory pointed to by parameter dst. - * If the framebuffer is in format Bitmap::RGB888, parameter dst is not used and the - * parameter src is simply returned. - * - * @param [in] src The framebuffer. - * @param format Describes the format of the framebuffer (lcd().framebufferFormat()). - * - * @return Null if it fails, else a pointer to an uint8_t. - */ - static uint8_t* scaleTo24bpp(uint16_t* src, Bitmap::BitmapFormat format); - - /** - * Rotates a framebuffer if the display is rotated. - * - * @param [in] src The framebuffer. - * - * @return Null if it fails, else a pointer to an uint8_t. - */ - static uint8_t* doRotate(uint8_t* src); - - /** - * Change visibility of window (hidden vs. shown) as well as (due to - * backward compatibility) the visibility of the console window. - * - * @param visible Should the window be visible? - * @param redrawWindow (Optional) Should the window be redrawn? Default is true. - * - * @see getWindowVisible, setConsoleVisible - */ - void setWindowVisible(bool visible, bool redrawWindow = true) - { - isWindowVisible = visible; - isConsoleVisible = visible; - if (redrawWindow) - { - recreateWindow(); - simulator_enable_stdio(); - } - } - - /** - * Is the window visible? - * - * @return True if it is visible, false if it is hidden. - * - * @see setWindowVisible, getConsoleVisible - */ - bool getWindowVisible() const - { - return isWindowVisible; - } - - /** - * Change visibility of console window (hidden vs. shown). - * - * @param visible Should the window be visible? - * @param redrawWindow (Optional) Should the window be redrawn? Default is true. - * - * @see setWindowVisible, getConsoleVisible - */ - void setConsoleVisible(bool visible, bool redrawWindow = true) - { - isConsoleVisible = visible; - if (redrawWindow) - { - recreateWindow(); - touchgfx::simulator_enable_stdio(); - } - } - - /** - * Is console window visible? - * - * @return True if it is visible, false if it is hidden. - * - * @see setConsoleVisible, getWindowVisible - */ - bool getConsoleVisible() const - { - return isConsoleVisible; - } - - /** - * Also write touchgfx_printf() to a file. The file will be generated (no appended to). - * - * @param filename The name of the file to write to (or null to stop writing to a file). - * - * @return True if the operation succeeds, false otherwise. - */ - bool printToFile(const char* filename); - - /** - * Get file handle to output file (if set). - * - * @return A file handle to the file where output is copied to. - * - * @see printToFile - */ - FILE* getPrintFile() const - { - return printFile; - } - - /** - * Generate name of file placed next to the simulator. - * - * @param [in] buffer If the buffer to fill with the local filename. Must be at least - * 300+length of filename parameter. - * @param buffer_size The size of the buffer in bytes. - * @param [in] filename The filename relative to the simulator executable. - * - * @return The filled buffer. - */ - char* localFileName(char* buffer, size_t buffer_size, const char* filename); - -protected: - /** - * Gets TFT framebuffer. - * - * @return null if it fails, else the TFT framebuffer. - */ - virtual uint16_t* getTFTFrameBuffer() const; - - /** - * Sets TFT framebuffer. - * - * @param [in] addr The address of the TFT framebuffer. - */ - void setTFTFrameBuffer(uint16_t* addr); - - /** - * Update framebuffer using an SDL Surface. - * - * @param _rectToUpdate Area to update. - * @param [in] frameBuffer Target framebuffer. - */ - virtual void renderLCD_FrameBufferToMemory(const Rect& _rectToUpdate, uint8_t* frameBuffer); - - /** Disables the DMA and LCD interrupts. */ - virtual void disableInterrupts() - { - } - - /** Enables the DMA and LCD interrupts. */ - virtual void enableInterrupts() - { - } - - /** Configures LCD interrupt. */ - virtual void configureLCDInterrupt() - { - } - - /** Enables the LCD interrupt. */ - virtual void enableLCDControllerInterrupt() - { - } - - /** - * Configures the interrupts relevant for TouchGFX. This primarily entails setting the - * interrupt priorities for the DMA and LCD interrupts. - */ - virtual void configureInterrupts() - { - } - - /** Perform the actual display orientation change. */ - void performDisplayOrientationChange(); - -private: - void recreateWindow(bool updateContent = true); - void pushTouch(bool down) const; - bool popTouch() const; - static void updateTitle(); - void alphaChannelCheck(SDL_Surface* surface, bool& isOpaque, bool& hasSemiTransparency); - void updateCurrentSkin(); - int getCurrentSkinX() const; - int getCurrentSkinY() const; - - static bool debugInfoEnabled; - - float msBetweenTicks; - float msPassed; - - static uint16_t icon[]; - static const char* customTitle; - - class SkinInfo - { - public: - SDL_Surface* surface; - bool isOpaque; - bool hasSemiTransparency; - int offsetX; - int offsetY; - - SkinInfo() - : surface(0), isOpaque(true), hasSemiTransparency(false), offsetX(0), offsetY(0) - { - } - - virtual ~SkinInfo() - { - } - }; - - char programPath[300]; - SkinInfo portraitSkin; - SkinInfo landscapeSkin; - SkinInfo* currentSkin; - bool isSkinActive; - bool isWindowBorderless; - bool isWindowVisible; - bool isConsoleVisible; - FILE* printFile; - static bool flashInvalidatedRect; - - bool windowDrag; - int windowDragX; - int windowDragY; - - static int32_t _xMouse; - static int32_t _yMouse; - static int32_t _x; - static int32_t _y; - static bool isWindowBeingDragged; - static int initialWindowX; - static int initialWindowY; - static int initialMouseX; - static int initialMouseY; - static bool _lastTouch; - static bool _touches[5]; - static int _numTouches; - - static uint8_t keyPressed; - - static bool singleSteppingEnabled; - static uint16_t singleSteppingSteps; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_HALSDL2_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL.h deleted file mode 100644 index 7647b51..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL.h - * - * Main include header for the SDL library - */ - - -#ifndef _SDL_H -#define _SDL_H - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_assert.h" -#include "SDL_atomic.h" -#include "SDL_audio.h" -#include "SDL_clipboard.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_filesystem.h" -#include "SDL_joystick.h" -#include "SDL_gamecontroller.h" -#include "SDL_haptic.h" -#include "SDL_hints.h" -#include "SDL_loadso.h" -#include "SDL_log.h" -#include "SDL_messagebox.h" -#include "SDL_mutex.h" -#include "SDL_power.h" -#include "SDL_render.h" -#include "SDL_rwops.h" -#include "SDL_system.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_version.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* As of version 0.5, SDL is loaded dynamically into the application */ - -/** - * \name SDL_INIT_* - * - * These are the flags which may be passed to SDL_Init(). You should - * specify the subsystems which you will be using in your application. - */ -/* @{ */ -#define SDL_INIT_TIMER 0x00000001 -#define SDL_INIT_AUDIO 0x00000010 -#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ -#define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ -#define SDL_INIT_HAPTIC 0x00001000 -#define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ -#define SDL_INIT_EVENTS 0x00004000 -#define SDL_INIT_NOPARACHUTE 0x00100000 /**< compatibility; this flag is ignored. */ -#define SDL_INIT_EVERYTHING ( \ - SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ - SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ - ) -/* @} */ - -/** - * This function initializes the subsystems specified by \c flags - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/** - * This function initializes specific SDL subsystems - * - * Subsystem initialization is ref-counted, you must call - * SDL_QuitSubSystem for each SDL_InitSubSystem to correctly - * shutdown a subsystem manually (or call SDL_Quit to force shutdown). - * If a subsystem is already loaded then this call will - * increase the ref-count and return. - */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/** - * This function cleans up specific SDL subsystems - */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/** - * This function returns a mask of the specified subsystems which have - * previously been initialized. - * - * If \c flags is 0, it returns a mask of all initialized subsystems. - */ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/** - * This function cleans up all initialized subsystems. You should - * call it upon all exit conditions. - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_H */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_assert.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_assert.h deleted file mode 100644 index 402981f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_assert.h +++ /dev/null @@ -1,289 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_assert_h -#define _SDL_assert_h - -#include "SDL_config.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef SDL_ASSERT_LEVEL -#ifdef SDL_DEFAULT_ASSERT_LEVEL -#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL -#elif defined(_DEBUG) || defined(DEBUG) || \ - (defined(__GNUC__) && !defined(__OPTIMIZE__)) -#define SDL_ASSERT_LEVEL 2 -#else -#define SDL_ASSERT_LEVEL 1 -#endif -#endif /* SDL_ASSERT_LEVEL */ - -/* -These are macros and not first class functions so that the debugger breaks -on the assertion line and not in some random guts of SDL, and so each -assert can have unique static variables associated with it. -*/ - -#if defined(_MSC_VER) -/* Don't include intrin.h here because it contains C++ code */ - extern void __cdecl __debugbreak(void); - #define SDL_TriggerBreakpoint() __debugbreak() -#elif (!defined(__NACL__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) - #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) -#elif defined(HAVE_SIGNAL_H) - #include - #define SDL_TriggerBreakpoint() raise(SIGTRAP) -#else - /* How do we trigger breakpoints on this platform? */ - #define SDL_TriggerBreakpoint() -#endif - -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ -# define SDL_FUNCTION __func__ -#elif ((__GNUC__ >= 2) || defined(_MSC_VER)) -# define SDL_FUNCTION __FUNCTION__ -#else -# define SDL_FUNCTION "???" -#endif -#define SDL_FILE __FILE__ -#define SDL_LINE __LINE__ - -/* -sizeof (x) makes the compiler still parse the expression even without -assertions enabled, so the code is always checked at compile time, but -doesn't actually generate code for it, so there are no side effects or -expensive checks at run time, just the constant size of what x WOULD be, -which presumably gets optimized out as unused. -This also solves the problem of... - - int somevalue = blah(); - SDL_assert(somevalue == 1); - -...which would cause compiles to complain that somevalue is unused if we -disable assertions. -*/ - -/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking - this condition isn't constant. And looks like an owl's face! */ -#ifdef _MSC_VER /* stupid /W4 warnings. */ -#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) -#else -#define SDL_NULL_WHILE_LOOP_CONDITION (0) -#endif - -#define SDL_disabled_assert(condition) \ - do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) - -typedef enum -{ - SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ - SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ - SDL_ASSERTION_ABORT, /**< Terminate the program. */ - SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ - SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ -} SDL_AssertState; - -typedef struct SDL_AssertData -{ - int always_ignore; - unsigned int trigger_count; - const char *condition; - const char *filename; - int linenum; - const char *function; - const struct SDL_AssertData *next; -} SDL_AssertData; - -#if (SDL_ASSERT_LEVEL > 0) - -/* Never call this directly. Use the SDL_assert* macros. */ -extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, - const char *, - const char *, int) -#if defined(__clang__) -#if __has_feature(attribute_analyzer_noreturn) -/* this tells Clang's static analysis that we're a custom assert function, - and that the analyzer should assume the condition was always true past this - SDL_assert test. */ - __attribute__((analyzer_noreturn)) -#endif -#endif -; - -/* the do {} while(0) avoids dangling else problems: - if (x) SDL_assert(y); else blah(); - ... without the do/while, the "else" could attach to this macro's "if". - We try to handle just the minimum we need here in a macro...the loop, - the static vars, and break points. The heavy lifting is handled in - SDL_ReportAssertion(), in SDL_assert.c. -*/ -#define SDL_enabled_assert(condition) \ - do { \ - while ( !(condition) ) { \ - static struct SDL_AssertData sdl_assert_data = { \ - 0, 0, #condition, 0, 0, 0, 0 \ - }; \ - const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ - if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ - continue; /* go again. */ \ - } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ - SDL_TriggerBreakpoint(); \ - } \ - break; /* not retrying. */ \ - } \ - } while (SDL_NULL_WHILE_LOOP_CONDITION) - -#endif /* enabled assertions support code */ - -/* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_disabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) -#else -# error Unknown assertion level. -#endif - -/* this assertion is never disabled at any level. */ -#define SDL_assert_always(condition) SDL_enabled_assert(condition) - - -typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( - const SDL_AssertData* data, void* userdata); - -/** - * \brief Set an application-defined assertion handler. - * - * This allows an app to show its own assertion UI and/or force the - * response to an assertion failure. If the app doesn't provide this, SDL - * will try to do the right thing, popping up a system-specific GUI dialog, - * and probably minimizing any fullscreen windows. - * - * This callback may fire from any thread, but it runs wrapped in a mutex, so - * it will only fire from one thread at a time. - * - * Setting the callback to NULL restores SDL's original internal handler. - * - * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! - * - * \return SDL_AssertState value of how to handle the assertion failure. - * - * \param handler Callback function, called when an assertion fails. - * \param userdata A pointer passed to the callback as-is. - */ -extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( - SDL_AssertionHandler handler, - void *userdata); - -/** - * \brief Get the default assertion handler. - * - * This returns the function pointer that is called by default when an - * assertion is triggered. This is an internal function provided by SDL, - * that is used for assertions when SDL_SetAssertionHandler() hasn't been - * used to provide a different function. - * - * \return The default SDL_AssertionHandler that is called when an assert triggers. - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); - -/** - * \brief Get the current assertion handler. - * - * This returns the function pointer that is called when an assertion is - * triggered. This is either the value last passed to - * SDL_SetAssertionHandler(), or if no application-specified function is - * set, is equivalent to calling SDL_GetDefaultAssertionHandler(). - * - * \param puserdata Pointer to a void*, which will store the "userdata" - * pointer that was passed to SDL_SetAssertionHandler(). - * This value will always be NULL for the default handler. - * If you don't care about this data, it is safe to pass - * a NULL pointer to this function to ignore it. - * \return The SDL_AssertionHandler that is called when an assert triggers. - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); - -/** - * \brief Get a list of all assertion failures. - * - * Get all assertions triggered since last call to SDL_ResetAssertionReport(), - * or the start of the program. - * - * The proper way to examine this data looks something like this: - * - * - * const SDL_AssertData *item = SDL_GetAssertionReport(); - * while (item) { - * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", - * item->condition, item->function, item->filename, - * item->linenum, item->trigger_count, - * item->always_ignore ? "yes" : "no"); - * item = item->next; - * } - * - * - * \return List of all assertions. - * \sa SDL_ResetAssertionReport - */ -extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); - -/** - * \brief Reset the list of all assertion failures. - * - * Reset list of all assertions triggered. - * - * \sa SDL_GetAssertionReport - */ -extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); - - -/* these had wrong naming conventions until 2.0.4. Please update your app! */ -#define SDL_assert_state SDL_AssertState -#define SDL_assert_data SDL_AssertData - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_assert_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_atomic.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_atomic.h deleted file mode 100644 index 56aa81d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_atomic.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_atomic.h - * - * Atomic operations. - * - * IMPORTANT: - * If you are not an expert in concurrent lockless programming, you should - * only be using the atomic lock and reference counting functions in this - * file. In all other cases you should be protecting your data structures - * with full mutexes. - * - * The list of "safe" functions to use are: - * SDL_AtomicLock() - * SDL_AtomicUnlock() - * SDL_AtomicIncRef() - * SDL_AtomicDecRef() - * - * Seriously, here be dragons! - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * You can find out a little more about lockless programming and the - * subtle issues that can arise here: - * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx - * - * There's also lots of good information here: - * http://www.1024cores.net/home/lock-free-algorithms - * http://preshing.com/ - * - * These operations may or may not actually be implemented using - * processor specific atomic operations. When possible they are - * implemented as true processor specific atomic operations. When that - * is not possible the are implemented using locks that *do* use the - * available atomic operations. - * - * All of the atomic operations that modify memory are full memory barriers. - */ - -#ifndef _SDL_atomic_h_ -#define _SDL_atomic_h_ - -#include "SDL_stdinc.h" -#include "SDL_platform.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SDL AtomicLock - * - * The atomic locks are efficient spinlocks using CPU instructions, - * but are vulnerable to starvation and can spin forever if a thread - * holding a lock has been terminated. For this reason you should - * minimize the code executed inside an atomic lock and never do - * expensive things like API or system calls while holding them. - * - * The atomic locks are not safe to lock recursively. - * - * Porting Note: - * The spin lock functions and type are required and can not be - * emulated because they are used in the atomic emulation code. - */ -/* @{ */ - -typedef int SDL_SpinLock; - -/** - * \brief Try to lock a spin lock by setting it to a non-zero value. - * - * \param lock Points to the lock. - * - * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); - -/** - * \brief Lock a spin lock by setting it to a non-zero value. - * - * \param lock Points to the lock. - */ -extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); - -/** - * \brief Unlock a spin lock by setting it to 0. Always returns immediately - * - * \param lock Points to the lock. - */ -extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); - -/* @} *//* SDL AtomicLock */ - - -/** - * The compiler barrier prevents the compiler from reordering - * reads and writes to globally visible variables across the call. - */ -#if defined(_MSC_VER) && (_MSC_VER > 1200) -void _ReadWriteBarrier(void); -#pragma intrinsic(_ReadWriteBarrier) -#define SDL_CompilerBarrier() _ReadWriteBarrier() -#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ -#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") -#else -#define SDL_CompilerBarrier() \ -{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } -#endif - -/** - * Memory barriers are designed to prevent reads and writes from being - * reordered by the compiler and being seen out of order on multi-core CPUs. - * - * A typical pattern would be for thread A to write some data and a flag, - * and for thread B to read the flag and get the data. In this case you - * would insert a release barrier between writing the data and the flag, - * guaranteeing that the data write completes no later than the flag is - * written, and you would insert an acquire barrier between reading the - * flag and reading the data, to ensure that all the reads associated - * with the flag have completed. - * - * In this pattern you should always see a release barrier paired with - * an acquire barrier and you should gate the data reads/writes with a - * single flag variable. - * - * For more information on these semantics, take a look at the blog post: - * http://preshing.com/20120913/acquire-and-release-semantics - */ -#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") -#elif defined(__GNUC__) && defined(__arm__) -#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) -#ifdef __thumb__ -/* The mcr instruction isn't available in thumb mode, use real functions */ -extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease(); -extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire(); -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#endif /* __thumb__ */ -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") -#endif /* __GNUC__ && __arm__ */ -#else -#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ -#include -#define SDL_MemoryBarrierRelease() __machine_rel_barrier() -#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() -#else -/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ -#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() -#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() -#endif -#endif - -/** - * \brief A type representing an atomic integer value. It is a struct - * so people don't accidentally use numeric operations on it. - */ -typedef struct { int value; } SDL_atomic_t; - -/** - * \brief Set an atomic variable to a new value if it is currently an old value. - * - * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. - * - * \note If you don't know what this function is for, you shouldn't use it! -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); - -/** - * \brief Set an atomic variable to a value. - * - * \return The previous value of the atomic variable. - */ -extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); - -/** - * \brief Get the value of an atomic variable - */ -extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); - -/** - * \brief Add to an atomic variable. - * - * \return The previous value of the atomic variable. - * - * \note This same style can be used for any number operation - */ -extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); - -/** - * \brief Increment an atomic variable used as a reference count. - */ -#ifndef SDL_AtomicIncRef -#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) -#endif - -/** - * \brief Decrement an atomic variable used as a reference count. - * - * \return SDL_TRUE if the variable reached zero after decrementing, - * SDL_FALSE otherwise - */ -#ifndef SDL_AtomicDecRef -#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) -#endif - -/** - * \brief Set a pointer to a new value if it is currently an old value. - * - * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. - * - * \note If you don't know what this function is for, you shouldn't use it! -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); - -/** - * \brief Set a pointer to a value atomically. - * - * \return The previous value of the pointer. - */ -extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); - -/** - * \brief Get the value of a pointer atomically. - */ -extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#include "close_code.h" - -#endif /* _SDL_atomic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_audio.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_audio.h deleted file mode 100644 index 4f65521..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_audio.h +++ /dev/null @@ -1,605 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_audio.h - * - * Access to the raw audio mixing buffer for the SDL library. - */ - -#ifndef _SDL_audio_h -#define _SDL_audio_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Audio format flags. - * - * These are what the 16 bits in SDL_AudioFormat currently mean... - * (Unspecified bits are always zero). - * - * \verbatim - ++-----------------------sample is signed if set - || - || ++-----------sample is bigendian if set - || || - || || ++---sample is float if set - || || || - || || || +---sample bit size---+ - || || || | | - 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - \endverbatim - * - * There are macros in SDL 2.0 and later to query these bits. - */ -typedef Uint16 SDL_AudioFormat; - -/** - * \name Audio flags - */ -/* @{ */ - -#define SDL_AUDIO_MASK_BITSIZE (0xFF) -#define SDL_AUDIO_MASK_DATATYPE (1<<8) -#define SDL_AUDIO_MASK_ENDIAN (1<<12) -#define SDL_AUDIO_MASK_SIGNED (1<<15) -#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) -#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) -#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) -#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) -#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) -#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) -#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) - -/** - * \name Audio format flags - * - * Defaults to LSB byte order. - */ -/* @{ */ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB -/* @} */ - -/** - * \name int32 support - */ -/* @{ */ -#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ -#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ -#define AUDIO_S32 AUDIO_S32LSB -/* @} */ - -/** - * \name float32 support - */ -/* @{ */ -#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ -#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ -#define AUDIO_F32 AUDIO_F32LSB -/* @} */ - -/** - * \name Native audio byte ordering - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#define AUDIO_S32SYS AUDIO_S32LSB -#define AUDIO_F32SYS AUDIO_F32LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#define AUDIO_S32SYS AUDIO_S32MSB -#define AUDIO_F32SYS AUDIO_F32MSB -#endif -/* @} */ - -/** - * \name Allow change flags - * - * Which audio format changes are allowed when opening a device. - */ -/* @{ */ -#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 -#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 -#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 -#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) -/* @} */ - -/* @} *//* Audio flags */ - -/** - * This function is called when the audio device needs more data. - * - * \param userdata An application-specific parameter saved in - * the SDL_AudioSpec structure - * \param stream A pointer to the audio data buffer. - * \param len The length of that buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - * - * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if - * you like. Just open your audio device with a NULL callback. - */ -typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, - int len); - -/** - * The calculated values in this structure are calculated by SDL_OpenAudio(). - */ -typedef struct SDL_AudioSpec -{ - int freq; /**< DSP frequency -- samples per second */ - SDL_AudioFormat format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in samples (power of 2) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ - void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ -} SDL_AudioSpec; - - -struct SDL_AudioCVT; -typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, - SDL_AudioFormat format); - -/** - * A structure to hold a set of audio conversion filters and buffers. - */ -#ifdef __GNUC__ -/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't - pad it out to 88 bytes to guarantee ABI compatibility between compilers. - vvv - The next time we rev the ABI, make sure to size the ints and add padding. -*/ -#define SDL_AUDIOCVT_PACKED __attribute__((packed)) -#else -#define SDL_AUDIOCVT_PACKED -#endif -/* */ -typedef struct SDL_AudioCVT -{ - int needed; /**< Set to 1 if conversion possible */ - SDL_AudioFormat src_format; /**< Source audio format */ - SDL_AudioFormat dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - SDL_AudioFilter filters[10]; /**< Filter list */ - int filter_index; /**< Current audio conversion function */ -} SDL_AUDIOCVT_PACKED SDL_AudioCVT; - - -/* Function prototypes */ - -/** - * \name Driver discovery functions - * - * These functions return the list of built in audio drivers, in the - * order that they are normally initialized by default. - */ -/* @{ */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); -extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); -/* @} */ - -/** - * \name Initialization and cleanup - * - * \internal These functions are used internally, and should not be used unless - * you have a specific need to specify the audio driver you want to - * use. You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/* @{ */ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); -/* @} */ - -/** - * This function returns the name of the current audio driver, or NULL - * if no driver has been initialized. - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); - -/** - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by \c obtained. If \c obtained is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. - * - * When filling in the desired audio spec structure, - * - \c desired->freq should be the desired audio frequency in samples-per- - * second. - * - \c desired->format should be the desired audio format. - * - \c desired->samples is the desired size of the audio buffer, in - * samples. This number should be a power of two, and may be adjusted by - * the audio driver to a value more suitable for the hardware. Good values - * seem to range between 512 and 8096 inclusive, depending on the - * application and CPU speed. Smaller values yield faster response time, - * but can lead to underflow if the application is doing heavy processing - * and cannot fill the audio buffer in time. A stereo sample consists of - * both right and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: \code ms = (samples*1000)/freq \endcode - * - \c desired->size is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * - \c desired->silence is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * - \c desired->callback should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL - * pointer here, and call SDL_QueueAudio() with some frequency, to queue - * more audio samples to be played. - * - \c desired->userdata is passed as the first parameter to your callback - * function. If you passed a NULL callback, this value is ignored. - * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, - SDL_AudioSpec * obtained); - -/** - * SDL Audio Device IDs. - * - * A successful call to SDL_OpenAudio() is always device id 1, and legacy - * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls - * always returns devices >= 2 on success. The legacy calls are good both - * for backwards compatibility and when you don't care about multiple, - * specific, or capture devices. - */ -typedef Uint32 SDL_AudioDeviceID; - -/** - * Get the number of available devices exposed by the current driver. - * Only valid after a successfully initializing the audio subsystem. - * Returns -1 if an explicit list of devices can't be determined; this is - * not an error. For example, if SDL is set up to talk to a remote audio - * server, it can't list every one available on the Internet, but it will - * still allow a specific host to be specified to SDL_OpenAudioDevice(). - * - * In many common cases, when this function returns a value <= 0, it can still - * successfully open the default device (NULL for first argument of - * SDL_OpenAudioDevice()). - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); - -/** - * Get the human-readable name of a specific audio device. - * Must be a value between 0 and (number of audio devices-1). - * Only valid after a successfully initializing the audio subsystem. - * The values returned by this function reflect the latest call to - * SDL_GetNumAudioDevices(); recall that function to redetect available - * hardware. - * - * The string returned by this function is UTF-8 encoded, read-only, and - * managed internally. You are not to free it. If you need to keep the - * string for any length of time, you should make your own copy of it, as it - * will be invalid next time any of several other SDL functions is called. - */ -extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, - int iscapture); - - -/** - * Open a specific audio device. Passing in a device name of NULL requests - * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). - * - * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but - * some drivers allow arbitrary and driver-specific strings, such as a - * hostname/IP address for a remote audio server, or a filename in the - * diskaudio driver. - * - * \return 0 on error, a valid device ID that is >= 2 on success. - * - * SDL_OpenAudio(), unlike this function, always acts on device ID 1. - */ -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char - *device, - int iscapture, - const - SDL_AudioSpec * - desired, - SDL_AudioSpec * - obtained, - int - allowed_changes); - - - -/** - * \name Audio state - * - * Get the current audio state. - */ -/* @{ */ -typedef enum -{ - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_AudioStatus; -extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); - -extern DECLSPEC SDL_AudioStatus SDLCALL -SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); -/* @} *//* Audio State */ - -/** - * \name Pause audio functions - * - * These functions pause and unpause the audio callback processing. - * They should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -/* @{ */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); -extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, - int pause_on); -/* @} *//* Pause audio functions */ - -/** - * This function loads a WAVE from the data source, automatically freeing - * that source if \c freesrc is non-zero. For example, to load a WAVE file, - * you could do: - * \code - * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); - * \endcode - * - * If this function succeeds, it returns the given SDL_AudioSpec, - * filled with the audio data format of the wave data, and sets - * \c *audio_buf to a malloc()'d buffer containing the audio data, - * and sets \c *audio_len to the length of that audio buffer, in bytes. - * You need to free the audio buffer with SDL_FreeWAV() when you are - * done with it. - * - * This function returns NULL and sets the SDL error message if the - * wave file cannot be opened, uses an unknown data format, or is - * corrupt. Currently raw and MS-ADPCM WAVE files are supported. - */ -extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, - int freesrc, - SDL_AudioSpec * spec, - Uint8 ** audio_buf, - Uint32 * audio_len); - -/** - * Loads a WAV from a file. - * Compatibility convenience function. - */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/** - * This function frees data previously allocated with SDL_LoadWAV_RW() - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); - -/** - * This function takes a source format and rate and a destination format - * and rate, and initializes the \c cvt structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. - * - * \return -1 if the format conversion is not supported, 0 if there's - * no conversion needed, or 1 if the audio filter is set up. - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, - SDL_AudioFormat src_format, - Uint8 src_channels, - int src_rate, - SDL_AudioFormat dst_format, - Uint8 dst_channels, - int dst_rate); - -/** - * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), - * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * - * The data conversion may expand the size of the audio data, so the buffer - * \c cvt->buf should be allocated after the \c cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); - -#define SDL_MIX_MAXVOLUME 128 -/** - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. - */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, - Uint32 len, int volume); - -/** - * This works like SDL_MixAudio(), but you specify the audio format instead of - * using the format of audio device 1. Thus it can be used when no audio - * device is open at all. - */ -extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, - const Uint8 * src, - SDL_AudioFormat format, - Uint32 len, int volume); - -/** - * Queue more audio on non-callback devices. - * - * SDL offers two ways to feed audio to the device: you can either supply a - * callback that SDL triggers with some frequency to obtain more audio - * (pull method), or you can supply no callback, and then SDL will expect - * you to supply data at regular intervals (push method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Queued data will drain to the device as - * necessary without further intervention from you. If the device needs - * audio but there is not enough queued, it will play silence to make up - * the difference. This means you will have skips in your audio playback - * if you aren't routinely queueing sufficient data. - * - * This function copies the supplied data, so you are safe to free it when - * the function returns. This function is thread-safe, but queueing to the - * same device from two threads at once does not promise which buffer will - * be queued first. - * - * You may not queue audio on a device that is using an application-supplied - * callback; doing so returns an error. You have to use the audio callback - * or queue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before queueing; SDL - * handles locking internally for this function. - * - * \param dev The device ID to which we will queue audio. - * \param data The data to queue to the device for later playback. - * \param len The number of bytes (not samples!) to which (data) points. - * \return zero on success, -1 on error. - * - * \sa SDL_GetQueuedAudioSize - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); - -/** - * Get the number of bytes of still-queued audio. - * - * This is the number of bytes that have been queued for playback with - * SDL_QueueAudio(), but have not yet been sent to the hardware. - * - * Once we've sent it to the hardware, this function can not decide the exact - * byte boundary of what has been played. It's possible that we just gave the - * hardware several kilobytes right before you called this function, but it - * hasn't played any of it yet, or maybe half of it, etc. - * - * You may not queue audio on a device that is using an application-supplied - * callback; calling this function on such a device always returns 0. - * You have to use the audio callback or queue audio with SDL_QueueAudio(), - * but not both. - * - * You should not call SDL_LockAudio() on the device before querying; SDL - * handles locking internally for this function. - * - * \param dev The device ID of which we will query queued audio size. - * \return Number of bytes (not samples!) of queued audio. - * - * \sa SDL_QueueAudio - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); - -/** - * Drop any queued audio data waiting to be sent to the hardware. - * - * Immediately after this call, SDL_GetQueuedAudioSize() will return 0 and - * the hardware will start playing silence if more audio isn't queued. - * - * This will not prevent playback of queued audio that's already been sent - * to the hardware, as we can not undo that, so expect there to be some - * fraction of a second of audio that might still be heard. This can be - * useful if you want to, say, drop any pending music during a level change - * in your game. - * - * You may not queue audio on a device that is using an application-supplied - * callback; calling this function on such a device is always a no-op. - * You have to use the audio callback or queue audio with SDL_QueueAudio(), - * but not both. - * - * You should not call SDL_LockAudio() on the device before clearing the - * queue; SDL handles locking internally for this function. - * - * This function always succeeds and thus returns void. - * - * \param dev The device ID of which to clear the audio queue. - * - * \sa SDL_QueueAudio - * \sa SDL_GetQueuedAudioSize - */ -extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); - - -/** - * \name Audio lock functions - * - * The lock manipulated by these functions protects the callback function. - * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that - * the callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -/* @{ */ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); -extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); -/* @} *//* Audio lock functions */ - -/** - * This function shuts down audio processing and closes the audio device. - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); -extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_audio_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_bits.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_bits.h deleted file mode 100644 index 528da2e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_bits.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_bits.h - * - * Functions for fiddling with bits and bitmasks. - */ - -#ifndef _SDL_bits_h -#define _SDL_bits_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_bits.h - */ - -/** - * Get the index of the most significant bit. Result is undefined when called - * with 0. This operation can also be stated as "count leading zeroes" and - * "log base 2". - * - * \return Index of the most significant bit, or -1 if the value is 0. - */ -SDL_FORCE_INLINE int -SDL_MostSignificantBitIndex32(Uint32 x) -{ -#if defined(__GNUC__) && __GNUC__ >= 4 - /* Count Leading Zeroes builtin in GCC. - * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html - */ - if (x == 0) { - return -1; - } - return 31 - __builtin_clz(x); -#else - /* Based off of Bit Twiddling Hacks by Sean Eron Anderson - * , released in the public domain. - * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog - */ - const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; - const int S[] = {1, 2, 4, 8, 16}; - - int msbIndex = 0; - int i; - - if (x == 0) { - return -1; - } - - for (i = 4; i >= 0; i--) - { - if (x & b[i]) - { - x >>= S[i]; - msbIndex |= S[i]; - } - } - - return msbIndex; -#endif -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_bits_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_blendmode.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_blendmode.h deleted file mode 100644 index 56d8ad6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_blendmode.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_blendmode.h - * - * Header file declaring the SDL_BlendMode enumeration - */ - -#ifndef _SDL_blendmode_h -#define _SDL_blendmode_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The blend mode used in SDL_RenderCopy() and drawing operations. - */ -typedef enum -{ - SDL_BLENDMODE_NONE = 0x00000000, /**< no blending - dstRGBA = srcRGBA */ - SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) */ - SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending - dstRGB = (srcRGB * srcA) + dstRGB - dstA = dstA */ - SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate - dstRGB = srcRGB * dstRGB - dstA = dstA */ -} SDL_BlendMode; - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_blendmode_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_clipboard.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_clipboard.h deleted file mode 100644 index a5556f2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_clipboard.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_clipboard.h - * - * Include file for SDL clipboard handling - */ - -#ifndef _SDL_clipboard_h -#define _SDL_clipboard_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -/** - * \brief Put UTF-8 text into the clipboard - * - * \sa SDL_GetClipboardText() - */ -extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); - -/** - * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() - * - * \sa SDL_SetClipboardText() - */ -extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); - -/** - * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty - * - * \sa SDL_GetClipboardText() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_clipboard_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h deleted file mode 100644 index 4270c78..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/** - * \file SDL_config.h - */ - -/* Add any platform that doesn't build using the configure system. */ -#ifdef USING_PREMAKE_CONFIG_H -#include "SDL_config_premake.h" -#elif defined(__WIN32__) -#include "SDL_config_windows.h" -#elif defined(__WINRT__) -#include "SDL_config_winrt.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__ANDROID__) -#include "SDL_config_android.h" -#elif defined(__PSP__) -#include "SDL_config_psp.h" -#else -/* This is a minimal configuration just to get SDL running on new platforms */ -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#ifdef USING_GENERATED_CONFIG_H -#error Wrong SDL_config.h, check your include path? -#endif - -#endif /* _SDL_config_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h.cmake b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h.cmake deleted file mode 100644 index 44173a0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h.cmake +++ /dev/null @@ -1,419 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -/** - * \file SDL_config.h.in - * - * This is a set of defines to configure the SDL features - */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -/* C language features */ -#cmakedefine const @HAVE_CONST@ -#cmakedefine inline @HAVE_INLINE@ -#cmakedefine volatile @HAVE_VOLATILE@ - -/* C datatypes */ -/* Define SIZEOF_VOIDP for 64/32 architectures */ -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ -#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ - -#cmakedefine HAVE_D3D_H @HAVE_D3D_H@ -#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ -#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@ -#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@ -#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@ -#cmakedefine HAVE_XAUDIO2_H @HAVE_XAUDIO2_H@ -#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ -#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ - -/* Comment this if you want to build without any C library requirements */ -#cmakedefine HAVE_LIBC 1 -#if HAVE_LIBC - -/* Useful headers */ -#cmakedefine HAVE_ALLOCA_H 1 -#cmakedefine HAVE_SYS_TYPES_H 1 -#cmakedefine HAVE_STDIO_H 1 -#cmakedefine STDC_HEADERS 1 -#cmakedefine HAVE_STDLIB_H 1 -#cmakedefine HAVE_STDARG_H 1 -#cmakedefine HAVE_MALLOC_H 1 -#cmakedefine HAVE_MEMORY_H 1 -#cmakedefine HAVE_STRING_H 1 -#cmakedefine HAVE_STRINGS_H 1 -#cmakedefine HAVE_INTTYPES_H 1 -#cmakedefine HAVE_STDINT_H 1 -#cmakedefine HAVE_CTYPE_H 1 -#cmakedefine HAVE_MATH_H 1 -#cmakedefine HAVE_ICONV_H 1 -#cmakedefine HAVE_SIGNAL_H 1 -#cmakedefine HAVE_ALTIVEC_H 1 -#cmakedefine HAVE_PTHREAD_NP_H 1 -#cmakedefine HAVE_LIBUDEV_H 1 -#cmakedefine HAVE_DBUS_DBUS_H 1 - -/* C library functions */ -#cmakedefine HAVE_MALLOC 1 -#cmakedefine HAVE_CALLOC 1 -#cmakedefine HAVE_REALLOC 1 -#cmakedefine HAVE_FREE 1 -#cmakedefine HAVE_ALLOCA 1 -#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ -#cmakedefine HAVE_GETENV 1 -#cmakedefine HAVE_SETENV 1 -#cmakedefine HAVE_PUTENV 1 -#cmakedefine HAVE_UNSETENV 1 -#endif -#cmakedefine HAVE_QSORT 1 -#cmakedefine HAVE_ABS 1 -#cmakedefine HAVE_BCOPY 1 -#cmakedefine HAVE_MEMSET 1 -#cmakedefine HAVE_MEMCPY 1 -#cmakedefine HAVE_MEMMOVE 1 -#cmakedefine HAVE_MEMCMP 1 -#cmakedefine HAVE_STRLEN 1 -#cmakedefine HAVE_STRLCPY 1 -#cmakedefine HAVE_STRLCAT 1 -#cmakedefine HAVE_STRDUP 1 -#cmakedefine HAVE__STRREV 1 -#cmakedefine HAVE__STRUPR 1 -#cmakedefine HAVE__STRLWR 1 -#cmakedefine HAVE_INDEX 1 -#cmakedefine HAVE_RINDEX 1 -#cmakedefine HAVE_STRCHR 1 -#cmakedefine HAVE_STRRCHR 1 -#cmakedefine HAVE_STRSTR 1 -#cmakedefine HAVE_ITOA 1 -#cmakedefine HAVE__LTOA 1 -#cmakedefine HAVE__UITOA 1 -#cmakedefine HAVE__ULTOA 1 -#cmakedefine HAVE_STRTOL 1 -#cmakedefine HAVE_STRTOUL 1 -#cmakedefine HAVE__I64TOA 1 -#cmakedefine HAVE__UI64TOA 1 -#cmakedefine HAVE_STRTOLL 1 -#cmakedefine HAVE_STRTOULL 1 -#cmakedefine HAVE_STRTOD 1 -#cmakedefine HAVE_ATOI 1 -#cmakedefine HAVE_ATOF 1 -#cmakedefine HAVE_STRCMP 1 -#cmakedefine HAVE_STRNCMP 1 -#cmakedefine HAVE__STRICMP 1 -#cmakedefine HAVE_STRCASECMP 1 -#cmakedefine HAVE__STRNICMP 1 -#cmakedefine HAVE_STRNCASECMP 1 -#cmakedefine HAVE_VSSCANF 1 -#cmakedefine HAVE_VSNPRINTF 1 -#cmakedefine HAVE_M_PI 1 -#cmakedefine HAVE_ATAN 1 -#cmakedefine HAVE_ATAN2 1 -#cmakedefine HAVE_ACOS 1 -#cmakedefine HAVE_ASIN 1 -#cmakedefine HAVE_CEIL 1 -#cmakedefine HAVE_COPYSIGN 1 -#cmakedefine HAVE_COS 1 -#cmakedefine HAVE_COSF 1 -#cmakedefine HAVE_FABS 1 -#cmakedefine HAVE_FLOOR 1 -#cmakedefine HAVE_LOG 1 -#cmakedefine HAVE_POW 1 -#cmakedefine HAVE_SCALBN 1 -#cmakedefine HAVE_SIN 1 -#cmakedefine HAVE_SINF 1 -#cmakedefine HAVE_SQRT 1 -#cmakedefine HAVE_SQRTF 1 -#cmakedefine HAVE_TAN 1 -#cmakedefine HAVE_TANF 1 -#cmakedefine HAVE_FSEEKO 1 -#cmakedefine HAVE_FSEEKO64 1 -#cmakedefine HAVE_SIGACTION 1 -#cmakedefine HAVE_SA_SIGACTION 1 -#cmakedefine HAVE_SETJMP 1 -#cmakedefine HAVE_NANOSLEEP 1 -#cmakedefine HAVE_SYSCONF 1 -#cmakedefine HAVE_SYSCTLBYNAME 1 -#cmakedefine HAVE_CLOCK_GETTIME 1 -#cmakedefine HAVE_GETPAGESIZE 1 -#cmakedefine HAVE_MPROTECT 1 -#cmakedefine HAVE_ICONV 1 -#cmakedefine HAVE_PTHREAD_SETNAME_NP 1 -#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 -#cmakedefine HAVE_SEM_TIMEDWAIT 1 -#elif __WIN32__ -#cmakedefine HAVE_STDARG_H 1 -#cmakedefine HAVE_STDDEF_H 1 -#else -/* We may need some replacement for stdarg.h here */ -#include -#endif /* HAVE_LIBC */ - -/* SDL internal assertion support */ -#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ - -/* Allow disabling of core subsystems */ -#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@ -#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@ -#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@ -#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@ -#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ -#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ -#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ -#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ -#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ -#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@ -#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@ -#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@ -#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@ -#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@ - -/* Enable various audio drivers */ -#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ -#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@ -#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ -#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ -#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@ -#cmakedefine SDL_AUDIO_DRIVER_BSD @SDL_AUDIO_DRIVER_BSD@ -#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ -#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ -#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ -#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@ -#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ -#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ -#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ -#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ -#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ -#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@ -#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ -#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ -#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ -#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@ - -/* Enable various input drivers */ -#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ -#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ -#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ -#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ -#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ -#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ -#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@ -#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ -#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ -#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@ -#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ -#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ -#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ -#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ -#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ -#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ -#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ -#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ -#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ -#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ - -/* Enable various shared object loading systems */ -#cmakedefine SDL_LOADSO_HAIKU @SDL_LOADSO_HAIKU@ -#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ -#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ -#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ -#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ - -/* Enable various threading systems */ -#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@ -#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ -#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ -#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ - -/* Enable various timer systems */ -#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ -#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ -#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ -#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ -#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@ - -/* Enable various video drivers */ -#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ -#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@ -#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@ -#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@ -#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ -#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ -#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ -#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@ -#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ -#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ -#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ - -#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@ -#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@ -#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@ -#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@ -#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@ - -#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@ -#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@ -#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@ -#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@ -#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ -#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@ -#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@ -#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ -#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@ -#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ - -#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@ -#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@ -#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@ -#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@ -#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ -#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ - -/* Enable OpenGL support */ -#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ -#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@ -#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@ -#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@ -#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@ -#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@ -#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@ -#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@ -#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@ -#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@ - -/* Enable system power support */ -#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@ -#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ -#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ -#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ -#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ -#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ -#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ - -/* Enable system filesystem support */ -#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@ -#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@ -#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@ -#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@ -#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ -#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ -#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ - -/* Enable assembly routines */ -#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@ -#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@ - - -/* Platform specific definitions */ -#if !defined(__WIN32__) -# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) -typedef unsigned int size_t; -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -# endif /* if (stdint.h isn't available) */ -#else /* __WIN32__ */ -# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) -# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -# elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -# ifndef _UINTPTR_T_DEFINED -# ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -# else -typedef unsigned int uintptr_t; -# endif -#define _UINTPTR_T_DEFINED -# endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -# endif -# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -# endif -# else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -# ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -# endif -typedef unsigned int uintptr_t; -# endif /* __GNUC__ || _MSC_VER */ -# endif /* !_STDINT_H_ && !HAVE_STDINT_H */ -#endif /* __WIN32__ */ - -#endif /* _SDL_config_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h.in b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h.in deleted file mode 100644 index 2071be4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config.h.in +++ /dev/null @@ -1,359 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -/** - * \file SDL_config.h.in - * - * This is a set of defines to configure the SDL features - */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -/* Make sure that this isn't included by Visual C++ */ -#ifdef _MSC_VER -#error You should run hg revert SDL_config.h -#endif - -/* C language features */ -#undef const -#undef inline -#undef volatile - -/* C datatypes */ -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif -#undef HAVE_GCC_ATOMICS -#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET - -#undef HAVE_DDRAW_H -#undef HAVE_DINPUT_H -#undef HAVE_DSOUND_H -#undef HAVE_DXGI_H -#undef HAVE_XINPUT_H - -/* Comment this if you want to build without any C library requirements */ -#undef HAVE_LIBC -#if HAVE_LIBC - -/* Useful headers */ -#undef HAVE_ALLOCA_H -#undef HAVE_SYS_TYPES_H -#undef HAVE_STDIO_H -#undef STDC_HEADERS -#undef HAVE_STDLIB_H -#undef HAVE_STDARG_H -#undef HAVE_MALLOC_H -#undef HAVE_MEMORY_H -#undef HAVE_STRING_H -#undef HAVE_STRINGS_H -#undef HAVE_INTTYPES_H -#undef HAVE_STDINT_H -#undef HAVE_CTYPE_H -#undef HAVE_MATH_H -#undef HAVE_ICONV_H -#undef HAVE_SIGNAL_H -#undef HAVE_ALTIVEC_H -#undef HAVE_PTHREAD_NP_H -#undef HAVE_LIBUDEV_H -#undef HAVE_DBUS_DBUS_H -#undef HAVE_IBUS_IBUS_H - -/* C library functions */ -#undef HAVE_MALLOC -#undef HAVE_CALLOC -#undef HAVE_REALLOC -#undef HAVE_FREE -#undef HAVE_ALLOCA -#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ -#undef HAVE_GETENV -#undef HAVE_SETENV -#undef HAVE_PUTENV -#undef HAVE_UNSETENV -#endif -#undef HAVE_QSORT -#undef HAVE_ABS -#undef HAVE_BCOPY -#undef HAVE_MEMSET -#undef HAVE_MEMCPY -#undef HAVE_MEMMOVE -#undef HAVE_MEMCMP -#undef HAVE_STRLEN -#undef HAVE_STRLCPY -#undef HAVE_STRLCAT -#undef HAVE_STRDUP -#undef HAVE__STRREV -#undef HAVE__STRUPR -#undef HAVE__STRLWR -#undef HAVE_INDEX -#undef HAVE_RINDEX -#undef HAVE_STRCHR -#undef HAVE_STRRCHR -#undef HAVE_STRSTR -#undef HAVE_ITOA -#undef HAVE__LTOA -#undef HAVE__UITOA -#undef HAVE__ULTOA -#undef HAVE_STRTOL -#undef HAVE_STRTOUL -#undef HAVE__I64TOA -#undef HAVE__UI64TOA -#undef HAVE_STRTOLL -#undef HAVE_STRTOULL -#undef HAVE_STRTOD -#undef HAVE_ATOI -#undef HAVE_ATOF -#undef HAVE_STRCMP -#undef HAVE_STRNCMP -#undef HAVE__STRICMP -#undef HAVE_STRCASECMP -#undef HAVE__STRNICMP -#undef HAVE_STRNCASECMP -#undef HAVE_SSCANF -#undef HAVE_VSSCANF -#undef HAVE_SNPRINTF -#undef HAVE_VSNPRINTF -#undef HAVE_M_PI -#undef HAVE_ATAN -#undef HAVE_ATAN2 -#undef HAVE_ACOS -#undef HAVE_ASIN -#undef HAVE_CEIL -#undef HAVE_COPYSIGN -#undef HAVE_COS -#undef HAVE_COSF -#undef HAVE_FABS -#undef HAVE_FLOOR -#undef HAVE_LOG -#undef HAVE_POW -#undef HAVE_SCALBN -#undef HAVE_SIN -#undef HAVE_SINF -#undef HAVE_SQRT -#undef HAVE_SQRTF -#undef HAVE_TAN -#undef HAVE_TANF -#undef HAVE_FSEEKO -#undef HAVE_FSEEKO64 -#undef HAVE_SIGACTION -#undef HAVE_SA_SIGACTION -#undef HAVE_SETJMP -#undef HAVE_NANOSLEEP -#undef HAVE_SYSCONF -#undef HAVE_SYSCTLBYNAME -#undef HAVE_CLOCK_GETTIME -#undef HAVE_GETPAGESIZE -#undef HAVE_MPROTECT -#undef HAVE_ICONV -#undef HAVE_PTHREAD_SETNAME_NP -#undef HAVE_PTHREAD_SET_NAME_NP -#undef HAVE_SEM_TIMEDWAIT - -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_STDINT_H 1 -#endif /* HAVE_LIBC */ - -/* SDL internal assertion support */ -#undef SDL_DEFAULT_ASSERT_LEVEL - -/* Allow disabling of core subsystems */ -#undef SDL_ATOMIC_DISABLED -#undef SDL_AUDIO_DISABLED -#undef SDL_CPUINFO_DISABLED -#undef SDL_EVENTS_DISABLED -#undef SDL_FILE_DISABLED -#undef SDL_JOYSTICK_DISABLED -#undef SDL_HAPTIC_DISABLED -#undef SDL_LOADSO_DISABLED -#undef SDL_RENDER_DISABLED -#undef SDL_THREADS_DISABLED -#undef SDL_TIMERS_DISABLED -#undef SDL_VIDEO_DISABLED -#undef SDL_POWER_DISABLED -#undef SDL_FILESYSTEM_DISABLED - -/* Enable various audio drivers */ -#undef SDL_AUDIO_DRIVER_ALSA -#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC -#undef SDL_AUDIO_DRIVER_ARTS -#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC -#undef SDL_AUDIO_DRIVER_PULSEAUDIO -#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC -#undef SDL_AUDIO_DRIVER_HAIKU -#undef SDL_AUDIO_DRIVER_BSD -#undef SDL_AUDIO_DRIVER_COREAUDIO -#undef SDL_AUDIO_DRIVER_DISK -#undef SDL_AUDIO_DRIVER_DUMMY -#undef SDL_AUDIO_DRIVER_ANDROID -#undef SDL_AUDIO_DRIVER_XAUDIO2 -#undef SDL_AUDIO_DRIVER_DSOUND -#undef SDL_AUDIO_DRIVER_ESD -#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#undef SDL_AUDIO_DRIVER_NACL -#undef SDL_AUDIO_DRIVER_NAS -#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC -#undef SDL_AUDIO_DRIVER_SNDIO -#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC -#undef SDL_AUDIO_DRIVER_OSS -#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H -#undef SDL_AUDIO_DRIVER_PAUDIO -#undef SDL_AUDIO_DRIVER_QSA -#undef SDL_AUDIO_DRIVER_SUNAUDIO -#undef SDL_AUDIO_DRIVER_WINMM -#undef SDL_AUDIO_DRIVER_FUSIONSOUND -#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC -#undef SDL_AUDIO_DRIVER_EMSCRIPTEN - -/* Enable various input drivers */ -#undef SDL_INPUT_LINUXEV -#undef SDL_INPUT_LINUXKD -#undef SDL_INPUT_TSLIB -#undef SDL_JOYSTICK_HAIKU -#undef SDL_JOYSTICK_DINPUT -#undef SDL_JOYSTICK_XINPUT -#undef SDL_JOYSTICK_DUMMY -#undef SDL_JOYSTICK_IOKIT -#undef SDL_JOYSTICK_LINUX -#undef SDL_JOYSTICK_ANDROID -#undef SDL_JOYSTICK_WINMM -#undef SDL_JOYSTICK_USBHID -#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H -#undef SDL_JOYSTICK_EMSCRIPTEN -#undef SDL_HAPTIC_DUMMY -#undef SDL_HAPTIC_LINUX -#undef SDL_HAPTIC_IOKIT -#undef SDL_HAPTIC_DINPUT -#undef SDL_HAPTIC_XINPUT - -/* Enable various shared object loading systems */ -#undef SDL_LOADSO_HAIKU -#undef SDL_LOADSO_DLOPEN -#undef SDL_LOADSO_DUMMY -#undef SDL_LOADSO_LDG -#undef SDL_LOADSO_WINDOWS - -/* Enable various threading systems */ -#undef SDL_THREAD_PTHREAD -#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX -#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP -#undef SDL_THREAD_WINDOWS - -/* Enable various timer systems */ -#undef SDL_TIMER_HAIKU -#undef SDL_TIMER_DUMMY -#undef SDL_TIMER_UNIX -#undef SDL_TIMER_WINDOWS - -/* Enable various video drivers */ -#undef SDL_VIDEO_DRIVER_HAIKU -#undef SDL_VIDEO_DRIVER_COCOA -#undef SDL_VIDEO_DRIVER_DIRECTFB -#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC -#undef SDL_VIDEO_DRIVER_DUMMY -#undef SDL_VIDEO_DRIVER_WINDOWS -#undef SDL_VIDEO_DRIVER_WAYLAND -#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON -#undef SDL_VIDEO_DRIVER_MIR -#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC -#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON -#undef SDL_VIDEO_DRIVER_X11 -#undef SDL_VIDEO_DRIVER_RPI -#undef SDL_VIDEO_DRIVER_ANDROID -#undef SDL_VIDEO_DRIVER_EMSCRIPTEN -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE -#undef SDL_VIDEO_DRIVER_X11_XCURSOR -#undef SDL_VIDEO_DRIVER_X11_XDBE -#undef SDL_VIDEO_DRIVER_X11_XINERAMA -#undef SDL_VIDEO_DRIVER_X11_XINPUT2 -#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH -#undef SDL_VIDEO_DRIVER_X11_XRANDR -#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER -#undef SDL_VIDEO_DRIVER_X11_XSHAPE -#undef SDL_VIDEO_DRIVER_X11_XVIDMODE -#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS -#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY -#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM -#undef SDL_VIDEO_DRIVER_NACL -#undef SDL_VIDEO_DRIVER_VIVANTE -#undef SDL_VIDEO_DRIVER_VIVANTE_VDK - -#undef SDL_VIDEO_RENDER_D3D -#undef SDL_VIDEO_RENDER_D3D11 -#undef SDL_VIDEO_RENDER_OGL -#undef SDL_VIDEO_RENDER_OGL_ES -#undef SDL_VIDEO_RENDER_OGL_ES2 -#undef SDL_VIDEO_RENDER_DIRECTFB - -/* Enable OpenGL support */ -#undef SDL_VIDEO_OPENGL -#undef SDL_VIDEO_OPENGL_ES -#undef SDL_VIDEO_OPENGL_ES2 -#undef SDL_VIDEO_OPENGL_BGL -#undef SDL_VIDEO_OPENGL_CGL -#undef SDL_VIDEO_OPENGL_EGL -#undef SDL_VIDEO_OPENGL_GLX -#undef SDL_VIDEO_OPENGL_WGL -#undef SDL_VIDEO_OPENGL_OSMESA -#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC - -/* Enable system power support */ -#undef SDL_POWER_LINUX -#undef SDL_POWER_WINDOWS -#undef SDL_POWER_MACOSX -#undef SDL_POWER_HAIKU -#undef SDL_POWER_ANDROID -#undef SDL_POWER_EMSCRIPTEN -#undef SDL_POWER_HARDWIRED - -/* Enable system filesystem support */ -#undef SDL_FILESYSTEM_HAIKU -#undef SDL_FILESYSTEM_COCOA -#undef SDL_FILESYSTEM_DUMMY -#undef SDL_FILESYSTEM_UNIX -#undef SDL_FILESYSTEM_WINDOWS -#undef SDL_FILESYSTEM_NACL -#undef SDL_FILESYSTEM_ANDROID -#undef SDL_FILESYSTEM_EMSCRIPTEN - -/* Enable assembly routines */ -#undef SDL_ASSEMBLY_ROUTINES -#undef SDL_ALTIVEC_BLITTERS - -#endif /* _SDL_config_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_android.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_android.h deleted file mode 100644 index a388ba8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_android.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_android_h -#define _SDL_config_android_h - -#include "SDL_platform.h" - -/** - * \file SDL_config_android.h - * - * This is a configuration that can be used to build SDL for Android - */ - -#include - -#define HAVE_GCC_ATOMICS 1 - -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_CLOCK_GETTIME 1 - -#define SIZEOF_VOIDP 4 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_ANDROID 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_ANDROID 1 -#define SDL_HAPTIC_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_ANDROID 1 - -/* Enable OpenGL ES */ -#define SDL_VIDEO_OPENGL_ES 1 -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES2 1 - -/* Enable system power support */ -#define SDL_POWER_ANDROID 1 - -/* Enable the filesystem driver */ -#define SDL_FILESYSTEM_ANDROID 1 - -#endif /* _SDL_config_android_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_iphoneos.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_iphoneos.h deleted file mode 100644 index 304c892..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_iphoneos.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_iphoneos_h -#define _SDL_config_iphoneos_h - -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define HAVE_GCC_ATOMICS 1 - -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_SYSCTLBYNAME 1 - -/* enable iPhone version of Core Audio driver */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DUMMY 1 - -/* Enable MFi joystick support */ -#define SDL_JOYSTICK_MFI 1 - -/* Enable Unix style SO loading */ -/* Technically this works, but violates the iOS dev agreement prior to iOS 8 */ -/* #define SDL_LOADSO_DLOPEN 1 */ - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Supported video drivers */ -#define SDL_VIDEO_DRIVER_UIKIT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* enable OpenGL ES */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES2 1 - -/* Enable system power support */ -#define SDL_POWER_UIKIT 1 - -/* enable iPhone keyboard support */ -#define SDL_IPHONE_KEYBOARD 1 - -/* enable iOS extended launch screen */ -#define SDL_IPHONE_LAUNCHSCREEN 1 - -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - -/* enable filesystem support */ -#define SDL_FILESYSTEM_COCOA 1 - -#endif /* _SDL_config_iphoneos_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_macosx.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_macosx.h deleted file mode 100644 index 5c8b7e0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_macosx.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_macosx_h -#define _SDL_config_macosx_h - -#include "SDL_platform.h" - -/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ -#include - -/* This is a set of defines to configure the SDL features */ - -#ifdef __LP64__ - #define SIZEOF_VOIDP 8 -#else - #define SIZEOF_VOIDP 4 -#endif - -/* Useful headers */ -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_SYSCTLBYNAME 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 -#define SDL_HAPTIC_IOKIT 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_COCOA 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 -#undef SDL_VIDEO_DRIVER_X11 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" -#define SDL_VIDEO_DRIVER_X11_XDBE 1 -#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 -#define SDL_VIDEO_DRIVER_X11_XRANDR 1 -#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 -#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 -#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 -#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 - -#ifdef MAC_OS_X_VERSION_10_8 -/* - * No matter the versions targeted, this is the 10.8 or later SDK, so you have - * to use the external Xquartz, which is a more modern Xlib. Previous SDKs - * used an older Xlib. - */ -#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 -#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 -#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 -#endif - -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_CGL -#define SDL_VIDEO_OPENGL_CGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_GLX -#define SDL_VIDEO_OPENGL_GLX 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_MACOSX 1 - -/* enable filesystem support */ -#define SDL_FILESYSTEM_COCOA 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 -#ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 -#endif - -#endif /* _SDL_config_macosx_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_minimal.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_minimal.h deleted file mode 100644 index 3c9d09a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_minimal.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_minimal_h -#define _SDL_config_minimal_h - -#include "SDL_platform.h" - -/** - * \file SDL_config_minimal.h - * - * This is the minimal configuration that can be used to build SDL. - */ - -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 - -/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ -#if defined(_MSC_VER) && (_MSC_VER < 1600) -/* Here are some reasonable defaults */ -typedef unsigned int size_t; -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -#else -#define HAVE_STDINT_H 1 -#endif /* Visual Studio 2008 */ - -#ifdef __GNUC__ -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 -#endif - -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 - -/* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ -#define SDL_FILESYSTEM_DUMMY 1 - -#endif /* _SDL_config_minimal_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_pandora.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_pandora.h deleted file mode 100644 index 7b51e57..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_pandora.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define SDL_BYTEORDER 1234 - -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 -#define SDL_FILESYSTEM_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* _SDL_config_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_psp.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_psp.h deleted file mode 100644 index a6e4960..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_psp.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_psp_h -#define _SDL_config_psp_h - -#include "SDL_platform.h" - - - -#ifdef __GNUC__ -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 -#endif - -#define HAVE_GCC_ATOMICS 1 - -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -/* #define HAVE_SYSCONF 1 */ -/* #define HAVE_SIGACTION 1 */ - - -/* PSP isn't that sophisticated */ -#define LACKS_SYS_MMAN_H 1 - -/* Enable the stub thread support (src/thread/psp/\*.c) */ -#define SDL_THREAD_PSP 1 - -/* Enable the stub timer support (src/timer/psp/\*.c) */ -#define SDL_TIMERS_PSP 1 - -/* Enable the stub joystick driver (src/joystick/psp/\*.c) */ -#define SDL_JOYSTICK_PSP 1 - -/* Enable the stub audio driver (src/audio/psp/\*.c) */ -#define SDL_AUDIO_DRIVER_PSP 1 - -/* PSP video dirver */ -#define SDL_VIDEO_DRIVER_PSP 1 - -/* PSP render dirver */ -#define SDL_VIDEO_RENDER_PSP 1 - -#define SDL_POWER_PSP 1 - -/* !!! FIXME: what does PSP do for filesystem stuff? */ -#define SDL_FILESYSTEM_DUMMY 1 - -/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* PSP can't load shared object (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - - -#endif /* _SDL_config_psp_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_windows.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_windows.h deleted file mode 100644 index 890986c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_windows.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_windows_h -#define _SDL_config_windows_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -#define HAVE_DDRAW_H 1 -#define HAVE_DINPUT_H 1 -#define HAVE_DSOUND_H 1 -#define HAVE_DXGI_H 1 -#define HAVE_XINPUT_H 1 - -/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ -#ifdef HAVE_LIBC -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_CEIL 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#if _MSC_VER >= 1800 -#define HAVE_STRTOLL 1 -#define HAVE_VSSCANF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_SCALBN 1 -#endif -#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) -#define HAVE_M_PI 1 -#endif -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_XAUDIO2 1 -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_HAPTIC_DINPUT 1 -#define SDL_HAPTIC_XINPUT 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WINDOWS 1 - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 - -#ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif -#ifndef SDL_VIDEO_RENDER_D3D11 -#define SDL_VIDEO_RENDER_D3D11 0 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif - - -/* Enable system power support */ -#define SDL_POWER_WINDOWS 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* _SDL_config_windows_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_winrt.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_winrt.h deleted file mode 100644 index e392f77..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_winrt.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_winrt_h -#define _SDL_config_winrt_h - -#include "SDL_platform.h" - -/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used - by SDL to determine which version of the Windows SDK is being used. -*/ -#include - -/* Define possibly-undefined NTDDI values (used when compiling SDL against - older versions of the Windows SDK. -*/ -#ifndef NTDDI_WINBLUE -#define NTDDI_WINBLUE 0x06030000 -#endif -#ifndef NTDDI_WIN10 -#define NTDDI_WIN10 0x0A000000 -#endif - -/* This is a set of defines to configure the SDL features */ - -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -/* Useful headers */ -#define HAVE_DXGI_H 1 -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP -#define HAVE_XINPUT_H 1 -#endif -#define HAVE_LIBC 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead -//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead -//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -//#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_VSNPRINTF 1 -//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead -#define HAVE_M_PI 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_CEIL 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -//#define HAVE_SCALBN 1 -#define HAVE__SCALB 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE__FSEEKI64 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_XAUDIO2 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 -#else -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_HAPTIC_XINPUT 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#if (NTDDI_VERSION >= NTDDI_WINBLUE) -#define SDL_THREAD_WINDOWS 1 -#else -/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ -#define SDL_THREAD_STDCPP 1 -#endif - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_WINRT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 - -/* Enable appropriate renderer(s) */ -#define SDL_VIDEO_RENDER_D3D11 1 - -#if SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_WINRT 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* _SDL_config_winrt_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_wiz.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_wiz.h deleted file mode 100644 index e090a1a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_config_wiz.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#define SDL_BYTEORDER 1234 - -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_POW 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* _SDL_config_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_copying.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_copying.h deleted file mode 100644 index 212da0e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_copying.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_cpuinfo.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_cpuinfo.h deleted file mode 100644 index d0ba47b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_cpuinfo.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_cpuinfo.h - * - * CPU feature detection for SDL. - */ - -#ifndef _SDL_cpuinfo_h -#define _SDL_cpuinfo_h - -#include "SDL_stdinc.h" - -/* Need to do this here because intrin.h has C++ code in it */ -/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ -#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) -#include -#ifndef _WIN64 -#define __MMX__ -#define __3dNOW__ -#endif -#define __SSE__ -#define __SSE2__ -#elif defined(__MINGW64_VERSION_MAJOR) -#include -#else -#ifdef __ALTIVEC__ -#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) -#include -#undef pixel -#endif -#endif -#ifdef __MMX__ -#include -#endif -#ifdef __3dNOW__ -#include -#endif -#ifdef __SSE__ -#include -#endif -#ifdef __SSE2__ -#include -#endif -#endif - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* This is a guess for the cacheline size used for padding. - * Most x86 processors have a 64 byte cache line. - * The 64-bit PowerPC processors have a 128 byte cache line. - * We'll use the larger value to be generally safe. - */ -#define SDL_CACHELINE_SIZE 128 - -/** - * This function returns the number of CPU cores available. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); - -/** - * This function returns the L1 cache line size of the CPU - * - * This is useful for determining multi-threaded structure padding - * or SIMD prefetch sizes. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); - -/** - * This function returns true if the CPU has the RDTSC instruction. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/** - * This function returns true if the CPU has AltiVec features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/** - * This function returns true if the CPU has MMX features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/** - * This function returns true if the CPU has 3DNow! features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/** - * This function returns true if the CPU has SSE features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/** - * This function returns true if the CPU has SSE2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/** - * This function returns true if the CPU has SSE3 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); - -/** - * This function returns true if the CPU has SSE4.1 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); - -/** - * This function returns true if the CPU has SSE4.2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); - -/** - * This function returns true if the CPU has AVX features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); - -/** - * This function returns true if the CPU has AVX2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); - -/** - * This function returns the amount of RAM configured in the system, in MB. - */ -extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_cpuinfo_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_egl.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_egl.h deleted file mode 100644 index bea2a6c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_egl.h +++ /dev/null @@ -1,1673 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_egl.h - * - * This is a simple file to encapsulate the EGL API headers. - */ -#ifndef _MSC_VER - -#include -#include - -#else /* _MSC_VER */ - -/* EGL headers for Visual Studio */ - -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. -* -* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ -* -* Adopters may modify this file to suit their platform. Adopters are -* encouraged to submit platform specific modifications to the Khronos -* group so that they can be included in future versions of this file. -* Please submit changes by sending them to the public Khronos Bugzilla -* (http://khronos.org/bugzilla) by filing a bug against product -* "Khronos (general)" component "Registry". -* -* A predefined template which fills in some of the bug fields can be -* reached using http://tinyurl.com/khrplatform-h-bugreport, but you -* must create a Bugzilla login first. -* -* -* See the Implementer's Guidelines for information about where this file -* should be located on your system and for more details of its use: -* http://www.khronos.org/registry/implementers_guide.pdf -* -* This file should be included as -* #include -* by Khronos client API header files that use its types and defines. -* -* The types in khrplatform.h should only be used to define API-specific types. -* -* Types defined in khrplatform.h: -* khronos_int8_t signed 8 bit -* khronos_uint8_t unsigned 8 bit -* khronos_int16_t signed 16 bit -* khronos_uint16_t unsigned 16 bit -* khronos_int32_t signed 32 bit -* khronos_uint32_t unsigned 32 bit -* khronos_int64_t signed 64 bit -* khronos_uint64_t unsigned 64 bit -* khronos_intptr_t signed same number of bits as a pointer -* khronos_uintptr_t unsigned same number of bits as a pointer -* khronos_ssize_t signed size -* khronos_usize_t unsigned size -* khronos_float_t signed 32 bit floating point -* khronos_time_ns_t unsigned 64 bit time in nanoseconds -* khronos_utime_nanoseconds_t unsigned time interval or absolute time in -* nanoseconds -* khronos_stime_nanoseconds_t signed time interval in nanoseconds -* khronos_boolean_enum_t enumerated boolean type. This should -* only be used as a base type when a client API's boolean type is -* an enum. Client APIs which use an integer or other type for -* booleans cannot use this as the base type for their boolean. -* -* Tokens defined in khrplatform.h: -* -* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. -* -* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. -* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. -* -* Calling convention macros defined in this file: -* KHRONOS_APICALL -* KHRONOS_APIENTRY -* KHRONOS_APIATTRIBUTES -* -* These may be used in function prototypes as: -* -* KHRONOS_APICALL void KHRONOS_APIENTRY funcname( -* int arg1, -* int arg2) KHRONOS_APIATTRIBUTES; -*/ - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APICALL -*------------------------------------------------------------------------- -* This precedes the return type of the function in the function prototype. -*/ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APIENTRY -*------------------------------------------------------------------------- -* This follows the return type of the function and precedes the function -* name in the function prototype. -*/ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) -/* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APIATTRIBUTES -*------------------------------------------------------------------------- -* This follows the closing parenthesis of the function prototype arguments. -*/ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- -* basic type definitions -*-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* -* Using -*/ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* -* Using -*/ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* -* Win32 -*/ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* -* Sun or Digital -*/ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* -* Hypothetical platform with no float or int64 support -*/ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* -* Generic fallback -*/ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* -* Types that are (so far) the same on all platforms -*/ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* -* Types that differ between LLP64 and LP64 architectures - in LLP64, -* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears -* to be the only LLP64 architecture in current use. -*/ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* -* Float type -*/ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types -* -* These types can be used to represent a time interval in nanoseconds or -* an absolute Unadjusted System Time. Unadjusted System Time is the number -* of nanoseconds since some arbitrary system event (e.g. since the last -* time the system booted). The Unadjusted System Time is an unsigned -* 64 bit value that wraps back to 0 every 584 years. Time intervals -* may be either signed or unsigned. -*/ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* -* Dummy value used to pad enum types to 32 bits. -*/ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* -* Enumerated boolean type -* -* Values other than zero should be considered to be true. Therefore -* comparisons should not be made against KHRONOS_TRUE. -*/ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - - -#ifndef __eglplatform_h_ -#define __eglplatform_h_ - -/* -** Copyright (c) 2007-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Platform-specific types and definitions for egl.h -* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ -* -* Adopters may modify khrplatform.h and this file to suit their platform. -* You are encouraged to submit all modifications to the Khronos group so that -* they can be included in future versions of this file. Please submit changes -* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) -* by filing a bug against product "EGL" component "Registry". -*/ - -/*#include */ - -/* Macros used in EGL function prototype declarations. -* -* EGL functions should be prototyped as: -* -* EGLAPI return-type EGLAPIENTRY eglFunction(arguments); -* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); -* -* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h -*/ - -#ifndef EGLAPI -#define EGLAPI KHRONOS_APICALL -#endif - -#ifndef EGLAPIENTRY -#define EGLAPIENTRY KHRONOS_APIENTRY -#endif -#define EGLAPIENTRYP EGLAPIENTRY* - -/* The types NativeDisplayType, NativeWindowType, and NativePixmapType -* are aliases of window-system-dependent types, such as X Display * or -* Windows Device Context. They must be defined in platform-specific -* code below. The EGL-prefixed versions of Native*Type are the same -* types, renamed in EGL 1.3 so all types in the API start with "EGL". -* -* Khronos STRONGLY RECOMMENDS that you use the default definitions -* provided below, since these changes affect both binary and source -* portability of applications using EGL running on different EGL -* implementations. -*/ - -#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#include - -#if __WINRT__ -#include -typedef IUnknown * EGLNativeWindowType; -typedef IUnknown * EGLNativePixmapType; -typedef IUnknown * EGLNativeDisplayType; -#else -typedef HDC EGLNativeDisplayType; -typedef HBITMAP EGLNativePixmapType; -typedef HWND EGLNativeWindowType; -#endif - -#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ - -typedef int EGLNativeDisplayType; -typedef void *EGLNativeWindowType; -typedef void *EGLNativePixmapType; - -#elif defined(WL_EGL_PLATFORM) - -typedef struct wl_display *EGLNativeDisplayType; -typedef struct wl_egl_pixmap *EGLNativePixmapType; -typedef struct wl_egl_window *EGLNativeWindowType; - -#elif defined(__GBM__) - -typedef struct gbm_device *EGLNativeDisplayType; -typedef struct gbm_bo *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(__ANDROID__) /* Android */ - -struct ANativeWindow; -struct egl_native_pixmap_t; - -typedef struct ANativeWindow *EGLNativeWindowType; -typedef struct egl_native_pixmap_t *EGLNativePixmapType; -typedef void *EGLNativeDisplayType; - -#elif defined(MIR_EGL_PLATFORM) - -#include -typedef MirEGLNativeDisplayType EGLNativeDisplayType; -typedef void *EGLNativePixmapType; -typedef MirEGLNativeWindowType EGLNativeWindowType; - -#elif defined(__unix__) - -#ifdef MESA_EGL_NO_X11_HEADERS - -typedef void *EGLNativeDisplayType; -typedef khronos_uintptr_t EGLNativePixmapType; -typedef khronos_uintptr_t EGLNativeWindowType; - -#else - -/* X11 (tentative) */ -#include -#include - -typedef Display *EGLNativeDisplayType; -typedef Pixmap EGLNativePixmapType; -typedef Window EGLNativeWindowType; - -#endif /* MESA_EGL_NO_X11_HEADERS */ - -#else -#error "Platform not recognized" -#endif - -/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ -typedef EGLNativeDisplayType NativeDisplayType; -typedef EGLNativePixmapType NativePixmapType; -typedef EGLNativeWindowType NativeWindowType; - - -/* Define EGLint. This must be a signed integral type large enough to contain -* all legal attribute names and values passed into and out of EGL, whether -* their type is boolean, bitmask, enumerant (symbolic constant), integer, -* handle, or other. While in general a 32-bit integer will suffice, if -* handles are 64 bit types, then EGLint should be defined as a signed 64-bit -* integer type. -*/ -typedef khronos_int32_t EGLint; - -#endif /* __eglplatform_h */ - -#ifndef __egl_h_ -#define __egl_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ -*/ - -/*#include */ - -/* Generated on date 20150623 */ - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: .* - * Default extensions included: None - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_VERSION_1_0 -#define EGL_VERSION_1_0 1 -typedef unsigned int EGLBoolean; -typedef void *EGLDisplay; -typedef void *EGLConfig; -typedef void *EGLSurface; -typedef void *EGLContext; -typedef void (*__eglMustCastToProperFunctionPointerType)(void); -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300A -#define EGL_BAD_NATIVE_WINDOW 0x300B -#define EGL_BAD_PARAMETER 0x300C -#define EGL_BAD_SURFACE 0x300D -#define EGL_BLUE_SIZE 0x3022 -#define EGL_BUFFER_SIZE 0x3020 -#define EGL_CONFIG_CAVEAT 0x3027 -#define EGL_CONFIG_ID 0x3028 -#define EGL_CORE_NATIVE_ENGINE 0x305B -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_DONT_CARE ((EGLint)-1) -#define EGL_DRAW 0x3059 -#define EGL_EXTENSIONS 0x3055 -#define EGL_FALSE 0 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_HEIGHT 0x3056 -#define EGL_LARGEST_PBUFFER 0x3058 -#define EGL_LEVEL 0x3029 -#define EGL_MAX_PBUFFER_HEIGHT 0x302A -#define EGL_MAX_PBUFFER_PIXELS 0x302B -#define EGL_MAX_PBUFFER_WIDTH 0x302C -#define EGL_NATIVE_RENDERABLE 0x302D -#define EGL_NATIVE_VISUAL_ID 0x302E -#define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_NONE 0x3038 -#define EGL_NON_CONFORMANT_CONFIG 0x3051 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_NO_CONTEXT ((EGLContext)0) -#define EGL_NO_DISPLAY ((EGLDisplay)0) -#define EGL_NO_SURFACE ((EGLSurface)0) -#define EGL_PBUFFER_BIT 0x0001 -#define EGL_PIXMAP_BIT 0x0002 -#define EGL_READ 0x305A -#define EGL_RED_SIZE 0x3024 -#define EGL_SAMPLES 0x3031 -#define EGL_SAMPLE_BUFFERS 0x3032 -#define EGL_SLOW_CONFIG 0x3050 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_SUCCESS 0x3000 -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 -#define EGL_TRANSPARENT_RED_VALUE 0x3037 -#define EGL_TRANSPARENT_RGB 0x3052 -#define EGL_TRANSPARENT_TYPE 0x3034 -#define EGL_TRUE 1 -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_WIDTH 0x3057 -#define EGL_WINDOW_BIT 0x0004 -EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); -EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); -EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); -EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); -EGLAPI EGLint EGLAPIENTRY eglGetError (void); -EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); -EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); -EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); -EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); -#endif /* EGL_VERSION_1_0 */ - -#ifndef EGL_VERSION_1_1 -#define EGL_VERSION_1_1 1 -#define EGL_BACK_BUFFER 0x3084 -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A -#define EGL_CONTEXT_LOST 0x300E -#define EGL_MIN_SWAP_INTERVAL 0x303B -#define EGL_MAX_SWAP_INTERVAL 0x303C -#define EGL_MIPMAP_TEXTURE 0x3082 -#define EGL_MIPMAP_LEVEL 0x3083 -#define EGL_NO_TEXTURE 0x305C -#define EGL_TEXTURE_2D 0x305F -#define EGL_TEXTURE_FORMAT 0x3080 -#define EGL_TEXTURE_RGB 0x305D -#define EGL_TEXTURE_RGBA 0x305E -#define EGL_TEXTURE_TARGET 0x3081 -EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); -#endif /* EGL_VERSION_1_1 */ - -#ifndef EGL_VERSION_1_2 -#define EGL_VERSION_1_2 1 -typedef unsigned int EGLenum; -typedef void *EGLClientBuffer; -#define EGL_ALPHA_FORMAT 0x3088 -#define EGL_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_ALPHA_FORMAT_PRE 0x308C -#define EGL_ALPHA_MASK_SIZE 0x303E -#define EGL_BUFFER_PRESERVED 0x3094 -#define EGL_BUFFER_DESTROYED 0x3095 -#define EGL_CLIENT_APIS 0x308D -#define EGL_COLORSPACE 0x3087 -#define EGL_COLORSPACE_sRGB 0x3089 -#define EGL_COLORSPACE_LINEAR 0x308A -#define EGL_COLOR_BUFFER_TYPE 0x303F -#define EGL_CONTEXT_CLIENT_TYPE 0x3097 -#define EGL_DISPLAY_SCALING 10000 -#define EGL_HORIZONTAL_RESOLUTION 0x3090 -#define EGL_LUMINANCE_BUFFER 0x308F -#define EGL_LUMINANCE_SIZE 0x303D -#define EGL_OPENGL_ES_BIT 0x0001 -#define EGL_OPENVG_BIT 0x0002 -#define EGL_OPENGL_ES_API 0x30A0 -#define EGL_OPENVG_API 0x30A1 -#define EGL_OPENVG_IMAGE 0x3096 -#define EGL_PIXEL_ASPECT_RATIO 0x3092 -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_RGB_BUFFER 0x308E -#define EGL_SINGLE_BUFFER 0x3085 -#define EGL_SWAP_BEHAVIOR 0x3093 -#define EGL_UNKNOWN ((EGLint)-1) -#define EGL_VERTICAL_RESOLUTION 0x3091 -EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); -EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); -#endif /* EGL_VERSION_1_2 */ - -#ifndef EGL_VERSION_1_3 -#define EGL_VERSION_1_3 1 -#define EGL_CONFORMANT 0x3042 -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 -#define EGL_MATCH_NATIVE_PIXMAP 0x3041 -#define EGL_OPENGL_ES2_BIT 0x0004 -#define EGL_VG_ALPHA_FORMAT 0x3088 -#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_VG_ALPHA_FORMAT_PRE 0x308C -#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 -#define EGL_VG_COLORSPACE 0x3087 -#define EGL_VG_COLORSPACE_sRGB 0x3089 -#define EGL_VG_COLORSPACE_LINEAR 0x308A -#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 -#endif /* EGL_VERSION_1_3 */ - -#ifndef EGL_VERSION_1_4 -#define EGL_VERSION_1_4 1 -#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) -#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 -#define EGL_MULTISAMPLE_RESOLVE 0x3099 -#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A -#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B -#define EGL_OPENGL_API 0x30A2 -#define EGL_OPENGL_BIT 0x0008 -#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 -EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); -#endif /* EGL_VERSION_1_4 */ - -#ifndef EGL_VERSION_1_5 -#define EGL_VERSION_1_5 1 -typedef void *EGLSync; -typedef intptr_t EGLAttrib; -typedef khronos_utime_nanoseconds_t EGLTime; -typedef void *EGLImage; -#define EGL_CONTEXT_MAJOR_VERSION 0x3098 -#define EGL_CONTEXT_MINOR_VERSION 0x30FB -#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD -#define EGL_NO_RESET_NOTIFICATION 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 -#define EGL_OPENGL_ES3_BIT 0x00000040 -#define EGL_CL_EVENT_HANDLE 0x309C -#define EGL_SYNC_CL_EVENT 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 -#define EGL_SYNC_TYPE 0x30F7 -#define EGL_SYNC_STATUS 0x30F1 -#define EGL_SYNC_CONDITION 0x30F8 -#define EGL_SIGNALED 0x30F2 -#define EGL_UNSIGNALED 0x30F3 -#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 -#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull -#define EGL_TIMEOUT_EXPIRED 0x30F5 -#define EGL_CONDITION_SATISFIED 0x30F6 -#define EGL_NO_SYNC ((EGLSync)0) -#define EGL_SYNC_FENCE 0x30F9 -#define EGL_GL_COLORSPACE 0x309D -#define EGL_GL_COLORSPACE_SRGB 0x3089 -#define EGL_GL_COLORSPACE_LINEAR 0x308A -#define EGL_GL_RENDERBUFFER 0x30B9 -#define EGL_GL_TEXTURE_2D 0x30B1 -#define EGL_GL_TEXTURE_LEVEL 0x30BC -#define EGL_GL_TEXTURE_3D 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET 0x30BD -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 -#define EGL_IMAGE_PRESERVED 0x30D2 -#define EGL_NO_IMAGE ((EGLImage)0) -EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); -EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); -#endif /* EGL_VERSION_1_5 */ - -#ifdef __cplusplus -} -#endif - -#endif /* __egl_h_ */ - - - -#ifndef __eglext_h_ -#define __eglext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ -*/ - -/*#include */ - -#define EGL_EGLEXT_VERSION 20150623 - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: _nomatch_^ - * Default extensions included: egl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_KHR_cl_event -#define EGL_KHR_cl_event 1 -#define EGL_CL_EVENT_HANDLE_KHR 0x309C -#define EGL_SYNC_CL_EVENT_KHR 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF -#endif /* EGL_KHR_cl_event */ - -#ifndef EGL_KHR_cl_event2 -#define EGL_KHR_cl_event2 1 -typedef void *EGLSyncKHR; -typedef intptr_t EGLAttribKHR; -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#endif -#endif /* EGL_KHR_cl_event2 */ - -#ifndef EGL_KHR_client_get_all_proc_addresses -#define EGL_KHR_client_get_all_proc_addresses 1 -#endif /* EGL_KHR_client_get_all_proc_addresses */ - -#ifndef EGL_KHR_config_attribs -#define EGL_KHR_config_attribs 1 -#define EGL_CONFORMANT_KHR 0x3042 -#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 -#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 -#endif /* EGL_KHR_config_attribs */ - -#ifndef EGL_KHR_create_context -#define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 -#endif /* EGL_KHR_create_context */ - -#ifndef EGL_KHR_create_context_no_error -#define EGL_KHR_create_context_no_error 1 -#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 -#endif /* EGL_KHR_create_context_no_error */ - -#ifndef EGL_KHR_fence_sync -#define EGL_KHR_fence_sync 1 -typedef khronos_utime_nanoseconds_t EGLTimeKHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 -#define EGL_SYNC_CONDITION_KHR 0x30F8 -#define EGL_SYNC_FENCE_KHR 0x30F9 -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_fence_sync */ - -#ifndef EGL_KHR_get_all_proc_addresses -#define EGL_KHR_get_all_proc_addresses 1 -#endif /* EGL_KHR_get_all_proc_addresses */ - -#ifndef EGL_KHR_gl_colorspace -#define EGL_KHR_gl_colorspace 1 -#define EGL_GL_COLORSPACE_KHR 0x309D -#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 -#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A -#endif /* EGL_KHR_gl_colorspace */ - -#ifndef EGL_KHR_gl_renderbuffer_image -#define EGL_KHR_gl_renderbuffer_image 1 -#define EGL_GL_RENDERBUFFER_KHR 0x30B9 -#endif /* EGL_KHR_gl_renderbuffer_image */ - -#ifndef EGL_KHR_gl_texture_2D_image -#define EGL_KHR_gl_texture_2D_image 1 -#define EGL_GL_TEXTURE_2D_KHR 0x30B1 -#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC -#endif /* EGL_KHR_gl_texture_2D_image */ - -#ifndef EGL_KHR_gl_texture_3D_image -#define EGL_KHR_gl_texture_3D_image 1 -#define EGL_GL_TEXTURE_3D_KHR 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD -#endif /* EGL_KHR_gl_texture_3D_image */ - -#ifndef EGL_KHR_gl_texture_cubemap_image -#define EGL_KHR_gl_texture_cubemap_image 1 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 -#endif /* EGL_KHR_gl_texture_cubemap_image */ - -#ifndef EGL_KHR_image -#define EGL_KHR_image 1 -typedef void *EGLImageKHR; -#define EGL_NATIVE_PIXMAP_KHR 0x30B0 -#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); -#endif -#endif /* EGL_KHR_image */ - -#ifndef EGL_KHR_image_base -#define EGL_KHR_image_base 1 -#define EGL_IMAGE_PRESERVED_KHR 0x30D2 -#endif /* EGL_KHR_image_base */ - -#ifndef EGL_KHR_image_pixmap -#define EGL_KHR_image_pixmap 1 -#endif /* EGL_KHR_image_pixmap */ - -#ifndef EGL_KHR_lock_surface -#define EGL_KHR_lock_surface 1 -#define EGL_READ_SURFACE_BIT_KHR 0x0001 -#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 -#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 -#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 -#define EGL_MATCH_FORMAT_KHR 0x3043 -#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 -#define EGL_FORMAT_RGB_565_KHR 0x30C1 -#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 -#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 -#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 -#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 -#define EGL_BITMAP_POINTER_KHR 0x30C6 -#define EGL_BITMAP_PITCH_KHR 0x30C7 -#define EGL_BITMAP_ORIGIN_KHR 0x30C8 -#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 -#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA -#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB -#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC -#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD -#define EGL_LOWER_LEFT_KHR 0x30CE -#define EGL_UPPER_LEFT_KHR 0x30CF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); -#endif -#endif /* EGL_KHR_lock_surface */ - -#ifndef EGL_KHR_lock_surface2 -#define EGL_KHR_lock_surface2 1 -#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 -#endif /* EGL_KHR_lock_surface2 */ - -#ifndef EGL_KHR_lock_surface3 -#define EGL_KHR_lock_surface3 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#endif -#endif /* EGL_KHR_lock_surface3 */ - -#ifndef EGL_KHR_partial_update -#define EGL_KHR_partial_update 1 -#define EGL_BUFFER_AGE_KHR 0x313D -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_partial_update */ - -#ifndef EGL_KHR_platform_android -#define EGL_KHR_platform_android 1 -#define EGL_PLATFORM_ANDROID_KHR 0x3141 -#endif /* EGL_KHR_platform_android */ - -#ifndef EGL_KHR_platform_gbm -#define EGL_KHR_platform_gbm 1 -#define EGL_PLATFORM_GBM_KHR 0x31D7 -#endif /* EGL_KHR_platform_gbm */ - -#ifndef EGL_KHR_platform_wayland -#define EGL_KHR_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 -#endif /* EGL_KHR_platform_wayland */ - -#ifndef EGL_KHR_platform_x11 -#define EGL_KHR_platform_x11 1 -#define EGL_PLATFORM_X11_KHR 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 -#endif /* EGL_KHR_platform_x11 */ - -#ifndef EGL_KHR_reusable_sync -#define EGL_KHR_reusable_sync 1 -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_STATUS_KHR 0x30F1 -#define EGL_SIGNALED_KHR 0x30F2 -#define EGL_UNSIGNALED_KHR 0x30F3 -#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 -#define EGL_CONDITION_SATISFIED_KHR 0x30F6 -#define EGL_SYNC_TYPE_KHR 0x30F7 -#define EGL_SYNC_REUSABLE_KHR 0x30FA -#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 -#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull -#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_reusable_sync */ - -#ifndef EGL_KHR_stream -#define EGL_KHR_stream 1 -typedef void *EGLStreamKHR; -typedef khronos_uint64_t EGLuint64KHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) -#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 -#define EGL_PRODUCER_FRAME_KHR 0x3212 -#define EGL_CONSUMER_FRAME_KHR 0x3213 -#define EGL_STREAM_STATE_KHR 0x3214 -#define EGL_STREAM_STATE_CREATED_KHR 0x3215 -#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 -#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 -#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 -#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 -#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A -#define EGL_BAD_STREAM_KHR 0x321B -#define EGL_BAD_STATE_KHR 0x321C -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_stream */ - -#ifndef EGL_KHR_stream_consumer_gltexture -#define EGL_KHR_stream_consumer_gltexture 1 -#ifdef EGL_KHR_stream -#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_consumer_gltexture */ - -#ifndef EGL_KHR_stream_cross_process_fd -#define EGL_KHR_stream_cross_process_fd 1 -typedef int EGLNativeFileDescriptorKHR; -#ifdef EGL_KHR_stream -#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) -typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_cross_process_fd */ - -#ifndef EGL_KHR_stream_fifo -#define EGL_KHR_stream_fifo 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC -#define EGL_STREAM_TIME_NOW_KHR 0x31FD -#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE -#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_fifo */ - -#ifndef EGL_KHR_stream_producer_aldatalocator -#define EGL_KHR_stream_producer_aldatalocator 1 -#ifdef EGL_KHR_stream -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_aldatalocator */ - -#ifndef EGL_KHR_stream_producer_eglsurface -#define EGL_KHR_stream_producer_eglsurface 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_BIT_KHR 0x0800 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_eglsurface */ - -#ifndef EGL_KHR_surfaceless_context -#define EGL_KHR_surfaceless_context 1 -#endif /* EGL_KHR_surfaceless_context */ - -#ifndef EGL_KHR_swap_buffers_with_damage -#define EGL_KHR_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_swap_buffers_with_damage */ - -#ifndef EGL_KHR_vg_parent_image -#define EGL_KHR_vg_parent_image 1 -#define EGL_VG_PARENT_IMAGE_KHR 0x30BA -#endif /* EGL_KHR_vg_parent_image */ - -#ifndef EGL_KHR_wait_sync -#define EGL_KHR_wait_sync 1 -typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif -#endif /* EGL_KHR_wait_sync */ - -#ifndef EGL_ANDROID_blob_cache -#define EGL_ANDROID_blob_cache 1 -typedef khronos_ssize_t EGLsizeiANDROID; -typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); -typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); -typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#endif -#endif /* EGL_ANDROID_blob_cache */ - -#ifndef EGL_ANDROID_framebuffer_target -#define EGL_ANDROID_framebuffer_target 1 -#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 -#endif /* EGL_ANDROID_framebuffer_target */ - -#ifndef EGL_ANDROID_image_native_buffer -#define EGL_ANDROID_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_ANDROID 0x3140 -#endif /* EGL_ANDROID_image_native_buffer */ - -#ifndef EGL_ANDROID_native_fence_sync -#define EGL_ANDROID_native_fence_sync 1 -#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 -#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 -#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 -#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 -typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); -#endif -#endif /* EGL_ANDROID_native_fence_sync */ - -#ifndef EGL_ANDROID_recordable -#define EGL_ANDROID_recordable 1 -#define EGL_RECORDABLE_ANDROID 0x3142 -#endif /* EGL_ANDROID_recordable */ - -#ifndef EGL_ANGLE_d3d_share_handle_client_buffer -#define EGL_ANGLE_d3d_share_handle_client_buffer 1 -#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 -#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ - -#ifndef EGL_ANGLE_device_d3d -#define EGL_ANGLE_device_d3d 1 -#define EGL_D3D9_DEVICE_ANGLE 0x33A0 -#define EGL_D3D11_DEVICE_ANGLE 0x33A1 -#endif /* EGL_ANGLE_device_d3d */ - -#ifndef EGL_ANGLE_query_surface_pointer -#define EGL_ANGLE_query_surface_pointer 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#endif -#endif /* EGL_ANGLE_query_surface_pointer */ - -#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle -#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 -#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ - -#ifndef EGL_ANGLE_window_fixed_size -#define EGL_ANGLE_window_fixed_size 1 -#define EGL_FIXED_SIZE_ANGLE 0x3201 -#endif /* EGL_ANGLE_window_fixed_size */ - -#ifndef EGL_ARM_pixmap_multisample_discard -#define EGL_ARM_pixmap_multisample_discard 1 -#define EGL_DISCARD_SAMPLES_ARM 0x3286 -#endif /* EGL_ARM_pixmap_multisample_discard */ - -#ifndef EGL_EXT_buffer_age -#define EGL_EXT_buffer_age 1 -#define EGL_BUFFER_AGE_EXT 0x313D -#endif /* EGL_EXT_buffer_age */ - -#ifndef EGL_EXT_client_extensions -#define EGL_EXT_client_extensions 1 -#endif /* EGL_EXT_client_extensions */ - -#ifndef EGL_EXT_create_context_robustness -#define EGL_EXT_create_context_robustness 1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 -#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF -#endif /* EGL_EXT_create_context_robustness */ - -#ifndef EGL_EXT_device_base -#define EGL_EXT_device_base 1 -typedef void *EGLDeviceEXT; -#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) -#define EGL_BAD_DEVICE_EXT 0x322B -#define EGL_DEVICE_EXT 0x322C -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#endif -#endif /* EGL_EXT_device_base */ - -#ifndef EGL_EXT_device_drm -#define EGL_EXT_device_drm 1 -#define EGL_DRM_DEVICE_FILE_EXT 0x3233 -#endif /* EGL_EXT_device_drm */ - -#ifndef EGL_EXT_device_enumeration -#define EGL_EXT_device_enumeration 1 -#endif /* EGL_EXT_device_enumeration */ - -#ifndef EGL_EXT_device_openwf -#define EGL_EXT_device_openwf 1 -#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 -#endif /* EGL_EXT_device_openwf */ - -#ifndef EGL_EXT_device_query -#define EGL_EXT_device_query 1 -#endif /* EGL_EXT_device_query */ - -#ifndef EGL_EXT_image_dma_buf_import -#define EGL_EXT_image_dma_buf_import 1 -#define EGL_LINUX_DMA_BUF_EXT 0x3270 -#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 -#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 -#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 -#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 -#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 -#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 -#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 -#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 -#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 -#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A -#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B -#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C -#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D -#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E -#define EGL_ITU_REC601_EXT 0x327F -#define EGL_ITU_REC709_EXT 0x3280 -#define EGL_ITU_REC2020_EXT 0x3281 -#define EGL_YUV_FULL_RANGE_EXT 0x3282 -#define EGL_YUV_NARROW_RANGE_EXT 0x3283 -#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 -#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 -#endif /* EGL_EXT_image_dma_buf_import */ - -#ifndef EGL_EXT_multiview_window -#define EGL_EXT_multiview_window 1 -#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 -#endif /* EGL_EXT_multiview_window */ - -#ifndef EGL_EXT_output_base -#define EGL_EXT_output_base 1 -typedef void *EGLOutputLayerEXT; -typedef void *EGLOutputPortEXT; -#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) -#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) -#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D -#define EGL_BAD_OUTPUT_PORT_EXT 0x322E -#define EGL_SWAP_INTERVAL_EXT 0x322F -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#endif -#endif /* EGL_EXT_output_base */ - -#ifndef EGL_EXT_output_drm -#define EGL_EXT_output_drm 1 -#define EGL_DRM_CRTC_EXT 0x3234 -#define EGL_DRM_PLANE_EXT 0x3235 -#define EGL_DRM_CONNECTOR_EXT 0x3236 -#endif /* EGL_EXT_output_drm */ - -#ifndef EGL_EXT_output_openwf -#define EGL_EXT_output_openwf 1 -#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 -#define EGL_OPENWF_PORT_ID_EXT 0x3239 -#endif /* EGL_EXT_output_openwf */ - -#ifndef EGL_EXT_platform_base -#define EGL_EXT_platform_base 1 -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#endif -#endif /* EGL_EXT_platform_base */ - -#ifndef EGL_EXT_platform_device -#define EGL_EXT_platform_device 1 -#define EGL_PLATFORM_DEVICE_EXT 0x313F -#endif /* EGL_EXT_platform_device */ - -#ifndef EGL_EXT_platform_wayland -#define EGL_EXT_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 -#endif /* EGL_EXT_platform_wayland */ - -#ifndef EGL_EXT_platform_x11 -#define EGL_EXT_platform_x11 1 -#define EGL_PLATFORM_X11_EXT 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 -#endif /* EGL_EXT_platform_x11 */ - -#ifndef EGL_EXT_protected_surface -#define EGL_EXT_protected_surface 1 -#define EGL_PROTECTED_CONTENT_EXT 0x32C0 -#endif /* EGL_EXT_protected_surface */ - -#ifndef EGL_EXT_stream_consumer_egloutput -#define EGL_EXT_stream_consumer_egloutput 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#endif -#endif /* EGL_EXT_stream_consumer_egloutput */ - -#ifndef EGL_EXT_swap_buffers_with_damage -#define EGL_EXT_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_EXT_swap_buffers_with_damage */ - -#ifndef EGL_EXT_yuv_surface -#define EGL_EXT_yuv_surface 1 -#define EGL_YUV_ORDER_EXT 0x3301 -#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 -#define EGL_YUV_SUBSAMPLE_EXT 0x3312 -#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 -#define EGL_YUV_CSC_STANDARD_EXT 0x330A -#define EGL_YUV_PLANE_BPP_EXT 0x331A -#define EGL_YUV_BUFFER_EXT 0x3300 -#define EGL_YUV_ORDER_YUV_EXT 0x3302 -#define EGL_YUV_ORDER_YVU_EXT 0x3303 -#define EGL_YUV_ORDER_YUYV_EXT 0x3304 -#define EGL_YUV_ORDER_UYVY_EXT 0x3305 -#define EGL_YUV_ORDER_YVYU_EXT 0x3306 -#define EGL_YUV_ORDER_VYUY_EXT 0x3307 -#define EGL_YUV_ORDER_AYUV_EXT 0x3308 -#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 -#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 -#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 -#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 -#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 -#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B -#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C -#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D -#define EGL_YUV_PLANE_BPP_0_EXT 0x331B -#define EGL_YUV_PLANE_BPP_8_EXT 0x331C -#define EGL_YUV_PLANE_BPP_10_EXT 0x331D -#endif /* EGL_EXT_yuv_surface */ - -#ifndef EGL_HI_clientpixmap -#define EGL_HI_clientpixmap 1 -struct EGLClientPixmapHI { - void *pData; - EGLint iWidth; - EGLint iHeight; - EGLint iStride; -}; -#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#endif -#endif /* EGL_HI_clientpixmap */ - -#ifndef EGL_HI_colorformats -#define EGL_HI_colorformats 1 -#define EGL_COLOR_FORMAT_HI 0x8F70 -#define EGL_COLOR_RGB_HI 0x8F71 -#define EGL_COLOR_RGBA_HI 0x8F72 -#define EGL_COLOR_ARGB_HI 0x8F73 -#endif /* EGL_HI_colorformats */ - -#ifndef EGL_IMG_context_priority -#define EGL_IMG_context_priority 1 -#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 -#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 -#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 -#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 -#endif /* EGL_IMG_context_priority */ - -#ifndef EGL_MESA_drm_image -#define EGL_MESA_drm_image 1 -#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 -#define EGL_DRM_BUFFER_USE_MESA 0x31D1 -#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 -#define EGL_DRM_BUFFER_MESA 0x31D3 -#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 -#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 -#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#endif -#endif /* EGL_MESA_drm_image */ - -#ifndef EGL_MESA_image_dma_buf_export -#define EGL_MESA_image_dma_buf_export 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#endif -#endif /* EGL_MESA_image_dma_buf_export */ - -#ifndef EGL_MESA_platform_gbm -#define EGL_MESA_platform_gbm 1 -#define EGL_PLATFORM_GBM_MESA 0x31D7 -#endif /* EGL_MESA_platform_gbm */ - -#ifndef EGL_NOK_swap_region -#define EGL_NOK_swap_region 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region */ - -#ifndef EGL_NOK_swap_region2 -#define EGL_NOK_swap_region2 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region2 */ - -#ifndef EGL_NOK_texture_from_pixmap -#define EGL_NOK_texture_from_pixmap 1 -#define EGL_Y_INVERTED_NOK 0x307F -#endif /* EGL_NOK_texture_from_pixmap */ - -#ifndef EGL_NV_3dvision_surface -#define EGL_NV_3dvision_surface 1 -#define EGL_AUTO_STEREO_NV 0x3136 -#endif /* EGL_NV_3dvision_surface */ - -#ifndef EGL_NV_coverage_sample -#define EGL_NV_coverage_sample 1 -#define EGL_COVERAGE_BUFFERS_NV 0x30E0 -#define EGL_COVERAGE_SAMPLES_NV 0x30E1 -#endif /* EGL_NV_coverage_sample */ - -#ifndef EGL_NV_coverage_sample_resolve -#define EGL_NV_coverage_sample_resolve 1 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 -#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 -#endif /* EGL_NV_coverage_sample_resolve */ - -#ifndef EGL_NV_cuda_event -#define EGL_NV_cuda_event 1 -#define EGL_CUDA_EVENT_HANDLE_NV 0x323B -#define EGL_SYNC_CUDA_EVENT_NV 0x323C -#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D -#endif /* EGL_NV_cuda_event */ - -#ifndef EGL_NV_depth_nonlinear -#define EGL_NV_depth_nonlinear 1 -#define EGL_DEPTH_ENCODING_NV 0x30E2 -#define EGL_DEPTH_ENCODING_NONE_NV 0 -#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 -#endif /* EGL_NV_depth_nonlinear */ - -#ifndef EGL_NV_device_cuda -#define EGL_NV_device_cuda 1 -#define EGL_CUDA_DEVICE_NV 0x323A -#endif /* EGL_NV_device_cuda */ - -#ifndef EGL_NV_native_query -#define EGL_NV_native_query 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#endif -#endif /* EGL_NV_native_query */ - -#ifndef EGL_NV_post_convert_rounding -#define EGL_NV_post_convert_rounding 1 -#endif /* EGL_NV_post_convert_rounding */ - -#ifndef EGL_NV_post_sub_buffer -#define EGL_NV_post_sub_buffer 1 -#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE -typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#endif -#endif /* EGL_NV_post_sub_buffer */ - -#ifndef EGL_NV_stream_sync -#define EGL_NV_stream_sync 1 -#define EGL_SYNC_NEW_FRAME_NV 0x321F -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#endif -#endif /* EGL_NV_stream_sync */ - -#ifndef EGL_NV_sync -#define EGL_NV_sync 1 -typedef void *EGLSyncNV; -typedef khronos_utime_nanoseconds_t EGLTimeNV; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 -#define EGL_SYNC_STATUS_NV 0x30E7 -#define EGL_SIGNALED_NV 0x30E8 -#define EGL_UNSIGNALED_NV 0x30E9 -#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 -#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull -#define EGL_ALREADY_SIGNALED_NV 0x30EA -#define EGL_TIMEOUT_EXPIRED_NV 0x30EB -#define EGL_CONDITION_SATISFIED_NV 0x30EC -#define EGL_SYNC_TYPE_NV 0x30ED -#define EGL_SYNC_CONDITION_NV 0x30EE -#define EGL_SYNC_FENCE_NV 0x30EF -#define EGL_NO_SYNC_NV ((EGLSyncNV)0) -typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); -EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_sync */ - -#ifndef EGL_NV_system_time -#define EGL_NV_system_time 1 -typedef khronos_utime_nanoseconds_t EGLuint64NV; -#ifdef KHRONOS_SUPPORT_INT64 -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_system_time */ - -#ifndef EGL_TIZEN_image_native_buffer -#define EGL_TIZEN_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 -#endif /* EGL_TIZEN_image_native_buffer */ - -#ifndef EGL_TIZEN_image_native_surface -#define EGL_TIZEN_image_native_surface 1 -#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 -#endif /* EGL_TIZEN_image_native_surface */ - -#ifdef __cplusplus -} -#endif - -#endif /* __eglext_h_ */ - - -#endif /* _MSC_VER */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_endian.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_endian.h deleted file mode 100644 index 9100b10..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_endian.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_endian.h - * - * Functions for reading and writing endian-specific values - */ - -#ifndef _SDL_endian_h -#define _SDL_endian_h - -#include "SDL_stdinc.h" - -/** - * \name The two types of endianness - */ -/* @{ */ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 -/* @} */ - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#ifdef __linux__ -#include -#define SDL_BYTEORDER __BYTE_ORDER -#else /* __linux__ */ -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MISPEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* __linux__ */ -#endif /* !SDL_BYTEORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_endian.h - */ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - int result; - - __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); - return (Uint16)result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#else -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); - __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); - __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); - return result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#else -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | - ((x >> 8) & 0x0000FF00) | (x >> 24))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - union - { - struct - { - Uint32 a, b; - } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), - "1"(v.s. - b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0": "=r"(x):"0"(x)); - return x; -} -#else -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif - - -SDL_FORCE_INLINE float -SDL_SwapFloat(float x) -{ - union - { - float f; - Uint32 ui32; - } swapper; - swapper.f = x; - swapper.ui32 = SDL_Swap32(swapper.ui32); - return swapper.f; -} - - -/** - * \name Swap to native - * Byteswap item from the specified endianness to the native endianness. - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapFloatLE(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#define SDL_SwapFloatBE(X) (X) -#endif -/* @} *//* Swap to native */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_endian_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_error.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_error.h deleted file mode 100644 index 2f3b4b5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_error.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_error.h - * - * Simple error message routines for SDL. - */ - -#ifndef _SDL_error_h -#define _SDL_error_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Public functions */ -/* SDL_SetError() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); -extern DECLSPEC const char *SDLCALL SDL_GetError(void); -extern DECLSPEC void SDLCALL SDL_ClearError(void); - -/** - * \name Internal error functions - * - * \internal - * Private error reporting function - used internally. - */ -/* @{ */ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) -typedef enum -{ - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -/* SDL_Error() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); -/* @} *//* Internal error functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_error_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_events.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_events.h deleted file mode 100644 index 1437f4c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_events.h +++ /dev/null @@ -1,750 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_events.h - * - * Include file for SDL event handling. - */ - -#ifndef _SDL_events_h -#define _SDL_events_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_gamecontroller.h" -#include "SDL_quit.h" -#include "SDL_gesture.h" -#include "SDL_touch.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* General keyboard/mouse state definitions */ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 - -/** - * \brief The types of events that can be delivered. - */ -typedef enum -{ - SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ - - /* Application events */ - SDL_QUIT = 0x100, /**< User-requested quit */ - - /* These application events have special meaning on iOS, see README-ios.md for details */ - SDL_APP_TERMINATING, /**< The application is being terminated by the OS - Called on iOS in applicationWillTerminate() - Called on Android in onDestroy() - */ - SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. - Called on iOS in applicationDidReceiveMemoryWarning() - Called on Android in onLowMemory() - */ - SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background - Called on iOS in applicationWillResignActive() - Called on Android in onPause() - */ - SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time - Called on iOS in applicationDidEnterBackground() - Called on Android in onPause() - */ - SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground - Called on iOS in applicationWillEnterForeground() - Called on Android in onResume() - */ - SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive - Called on iOS in applicationDidBecomeActive() - Called on Android in onResume() - */ - - /* Window events */ - SDL_WINDOWEVENT = 0x200, /**< Window state change */ - SDL_SYSWMEVENT, /**< System specific event */ - - /* Keyboard events */ - SDL_KEYDOWN = 0x300, /**< Key pressed */ - SDL_KEYUP, /**< Key released */ - SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ - SDL_TEXTINPUT, /**< Keyboard text input */ - SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an - input language or keyboard layout change. - */ - - /* Mouse events */ - SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_MOUSEWHEEL, /**< Mouse wheel motion */ - - /* Joystick events */ - SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ - SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ - - /* Game controller events */ - SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ - SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ - SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ - SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ - SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ - SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ - - /* Touch events */ - SDL_FINGERDOWN = 0x700, - SDL_FINGERUP, - SDL_FINGERMOTION, - - /* Gesture events */ - SDL_DOLLARGESTURE = 0x800, - SDL_DOLLARRECORD, - SDL_MULTIGESTURE, - - /* Clipboard events */ - SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ - - /* Drag and drop events */ - SDL_DROPFILE = 0x1000, /**< The system requests a file open */ - - /* Audio hotplug events */ - SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ - SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ - - /* Render events */ - SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ - SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ - - /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, - * and should be allocated with SDL_RegisterEvents() - */ - SDL_USEREVENT = 0x8000, - - /** - * This last event is only for bounding internal arrays - */ - SDL_LASTEVENT = 0xFFFF -} SDL_EventType; - -/** - * \brief Fields shared by every event - */ -typedef struct SDL_CommonEvent -{ - Uint32 type; - Uint32 timestamp; -} SDL_CommonEvent; - -/** - * \brief Window state change event data (event.window.*) - */ -typedef struct SDL_WindowEvent -{ - Uint32 type; /**< ::SDL_WINDOWEVENT */ - Uint32 timestamp; - Uint32 windowID; /**< The associated window */ - Uint8 event; /**< ::SDL_WindowEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ - Sint32 data2; /**< event dependent data */ -} SDL_WindowEvent; - -/** - * \brief Keyboard button event structure (event.key.*) - */ -typedef struct SDL_KeyboardEvent -{ - Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ - Uint32 timestamp; - Uint32 windowID; /**< The window with keyboard focus, if any */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 repeat; /**< Non-zero if this is a key repeat */ - Uint8 padding2; - Uint8 padding3; - SDL_Keysym keysym; /**< The key that was pressed or released */ -} SDL_KeyboardEvent; - -#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text editing event structure (event.edit.*) - */ -typedef struct SDL_TextEditingEvent -{ - Uint32 type; /**< ::SDL_TEXTEDITING */ - Uint32 timestamp; - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ - Sint32 start; /**< The start cursor of selected editing text */ - Sint32 length; /**< The length of selected editing text */ -} SDL_TextEditingEvent; - - -#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text input event structure (event.text.*) - */ -typedef struct SDL_TextInputEvent -{ - Uint32 type; /**< ::SDL_TEXTINPUT */ - Uint32 timestamp; - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ -} SDL_TextInputEvent; - -/** - * \brief Mouse motion event structure (event.motion.*) - */ -typedef struct SDL_MouseMotionEvent -{ - Uint32 type; /**< ::SDL_MOUSEMOTION */ - Uint32 timestamp; - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint32 state; /**< The current button state */ - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ - Sint32 xrel; /**< The relative motion in the X direction */ - Sint32 yrel; /**< The relative motion in the Y direction */ -} SDL_MouseMotionEvent; - -/** - * \brief Mouse button event structure (event.button.*) - */ -typedef struct SDL_MouseButtonEvent -{ - Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ - Uint32 timestamp; - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ - Uint8 padding1; - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ -} SDL_MouseButtonEvent; - -/** - * \brief Mouse wheel event structure (event.wheel.*) - */ -typedef struct SDL_MouseWheelEvent -{ - Uint32 type; /**< ::SDL_MOUSEWHEEL */ - Uint32 timestamp; - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ - Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ - Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ -} SDL_MouseWheelEvent; - -/** - * \brief Joystick axis motion event structure (event.jaxis.*) - */ -typedef struct SDL_JoyAxisEvent -{ - Uint32 type; /**< ::SDL_JOYAXISMOTION */ - Uint32 timestamp; - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The joystick axis index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_JoyAxisEvent; - -/** - * \brief Joystick trackball motion event structure (event.jball.*) - */ -typedef struct SDL_JoyBallEvent -{ - Uint32 type; /**< ::SDL_JOYBALLMOTION */ - Uint32 timestamp; - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 ball; /**< The joystick trackball index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** - * \brief Joystick hat position change event structure (event.jhat.*) - */ -typedef struct SDL_JoyHatEvent -{ - Uint32 type; /**< ::SDL_JOYHATMOTION */ - Uint32 timestamp; - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value. - * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP - * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT - * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN - * - * Note that zero means the POV is centered. - */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyHatEvent; - -/** - * \brief Joystick button event structure (event.jbutton.*) - */ -typedef struct SDL_JoyButtonEvent -{ - Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ - Uint32 timestamp; - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyButtonEvent; - -/** - * \brief Joystick device event structure (event.jdevice.*) - */ -typedef struct SDL_JoyDeviceEvent -{ - Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ - Uint32 timestamp; - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ -} SDL_JoyDeviceEvent; - - -/** - * \brief Game controller axis motion event structure (event.caxis.*) - */ -typedef struct SDL_ControllerAxisEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ - Uint32 timestamp; - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_ControllerAxisEvent; - - -/** - * \brief Game controller button event structure (event.cbutton.*) - */ -typedef struct SDL_ControllerButtonEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ - Uint32 timestamp; - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The controller button (SDL_GameControllerButton) */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_ControllerButtonEvent; - - -/** - * \brief Controller device event structure (event.cdevice.*) - */ -typedef struct SDL_ControllerDeviceEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ - Uint32 timestamp; - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ -} SDL_ControllerDeviceEvent; - -/** - * \brief Audio device event structure (event.adevice.*) - */ -typedef struct SDL_AudioDeviceEvent -{ - Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ - Uint32 timestamp; - Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ - Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; -} SDL_AudioDeviceEvent; - - -/** - * \brief Touch finger event structure (event.tfinger.*) - */ -typedef struct SDL_TouchFingerEvent -{ - Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ - Uint32 timestamp; - SDL_TouchID touchId; /**< The touch device id */ - SDL_FingerID fingerId; - float x; /**< Normalized in the range 0...1 */ - float y; /**< Normalized in the range 0...1 */ - float dx; /**< Normalized in the range -1...1 */ - float dy; /**< Normalized in the range -1...1 */ - float pressure; /**< Normalized in the range 0...1 */ -} SDL_TouchFingerEvent; - - -/** - * \brief Multiple Finger Gesture Event (event.mgesture.*) - */ -typedef struct SDL_MultiGestureEvent -{ - Uint32 type; /**< ::SDL_MULTIGESTURE */ - Uint32 timestamp; - SDL_TouchID touchId; /**< The touch device index */ - float dTheta; - float dDist; - float x; - float y; - Uint16 numFingers; - Uint16 padding; -} SDL_MultiGestureEvent; - - -/** - * \brief Dollar Gesture Event (event.dgesture.*) - */ -typedef struct SDL_DollarGestureEvent -{ - Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ - Uint32 timestamp; - SDL_TouchID touchId; /**< The touch device id */ - SDL_GestureID gestureId; - Uint32 numFingers; - float error; - float x; /**< Normalized center of gesture */ - float y; /**< Normalized center of gesture */ -} SDL_DollarGestureEvent; - - -/** - * \brief An event used to request a file open by the system (event.drop.*) - * This event is enabled by default, you can disable it with SDL_EventState(). - * \note If this event is enabled, you must free the filename in the event. - */ -typedef struct SDL_DropEvent -{ - Uint32 type; /**< ::SDL_DROPFILE */ - Uint32 timestamp; - char *file; /**< The file name, which should be freed with SDL_free() */ -} SDL_DropEvent; - - -/** - * \brief The "quit requested" event - */ -typedef struct SDL_QuitEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; -} SDL_QuitEvent; - -/** - * \brief OS Specific event - */ -typedef struct SDL_OSEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; -} SDL_OSEvent; - -/** - * \brief A user-defined event type (event.user.*) - */ -typedef struct SDL_UserEvent -{ - Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ - Uint32 timestamp; - Uint32 windowID; /**< The associated window if any */ - Sint32 code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ -} SDL_UserEvent; - - -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; - -/** - * \brief A video driver dependent system event (event.syswm.*) - * This event is disabled by default, you can enable it with SDL_EventState() - * - * \note If you want to use this event, you should include SDL_syswm.h. - */ -typedef struct SDL_SysWMEvent -{ - Uint32 type; /**< ::SDL_SYSWMEVENT */ - Uint32 timestamp; - SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ -} SDL_SysWMEvent; - -/** - * \brief General event structure - */ -typedef union SDL_Event -{ - Uint32 type; /**< Event type, shared with all events */ - SDL_CommonEvent common; /**< Common event data */ - SDL_WindowEvent window; /**< Window event data */ - SDL_KeyboardEvent key; /**< Keyboard event data */ - SDL_TextEditingEvent edit; /**< Text editing event data */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ - SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ - SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ - SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ - SDL_AudioDeviceEvent adevice; /**< Audio device event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_MultiGestureEvent mgesture; /**< Gesture event data */ - SDL_DollarGestureEvent dgesture; /**< Gesture event data */ - SDL_DropEvent drop; /**< Drag and drop event data */ - - /* This is necessary for ABI compatibility between Visual C++ and GCC - Visual C++ will respect the push pack pragma and use 52 bytes for - this structure, and GCC will use the alignment of the largest datatype - within the union, which is 8 bytes. - - So... we'll add padding to force the size to be 56 bytes for both. - */ - Uint8 padding[56]; -} SDL_Event; - - -/* Function prototypes */ - -/** - * Pumps the event loop, gathering events from the input devices. - * - * This function updates the event queue and internal input device state. - * - * This should only be run in the thread that sets the video mode. - */ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -/* @{ */ -typedef enum -{ - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; - -/** - * Checks the event queue for messages and optionally returns them. - * - * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to - * the back of the event queue. - * - * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front - * of the event queue, within the specified minimum and maximum type, - * will be returned and will not be removed from the queue. - * - * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front - * of the event queue, within the specified minimum and maximum type, - * will be returned and will be removed from the queue. - * - * \return The number of events actually stored, or -1 if there was an error. - * - * This function is thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, - SDL_eventaction action, - Uint32 minType, Uint32 maxType); -/* @} */ - -/** - * Checks to see if certain event types are in the event queue. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); - -/** - * This function clears events from the event queue - * This function only affects currently queued events. If you want to make - * sure that all pending OS events are flushed, you can call SDL_PumpEvents() - * on the main thread immediately before the flush call. - */ -extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); -extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); - -/** - * \brief Polls for currently pending events. - * - * \return 1 if there are any pending events, or 0 if there are none available. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); - -/** - * \brief Waits indefinitely for the next available event. - * - * \return 1, or 0 if there was an error while waiting for events. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); - -/** - * \brief Waits until the specified timeout (in milliseconds) for the next - * available event. - * - * \return 1, or 0 if there was an error while waiting for events. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - * \param timeout The timeout (in milliseconds) to wait for next event. - */ -extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, - int timeout); - -/** - * \brief Add an event to the event queue. - * - * \return 1 on success, 0 if the event was filtered, or -1 if the event queue - * was full or there was some other error. - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); - -typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); - -/** - * Sets up a filter to process all events before they change internal state and - * are posted to the internal event queue. - * - * The filter is prototyped as: - * \code - * int SDL_EventFilter(void *userdata, SDL_Event * event); - * \endcode - * - * If the filter returns 1, then the event will be added to the internal queue. - * If it returns 0, then the event will be dropped from the queue, but the - * internal state will still be updated. This allows selective filtering of - * dynamically arriving events. - * - * \warning Be very careful of what you do in the event filter function, as - * it may run in a different thread! - * - * There is one caveat when dealing with the ::SDL_QuitEvent event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will - * be closed, otherwise the window will remain open if possible. - * - * If the quit event is generated by an interrupt signal, it will bypass the - * internal queue and be delivered to the application at the next event poll. - */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, - void *userdata); - -/** - * Return the current event filter - can be used to "chain" filters. - * If there is no event filter set, this function returns SDL_FALSE. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, - void **userdata); - -/** - * Add a function which is called when an event is added to the queue. - */ -extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Remove an event watch function added with SDL_AddEventWatch() - */ -extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Run the filter function on the current event queue, removing any - * events for which the filter returns 0. - */ -extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, - void *userdata); - -/* @{ */ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 - -/** - * This function allows you to set the state of processing certain events. - * - If \c state is set to ::SDL_IGNORE, that event will be automatically - * dropped from the event queue and will not event be filtered. - * - If \c state is set to ::SDL_ENABLE, that event will be processed - * normally. - * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the - * current processing state of the specified event. - */ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); -/* @} */ -#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) - -/** - * This function allocates a set of user-defined events, and returns - * the beginning event number for that set of events. - * - * If there aren't enough user-defined events left, this function - * returns (Uint32)-1 - */ -extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_events_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_filesystem.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_filesystem.h deleted file mode 100644 index 02999ed..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_filesystem.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_filesystem.h - * - * \brief Include file for filesystem SDL API functions - */ - -#ifndef _SDL_filesystem_h -#define _SDL_filesystem_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Get the path where the application resides. - * - * Get the "base path". This is the directory where the application was run - * from, which is probably the installation directory, and may or may not - * be the process's current working directory. - * - * This returns an absolute path in UTF-8 encoding, and is guaranteed to - * end with a path separator ('\\' on Windows, '/' most other places). - * - * The pointer returned by this function is owned by you. Please call - * SDL_free() on the pointer when you are done with it, or it will be a - * memory leak. This is not necessarily a fast call, though, so you should - * call this once near startup and save the string if you need it. - * - * Some platforms can't determine the application's path, and on other - * platforms, this might be meaningless. In such cases, this function will - * return NULL. - * - * \return String of base dir in UTF-8 encoding, or NULL on error. - * - * \sa SDL_GetPrefPath - */ -extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); - -/** - * \brief Get the user-and-app-specific path where files can be written. - * - * Get the "pref dir". This is meant to be where users can write personal - * files (preferences and save games, etc) that are specific to your - * application. This directory is unique per user, per application. - * - * This function will decide the appropriate location in the native filesystem, - * create the directory if necessary, and return a string of the absolute - * path to the directory in UTF-8 encoding. - * - * On Windows, the string might look like: - * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" - * - * On Linux, the string might look like: - * "/home/bob/.local/share/My Program Name/" - * - * On Mac OS X, the string might look like: - * "/Users/bob/Library/Application Support/My Program Name/" - * - * (etc.) - * - * You specify the name of your organization (if it's not a real organization, - * your name or an Internet domain you own might do) and the name of your - * application. These should be untranslated proper names. - * - * Both the org and app strings may become part of a directory name, so - * please follow these rules: - * - * - Try to use the same org string (including case-sensitivity) for - * all your applications that use this function. - * - Always use a unique app string for each one, and make sure it never - * changes for an app once you've decided on it. - * - Unicode characters are legal, as long as it's UTF-8 encoded, but... - * - ...only use letters, numbers, and spaces. Avoid punctuation like - * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. - * - * This returns an absolute path in UTF-8 encoding, and is guaranteed to - * end with a path separator ('\\' on Windows, '/' most other places). - * - * The pointer returned by this function is owned by you. Please call - * SDL_free() on the pointer when you are done with it, or it will be a - * memory leak. This is not necessarily a fast call, though, so you should - * call this once near startup and save the string if you need it. - * - * You should assume the path returned by this function is the only safe - * place to write files (and that SDL_GetBasePath(), while it might be - * writable, or even the parent of the returned path, aren't where you - * should be writing things). - * - * Some platforms can't determine the pref path, and on other - * platforms, this might be meaningless. In such cases, this function will - * return NULL. - * - * \param org The name of your organization. - * \param app The name of your application. - * \return UTF-8 string of user dir in platform-dependent notation. NULL - * if there's a problem (creating directory failed, etc). - * - * \sa SDL_GetBasePath - */ -extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_filesystem_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_gamecontroller.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_gamecontroller.h deleted file mode 100644 index 42087ee..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_gamecontroller.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_gamecontroller.h - * - * Include file for SDL game controller event handling - */ - -#ifndef _SDL_gamecontroller_h -#define _SDL_gamecontroller_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_gamecontroller.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system - * for game controllers, and load appropriate drivers. - * - * If you would like to receive controller updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/* The gamecontroller structure used to identify an SDL game controller */ -struct _SDL_GameController; -typedef struct _SDL_GameController SDL_GameController; - - -typedef enum -{ - SDL_CONTROLLER_BINDTYPE_NONE = 0, - SDL_CONTROLLER_BINDTYPE_BUTTON, - SDL_CONTROLLER_BINDTYPE_AXIS, - SDL_CONTROLLER_BINDTYPE_HAT -} SDL_GameControllerBindType; - -/** - * Get the SDL joystick layer binding for this controller button/axis mapping - */ -typedef struct SDL_GameControllerButtonBind -{ - SDL_GameControllerBindType bindType; - union - { - int button; - int axis; - struct { - int hat; - int hat_mask; - } hat; - } value; - -} SDL_GameControllerButtonBind; - - -/** - * To count the number of game controllers in the system for the following: - * int nJoysticks = SDL_NumJoysticks(); - * int nGameControllers = 0; - * for ( int i = 0; i < nJoysticks; i++ ) { - * if ( SDL_IsGameController(i) ) { - * nGameControllers++; - * } - * } - * - * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: - * guid,name,mappings - * - * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. - * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. - * The mapping format for joystick is: - * bX - a joystick button, index X - * hX.Y - hat X with value Y - * aX - axis X of the joystick - * Buttons can be used as a controller axis and vice versa. - * - * This string shows an example of a valid mapping for a controller - * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", - * - */ - -/** - * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform() - * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt - * - * If \c freerw is non-zero, the stream will be closed after being read. - * - * \return number of mappings added, -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW( SDL_RWops * rw, int freerw ); - -/** - * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() - * - * Convenience macro. - */ -#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Add or update an existing mapping configuration - * - * \return 1 if mapping is added, 0 if updated, -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString ); - -/** - * Get a mapping string for a GUID - * - * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid ); - -/** - * Get a mapping string for an open GameController - * - * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller ); - -/** - * Is the joystick on this index supported by the game controller interface? - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); - - -/** - * Get the implementation dependent name of a game controller. - * This can be called before any controllers are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); - -/** - * Open a game controller for use. - * The index passed as an argument refers to the N'th game controller on the system. - * This index is not the value which will identify this controller in future - * controller events. The joystick's instance id (::SDL_JoystickID) will be - * used there instead. - * - * \return A controller identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); - -/** - * Return the SDL_GameController associated with an instance id. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); - -/** - * Return the name for this currently opened controller - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); - -/** - * Returns SDL_TRUE if the controller has been opened and currently connected, - * or SDL_FALSE if it has not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); - -/** - * Get the underlying joystick object used by a controller - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); - -/** - * Enable/disable controller event polling. - * - * If controller events are disabled, you must call SDL_GameControllerUpdate() - * yourself and check the state of the controller when you want controller - * information. - * - * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); - -/** - * Update the current state of the open game controllers. - * - * This is called automatically by the event loop if any game controller - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); - - -/** - * The list of axes available from a controller - */ -typedef enum -{ - SDL_CONTROLLER_AXIS_INVALID = -1, - SDL_CONTROLLER_AXIS_LEFTX, - SDL_CONTROLLER_AXIS_LEFTY, - SDL_CONTROLLER_AXIS_RIGHTX, - SDL_CONTROLLER_AXIS_RIGHTY, - SDL_CONTROLLER_AXIS_TRIGGERLEFT, - SDL_CONTROLLER_AXIS_TRIGGERRIGHT, - SDL_CONTROLLER_AXIS_MAX -} SDL_GameControllerAxis; - -/** - * turn this string into a axis mapping - */ -extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); - -/** - * turn this axis enum into a string mapping - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); - -/** - * Get the SDL joystick layer binding for this controller button mapping - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * Get the current state of an axis control on a game controller. - * - * The state is a value ranging from -32768 to 32767 (except for the triggers, - * which range from 0 to 32767). - * - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * The list of buttons available from a controller - */ -typedef enum -{ - SDL_CONTROLLER_BUTTON_INVALID = -1, - SDL_CONTROLLER_BUTTON_A, - SDL_CONTROLLER_BUTTON_B, - SDL_CONTROLLER_BUTTON_X, - SDL_CONTROLLER_BUTTON_Y, - SDL_CONTROLLER_BUTTON_BACK, - SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_START, - SDL_CONTROLLER_BUTTON_LEFTSTICK, - SDL_CONTROLLER_BUTTON_RIGHTSTICK, - SDL_CONTROLLER_BUTTON_LEFTSHOULDER, - SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, - SDL_CONTROLLER_BUTTON_DPAD_UP, - SDL_CONTROLLER_BUTTON_DPAD_DOWN, - SDL_CONTROLLER_BUTTON_DPAD_LEFT, - SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - SDL_CONTROLLER_BUTTON_MAX -} SDL_GameControllerButton; - -/** - * turn this string into a button mapping - */ -extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); - -/** - * turn this button enum into a string mapping - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); - -/** - * Get the SDL joystick layer binding for this controller button mapping - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - - -/** - * Get the current state of a button on a game controller. - * - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - -/** - * Close a controller previously opened with SDL_GameControllerOpen(). - */ -extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_gamecontroller_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_gesture.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_gesture.h deleted file mode 100644 index 3c29ca7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_gesture.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_gesture.h - * - * Include file for SDL gesture event handling. - */ - -#ifndef _SDL_gesture_h -#define _SDL_gesture_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "SDL_touch.h" - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_GestureID; - -/* Function prototypes */ - -/** - * \brief Begin Recording a gesture on the specified touch, or all touches (-1) - * - * - */ -extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); - - -/** - * \brief Save all currently loaded Dollar Gesture templates - * - * - */ -extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); - -/** - * \brief Save a currently loaded Dollar Gesture template - * - * - */ -extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); - - -/** - * \brief Load Dollar Gesture templates from a file - * - * - */ -extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_gesture_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_haptic.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_haptic.h deleted file mode 100644 index b36d78b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_haptic.h +++ /dev/null @@ -1,1223 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_haptic.h - * - * \brief The SDL Haptic subsystem allows you to control haptic (force feedback) - * devices. - * - * The basic usage is as follows: - * - Initialize the Subsystem (::SDL_INIT_HAPTIC). - * - Open a Haptic Device. - * - SDL_HapticOpen() to open from index. - * - SDL_HapticOpenFromJoystick() to open from an existing joystick. - * - Create an effect (::SDL_HapticEffect). - * - Upload the effect with SDL_HapticNewEffect(). - * - Run the effect with SDL_HapticRunEffect(). - * - (optional) Free the effect with SDL_HapticDestroyEffect(). - * - Close the haptic device with SDL_HapticClose(). - * - * \par Simple rumble example: - * \code - * SDL_Haptic *haptic; - * - * // Open the device - * haptic = SDL_HapticOpen( 0 ); - * if (haptic == NULL) - * return -1; - * - * // Initialize simple rumble - * if (SDL_HapticRumbleInit( haptic ) != 0) - * return -1; - * - * // Play effect at 50% strength for 2 seconds - * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) - * return -1; - * SDL_Delay( 2000 ); - * - * // Clean up - * SDL_HapticClose( haptic ); - * \endcode - * - * \par Complete example: - * \code - * int test_haptic( SDL_Joystick * joystick ) { - * SDL_Haptic *haptic; - * SDL_HapticEffect effect; - * int effect_id; - * - * // Open the device - * haptic = SDL_HapticOpenFromJoystick( joystick ); - * if (haptic == NULL) return -1; // Most likely joystick isn't haptic - * - * // See if it can do sine waves - * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { - * SDL_HapticClose(haptic); // No sine effect - * return -1; - * } - * - * // Create the effect - * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default - * effect.type = SDL_HAPTIC_SINE; - * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates - * effect.periodic.direction.dir[0] = 18000; // Force comes from south - * effect.periodic.period = 1000; // 1000 ms - * effect.periodic.magnitude = 20000; // 20000/32767 strength - * effect.periodic.length = 5000; // 5 seconds long - * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength - * effect.periodic.fade_length = 1000; // Takes 1 second to fade away - * - * // Upload the effect - * effect_id = SDL_HapticNewEffect( haptic, &effect ); - * - * // Test the effect - * SDL_HapticRunEffect( haptic, effect_id, 1 ); - * SDL_Delay( 5000); // Wait for the effect to finish - * - * // We destroy the effect, although closing the device also does this - * SDL_HapticDestroyEffect( haptic, effect_id ); - * - * // Close the device - * SDL_HapticClose(haptic); - * - * return 0; // Success - * } - * \endcode - */ - -#ifndef _SDL_haptic_h -#define _SDL_haptic_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * \typedef SDL_Haptic - * - * \brief The haptic structure used to identify an SDL haptic. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - */ -struct _SDL_Haptic; -typedef struct _SDL_Haptic SDL_Haptic; - - -/** - * \name Haptic features - * - * Different haptic features a device can have. - */ -/* @{ */ - -/** - * \name Haptic effects - */ -/* @{ */ - -/** - * \brief Constant effect supported. - * - * Constant haptic effect. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_CONSTANT (1<<0) - -/** - * \brief Sine wave effect supported. - * - * Periodic haptic effect that simulates sine waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SINE (1<<1) - -/** - * \brief Left/Right effect supported. - * - * Haptic effect for direct control over high/low frequency motors. - * - * \sa SDL_HapticLeftRight - * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, - * we ran out of bits, and this is important for XInput devices. - */ -#define SDL_HAPTIC_LEFTRIGHT (1<<2) - -/* !!! FIXME: put this back when we have more bits in 2.1 */ -/* #define SDL_HAPTIC_SQUARE (1<<2) */ - -/** - * \brief Triangle wave effect supported. - * - * Periodic haptic effect that simulates triangular waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_TRIANGLE (1<<3) - -/** - * \brief Sawtoothup wave effect supported. - * - * Periodic haptic effect that simulates saw tooth up waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHUP (1<<4) - -/** - * \brief Sawtoothdown wave effect supported. - * - * Periodic haptic effect that simulates saw tooth down waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) - -/** - * \brief Ramp effect supported. - * - * Ramp haptic effect. - * - * \sa SDL_HapticRamp - */ -#define SDL_HAPTIC_RAMP (1<<6) - -/** - * \brief Spring effect supported - uses axes position. - * - * Condition haptic effect that simulates a spring. Effect is based on the - * axes position. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_SPRING (1<<7) - -/** - * \brief Damper effect supported - uses axes velocity. - * - * Condition haptic effect that simulates dampening. Effect is based on the - * axes velocity. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_DAMPER (1<<8) - -/** - * \brief Inertia effect supported - uses axes acceleration. - * - * Condition haptic effect that simulates inertia. Effect is based on the axes - * acceleration. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_INERTIA (1<<9) - -/** - * \brief Friction effect supported - uses axes movement. - * - * Condition haptic effect that simulates friction. Effect is based on the - * axes movement. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_FRICTION (1<<10) - -/** - * \brief Custom effect is supported. - * - * User defined custom haptic effect. - */ -#define SDL_HAPTIC_CUSTOM (1<<11) - -/* @} *//* Haptic effects */ - -/* These last few are features the device has, not effects */ - -/** - * \brief Device can set global gain. - * - * Device supports setting the global gain. - * - * \sa SDL_HapticSetGain - */ -#define SDL_HAPTIC_GAIN (1<<12) - -/** - * \brief Device can set autocenter. - * - * Device supports setting autocenter. - * - * \sa SDL_HapticSetAutocenter - */ -#define SDL_HAPTIC_AUTOCENTER (1<<13) - -/** - * \brief Device can be queried for effect status. - * - * Device can be queried for effect status. - * - * \sa SDL_HapticGetEffectStatus - */ -#define SDL_HAPTIC_STATUS (1<<14) - -/** - * \brief Device can be paused. - * - * \sa SDL_HapticPause - * \sa SDL_HapticUnpause - */ -#define SDL_HAPTIC_PAUSE (1<<15) - - -/** - * \name Direction encodings - */ -/* @{ */ - -/** - * \brief Uses polar coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_POLAR 0 - -/** - * \brief Uses cartesian coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_CARTESIAN 1 - -/** - * \brief Uses spherical coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_SPHERICAL 2 - -/* @} *//* Direction encodings */ - -/* @} *//* Haptic features */ - -/* - * Misc defines. - */ - -/** - * \brief Used to play a device an infinite number of times. - * - * \sa SDL_HapticRunEffect - */ -#define SDL_HAPTIC_INFINITY 4294967295U - - -/** - * \brief Structure that represents a haptic direction. - * - * This is the direction where the force comes from, - * instead of the direction in which the force is exerted. - * - * Directions can be specified by: - * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. - * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. - * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. - * - * Cardinal directions of the haptic device are relative to the positioning - * of the device. North is considered to be away from the user. - * - * The following diagram represents the cardinal directions: - * \verbatim - .--. - |__| .-------. - |=.| |.-----.| - |--| || || - | | |'-----'| - |__|~')_____(' - [ COMPUTER ] - - - North (0,-1) - ^ - | - | - (-1,0) West <----[ HAPTIC ]----> East (1,0) - | - | - v - South (0,1) - - - [ USER ] - \|||/ - (o o) - ---ooO-(_)-Ooo--- - \endverbatim - * - * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a - * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses - * the first \c dir parameter. The cardinal directions would be: - * - North: 0 (0 degrees) - * - East: 9000 (90 degrees) - * - South: 18000 (180 degrees) - * - West: 27000 (270 degrees) - * - * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions - * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses - * the first three \c dir parameters. The cardinal directions would be: - * - North: 0,-1, 0 - * - East: 1, 0, 0 - * - South: 0, 1, 0 - * - West: -1, 0, 0 - * - * The Z axis represents the height of the effect if supported, otherwise - * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you - * can use any multiple you want, only the direction matters. - * - * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. - * The first two \c dir parameters are used. The \c dir parameters are as - * follows (all values are in hundredths of degrees): - * - Degrees from (1, 0) rotated towards (0, 1). - * - Degrees towards (0, 0, 1) (device needs at least 3 axes). - * - * - * Example of force coming from the south with all encodings (force coming - * from the south means the user will have to pull the stick to counteract): - * \code - * SDL_HapticDirection direction; - * - * // Cartesian directions - * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. - * direction.dir[0] = 0; // X position - * direction.dir[1] = 1; // Y position - * // Assuming the device has 2 axes, we don't need to specify third parameter. - * - * // Polar directions - * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. - * direction.dir[0] = 18000; // Polar only uses first parameter - * - * // Spherical coordinates - * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding - * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. - * \endcode - * - * \sa SDL_HAPTIC_POLAR - * \sa SDL_HAPTIC_CARTESIAN - * \sa SDL_HAPTIC_SPHERICAL - * \sa SDL_HapticEffect - * \sa SDL_HapticNumAxes - */ -typedef struct SDL_HapticDirection -{ - Uint8 type; /**< The type of encoding. */ - Sint32 dir[3]; /**< The encoded direction. */ -} SDL_HapticDirection; - - -/** - * \brief A structure containing a template for a Constant effect. - * - * The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect. - * - * A constant effect applies a constant force in the specified direction - * to the joystick. - * - * \sa SDL_HAPTIC_CONSTANT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticConstant -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Constant */ - Sint16 level; /**< Strength of the constant effect. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticConstant; - -/** - * \brief A structure containing a template for a Periodic effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SINE - * - ::SDL_HAPTIC_LEFTRIGHT - * - ::SDL_HAPTIC_TRIANGLE - * - ::SDL_HAPTIC_SAWTOOTHUP - * - ::SDL_HAPTIC_SAWTOOTHDOWN - * - * A periodic effect consists in a wave-shaped effect that repeats itself - * over time. The type determines the shape of the wave and the parameters - * determine the dimensions of the wave. - * - * Phase is given by hundredth of a degree meaning that giving the phase a value - * of 9000 will displace it 25% of its period. Here are sample values: - * - 0: No phase displacement. - * - 9000: Displaced 25% of its period. - * - 18000: Displaced 50% of its period. - * - 27000: Displaced 75% of its period. - * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. - * - * Examples: - * \verbatim - SDL_HAPTIC_SINE - __ __ __ __ - / \ / \ / \ / - / \__/ \__/ \__/ - - SDL_HAPTIC_SQUARE - __ __ __ __ __ - | | | | | | | | | | - | |__| |__| |__| |__| | - - SDL_HAPTIC_TRIANGLE - /\ /\ /\ /\ /\ - / \ / \ / \ / \ / - / \/ \/ \/ \/ - - SDL_HAPTIC_SAWTOOTHUP - /| /| /| /| /| /| /| - / | / | / | / | / | / | / | - / |/ |/ |/ |/ |/ |/ | - - SDL_HAPTIC_SAWTOOTHDOWN - \ |\ |\ |\ |\ |\ |\ | - \ | \ | \ | \ | \ | \ | \ | - \| \| \| \| \| \| \| - \endverbatim - * - * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HAPTIC_TRIANGLE - * \sa SDL_HAPTIC_SAWTOOTHUP - * \sa SDL_HAPTIC_SAWTOOTHDOWN - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticPeriodic -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, - ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or - ::SDL_HAPTIC_SAWTOOTHDOWN */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Periodic */ - Uint16 period; /**< Period of the wave. */ - Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ - Sint16 offset; /**< Mean value of the wave. */ - Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticPeriodic; - -/** - * \brief A structure containing a template for a Condition effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SPRING: Effect based on axes position. - * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. - * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. - * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. - * - * Direction is handled by condition internals instead of a direction member. - * The condition effect specific members have three parameters. The first - * refers to the X axis, the second refers to the Y axis and the third - * refers to the Z axis. The right terms refer to the positive side of the - * axis and the left terms refer to the negative side of the axis. Please - * refer to the ::SDL_HapticDirection diagram for which side is positive and - * which is negative. - * - * \sa SDL_HapticDirection - * \sa SDL_HAPTIC_SPRING - * \sa SDL_HAPTIC_DAMPER - * \sa SDL_HAPTIC_INERTIA - * \sa SDL_HAPTIC_FRICTION - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCondition -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, - ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ - SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Condition */ - Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ - Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ - Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ - Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ - Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ - Sint16 center[3]; /**< Position of the dead zone. */ -} SDL_HapticCondition; - -/** - * \brief A structure containing a template for a Ramp effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. - * - * The ramp effect starts at start strength and ends at end strength. - * It augments in linear fashion. If you use attack and fade with a ramp - * the effects get added to the ramp effect making the effect become - * quadratic instead of linear. - * - * \sa SDL_HAPTIC_RAMP - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticRamp -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_RAMP */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Ramp */ - Sint16 start; /**< Beginning strength level. */ - Sint16 end; /**< Ending strength level. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticRamp; - -/** - * \brief A structure containing a template for a Left/Right effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. - * - * The Left/Right effect is used to explicitly control the large and small - * motors, commonly found in modern game controllers. One motor is high - * frequency, the other is low frequency. - * - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticLeftRight -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - - /* Rumble */ - Uint16 large_magnitude; /**< Control of the large controller motor. */ - Uint16 small_magnitude; /**< Control of the small controller motor. */ -} SDL_HapticLeftRight; - -/** - * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. - * - * A custom force feedback effect is much like a periodic effect, where the - * application can define its exact shape. You will have to allocate the - * data yourself. Data should consist of channels * samples Uint16 samples. - * - * If channels is one, the effect is rotated using the defined direction. - * Otherwise it uses the samples in data for the different axes. - * - * \sa SDL_HAPTIC_CUSTOM - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCustom -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Custom */ - Uint8 channels; /**< Axes to use, minimum of one. */ - Uint16 period; /**< Sample periods. */ - Uint16 samples; /**< Amount of samples. */ - Uint16 *data; /**< Should contain channels*samples items. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticCustom; - -/** - * \brief The generic template for any haptic effect. - * - * All values max at 32767 (0x7FFF). Signed values also can be negative. - * Time values unless specified otherwise are in milliseconds. - * - * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 - * value. Neither delay, interval, attack_length nor fade_length support - * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. - * - * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of - * ::SDL_HAPTIC_INFINITY. - * - * Button triggers may not be supported on all devices, it is advised to not - * use them if possible. Buttons start at index 1 instead of index 0 like - * the joystick. - * - * If both attack_length and fade_level are 0, the envelope is not used, - * otherwise both values are used. - * - * Common parts: - * \code - * // Replay - All effects have this - * Uint32 length; // Duration of effect (ms). - * Uint16 delay; // Delay before starting effect. - * - * // Trigger - All effects have this - * Uint16 button; // Button that triggers effect. - * Uint16 interval; // How soon before effect can be triggered again. - * - * // Envelope - All effects except condition effects have this - * Uint16 attack_length; // Duration of the attack (ms). - * Uint16 attack_level; // Level at the start of the attack. - * Uint16 fade_length; // Duration of the fade out (ms). - * Uint16 fade_level; // Level at the end of the fade. - * \endcode - * - * - * Here we have an example of a constant effect evolution in time: - * \verbatim - Strength - ^ - | - | effect level --> _________________ - | / \ - | / \ - | / \ - | / \ - | attack_level --> | \ - | | | <--- fade_level - | - +--------------------------------------------------> Time - [--] [---] - attack_length fade_length - - [------------------][-----------------------] - delay length - \endverbatim - * - * Note either the attack_level or the fade_level may be above the actual - * effect level. - * - * \sa SDL_HapticConstant - * \sa SDL_HapticPeriodic - * \sa SDL_HapticCondition - * \sa SDL_HapticRamp - * \sa SDL_HapticLeftRight - * \sa SDL_HapticCustom - */ -typedef union SDL_HapticEffect -{ - /* Common for all force feedback effects */ - Uint16 type; /**< Effect type. */ - SDL_HapticConstant constant; /**< Constant effect. */ - SDL_HapticPeriodic periodic; /**< Periodic effect. */ - SDL_HapticCondition condition; /**< Condition effect. */ - SDL_HapticRamp ramp; /**< Ramp effect. */ - SDL_HapticLeftRight leftright; /**< Left/Right effect. */ - SDL_HapticCustom custom; /**< Custom effect. */ -} SDL_HapticEffect; - - -/* Function prototypes */ -/** - * \brief Count the number of haptic devices attached to the system. - * - * \return Number of haptic devices detected on the system. - */ -extern DECLSPEC int SDLCALL SDL_NumHaptics(void); - -/** - * \brief Get the implementation dependent name of a Haptic device. - * - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - * - * \param device_index Index of the device to get its name. - * \return Name of the device or NULL on error. - * - * \sa SDL_NumHaptics - */ -extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); - -/** - * \brief Opens a Haptic device for usage. - * - * The index passed as an argument refers to the N'th Haptic device on this - * system. - * - * When opening a haptic device, its gain will be set to maximum and - * autocenter will be disabled. To modify these values use - * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). - * - * \param device_index Index of the device to open. - * \return Device identifier or NULL on error. - * - * \sa SDL_HapticIndex - * \sa SDL_HapticOpenFromMouse - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - * \sa SDL_HapticSetGain - * \sa SDL_HapticSetAutocenter - * \sa SDL_HapticPause - * \sa SDL_HapticStopAll - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); - -/** - * \brief Checks if the haptic device at index has been opened. - * - * \param device_index Index to check to see if it has been opened. - * \return 1 if it has been opened or 0 if it hasn't. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticIndex - */ -extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); - -/** - * \brief Gets the index of a haptic device. - * - * \param haptic Haptic device to get the index of. - * \return The index of the haptic device or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpened - */ -extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); - -/** - * \brief Gets whether or not the current mouse has haptic capabilities. - * - * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. - * - * \sa SDL_HapticOpenFromMouse - */ -extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); - -/** - * \brief Tries to open a haptic device from the current mouse. - * - * \return The haptic device identifier or NULL on error. - * - * \sa SDL_MouseIsHaptic - * \sa SDL_HapticOpen - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); - -/** - * \brief Checks to see if a joystick has haptic features. - * - * \param joystick Joystick to test for haptic capabilities. - * \return 1 if the joystick is haptic, 0 if it isn't - * or -1 if an error ocurred. - * - * \sa SDL_HapticOpenFromJoystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); - -/** - * \brief Opens a Haptic device for usage from a Joystick device. - * - * You must still close the haptic device separately. It will not be closed - * with the joystick. - * - * When opening from a joystick you should first close the haptic device before - * closing the joystick device. If not, on some implementations the haptic - * device will also get unallocated and you'll be unable to use force feedback - * on that device. - * - * \param joystick Joystick to create a haptic device from. - * \return A valid haptic device identifier on success or NULL on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticClose - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * - joystick); - -/** - * \brief Closes a Haptic device previously opened with SDL_HapticOpen(). - * - * \param haptic Haptic device to close. - */ -extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); - -/** - * \brief Returns the number of effects a haptic device can store. - * - * On some platforms this isn't fully supported, and therefore is an - * approximation. Always check to see if your created effect was actually - * created and do not rely solely on SDL_HapticNumEffects(). - * - * \param haptic The haptic device to query effect max. - * \return The number of effects the haptic device can store or - * -1 on error. - * - * \sa SDL_HapticNumEffectsPlaying - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); - -/** - * \brief Returns the number of effects a haptic device can play at the same - * time. - * - * This is not supported on all platforms, but will always return a value. - * Added here for the sake of completeness. - * - * \param haptic The haptic device to query maximum playing effects. - * \return The number of effects the haptic device can play at the same time - * or -1 on error. - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); - -/** - * \brief Gets the haptic device's supported features in bitwise manner. - * - * Example: - * \code - * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { - * printf("We have constant haptic effect!"); - * } - * \endcode - * - * \param haptic The haptic device to query. - * \return Haptic features in bitwise manner (OR'd). - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticEffectSupported - */ -extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); - - -/** - * \brief Gets the number of haptic axes the device has. - * - * \sa SDL_HapticDirection - */ -extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); - -/** - * \brief Checks to see if effect is supported by haptic. - * - * \param haptic Haptic device to check on. - * \param effect Effect to check to see if it is supported. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. - * - * \sa SDL_HapticQuery - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, - SDL_HapticEffect * - effect); - -/** - * \brief Creates a new haptic effect on the device. - * - * \param haptic Haptic device to create the effect on. - * \param effect Properties of the effect to create. - * \return The id of the effect on success or -1 on error. - * - * \sa SDL_HapticUpdateEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, - SDL_HapticEffect * effect); - -/** - * \brief Updates the properties of an effect. - * - * Can be used dynamically, although behaviour when dynamically changing - * direction may be strange. Specifically the effect may reupload itself - * and start playing from the start. You cannot change the type either when - * running SDL_HapticUpdateEffect(). - * - * \param haptic Haptic device that has the effect. - * \param effect Effect to update. - * \param data New effect properties to use. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticNewEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, - int effect, - SDL_HapticEffect * data); - -/** - * \brief Runs the haptic effect on its associated haptic device. - * - * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over - * repeating the envelope (attack and fade) every time. If you only want the - * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length - * parameter. - * - * \param haptic Haptic device to run the effect on. - * \param effect Identifier of the haptic effect to run. - * \param iterations Number of iterations to run the effect. Use - * ::SDL_HAPTIC_INFINITY for infinity. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticStopEffect - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticGetEffectStatus - */ -extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, - int effect, - Uint32 iterations); - -/** - * \brief Stops the haptic effect on its associated haptic device. - * - * \param haptic Haptic device to stop the effect on. - * \param effect Identifier of the effect to stop. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, - int effect); - -/** - * \brief Destroys a haptic effect on the device. - * - * This will stop the effect if it's running. Effects are automatically - * destroyed when the device is closed. - * - * \param haptic Device to destroy the effect on. - * \param effect Identifier of the effect to destroy. - * - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, - int effect); - -/** - * \brief Gets the status of the current effect on the haptic device. - * - * Device must support the ::SDL_HAPTIC_STATUS feature. - * - * \param haptic Haptic device to query the effect status on. - * \param effect Identifier of the effect to query its status. - * \return 0 if it isn't playing, 1 if it is playing or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticStopEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, - int effect); - -/** - * \brief Sets the global gain of the device. - * - * Device must support the ::SDL_HAPTIC_GAIN feature. - * - * The user may specify the maximum gain by setting the environment variable - * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to - * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the - * maximum. - * - * \param haptic Haptic device to set the gain on. - * \param gain Value to set the gain to, should be between 0 and 100. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); - -/** - * \brief Sets the global autocenter of the device. - * - * Autocenter should be between 0 and 100. Setting it to 0 will disable - * autocentering. - * - * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. - * - * \param haptic Haptic device to set autocentering on. - * \param autocenter Value to set autocenter to, 0 disables autocentering. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, - int autocenter); - -/** - * \brief Pauses a haptic device. - * - * Device must support the ::SDL_HAPTIC_PAUSE feature. Call - * SDL_HapticUnpause() to resume playback. - * - * Do not modify the effects nor add new ones while the device is paused. - * That can cause all sorts of weird errors. - * - * \param haptic Haptic device to pause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticUnpause - */ -extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); - -/** - * \brief Unpauses a haptic device. - * - * Call to unpause after SDL_HapticPause(). - * - * \param haptic Haptic device to unpause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticPause - */ -extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); - -/** - * \brief Stops all the currently playing effects on a haptic device. - * - * \param haptic Haptic device to stop. - * \return 0 on success or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); - -/** - * \brief Checks to see if rumble is supported on a haptic device. - * - * \param haptic Haptic device to check to see if it supports rumble. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. - * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); - -/** - * \brief Initializes the haptic device for simple rumble playback. - * - * \param haptic Haptic device to initialize for simple rumble playback. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); - -/** - * \brief Runs simple rumble on a haptic device - * - * \param haptic Haptic device to play rumble effect on. - * \param strength Strength of the rumble to play as a 0-1 float value. - * \param length Length of the rumble to play in milliseconds. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); - -/** - * \brief Stops the simple rumble on a haptic device. - * - * \param haptic Haptic to stop the rumble on. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_haptic_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_hints.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_hints.h deleted file mode 100644 index 3bd5435..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_hints.h +++ /dev/null @@ -1,711 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_hints.h - * - * Official documentation for SDL configuration variables - * - * This file contains functions to set and get configuration hints, - * as well as listing each of them alphabetically. - * - * The convention for naming hints is SDL_HINT_X, where "SDL_X" is - * the environment variable that can be used to override the default. - * - * In general these hints are just that - they may or may not be - * supported or applicable on any given platform, but they provide - * a way for an application or user to give the library a hint as - * to how they would like the library to work. - */ - -#ifndef _SDL_hints_h -#define _SDL_hints_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. - * - * SDL can try to accelerate the SDL screen surface by using streaming - * textures with a 3D rendering engine. This variable controls whether and - * how this is done. - * - * This variable can be set to the following values: - * "0" - Disable 3D acceleration - * "1" - Enable 3D acceleration, using the default renderer. - * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) - * - * By default SDL tries to make a best guess for each platform whether - * to use acceleration or not. - */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" - -/** - * \brief A variable specifying which render driver to use. - * - * If the application doesn't pick a specific renderer to use, this variable - * specifies the name of the preferred renderer. If the preferred renderer - * can't be initialized, the normal default renderer is used. - * - * This variable is case insensitive and can be set to the following values: - * "direct3d" - * "opengl" - * "opengles2" - * "opengles" - * "software" - * - * The default varies by platform, but it's the first one in the list that - * is available on the current platform. - */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" - -/** - * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. - * - * This variable can be set to the following values: - * "0" - Disable shaders - * "1" - Enable shaders - * - * By default shaders are used if OpenGL supports them. - */ -#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" - -/** - * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. - * - * This variable can be set to the following values: - * "0" - Thread-safety is not enabled (faster) - * "1" - Thread-safety is enabled - * - * By default the Direct3D device is created with thread-safety disabled. - */ -#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" - -/** - * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. - * - * This variable does not have any effect on the Direct3D 9 based renderer. - * - * This variable can be set to the following values: - * "0" - Disable Debug Layer use - * "1" - Enable Debug Layer use - * - * By default, SDL does not use Direct3D Debug Layer. - */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" - -/** - * \brief A variable controlling the scaling quality - * - * This variable can be set to the following values: - * "0" or "nearest" - Nearest pixel sampling - * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) - * "2" or "best" - Currently this is the same as "linear" - * - * By default nearest pixel sampling is used - */ -#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" - -/** - * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. - * - * This variable can be set to the following values: - * "0" - Disable vsync - * "1" - Enable vsync - * - * By default SDL does not sync screen surface updates with vertical refresh. - */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" - -/** - * \brief A variable controlling whether the screensaver is enabled. - * - * This variable can be set to the following values: - * "0" - Disable screensaver - * "1" - Enable screensaver - * - * By default SDL will disable the screensaver. - */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" - -/** - * \brief A variable controlling whether the X11 VidMode extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XVidMode - * "1" - Enable XVidMode - * - * By default SDL will use XVidMode if it is available. - */ -#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" - -/** - * \brief A variable controlling whether the X11 Xinerama extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable Xinerama - * "1" - Enable Xinerama - * - * By default SDL will use Xinerama if it is available. - */ -#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" - -/** - * \brief A variable controlling whether the X11 XRandR extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XRandR - * "1" - Enable XRandR - * - * By default SDL will not use XRandR because of window manager issues. - */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" - -/** - * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_PING - * "1" - Enable _NET_WM_PING - * - * By default SDL will use _NET_WM_PING, but for applications that know they - * will not always be able to respond to ping requests in a timely manner they can - * turn it off to avoid the window manager thinking the app is hung. - * The hint is checked in CreateWindow. - */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" - -/** - * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden - * - * This variable can be set to the following values: - * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) - * "1" - The window frame is interactive when the cursor is hidden - * - * By default SDL will allow interaction with the window frame when the cursor is hidden - */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" - -/** - * \brief A variable controlling whether the windows message loop is processed by SDL - * - * This variable can be set to the following values: - * "0" - The window message loop is not run - * "1" - The window message loop is processed in SDL_PumpEvents() - * - * By default SDL will process the windows message loop - */ -#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" - -/** - * \brief A variable controlling whether grabbing input grabs the keyboard - * - * This variable can be set to the following values: - * "0" - Grab will affect only the mouse - * "1" - Grab will affect mouse and keyboard - * - * By default SDL will not grab the keyboard so system shortcuts still work. - */ -#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" - -/** -* \brief A variable controlling whether relative mouse mode is implemented using mouse warping -* -* This variable can be set to the following values: -* "0" - Relative mouse mode uses raw input -* "1" - Relative mouse mode uses mouse warping -* -* By default SDL will use raw input for relative mouse mode -*/ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" - -/** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. - * - */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" - -/** - * \brief A variable controlling whether the idle timer is disabled on iOS. - * - * When an iOS app does not receive touches for some time, the screen is - * dimmed automatically. For games where the accelerometer is the only input - * this is problematic. This functionality can be disabled by setting this - * hint. - * - * As of SDL 2.0.4, SDL_EnableScreenSaver and SDL_DisableScreenSaver accomplish - * the same thing on iOS. They should be preferred over this hint. - * - * This variable can be set to the following values: - * "0" - Enable idle timer - * "1" - Disable idle timer - */ -#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" - -/** - * \brief A variable controlling which orientations are allowed on iOS. - * - * In some circumstances it is necessary to be able to explicitly control - * which UI orientations are allowed. - * - * This variable is a space delimited list of the following values: - * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" - */ -#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" - -/** - * \brief A variable controlling whether the Android / iOS built-in - * accelerometer should be listed as a joystick device, rather than listing - * actual joysticks only. - * - * This variable can be set to the following values: - * "0" - List only real joysticks and accept input from them - * "1" - List real joysticks along with the accelerometer as if it were a 3 axis joystick (the default). - */ -#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" - - -/** - * \brief A variable that lets you disable the detection and use of Xinput gamepad devices - * - * The variable can be set to the following values: - * "0" - Disable XInput detection (only uses direct input) - * "1" - Enable XInput detection (the default) - */ -#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" - - -/** - * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. - * - * This hint is for backwards compatibility only and will be removed in SDL 2.1 - * - * The default value is "0". This hint must be set before SDL_Init() - */ -#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" - - -/** - * \brief A variable that lets you manually hint extra gamecontroller db entries - * - * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" - - -/** - * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. - * - * The variable can be set to the following values: - * "0" - Disable joystick & gamecontroller input events when the - * application is in the background. - * "1" - Enable joystick & gamecontroller input events when the - * application is in the background. - * - * The default value is "0". This hint may be set at any time. - */ -#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" - - -/** - * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. - * This is a debugging aid for developers and not expected to be used by end users. The default is "1" - * - * This variable can be set to the following values: - * "0" - don't allow topmost - * "1" - allow topmost - */ -#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" - - -/** - * \brief A variable that controls the timer resolution, in milliseconds. - * - * The higher resolution the timer, the more frequently the CPU services - * timer interrupts, and the more precise delays are, but this takes up - * power and CPU time. This hint is only used on Windows 7 and earlier. - * - * See this blog post for more information: - * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ - * - * If this variable is set to "0", the system timer resolution is not set. - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" - - - -/** -* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size -* -* Use this hint in case you need to set SDL's threads stack size to other than the default. -* This is specially useful if you build SDL against a non glibc libc library (such as musl) which -* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). -* Support for this hint is currently available only in the pthread backend. -*/ -#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" - -/** - * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) - */ -#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" - -/** - * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac - * - * If present, holding ctrl while left clicking will generate a right click - * event when on Mac. - */ -#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" - -/** -* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries -* -* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It -* can use two different sets of binaries, those compiled by the user from source -* or those provided by the Chrome browser. In the later case, these binaries require -* that SDL loads a DLL providing the shader compiler. -* -* This variable can be set to the following values: -* "d3dcompiler_46.dll" - default, best for Vista or later. -* "d3dcompiler_43.dll" - for XP support. -* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. -* -*/ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" - -/** -* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). -* -* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has -* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly -* created SDL_Window: -* -* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is -* needed for example when sharing an OpenGL context across multiple windows. -* -* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for -* OpenGL rendering. -* -* This variable can be set to the following values: -* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should -* share a pixel format with. -*/ -#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" - -/** - * \brief A URL to a WinRT app's privacy policy - * - * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be - * be available in the Windows Settings charm, as accessed from within the app. - * SDL provides code to add a URL-based link there, which can point to the app's - * privacy policy. - * - * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL - * before calling any SDL_Init functions. The contents of the hint should - * be a valid URL. For example, "http://www.example.com". - * - * The default value is "", which will prevent SDL from adding a privacy policy - * link to the Settings charm. This hint should only be set during app init. - * - * The label text of an app's "Privacy Policy" link may be customized via another - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that on Windows Phone, Microsoft does not provide standard UI - * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL - * will not get used on that platform. Network-enabled phone apps should display - * their privacy policy through some other, in-app means. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" - -/** \brief Label text for a WinRT app's privacy policy link - * - * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, - * Microsoft mandates that this policy be available via the Windows Settings charm. - * SDL provides code to add a link there, with its label text being set via the - * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that a privacy policy's contents are not set via this hint. A separate - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the - * policy. - * - * The contents of this hint should be encoded as a UTF8 string. - * - * The default value is "Privacy Policy". This hint should only be set during app - * initialization, preferably before any calls to SDL_Init. - * - * For additional information on linking to a privacy policy, see the documentation for - * SDL_HINT_WINRT_PRIVACY_POLICY_URL. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" - -/** \brief Allows back-button-press events on Windows Phone to be marked as handled - * - * Windows Phone devices typically feature a Back button. When pressed, - * the OS will emit back-button-press events, which apps are expected to - * handle in an appropriate manner. If apps do not explicitly mark these - * events as 'Handled', then the OS will invoke its default behavior for - * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to - * terminate the app (and attempt to switch to the previous app, or to the - * device's home screen). - * - * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL - * to mark back-button-press events as Handled, if and when one is sent to - * the app. - * - * Internally, Windows Phone sends back button events as parameters to - * special back-button-press callback functions. Apps that need to respond - * to back-button-press events are expected to register one or more - * callback functions for such, shortly after being launched (during the - * app's initialization phase). After the back button is pressed, the OS - * will invoke these callbacks. If the app's callback(s) do not explicitly - * mark the event as handled by the time they return, or if the app never - * registers one of these callback, the OS will consider the event - * un-handled, and it will apply its default back button behavior (terminate - * the app). - * - * SDL registers its own back-button-press callback with the Windows Phone - * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN - * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which - * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. - * If the hint's value is set to "1", the back button event's Handled - * property will get set to 'true'. If the hint's value is set to something - * else, or if it is unset, SDL will leave the event's Handled property - * alone. (By default, the OS sets this property to 'false', to note.) - * - * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a - * back button is pressed, or can set it in direct-response to a back button - * being pressed. - * - * In order to get notified when a back button is pressed, SDL apps should - * register a callback function with SDL_AddEventWatch(), and have it listen - * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. - * (Alternatively, SDL_KEYUP events can be listened-for. Listening for - * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON - * set by such a callback, will be applied to the OS' current - * back-button-press event. - * - * More details on back button behavior in Windows Phone apps can be found - * at the following page, on Microsoft's developer site: - * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx - */ -#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" - -/** - * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. - * - * This hint only applies to Mac OS X. - * - * The variable can be set to the following values: - * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and - * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" - * button on their titlebars). - * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and - * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" - * button on their titlebars). - * - * The default value is "1". Spaces are disabled regardless of this hint if - * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before - * any windows are created. - */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" - -/** -* \brief When set don't force the SDL app to become a foreground process -* -* This hint only applies to Mac OS X. -* -*/ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" - -/** - * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" - -/** - * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" - -/** - * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. - * - * The variable can be set to the following values: - * "0" - SDL_TEXTEDITING events are sent, and it is the application's - * responsibility to render the text from these events and - * differentiate it somehow from committed text. (default) - * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, - * and text that is being composed will be rendered in its own UI. - */ -#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" - - /** - * \brief A variable to control whether mouse and touch events are to be treated together or separately - * - * The variable can be set to the following values: - * "0" - Mouse events will be handled as touch events, and touch will raise fake mouse - * events. This is the behaviour of SDL <= 2.0.3. (default) - * "1" - Mouse events will be handled separately from pure touch events. - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH" - -/** - * \brief override the binding element for keyboard inputs for Emscripten builds - * - * This hint only applies to the emscripten platform - * - * The variable can be one of - * "#window" - The javascript window object (this is the default) - * "#document" - The javascript document object - * "#screen" - the javascript window.screen object - * "#canvas" - the WebGL canvas element - * any other string without a leading # sign applies to the element on the page with that ID. - */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" - -/** - * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. - * - * This hint only applies to Unix-like platforms. - * - * The variable can be set to the following values: - * "0" - SDL will install a SIGINT and SIGTERM handler, and when it - * catches a signal, convert it into an SDL_QUIT event. - * "1" - SDL will not install a signal handler at all. - */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" - -/** - * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. - * - * The variable can be set to the following values: - * "0" - SDL will generate a window-close event when it sees Alt+F4. - * "1" - SDL will only do normal key handling for Alt+F4. - */ -#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" - -/** - * \brief An enumeration of hint priorities - */ -typedef enum -{ - SDL_HINT_DEFAULT, - SDL_HINT_NORMAL, - SDL_HINT_OVERRIDE -} SDL_HintPriority; - - -/** - * \brief Set a hint with a specific priority - * - * The priority controls the behavior when setting a hint that already - * has a value. Hints will replace existing hints of their priority and - * lower. Environment variables are considered to have override priority. - * - * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); - -/** - * \brief Set a hint with normal priority - * - * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, - const char *value); - -/** - * \brief Get a hint - * - * \return The string value of a hint variable. - */ -extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); - -/** - * \brief Add a function to watch a particular hint - * - * \param name The hint to watch - * \param callback The function to call when the hint value changes - * \param userdata A pointer to pass to the callback function - */ -typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); -extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * \brief Remove a function watching a particular hint - * - * \param name The hint being watched - * \param callback The function being called when the hint value changes - * \param userdata A pointer being passed to the callback function - */ -extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * \brief Clear all hints - * - * This function is called during SDL_Quit() to free stored hints. - */ -extern DECLSPEC void SDLCALL SDL_ClearHints(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_hints_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_image.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_image.h deleted file mode 100644 index f654483..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_image.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - SDL_image: An example image loading library for use with SDL - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/* A simple library to load images of various formats as SDL surfaces */ - -#ifndef _SDL_IMAGE_H -#define _SDL_IMAGE_H - -#include "SDL.h" -#include "SDL_version.h" -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -#define SDL_IMAGE_MAJOR_VERSION 2 -#define SDL_IMAGE_MINOR_VERSION 0 -#define SDL_IMAGE_PATCHLEVEL 1 - -/* This macro can be used to fill a version structure with the compile-time - * version of the SDL_image library. - */ -#define SDL_IMAGE_VERSION(X) \ -{ \ - (X)->major = SDL_IMAGE_MAJOR_VERSION; \ - (X)->minor = SDL_IMAGE_MINOR_VERSION; \ - (X)->patch = SDL_IMAGE_PATCHLEVEL; \ -} - -/* This function gets the version of the dynamically linked SDL_image library. - it should NOT be used to fill a version structure, instead you should - use the SDL_IMAGE_VERSION() macro. - */ -extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void); - -typedef enum -{ - IMG_INIT_JPG = 0x00000001, - IMG_INIT_PNG = 0x00000002, - IMG_INIT_TIF = 0x00000004, - IMG_INIT_WEBP = 0x00000008 -} IMG_InitFlags; - -/* Loads dynamic libraries and prepares them for use. Flags should be - one or more flags from IMG_InitFlags OR'd together. - It returns the flags successfully initialized, or 0 on failure. - */ -extern DECLSPEC int SDLCALL IMG_Init(int flags); - -/* Unloads libraries loaded with IMG_Init */ -extern DECLSPEC void SDLCALL IMG_Quit(void); - -/* Load an image from an SDL data source. - The 'type' may be one of: "BMP", "GIF", "PNG", etc. - - If the image format supports a transparent pixel, SDL will set the - colorkey for the surface. You can enable RLE acceleration on the - surface afterwards by calling: - SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey); - */ -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, const char *type); -/* Convenience functions */ -extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file); -extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc); - -#if SDL_VERSION_ATLEAST(2,0,0) -/* Load an image directly into a render texture. - */ -extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer, const char *file); -extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc); -extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc, const char *type); -#endif /* SDL 2.0 */ - -/* Functions to detect a file type, given a seekable source */ -extern DECLSPEC int SDLCALL IMG_isICO(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isCUR(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src); -extern DECLSPEC int SDLCALL IMG_isWEBP(SDL_RWops *src); - -/* Individual loading functions */ -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadCUR_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src); -extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadWEBP_RW(SDL_RWops *src); - -extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm); - -/* Individual saving functions */ -extern DECLSPEC int SDLCALL IMG_SavePNG(SDL_Surface *surface, const char *file); -extern DECLSPEC int SDLCALL IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst); - -/* We'll use SDL for reporting errors */ -#define IMG_SetError SDL_SetError -#define IMG_GetError SDL_GetError - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_IMAGE_H */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_joystick.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_joystick.h deleted file mode 100644 index 266f3b3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_joystick.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_joystick.h - * - * Include file for SDL joystick event handling - * - * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick - * behind a device_index changing as joysticks are plugged and unplugged. - * - * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted - * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. - * - * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of - * the device (a X360 wired controller for example). This identifier is platform dependent. - * - * - */ - -#ifndef _SDL_joystick_h -#define _SDL_joystick_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_joystick.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. - * - * If you would like to receive joystick updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/* The joystick structure used to identify an SDL joystick */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - -/* A structure that encodes the stable unique id for a joystick device */ -typedef struct { - Uint8 data[16]; -} SDL_JoystickGUID; - -typedef Sint32 SDL_JoystickID; - -typedef enum -{ - SDL_JOYSTICK_POWER_UNKNOWN = -1, - SDL_JOYSTICK_POWER_EMPTY, - SDL_JOYSTICK_POWER_LOW, - SDL_JOYSTICK_POWER_MEDIUM, - SDL_JOYSTICK_POWER_FULL, - SDL_JOYSTICK_POWER_WIRED, - SDL_JOYSTICK_POWER_MAX -} SDL_JoystickPowerLevel; - -/* Function prototypes */ -/** - * Count the number of joysticks attached to the system right now - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/** - * Get the implementation dependent name of a joystick. - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); - -/** - * Open a joystick for use. - * The index passed as an argument refers to the N'th joystick on the system. - * This index is not the value which will identify this joystick in future - * joystick events. The joystick's instance id (::SDL_JoystickID) will be used - * there instead. - * - * \return A joystick identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); - -/** - * Return the SDL_Joystick associated with an instance id. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID joyid); - -/** - * Return the name for this currently opened joystick. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); - -/** - * Return the GUID for the joystick at this index - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); - -/** - * Return the GUID for this opened joystick - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); - -/** - * Return a string representation for this guid. pszGUID must point to at least 33 bytes - * (32 for the string plus a NULL terminator). - */ -extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); - -/** - * convert a string into a joystick formatted guid - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); - -/** - * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); - -/** - * Get the instance ID of an opened joystick or -1 if the joystick is invalid. - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); - -/** - * Get the number of general axis controls on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); - -/** - * Get the number of trackballs on a joystick. - * - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); - -/** - * Get the number of POV hats on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); - -/** - * Get the number of buttons on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); - -/** - * Update the current state of the open joysticks. - * - * This is called automatically by the event loop if any joystick - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/** - * Enable/disable joystick event polling. - * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. - * - * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -/** - * Get the current state of an axis control on a joystick. - * - * The state is a value ranging from -32768 to 32767. - * - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, - int axis); - -/** - * \name Hat positions - */ -/* @{ */ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/* @} */ - -/** - * Get the current state of a POV hat on a joystick. - * - * The hat indices start at index 0. - * - * \return The return value is one of the following positions: - * - ::SDL_HAT_CENTERED - * - ::SDL_HAT_UP - * - ::SDL_HAT_RIGHT - * - ::SDL_HAT_DOWN - * - ::SDL_HAT_LEFT - * - ::SDL_HAT_RIGHTUP - * - ::SDL_HAT_RIGHTDOWN - * - ::SDL_HAT_LEFTUP - * - ::SDL_HAT_LEFTDOWN - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, - int hat); - -/** - * Get the ball axis change since the last poll. - * - * \return 0, or -1 if you passed it invalid parameters. - * - * The ball indices start at index 0. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, - int ball, int *dx, int *dy); - -/** - * Get the current state of a button on a joystick. - * - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, - int button); - -/** - * Close a joystick previously opened with SDL_JoystickOpen(). - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); - -/** - * Return the battery level of this joystick - */ -extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_joystick_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_keyboard.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_keyboard.h deleted file mode 100644 index bbba0f0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_keyboard.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_keyboard.h - * - * Include file for SDL keyboard event handling - */ - -#ifndef _SDL_keyboard_h -#define _SDL_keyboard_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keycode.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The SDL keysym structure, used in key events. - * - * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. - */ -typedef struct SDL_Keysym -{ - SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ - SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ - Uint16 mod; /**< current key modifiers */ - Uint32 unused; -} SDL_Keysym; - -/* Function prototypes */ - -/** - * \brief Get the window which currently has keyboard focus. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); - -/** - * \brief Get a snapshot of the current state of the keyboard. - * - * \param numkeys if non-NULL, receives the length of the returned array. - * - * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. - * - * \b Example: - * \code - * const Uint8 *state = SDL_GetKeyboardState(NULL); - * if ( state[SDL_SCANCODE_RETURN] ) { - * printf(" is pressed.\n"); - * } - * \endcode - */ -extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); - -/** - * \brief Get the current key modifier state for the keyboard. - */ -extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); - -/** - * \brief Set the current key modifier state for the keyboard. - * - * \note This does not change the keyboard state, only the key modifier flags. - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); - -/** - * \brief Get the key code corresponding to the given scancode according - * to the current keyboard layout. - * - * See ::SDL_Keycode for details. - * - * \sa SDL_GetKeyName() - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); - -/** - * \brief Get the scancode corresponding to the given key code according to the - * current keyboard layout. - * - * See ::SDL_Scancode for details. - * - * \sa SDL_GetScancodeName() - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); - -/** - * \brief Get a human-readable name for a scancode. - * - * \return A pointer to the name for the scancode. - * If the scancode doesn't have a name, this function returns - * an empty string (""). - * - * \sa SDL_Scancode - */ -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); - -/** - * \brief Get a scancode from a human-readable name - * - * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized - * - * \sa SDL_Scancode - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); - -/** - * \brief Get a human-readable name for a key. - * - * \return A pointer to a UTF-8 string that stays valid at least until the next - * call to this function. If you need it around any longer, you must - * copy it. If the key doesn't have a name, this function returns an - * empty string (""). - * - * \sa SDL_Key - */ -extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); - -/** - * \brief Get a key code from a human-readable name - * - * \return key code, or SDLK_UNKNOWN if the name wasn't recognized - * - * \sa SDL_Keycode - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); - -/** - * \brief Start accepting Unicode text input events. - * This function will show the on-screen keyboard if supported. - * - * \sa SDL_StopTextInput() - * \sa SDL_SetTextInputRect() - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC void SDLCALL SDL_StartTextInput(void); - -/** - * \brief Return whether or not Unicode text input events are enabled. - * - * \sa SDL_StartTextInput() - * \sa SDL_StopTextInput() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); - -/** - * \brief Stop receiving any text input events. - * This function will hide the on-screen keyboard if supported. - * - * \sa SDL_StartTextInput() - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC void SDLCALL SDL_StopTextInput(void); - -/** - * \brief Set the rectangle used to type Unicode text inputs. - * This is used as a hint for IME and on-screen keyboard placement. - * - * \sa SDL_StartTextInput() - */ -extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); - -/** - * \brief Returns whether the platform has some screen keyboard support. - * - * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. - * - * \note Not all screen keyboard functions are supported on all platforms. - * - * \sa SDL_IsScreenKeyboardShown() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); - -/** - * \brief Returns whether the screen keyboard is shown for given window. - * - * \param window The window for which screen keyboard should be queried. - * - * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. - * - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_keyboard_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_keycode.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_keycode.h deleted file mode 100644 index 7be9635..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_keycode.h +++ /dev/null @@ -1,341 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_keycode.h - * - * Defines constants which identify keyboard keys and modifiers. - */ - -#ifndef _SDL_keycode_h -#define _SDL_keycode_h - -#include "SDL_stdinc.h" -#include "SDL_scancode.h" - -/** - * \brief The SDL virtual key representation. - * - * Values of this type are used to represent keyboard keys using the current - * layout of the keyboard. These values include Unicode values representing - * the unmodified character that would be generated by pressing the key, or - * an SDLK_* constant for those keys that do not generate characters. - */ -typedef Sint32 SDL_Keycode; - -#define SDLK_SCANCODE_MASK (1<<30) -#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) - -enum -{ - SDLK_UNKNOWN = 0, - - SDLK_RETURN = '\r', - SDLK_ESCAPE = '\033', - SDLK_BACKSPACE = '\b', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - SDLK_EXCLAIM = '!', - SDLK_QUOTEDBL = '"', - SDLK_HASH = '#', - SDLK_PERCENT = '%', - SDLK_DOLLAR = '$', - SDLK_AMPERSAND = '&', - SDLK_QUOTE = '\'', - SDLK_LEFTPAREN = '(', - SDLK_RIGHTPAREN = ')', - SDLK_ASTERISK = '*', - SDLK_PLUS = '+', - SDLK_COMMA = ',', - SDLK_MINUS = '-', - SDLK_PERIOD = '.', - SDLK_SLASH = '/', - SDLK_0 = '0', - SDLK_1 = '1', - SDLK_2 = '2', - SDLK_3 = '3', - SDLK_4 = '4', - SDLK_5 = '5', - SDLK_6 = '6', - SDLK_7 = '7', - SDLK_8 = '8', - SDLK_9 = '9', - SDLK_COLON = ':', - SDLK_SEMICOLON = ';', - SDLK_LESS = '<', - SDLK_EQUALS = '=', - SDLK_GREATER = '>', - SDLK_QUESTION = '?', - SDLK_AT = '@', - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = '[', - SDLK_BACKSLASH = '\\', - SDLK_RIGHTBRACKET = ']', - SDLK_CARET = '^', - SDLK_UNDERSCORE = '_', - SDLK_BACKQUOTE = '`', - SDLK_a = 'a', - SDLK_b = 'b', - SDLK_c = 'c', - SDLK_d = 'd', - SDLK_e = 'e', - SDLK_f = 'f', - SDLK_g = 'g', - SDLK_h = 'h', - SDLK_i = 'i', - SDLK_j = 'j', - SDLK_k = 'k', - SDLK_l = 'l', - SDLK_m = 'm', - SDLK_n = 'n', - SDLK_o = 'o', - SDLK_p = 'p', - SDLK_q = 'q', - SDLK_r = 'r', - SDLK_s = 's', - SDLK_t = 't', - SDLK_u = 'u', - SDLK_v = 'v', - SDLK_w = 'w', - SDLK_x = 'x', - SDLK_y = 'y', - SDLK_z = 'z', - - SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), - - SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), - SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), - SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), - SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), - SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), - SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), - SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), - SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), - SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), - SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), - SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), - SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), - - SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), - SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), - SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), - SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), - SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), - SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), - SDLK_DELETE = '\177', - SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), - SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), - SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), - SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), - SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), - SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), - - SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), - SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), - SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), - SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), - SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), - SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), - SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), - SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), - SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), - SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), - SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), - SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), - SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), - SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), - SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), - SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), - SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), - - SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), - SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), - SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), - SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), - SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), - SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), - SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), - SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), - SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), - SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), - SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), - SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), - SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), - SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), - SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), - SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), - SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), - SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), - SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), - SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), - SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), - SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), - SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), - SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), - SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), - SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), - SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), - SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), - SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), - SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), - SDLK_KP_EQUALSAS400 = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), - - SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), - SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), - SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), - SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), - SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), - SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), - SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), - SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), - SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), - SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), - SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), - SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), - - SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), - SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), - SDLK_THOUSANDSSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), - SDLK_DECIMALSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), - SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), - SDLK_CURRENCYSUBUNIT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), - SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), - SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), - SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), - SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), - SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), - SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), - SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), - SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), - SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), - SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), - SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), - SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), - SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), - SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), - SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), - SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), - SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), - SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), - SDLK_KP_DBLAMPERSAND = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), - SDLK_KP_VERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), - SDLK_KP_DBLVERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), - SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), - SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), - SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), - SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), - SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), - SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), - SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), - SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), - SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), - SDLK_KP_MEMSUBTRACT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), - SDLK_KP_MEMMULTIPLY = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), - SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), - SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), - SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), - SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), - SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), - SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), - SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), - SDLK_KP_HEXADECIMAL = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), - - SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), - SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), - SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), - SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), - SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), - SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), - SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), - SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), - - SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), - - SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), - SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), - SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), - SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), - SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), - SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), - SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), - SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), - SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), - SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), - SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), - SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), - SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), - SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), - SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), - SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), - SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), - - SDLK_BRIGHTNESSDOWN = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), - SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), - SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), - SDLK_KBDILLUMTOGGLE = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), - SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), - SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), - SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), - SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) -}; - -/** - * \brief Enumeration of valid key mods (possibly OR'd together). - */ -typedef enum -{ - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDL_Keymod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) - -#endif /* _SDL_keycode_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_loadso.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_loadso.h deleted file mode 100644 index 3d540bd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_loadso.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_loadso.h - * - * System dependent library loading routines - * - * Some things to keep in mind: - * \li These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * \li Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * \li Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - -#ifndef _SDL_loadso_h -#define _SDL_loadso_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. - */ -extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); - -/** - * Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). - */ -extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, - const char *name); - -/** - * Unload a shared object from memory. - */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_loadso_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_log.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_log.h deleted file mode 100644 index 09be110..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_log.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_log.h - * - * Simple log messages with categories and priorities. - * - * By default logs are quiet, but if you're debugging SDL you might want: - * - * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); - * - * Here's where the messages go on different platforms: - * Windows: debug output stream - * Android: log output - * Others: standard error output (stderr) - */ - -#ifndef _SDL_log_h -#define _SDL_log_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief The maximum size of a log message - * - * Messages longer than the maximum size will be truncated - */ -#define SDL_MAX_LOG_MESSAGE 4096 - -/** - * \brief The predefined log categories - * - * By default the application category is enabled at the INFO level, - * the assert category is enabled at the WARN level, test is enabled - * at the VERBOSE level and all other categories are enabled at the - * CRITICAL level. - */ -enum -{ - SDL_LOG_CATEGORY_APPLICATION, - SDL_LOG_CATEGORY_ERROR, - SDL_LOG_CATEGORY_ASSERT, - SDL_LOG_CATEGORY_SYSTEM, - SDL_LOG_CATEGORY_AUDIO, - SDL_LOG_CATEGORY_VIDEO, - SDL_LOG_CATEGORY_RENDER, - SDL_LOG_CATEGORY_INPUT, - SDL_LOG_CATEGORY_TEST, - - /* Reserved for future SDL library use */ - SDL_LOG_CATEGORY_RESERVED1, - SDL_LOG_CATEGORY_RESERVED2, - SDL_LOG_CATEGORY_RESERVED3, - SDL_LOG_CATEGORY_RESERVED4, - SDL_LOG_CATEGORY_RESERVED5, - SDL_LOG_CATEGORY_RESERVED6, - SDL_LOG_CATEGORY_RESERVED7, - SDL_LOG_CATEGORY_RESERVED8, - SDL_LOG_CATEGORY_RESERVED9, - SDL_LOG_CATEGORY_RESERVED10, - - /* Beyond this point is reserved for application use, e.g. - enum { - MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, - MYAPP_CATEGORY_AWESOME2, - MYAPP_CATEGORY_AWESOME3, - ... - }; - */ - SDL_LOG_CATEGORY_CUSTOM -}; - -/** - * \brief The predefined log priorities - */ -typedef enum -{ - SDL_LOG_PRIORITY_VERBOSE = 1, - SDL_LOG_PRIORITY_DEBUG, - SDL_LOG_PRIORITY_INFO, - SDL_LOG_PRIORITY_WARN, - SDL_LOG_PRIORITY_ERROR, - SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES -} SDL_LogPriority; - - -/** - * \brief Set the priority of all log categories - */ -extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); - -/** - * \brief Set the priority of a particular log category - */ -extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, - SDL_LogPriority priority); - -/** - * \brief Get the priority of a particular log category - */ -extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); - -/** - * \brief Reset all priorities to default. - * - * \note This is called in SDL_Quit(). - */ -extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); - -/** - * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO - */ -extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE - */ -extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_DEBUG - */ -extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_INFO - */ -extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_WARN - */ -extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_ERROR - */ -extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL - */ -extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with the specified category and priority. - */ -extern DECLSPEC void SDLCALL SDL_LogMessage(int category, - SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); - -/** - * \brief Log a message with the specified category and priority. - */ -extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, - SDL_LogPriority priority, - const char *fmt, va_list ap); - -/** - * \brief The prototype for the log output function - */ -typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); - -/** - * \brief Get the current log output function. - */ -extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); - -/** - * \brief This function allows you to replace the default log output - * function with one of your own. - */ -extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_log_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_main.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_main.h deleted file mode 100644 index 9ce3754..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_main.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_main_h -#define _SDL_main_h - -#include "SDL_stdinc.h" - -/** - * \file SDL_main.h - * - * Redefine main() on some platforms so that it is called by SDL. - */ - -#ifndef SDL_MAIN_HANDLED -#if defined(__WIN32__) -/* On Windows SDL provides WinMain(), which parses the command line and passes - the arguments to your main function. - - If you provide your own WinMain(), you may define SDL_MAIN_HANDLED - */ -#define SDL_MAIN_AVAILABLE - -#elif defined(__WINRT__) -/* On WinRT, SDL provides a main function that initializes CoreApplication, - creating an instance of IFrameworkView in the process. - - Please note that #include'ing SDL_main.h is not enough to get a main() - function working. In non-XAML apps, the file, - src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled - into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be - called, with a pointer to the Direct3D-hosted XAML control passed in. -*/ -#define SDL_MAIN_NEEDED - -#elif defined(__IPHONEOS__) -/* On iOS SDL provides a main function that creates an application delegate - and starts the iOS application run loop. - - See src/video/uikit/SDL_uikitappdelegate.m for more details. - */ -#define SDL_MAIN_NEEDED - -#elif defined(__ANDROID__) -/* On Android SDL provides a Java class in SDLActivity.java that is the - main activity entry point. - - See README-android.txt for more details on extending that class. - */ -#define SDL_MAIN_NEEDED - -#elif defined(__NACL__) -/* On NACL we use ppapi_simple to set up the application helper code, - then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before - starting the user main function. - All user code is run in a separate thread by ppapi_simple, thus - allowing for blocking io to take place via nacl_io -*/ -#define SDL_MAIN_NEEDED - -#endif -#endif /* SDL_MAIN_HANDLED */ - -#ifdef __cplusplus -#define C_LINKAGE "C" -#else -#define C_LINKAGE -#endif /* __cplusplus */ - -/** - * \file SDL_main.h - * - * The application's main() function must be called with C linkage, - * and should be declared like this: - * \code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * \endcode - */ - -#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) -#define main SDL_main -#endif - -/** - * The prototype for the application's main() function - */ -extern C_LINKAGE int SDL_main(int argc, char *argv[]); - - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This is called by the real SDL main function to let the rest of the - * library know that initialization was done properly. - * - * Calling this yourself without knowing what you're doing can cause - * crashes and hard to diagnose problems with your application. - */ -extern DECLSPEC void SDLCALL SDL_SetMainReady(void); - -#ifdef __WIN32__ - -/** - * This can be called to set the application class at startup - */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, - void *hInst); -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); - -#endif /* __WIN32__ */ - - -#ifdef __WINRT__ - -/** - * \brief Initializes and launches an SDL/WinRT application. - * - * \param mainFunction The SDL app's C-style main(). - * \param reserved Reserved for future use; should be NULL - * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more - * information on the failure. - */ -extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved); - -#endif /* __WINRT__ */ - - -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_main_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_messagebox.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_messagebox.h deleted file mode 100644 index ec370db..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_messagebox.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_messagebox_h -#define _SDL_messagebox_h - -#include "SDL_stdinc.h" -#include "SDL_video.h" /* For SDL_Window */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SDL_MessageBox flags. If supported will display warning icon, etc. - */ -typedef enum -{ - SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ - SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ - SDL_MESSAGEBOX_INFORMATION = 0x00000040 /**< informational dialog */ -} SDL_MessageBoxFlags; - -/** - * \brief Flags for SDL_MessageBoxButtonData. - */ -typedef enum -{ - SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ - SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ -} SDL_MessageBoxButtonFlags; - -/** - * \brief Individual button data. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ - int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ - const char * text; /**< The UTF-8 button text */ -} SDL_MessageBoxButtonData; - -/** - * \brief RGB value used in a message box color scheme - */ -typedef struct -{ - Uint8 r, g, b; -} SDL_MessageBoxColor; - -typedef enum -{ - SDL_MESSAGEBOX_COLOR_BACKGROUND, - SDL_MESSAGEBOX_COLOR_TEXT, - SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, - SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, - SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, - SDL_MESSAGEBOX_COLOR_MAX -} SDL_MessageBoxColorType; - -/** - * \brief A set of colors to use for message box dialogs - */ -typedef struct -{ - SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; -} SDL_MessageBoxColorScheme; - -/** - * \brief MessageBox structure containing title, text, window, etc. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxFlags */ - SDL_Window *window; /**< Parent window, can be NULL */ - const char *title; /**< UTF-8 title */ - const char *message; /**< UTF-8 message text */ - - int numbuttons; - const SDL_MessageBoxButtonData *buttons; - - const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ -} SDL_MessageBoxData; - -/** - * \brief Create a modal message box. - * - * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. - * \param buttonid The pointer to which user id of hit button should be copied. - * - * \return -1 on error, otherwise 0 and buttonid contains user id of button - * hit or -1 if dialog was closed. - * - * \note This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or - * closes the messagebox. - */ -extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); - -/** - * \brief Create a simple modal message box - * - * \param flags ::SDL_MessageBoxFlags - * \param title UTF-8 title text - * \param message UTF-8 message text - * \param window The parent window, or NULL for no parent - * - * \return 0 on success, -1 on error - * - * \sa SDL_ShowMessageBox - */ -extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_messagebox_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_mouse.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_mouse.h deleted file mode 100644 index ea9622f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_mouse.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_mouse.h - * - * Include file for SDL mouse event handling. - */ - -#ifndef _SDL_mouse_h -#define _SDL_mouse_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ - -/** - * \brief Cursor types for SDL_CreateSystemCursor. - */ -typedef enum -{ - SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ - SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ - SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ - SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ - SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ - SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ - SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ - SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ - SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ - SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ - SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ - SDL_SYSTEM_CURSOR_HAND, /**< Hand */ - SDL_NUM_SYSTEM_CURSORS -} SDL_SystemCursor; - -/** - * \brief Scroll direction types for the Scroll event - */ -typedef enum -{ - SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ - SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ -} SDL_MouseWheelDirection; - -/* Function prototypes */ - -/** - * \brief Get the window which currently has mouse focus. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); - -/** - * \brief Retrieve the current state of the mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse cursor position relative to the focus window for the currently - * selected mouse. You can pass NULL for either x or y. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); - -/** - * \brief Get the current state of the mouse, in relation to the desktop - * - * This works just like SDL_GetMouseState(), but the coordinates will be - * reported relative to the top-left of the desktop. This can be useful if - * you need to track the mouse outside of a specific window and - * SDL_CaptureMouse() doesn't fit your needs. For example, it could be - * useful if you need to track the mouse while dragging a window, where - * coordinates relative to a window might not be in sync at all times. - * - * \note SDL_GetMouseState() returns the mouse position as SDL understands - * it from the last pump of the event queue. This function, however, - * queries the OS for the current mouse position, and as such, might - * be a slightly less efficient function. Unless you know what you're - * doing and have a good reason to use this function, you probably want - * SDL_GetMouseState() instead. - * - * \param x Returns the current X coord, relative to the desktop. Can be NULL. - * \param y Returns the current Y coord, relative to the desktop. Can be NULL. - * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros. - * - * \sa SDL_GetMouseState - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); - -/** - * \brief Retrieve the relative state of the mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); - -/** - * \brief Moves the mouse to the given position within the window. - * - * \param window The window to move the mouse into, or NULL for the current mouse focus - * \param x The x coordinate within the window - * \param y The y coordinate within the window - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, - int x, int y); - -/** - * \brief Moves the mouse to the given position in global screen space. - * - * \param x The x coordinate - * \param y The y coordinate - * \return 0 on success, -1 on error (usually: unsupported by a platform). - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); - -/** - * \brief Set relative mouse mode. - * - * \param enabled Whether or not to enable relative mode - * - * \return 0 on success, or -1 if relative mode is not supported. - * - * While the mouse is in relative mode, the cursor is hidden, and the - * driver will try to report continuous motion in the current window. - * Only relative motion events will be delivered, the mouse position - * will not change. - * - * \note This function will flush any pending mouse motion. - * - * \sa SDL_GetRelativeMouseMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); - -/** - * \brief Capture the mouse, to track input outside an SDL window. - * - * \param enabled Whether or not to enable capturing - * - * Capturing enables your app to obtain mouse events globally, instead of - * just within your window. Not all video targets support this function. - * When capturing is enabled, the current window will get all mouse events, - * but unlike relative mode, no change is made to the cursor and it is - * not restrained to your window. - * - * This function may also deny mouse input to other windows--both those in - * your application and others on the system--so you should use this - * function sparingly, and in small bursts. For example, you might want to - * track the mouse while the user is dragging something, until the user - * releases a mouse button. It is not recommended that you capture the mouse - * for long periods of time, such as the entire time your app is running. - * - * While captured, mouse events still report coordinates relative to the - * current (foreground) window, but those coordinates may be outside the - * bounds of the window (including negative values). Capturing is only - * allowed for the foreground window. If the window loses focus while - * capturing, the capture will be disabled automatically. - * - * While capturing is enabled, the current window will have the - * SDL_WINDOW_MOUSE_CAPTURE flag set. - * - * \return 0 on success, or -1 if not supported. - */ -extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); - -/** - * \brief Query whether relative mouse mode is enabled. - * - * \sa SDL_SetRelativeMouseMode() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); - -/** - * \brief Create a cursor, using the specified bitmap data and - * mask (in MSB format). - * - * The cursor width must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * - * - * - * - * - * - *
data mask resulting pixel on screen
0 1 White
1 1 Black
0 0 Transparent
1 0 Inverted color if possible, black - * if not.
- * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, - const Uint8 * mask, - int w, int h, int hot_x, - int hot_y); - -/** - * \brief Create a color cursor. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, - int hot_x, - int hot_y); - -/** - * \brief Create a system cursor. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); - -/** - * \brief Set the active cursor. - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); - -/** - * \brief Return the active cursor. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); - -/** - * \brief Return the default cursor. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); - -/** - * \brief Frees a cursor created with SDL_CreateCursor(). - * - * \sa SDL_CreateCursor() - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); - -/** - * \brief Toggle whether or not the cursor is shown. - * - * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current - * state. - * - * \return 1 if the cursor is shown, or 0 if the cursor is hidden. - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/** - * Used as a mask when testing buttons in buttonstate. - * - Button 1: Left mouse button - * - Button 2: Middle mouse button - * - Button 3: Right mouse button - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_X1 4 -#define SDL_BUTTON_X2 5 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_mouse_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_mutex.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_mutex.h deleted file mode 100644 index b7e3973..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_mutex.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_mutex_h -#define _SDL_mutex_h - -/** - * \file SDL_mutex.h - * - * Functions to provide thread synchronization primitives. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Synchronization functions which can time out return this value - * if they time out. - */ -#define SDL_MUTEX_TIMEDOUT 1 - -/** - * This is the timeout value which corresponds to never time out. - */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/** - * \name Mutex functions - */ -/* @{ */ - -/* The SDL mutex structure, defined in SDL_sysmutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/** - * Create a mutex, initialized unlocked. - */ -extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); - -/** - * Lock the mutex. - * - * \return 0, or -1 on error. - */ -#define SDL_mutexP(m) SDL_LockMutex(m) -extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); - -/** - * Try to lock the mutex - * - * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); - -/** - * Unlock the mutex. - * - * \return 0, or -1 on error. - * - * \warning It is an error to unlock a mutex that has not been locked by - * the current thread, and doing so results in undefined behavior. - */ -#define SDL_mutexV(m) SDL_UnlockMutex(m) -extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); - -/** - * Destroy a mutex. - */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); - -/* @} *//* Mutex functions */ - - -/** - * \name Semaphore functions - */ -/* @{ */ - -/* The SDL semaphore structure, defined in SDL_syssem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/** - * Create a semaphore, initialized with value, returns NULL on failure. - */ -extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/** - * Destroy a semaphore. - */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); - -/** - * This function suspends the calling thread until the semaphore pointed - * to by \c sem has a positive count. It then atomically decreases the - * semaphore count. - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); - -/** - * Non-blocking variant of SDL_SemWait(). - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would - * block, and -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); - -/** - * Variant of SDL_SemWait() with a timeout in milliseconds. - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not - * succeed in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a - * delay of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); - -/** - * Atomically increases the semaphore's count (not blocking). - * - * \return 0, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); - -/** - * Returns the current count of the semaphore. - */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); - -/* @} *//* Semaphore functions */ - - -/** - * \name Condition variable functions - */ -/* @{ */ - -/* The SDL condition variable structure, defined in SDL_syscond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; - -/** - * Create a condition variable. - * - * Typical use of condition variables: - * - * Thread A: - * SDL_LockMutex(lock); - * while ( ! condition ) { - * SDL_CondWait(cond, lock); - * } - * SDL_UnlockMutex(lock); - * - * Thread B: - * SDL_LockMutex(lock); - * ... - * condition = true; - * ... - * SDL_CondSignal(cond); - * SDL_UnlockMutex(lock); - * - * There is some discussion whether to signal the condition variable - * with the mutex locked or not. There is some potential performance - * benefit to unlocking first on some platforms, but there are some - * potential race conditions depending on how your code is structured. - * - * In general it's safer to signal the condition variable while the - * mutex is locked. - */ -extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); - -/** - * Destroy a condition variable. - */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); - -/** - * Restart one of the threads that are waiting on the condition variable. - * - * \return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); - -/** - * Restart all threads that are waiting on the condition variable. - * - * \return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); - -/** - * Wait on the condition variable, unlocking the provided mutex. - * - * \warning The mutex must be locked before entering this function! - * - * The mutex is re-locked once the condition variable is signaled. - * - * \return 0 when it is signaled, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); - -/** - * Waits for at most \c ms milliseconds, and returns 0 if the condition - * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not - * signaled in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a - * delay of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, - SDL_mutex * mutex, Uint32 ms); - -/* @} *//* Condition variable functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_mutex_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_name.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_name.h deleted file mode 100644 index 06cd4a5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_name.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDLname_h_ -#define _SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* _SDLname_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengl.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengl.h deleted file mode 100644 index 780919b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengl.h +++ /dev/null @@ -1,2176 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_opengl.h - * - * This is a simple file to encapsulate the OpenGL API headers. - */ - -/** - * \def NO_SDL_GLEXT - * - * Define this if you have your own version of glext.h and want to disable the - * version included in SDL_opengl.h. - */ - -#ifndef _SDL_opengl_h -#define _SDL_opengl_h - -#include "SDL_config.h" - -#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ - -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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 __gl_h_ -#define __gl_h_ - -#if defined(USE_MGL_NAMESPACE) -#include "gl_mangle.h" -#endif - - -/********************************************************************** - * Begin system-specific stuff. - */ - -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) -#define __WIN32__ -#endif - -#if defined(__WIN32__) && !defined(__CYGWIN__) -# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# endif /* _STATIC_MESA support */ -# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ -# define GLAPIENTRY -# else -# define GLAPIENTRY __stdcall -# endif -#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ -# define GLAPI extern -# define GLAPIENTRY __stdcall -#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define GLAPI __attribute__((visibility("default"))) -# define GLAPIENTRY -#endif /* WIN32 && !CYGWIN */ - -/* - * WINDOWS: Include windows.h here to define APIENTRY. - * It is also useful when applications include this file by - * including only glut.h, since glut.h depends on windows.h. - * Applications needing to include windows.h with parms other - * than "WIN32_LEAN_AND_MEAN" may include windows.h before - * glut.h or gl.h. - */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include -#endif - -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef APIENTRY -#define APIENTRY GLAPIENTRY -#endif - -/* "P" suffix to be used for a pointer to a function */ -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifndef GLAPIENTRYP -#define GLAPIENTRYP GLAPIENTRY * -#endif - -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export on -#endif - -/* - * End system-specific stuff. - **********************************************************************/ - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -#define GL_VERSION_1_1 1 -#define GL_VERSION_1_2 1 -#define GL_VERSION_1_3 1 -#define GL_ARB_imaging 1 - - -/* - * Datatypes - */ -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; /* 1-byte signed */ -typedef short GLshort; /* 2-byte signed */ -typedef int GLint; /* 4-byte signed */ -typedef unsigned char GLubyte; /* 1-byte unsigned */ -typedef unsigned short GLushort; /* 2-byte unsigned */ -typedef unsigned int GLuint; /* 4-byte unsigned */ -typedef int GLsizei; /* 4-byte signed */ -typedef float GLfloat; /* single precision float */ -typedef float GLclampf; /* single precision float in [0,1] */ -typedef double GLdouble; /* double precision float */ -typedef double GLclampd; /* double precision float in [0,1] */ - - - -/* - * Constants - */ - -/* Boolean values */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* Data types */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A - -/* Primitives */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON 0x0009 - -/* Vertex Arrays */ -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D - -/* Matrix Mode */ -#define GL_MATRIX_MODE 0x0BA0 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 - -/* Points */ -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_POINT_SIZE_RANGE 0x0B12 - -/* Lines */ -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_WIDTH_RANGE 0x0B22 - -/* Polygons */ -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 - -/* Display Lists */ -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_LIST_MODE 0x0B30 - -/* Depth buffer */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_BITS 0x0D56 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_COMPONENT 0x1902 - -/* Lighting */ -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_SHININESS 0x1601 -#define GL_EMISSION 0x1600 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_SHADE_MODEL 0x0B54 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_NORMALIZE 0x0BA1 - -/* User clipping planes */ -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 - -/* Accumulation buffer */ -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_ACCUM 0x0100 -#define GL_ADD 0x0104 -#define GL_LOAD 0x0101 -#define GL_MULT 0x0103 -#define GL_RETURN 0x0102 - -/* Alpha testing */ -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_ALPHA_TEST_FUNC 0x0BC1 - -/* Blending */ -#define GL_BLEND 0x0BE2 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND_DST 0x0BE0 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 - -/* Render Mode */ -#define GL_FEEDBACK 0x1C01 -#define GL_RENDER 0x1C00 -#define GL_SELECT 0x1C02 - -/* Feedback */ -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 - -/* Selection */ -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 - -/* Fog */ -#define GL_FOG 0x0B60 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_COLOR 0x0B66 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_LINEAR 0x2601 -#define GL_EXP 0x0800 -#define GL_EXP2 0x0801 - -/* Logic Ops */ -#define GL_LOGIC_OP 0x0BF1 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_CLEAR 0x1500 -#define GL_SET 0x150F -#define GL_COPY 0x1503 -#define GL_COPY_INVERTED 0x150C -#define GL_NOOP 0x1505 -#define GL_INVERT 0x150A -#define GL_AND 0x1501 -#define GL_NAND 0x150E -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_XOR 0x1506 -#define GL_EQUIV 0x1509 -#define GL_AND_REVERSE 0x1502 -#define GL_AND_INVERTED 0x1504 -#define GL_OR_REVERSE 0x150B -#define GL_OR_INVERTED 0x150D - -/* Stencil */ -#define GL_STENCIL_BITS 0x0D57 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_INDEX 0x1901 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 - -/* Buffers, Pixel Drawing/Reading */ -#define GL_NONE 0 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -/*GL_FRONT 0x0404 */ -/*GL_BACK 0x0405 */ -/*GL_FRONT_AND_BACK 0x0408 */ -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_COLOR_INDEX 0x1900 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_ALPHA_BITS 0x0D55 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_INDEX_BITS 0x0D51 -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_READ_BUFFER 0x0C02 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_BITMAP 0x1A00 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_DITHER 0x0BD0 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 - -/* Implementation limits */ -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B - -/* Gets */ -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_MODE 0x0C30 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_RENDER_MODE 0x0C40 -#define GL_RGBA_MODE 0x0C31 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_VIEWPORT 0x0BA2 - -/* Evaluators */ -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 - -/* Hints */ -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* Scissor box */ -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 - -/* Pixel Mode / Transfer */ -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 - -/* Texture mapping */ -#define GL_TEXTURE_ENV 0x2300 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_LINEAR 0x2400 -#define GL_EYE_PLANE 0x2502 -#define GL_SPHERE_MAP 0x2402 -#define GL_DECAL 0x2101 -#define GL_MODULATE 0x2100 -#define GL_NEAREST 0x2600 -#define GL_REPEAT 0x2901 -#define GL_CLAMP 0x2900 -#define GL_S 0x2000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 - -/* Utility */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* Errors */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 - -/* glPush/PopAttrib bits */ -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000FFFFF - - -/* OpenGL 1.1 */ -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - - - -/* - * Miscellaneous - */ - -GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); - -GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glClear( GLbitfield mask ); - -GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); - -GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); - -GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); - -GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); - -GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); - -GLAPI void GLAPIENTRY glCullFace( GLenum mode ); - -GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); - -GLAPI void GLAPIENTRY glPointSize( GLfloat size ); - -GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); - -GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); - -GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); - -GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); - -GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); - -GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); - -GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); - -GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); - -GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); - -GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); - -GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); - -GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glEnable( GLenum cap ); - -GLAPI void GLAPIENTRY glDisable( GLenum cap ); - -GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); - - -GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ - -GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ - - -GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); - -GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); - -GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); - -GLAPI void GLAPIENTRY glPopAttrib( void ); - - -GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ - -GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ - - -GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); - -GLAPI GLenum GLAPIENTRY glGetError( void ); - -GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); - -GLAPI void GLAPIENTRY glFinish( void ); - -GLAPI void GLAPIENTRY glFlush( void ); - -GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); - - -/* - * Depth Buffer - */ - -GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); - -GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); - -GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); - -GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); - - -/* - * Accumulation Buffer - */ - -GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); - -GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); - - -/* - * Transformation - */ - -GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); - -GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, - GLsizei width, GLsizei height ); - -GLAPI void GLAPIENTRY glPushMatrix( void ); - -GLAPI void GLAPIENTRY glPopMatrix( void ); - -GLAPI void GLAPIENTRY glLoadIdentity( void ); - -GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glRotated( GLdouble angle, - GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRotatef( GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); - - -/* - * Display Lists - */ - -GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); - -GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); - -GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); - -GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); - -GLAPI void GLAPIENTRY glEndList( void ); - -GLAPI void GLAPIENTRY glCallList( GLuint list ); - -GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, - const GLvoid *lists ); - -GLAPI void GLAPIENTRY glListBase( GLuint base ); - - -/* - * Drawing Functions - */ - -GLAPI void GLAPIENTRY glBegin( GLenum mode ); - -GLAPI void GLAPIENTRY glEnd( void ); - - -GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); -GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); -GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); -GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); -GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); - -GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); -GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glIndexd( GLdouble c ); -GLAPI void GLAPIENTRY glIndexf( GLfloat c ); -GLAPI void GLAPIENTRY glIndexi( GLint c ); -GLAPI void GLAPIENTRY glIndexs( GLshort c ); -GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); -GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); -GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); -GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); -GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); -GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); -GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); -GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); -GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); -GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); -GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); -GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); - -GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, - GLbyte blue, GLbyte alpha ); -GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, - GLdouble blue, GLdouble alpha ); -GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); -GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, - GLint blue, GLint alpha ); -GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, - GLshort blue, GLshort alpha ); -GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha ); -GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, - GLuint blue, GLuint alpha ); -GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, - GLushort blue, GLushort alpha ); - - -GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); - -GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); - - -GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); -GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); -GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); -GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); - -GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); -GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); -GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); -GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); -GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); -GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); -GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); -GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); -GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); -GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); -GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); -GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); -GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); - - -GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); -GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); -GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); -GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); - - -/* - * Vertex Arrays (1.1) - */ - -GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); - -GLAPI void GLAPIENTRY glArrayElement( GLint i ); - -GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); - -GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, - const GLvoid *pointer ); - -/* - * Lighting - */ - -GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); - -GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, - GLfloat *params ); -GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); - - -/* - * Raster functions - */ - -GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); - -GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, - const GLfloat *values ); -GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, - const GLuint *values ); -GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, - const GLushort *values ); - -GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); -GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); -GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); - -GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, - GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); - -GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLvoid *pixels ); - -GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type ); - -/* - * Stenciling - */ - -GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); - -GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); - -GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); - -GLAPI void GLAPIENTRY glClearStencil( GLint s ); - - - -/* - * Texture mapping - */ - -GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); -GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); -GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); -GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, - GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, - GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, - GLvoid *pixels ); - - -/* 1.1 functions */ - -GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, - const GLuint *textures, - const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, - const GLuint *textures, - GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); - - -GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, - GLint xoffset, - GLsizei width, GLenum format, - GLenum type, const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - -/* - * Evaluators - */ - -GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, - GLint stride, - GLint order, const GLdouble *points ); -GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, - GLint stride, - GLint order, const GLfloat *points ); - -GLAPI void GLAPIENTRY glMap2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); -GLAPI void GLAPIENTRY glMap2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); -GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); -GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); - -GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); -GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); - -GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); -GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); - -GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); -GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); - -GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); -GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); - -GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); - -GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); - -GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); - -GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - - -/* - * Fog - */ - -GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); - -GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); - -GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); - - -/* - * Selection and Feedback - */ - -GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); - -GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); - -GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); - -GLAPI void GLAPIENTRY glInitNames( void ); - -GLAPI void GLAPIENTRY glLoadName( GLuint name ); - -GLAPI void GLAPIENTRY glPushName( GLuint name ); - -GLAPI void GLAPIENTRY glPopName( void ); - - - -/* - * OpenGL 1.2 - */ - -#define GL_RESCALE_NORMAL 0x803A -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_TEXTURE_BINDING_3D 0x806A - -GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels); - -GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ); - -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - - -/* - * GL_ARB_imaging - */ - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_BLEND_EQUATION 0x8009 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ); - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ); - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ); - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ); - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ); - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height); - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ); - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ); - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); - - - - -/* - * OpenGL 1.3 - */ - -/* multitexture */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -/* texture_cube_map */ -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -/* texture_compression */ -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -/* multisample */ -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -/* transpose_matrix */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -/* texture_env_combine */ -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -/* texture_env_dot3 */ -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -/* texture_border_clamp */ -#define GL_CLAMP_TO_BORDER 0x812D - -GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); - -GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); - - -GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); - - -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); - - - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#endif /* GL_ARB_multitexture */ - - - -/* - * Define this token if you want "old-style" header file behaviour (extensions - * defined in gl.h). Otherwise, extensions will be included from glext.h. - */ -#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) -#include "SDL_opengl_glext.h" -#endif /* GL_GLEXT_LEGACY */ - - - -/* - * ???. GL_MESA_packed_depth_stencil - * XXX obsolete - */ -#ifndef GL_MESA_packed_depth_stencil -#define GL_MESA_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_MESA 0x8750 -#define GL_UNSIGNED_INT_24_8_MESA 0x8751 -#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 -#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 -#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 - -#endif /* GL_MESA_packed_depth_stencil */ - - -#ifndef GL_ATI_blend_equation_separate -#define GL_ATI_blend_equation_separate 1 - -#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D - -GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); - -#endif /* GL_ATI_blend_equation_separate */ - - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -typedef void* GLeglImageOES; -#endif - -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - - -/** - ** NOTE!!!!! If you add new functions to this file, or update - ** glext.h be sure to regenerate the gl_mangle.h file. See comments - ** in that file for details. - **/ - - - -/********************************************************************** - * Begin system-specific stuff - */ -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export off -#endif - -/* - * End system-specific stuff - **********************************************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif /* __gl_h_ */ - -#endif /* !__IPHONEOS__ */ - -#endif /* _SDL_opengl_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengl_glext.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengl_glext.h deleted file mode 100644 index cd3869f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengl_glext.h +++ /dev/null @@ -1,11177 +0,0 @@ -#ifndef __glext_h_ -#define __glext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2014 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 26745 $ on $Date: 2014-05-21 03:12:26 -0700 (Wed, 21 May 2014) $ -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -#define GL_GLEXT_VERSION 20140521 - -/* Generated C header for: - * API: gl - * Profile: compatibility - * Versions considered: .* - * Versions emitted: 1\.[2-9]|[234]\.[0-9] - * Default extensions included: gl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_RESCALE_NORMAL 0x803A -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_VERSION_1_2 */ - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum texture); -GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); -GLAPI void APIENTRY glClientActiveTexture (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); -#endif -#endif /* GL_VERSION_1_3 */ - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); -GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); -GLAPI void APIENTRY glFogCoordf (GLfloat coord); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); -GLAPI void APIENTRY glFogCoordd (GLdouble coord); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2iv (const GLint *v); -GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); -GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3iv (const GLint *v); -GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); -GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void APIENTRY glBlendEquation (GLenum mode); -#endif -#endif /* GL_VERSION_1_4 */ - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#include -#ifdef __MACOSX__ -typedef long GLsizeiptr; -typedef long GLintptr; -#else -typedef ptrdiff_t GLsizeiptr; -typedef ptrdiff_t GLintptr; -#endif -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SRC1_ALPHA 0x8589 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_FOG_COORD_SRC 0x8450 -#define GL_FOG_COORD 0x8451 -#define GL_CURRENT_FOG_COORD 0x8453 -#define GL_FOG_COORD_ARRAY_TYPE 0x8454 -#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORD_ARRAY_POINTER 0x8456 -#define GL_FOG_COORD_ARRAY 0x8457 -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D -#define GL_SRC0_RGB 0x8580 -#define GL_SRC1_RGB 0x8581 -#define GL_SRC2_RGB 0x8582 -#define GL_SRC0_ALPHA 0x8588 -#define GL_SRC2_ALPHA 0x858A -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); -typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQuery (GLuint id); -GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQuery (GLenum target); -GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); -GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); -GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_VERSION_1_5 */ - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -typedef char GLchar; -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_TEXTURE_COORDS 0x8871 -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); -GLAPI void APIENTRY glCompileShader (GLuint shader); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum type); -GLAPI void APIENTRY glDeleteProgram (GLuint program); -GLAPI void APIENTRY glDeleteShader (GLuint shader); -GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); -GLAPI GLboolean APIENTRY glIsProgram (GLuint program); -GLAPI GLboolean APIENTRY glIsShader (GLuint shader); -GLAPI void APIENTRY glLinkProgram (GLuint program); -GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -GLAPI void APIENTRY glUseProgram (GLuint program); -GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glValidateProgram (GLuint program); -GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -#endif -#endif /* GL_VERSION_2_0 */ - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_VERSION_2_1 */ - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -typedef unsigned short GLhalf; -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_INDEX 0x8222 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_HALF_FLOAT 0x140B -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_ALPHA_INTEGER 0x8D97 -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); -GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); -GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); -GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); -GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); -GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); -GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index); -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmap (GLenum target); -GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glBindVertexArray (GLuint array); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); -#endif -#endif /* GL_VERSION_3_0 */ - -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFFu -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); -GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); -GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#endif -#endif /* GL_VERSION_3_1 */ - -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -typedef struct __GLsync *GLsync; -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif -#endif -typedef uint64_t GLuint64; -typedef int64_t GLint64; -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_DEPTH_CLAMP 0x864F -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); -typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); -typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -GLAPI void APIENTRY glProvokingVertex (GLenum mode); -GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); -GLAPI GLboolean APIENTRY glIsSync (GLsync sync); -GLAPI void APIENTRY glDeleteSync (GLsync sync); -GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); -GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); -GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); -#endif -#endif /* GL_VERSION_3_2 */ - -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_SAMPLER_BINDING 0x8919 -#define GL_RGB10_A2UI 0x906F -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 -#define GL_INT_2_10_10_10_REV 0x8D9F -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); -typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); -typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); -typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); -GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); -GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); -GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); -GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); -GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); -GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); -GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); -GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); -GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); -GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); -GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); -#endif -#endif /* GL_VERSION_3_3 */ - -#ifndef GL_VERSION_4_0 -#define GL_VERSION_4_0 1 -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_MAX_VERTEX_STREAMS 0x8E71 -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B -#define GL_PATCHES 0x000E -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); -typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); -typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); -typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); -typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); -typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShading (GLfloat value); -GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); -GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); -GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); -GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); -GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); -GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); -GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); -GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); -GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedback (void); -GLAPI void APIENTRY glResumeTransformFeedback (void); -GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); -GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); -GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); -GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); -GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); -#endif -#endif /* GL_VERSION_4_0 */ - -#ifndef GL_VERSION_4_1 -#define GL_VERSION_4_1 1 -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_RGB565 0x8D62 -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_ALL_SHADER_BITS 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings); -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); -typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); -GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GLAPI void APIENTRY glClearDepthf (GLfloat d); -GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings); -GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); -GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); -GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); -GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); -GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); -GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); -GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); -GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); -#endif -#endif /* GL_VERSION_4_1 */ - -#ifndef GL_VERSION_4_2 -#define GL_VERSION_4_2 1 -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#define GL_NUM_SAMPLE_COUNTS 0x9380 -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); -typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); -GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); -GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -#endif -#endif /* GL_VERSION_4_2 */ - -#ifndef GL_VERSION_4_3 -#define GL_VERSION_4_3 1 -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 -#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_MAX_UNIFORM_LOCATIONS 0x826E -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F -#define GL_IS_PER_PATCH 0x92E7 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF -#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_VERTEX_BINDING_BUFFER 0x8F4F -#define GL_DISPLAY_LIST 0x82E7 -typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); -typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); -typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); -typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); -GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); -GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); -GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); -GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); -GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); -GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); -GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GLAPI void APIENTRY glPopDebugGroup (void); -GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_VERSION_4_3 */ - -#ifndef GL_VERSION_4_4 -#define GL_VERSION_4_4 1 -#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_TEXTURE_BUFFER_BINDING 0x8C2A -#define GL_MAP_PERSISTENT_BIT 0x0040 -#define GL_MAP_COHERENT_BIT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT 0x0100 -#define GL_CLIENT_STORAGE_BIT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F -#define GL_BUFFER_STORAGE_FLAGS 0x8220 -#define GL_CLEAR_TEXTURE 0x9365 -#define GL_LOCATION_COMPONENT 0x934A -#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B -#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C -#define GL_QUERY_BUFFER 0x9192 -#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 -#define GL_QUERY_BUFFER_BINDING 0x9193 -#define GL_QUERY_RESULT_NO_WAIT 0x9194 -#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 -typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); -typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); -typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); -typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); -GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures); -GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers); -GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures); -GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -#endif -#endif /* GL_VERSION_4_4 */ - -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -#endif /* GL_ARB_ES2_compatibility */ - -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 -#endif /* GL_ARB_ES3_compatibility */ - -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 -#endif /* GL_ARB_arrays_of_arrays */ - -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 -#endif /* GL_ARB_base_instance */ - -#ifndef GL_ARB_bindless_texture -#define GL_ARB_bindless_texture 1 -typedef uint64_t GLuint64EXT; -#define GL_UNSIGNED_INT64_ARB 0x140F -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle); -GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params); -#endif -#endif /* GL_ARB_bindless_texture */ - -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 -#endif /* GL_ARB_blend_func_extended */ - -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 -#endif /* GL_ARB_buffer_storage */ - -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 -struct _cl_context; -struct _cl_event; -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 -typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); -#endif -#endif /* GL_ARB_cl_event */ - -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 -#endif /* GL_ARB_clear_buffer_object */ - -#ifndef GL_ARB_clear_texture -#define GL_ARB_clear_texture 1 -#endif /* GL_ARB_clear_texture */ - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); -#endif -#endif /* GL_ARB_color_buffer_float */ - -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -#endif /* GL_ARB_compatibility */ - -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -#endif /* GL_ARB_compressed_texture_pixel_storage */ - -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#endif /* GL_ARB_compute_shader */ - -#ifndef GL_ARB_compute_variable_group_size -#define GL_ARB_compute_variable_group_size 1 -#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB -#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 -#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -#endif -#endif /* GL_ARB_compute_variable_group_size */ - -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 -#endif /* GL_ARB_conservative_depth */ - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -#define GL_COPY_READ_BUFFER_BINDING 0x8F36 -#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 -#endif /* GL_ARB_copy_buffer */ - -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 -#endif /* GL_ARB_copy_image */ - -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#endif -#endif /* GL_ARB_debug_output */ - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#endif /* GL_ARB_depth_buffer_float */ - -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -#endif /* GL_ARB_depth_clamp */ - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif /* GL_ARB_depth_texture */ - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_ARB_draw_buffers */ - -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif -#endif /* GL_ARB_draw_buffers_blend */ - -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 -#endif /* GL_ARB_draw_elements_base_vertex */ - -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 -#endif /* GL_ARB_draw_indirect */ - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_ARB_draw_instanced */ - -#ifndef GL_ARB_enhanced_layouts -#define GL_ARB_enhanced_layouts 1 -#endif /* GL_ARB_enhanced_layouts */ - -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -#endif /* GL_ARB_explicit_attrib_location */ - -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 -#endif /* GL_ARB_explicit_uniform_location */ - -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 -#endif /* GL_ARB_fragment_coord_conventions */ - -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 -#endif /* GL_ARB_fragment_layer_viewport */ - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); -GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); -#endif -#endif /* GL_ARB_fragment_program */ - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif /* GL_ARB_fragment_program_shadow */ - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif /* GL_ARB_fragment_shader */ - -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 -#endif /* GL_ARB_framebuffer_no_attachments */ - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#endif /* GL_ARB_framebuffer_object */ - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#endif /* GL_ARB_framebuffer_sRGB */ - -#ifndef GL_KHR_context_flush_control -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC -#endif /* GL_KHR_context_flush_control */ - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif -#endif /* GL_ARB_geometry_shader4 */ - -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 -#endif /* GL_ARB_get_program_binary */ - -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 -#endif /* GL_ARB_gpu_shader5 */ - -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 -#endif /* GL_ARB_gpu_shader_fp64 */ - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -typedef unsigned short GLhalfARB; -#define GL_HALF_FLOAT_ARB 0x140B -#endif /* GL_ARB_half_float_pixel */ - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#endif /* GL_ARB_half_float_vertex */ - -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_EQUATION 0x8009 -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogram (GLenum target); -GLAPI void APIENTRY glResetMinmax (GLenum target); -#endif -#endif /* GL_ARB_imaging */ - -#ifndef GL_ARB_indirect_parameters -#define GL_ARB_indirect_parameters 1 -#define GL_PARAMETER_BUFFER_ARB 0x80EE -#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#endif -#endif /* GL_ARB_indirect_parameters */ - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); -#endif -#endif /* GL_ARB_instanced_arrays */ - -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 -#endif /* GL_ARB_internalformat_query */ - -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 -#define GL_SRGB_DECODE_ARB 0x8299 -#endif /* GL_ARB_internalformat_query2 */ - -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 -#endif /* GL_ARB_invalidate_subdata */ - -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 -#endif /* GL_ARB_map_buffer_alignment */ - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#endif /* GL_ARB_map_buffer_range */ - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_ARB_matrix_palette */ - -#ifndef GL_ARB_multi_bind -#define GL_ARB_multi_bind 1 -#endif /* GL_ARB_multi_bind */ - -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 -#endif /* GL_ARB_multi_draw_indirect */ - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); -#endif -#endif /* GL_ARB_multisample */ - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); -#endif -#endif /* GL_ARB_multitexture */ - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); -GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQueryARB (GLenum target); -GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); -#endif -#endif /* GL_ARB_occlusion_query */ - -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 -#endif /* GL_ARB_occlusion_query2 */ - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif /* GL_ARB_pixel_buffer_object */ - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_ARB_point_parameters */ - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif /* GL_ARB_point_sprite */ - -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 -#endif /* GL_ARB_program_interface_query */ - -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 -#endif /* GL_ARB_provoking_vertex */ - -#ifndef GL_ARB_query_buffer_object -#define GL_ARB_query_buffer_object 1 -#endif /* GL_ARB_query_buffer_object */ - -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 -#endif /* GL_ARB_robust_buffer_access_behavior */ - -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); -GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); -GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); -GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); -GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); -GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -#endif -#endif /* GL_ARB_robustness */ - -#ifndef GL_ARB_robustness_isolation -#define GL_ARB_robustness_isolation 1 -#endif /* GL_ARB_robustness_isolation */ - -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); -#endif -#endif /* GL_ARB_sample_shading */ - -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 -#endif /* GL_ARB_sampler_objects */ - -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 -#endif /* GL_ARB_seamless_cube_map */ - -#ifndef GL_ARB_seamless_cubemap_per_texture -#define GL_ARB_seamless_cubemap_per_texture 1 -#endif /* GL_ARB_seamless_cubemap_per_texture */ - -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 -#endif /* GL_ARB_separate_shader_objects */ - -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 -#endif /* GL_ARB_shader_atomic_counters */ - -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 -#endif /* GL_ARB_shader_bit_encoding */ - -#ifndef GL_ARB_shader_draw_parameters -#define GL_ARB_shader_draw_parameters 1 -#endif /* GL_ARB_shader_draw_parameters */ - -#ifndef GL_ARB_shader_group_vote -#define GL_ARB_shader_group_vote 1 -#endif /* GL_ARB_shader_group_vote */ - -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 -#endif /* GL_ARB_shader_image_load_store */ - -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 -#endif /* GL_ARB_shader_image_size */ - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -typedef char GLcharARB; -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif -#endif /* GL_ARB_shader_objects */ - -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 -#endif /* GL_ARB_shader_precision */ - -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 -#endif /* GL_ARB_shader_stencil_export */ - -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 -#endif /* GL_ARB_shader_storage_buffer_object */ - -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 -#endif /* GL_ARB_shader_subroutine */ - -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 -#endif /* GL_ARB_shader_texture_lod */ - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif /* GL_ARB_shading_language_100 */ - -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 -#endif /* GL_ARB_shading_language_420pack */ - -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA -typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); -typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); -GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#endif -#endif /* GL_ARB_shading_language_include */ - -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 -#endif /* GL_ARB_shading_language_packing */ - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif /* GL_ARB_shadow */ - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif /* GL_ARB_shadow_ambient */ - -#ifndef GL_ARB_sparse_texture -#define GL_ARB_sparse_texture 1 -#define GL_TEXTURE_SPARSE_ARB 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 -#define GL_MIN_SPARSE_LEVEL_ARB 0x919B -#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 -typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -#endif -#endif /* GL_ARB_sparse_texture */ - -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 -#endif /* GL_ARB_stencil_texturing */ - -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 -#endif /* GL_ARB_sync */ - -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 -#endif /* GL_ARB_tessellation_shader */ - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif /* GL_ARB_texture_border_clamp */ - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); -#endif -#endif /* GL_ARB_texture_buffer_object */ - -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 -#endif /* GL_ARB_texture_buffer_object_rgb32 */ - -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 -#endif /* GL_ARB_texture_buffer_range */ - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); -#endif -#endif /* GL_ARB_texture_compression */ - -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F -#endif /* GL_ARB_texture_compression_bptc */ - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#endif /* GL_ARB_texture_compression_rgtc */ - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif /* GL_ARB_texture_cube_map */ - -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F -#endif /* GL_ARB_texture_cube_map_array */ - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif /* GL_ARB_texture_env_add */ - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif /* GL_ARB_texture_env_combine */ - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif /* GL_ARB_texture_env_crossbar */ - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif /* GL_ARB_texture_env_dot3 */ - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif /* GL_ARB_texture_float */ - -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F -#endif /* GL_ARB_texture_gather */ - -#ifndef GL_ARB_texture_mirror_clamp_to_edge -#define GL_ARB_texture_mirror_clamp_to_edge 1 -#endif /* GL_ARB_texture_mirror_clamp_to_edge */ - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif /* GL_ARB_texture_mirrored_repeat */ - -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -#endif /* GL_ARB_texture_multisample */ - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif /* GL_ARB_texture_non_power_of_two */ - -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 -#endif /* GL_ARB_texture_query_levels */ - -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 -#endif /* GL_ARB_texture_query_lod */ - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif /* GL_ARB_texture_rectangle */ - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#endif /* GL_ARB_texture_rg */ - -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 -#endif /* GL_ARB_texture_rgb10_a2ui */ - -#ifndef GL_ARB_texture_stencil8 -#define GL_ARB_texture_stencil8 1 -#endif /* GL_ARB_texture_stencil8 */ - -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 -#endif /* GL_ARB_texture_storage */ - -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 -#endif /* GL_ARB_texture_storage_multisample */ - -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -#endif /* GL_ARB_texture_swizzle */ - -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 -#endif /* GL_ARB_texture_view */ - -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 -#endif /* GL_ARB_timer_query */ - -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 -#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 -#endif /* GL_ARB_transform_feedback2 */ - -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 -#endif /* GL_ARB_transform_feedback3 */ - -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 -#endif /* GL_ARB_transform_feedback_instanced */ - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); -#endif -#endif /* GL_ARB_transpose_matrix */ - -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#endif /* GL_ARB_uniform_buffer_object */ - -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 -#endif /* GL_ARB_vertex_array_bgra */ - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#endif /* GL_ARB_vertex_array_object */ - -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 -#endif /* GL_ARB_vertex_attrib_64bit */ - -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 -#endif /* GL_ARB_vertex_attrib_binding */ - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); -GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); -GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); -GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); -GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); -GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); -GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); -GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); -GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glVertexBlendARB (GLint count); -#endif -#endif /* GL_ARB_vertex_blend */ - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef __MACOSX__ /* The OS X headers haven't caught up with Khronos yet */ -typedef long GLsizeiptrARB; -typedef long GLintptrARB; -#else -typedef ptrdiff_t GLsizeiptrARB; -typedef ptrdiff_t GLintptrARB; -#endif -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_ARB_vertex_buffer_object */ - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); -#endif -#endif /* GL_ARB_vertex_program */ - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); -#endif -#endif /* GL_ARB_vertex_shader */ - -#ifndef GL_ARB_vertex_type_10f_11f_11f_rev -#define GL_ARB_vertex_type_10f_11f_11f_rev 1 -#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 -#endif /* GL_ARB_viewport_array */ - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); -#endif -#endif /* GL_ARB_window_pos */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#endif /* GL_KHR_debug */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif /* GL_KHR_texture_compression_astc_hdr */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif /* GL_KHR_texture_compression_astc_ldr */ - -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s); -typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t); -typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); -typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); -typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x); -typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y); -typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z); -typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); -GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t); -GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r); -GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glTexCoord1bOES (GLbyte s); -GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t); -GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); -GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex2bOES (GLbyte x); -GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y); -GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z); -GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); -#endif -#endif /* GL_OES_byte_coordinates */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif /* GL_OES_compressed_paletted_texture */ - -#ifndef GL_OES_fixed_point -#define GL_OES_fixed_point 1 -typedef GLint GLfixed; -#define GL_FIXED_OES 0x140C -typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); -typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); -typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); -typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); -typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); -typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); -typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); -typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); -typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEOESPROC) (GLfixed value, GLboolean invert); -typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value); -typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); -typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue); -typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components); -typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u); -typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v); -typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v); -typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values); -typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component); -typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2); -typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token); -typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values); -typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities); -typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y); -typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w); -typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2); -typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s); -typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t); -typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r); -typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x); -typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y); -typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); -GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glClearDepthxOES (GLfixed depth); -GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); -GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); -GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); -GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); -GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glLineWidthxOES (GLfixed width); -GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); -GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); -GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glPointSizexOES (GLfixed size); -GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); -GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glSampleCoverageOES (GLfixed value, GLboolean invert); -GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value); -GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); -GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue); -GLAPI void APIENTRY glColor3xvOES (const GLfixed *components); -GLAPI void APIENTRY glColor4xvOES (const GLfixed *components); -GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u); -GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords); -GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v); -GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer); -GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v); -GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param); -GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values); -GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glIndexxOES (GLfixed component); -GLAPI void APIENTRY glIndexxvOES (const GLfixed *component); -GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2); -GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s); -GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t); -GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r); -GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glPassThroughxOES (GLfixed token); -GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values); -GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param); -GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor); -GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities); -GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y); -GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w); -GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2); -GLAPI void APIENTRY glTexCoord1xOES (GLfixed s); -GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t); -GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r); -GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glVertex2xOES (GLfixed x); -GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y); -GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords); -#endif -#endif /* GL_OES_fixed_point */ - -#ifndef GL_OES_query_matrix -#define GL_OES_query_matrix 1 -typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); -#endif -#endif /* GL_OES_query_matrix */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif /* GL_OES_read_format */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 -typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); -typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); -typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); -typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClearDepthfOES (GLclampf depth); -GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); -GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); -GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); -GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -#endif -#endif /* GL_OES_single_precision */ - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif /* GL_3DFX_multisample */ - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); -#endif -#endif /* GL_3DFX_tbuffer */ - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif /* GL_3DFX_texture_compression_FXT1 */ - -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#endif /* GL_AMD_blend_minmax_factor */ - -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 -#endif /* GL_AMD_conservative_depth */ - -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#endif -#endif /* GL_AMD_debug_output */ - -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F -#endif /* GL_AMD_depth_clamp_separate */ - -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 -typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#endif -#endif /* GL_AMD_draw_buffers_blend */ - -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 -#endif /* GL_AMD_gcn_shader */ - -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 -typedef int64_t GLint64EXT; -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); -GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_AMD_gpu_shader_int64 */ - -#ifndef GL_AMD_interleaved_elements -#define GL_AMD_interleaved_elements 1 -#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 -#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 -typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param); -#endif -#endif /* GL_AMD_interleaved_elements */ - -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); -#endif -#endif /* GL_AMD_multi_draw_indirect */ - -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 -typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); -typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); -typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); -GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); -GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); -#endif -#endif /* GL_AMD_name_gen_delete */ - -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF -typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); -#endif -#endif /* GL_AMD_occlusion_query_event */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); -GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -#endif /* GL_AMD_performance_monitor */ - -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 -#endif /* GL_AMD_pinned_memory */ - -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 -#endif /* GL_AMD_query_buffer_object */ - -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F -typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); -#endif -#endif /* GL_AMD_sample_positions */ - -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 -#endif /* GL_AMD_seamless_cubemap_per_texture */ - -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 -#endif /* GL_AMD_shader_atomic_counter_ops */ - -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 -#endif /* GL_AMD_shader_stencil_export */ - -#ifndef GL_AMD_shader_trinary_minmax -#define GL_AMD_shader_trinary_minmax 1 -#endif /* GL_AMD_shader_trinary_minmax */ - -#ifndef GL_AMD_sparse_texture -#define GL_AMD_sparse_texture 1 -#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A -#define GL_MIN_SPARSE_LEVEL_AMD 0x919B -#define GL_MIN_LOD_WARNING_AMD 0x919C -#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 -typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -#endif -#endif /* GL_AMD_sparse_texture */ - -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D -typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); -#endif -#endif /* GL_AMD_stencil_operation_extended */ - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -#endif /* GL_AMD_texture_texture4 */ - -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 -#endif /* GL_AMD_transform_feedback3_lines_triangles */ - -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 -#endif /* GL_AMD_transform_feedback4 */ - -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 -#endif /* GL_AMD_vertex_shader_layer */ - -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); -GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); -#endif -#endif /* GL_AMD_vertex_shader_tessellator */ - -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 -#endif /* GL_AMD_vertex_shader_viewport_index */ - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 -#endif /* GL_APPLE_aux_depth_stencil */ - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif /* GL_APPLE_client_storage */ - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif -#endif /* GL_APPLE_element_array */ - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); -#endif -#endif /* GL_APPLE_fence */ - -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F -#endif /* GL_APPLE_float_pixels */ - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_APPLE_flush_buffer_range */ - -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D -typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#endif -#endif /* GL_APPLE_object_purgeable */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_RAW_422_APPLE 0x8A51 -#endif /* GL_APPLE_rgb_422 */ - -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 -#endif /* GL_APPLE_row_bytes */ - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif /* GL_APPLE_specular_vector */ - -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_APPLE_texture_range */ - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif /* GL_APPLE_transform_hint */ - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); -#endif -#endif /* GL_APPLE_vertex_array_object */ - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); -#endif -#endif /* GL_APPLE_vertex_array_range */ - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#endif -#endif /* GL_APPLE_vertex_program_evaluators */ - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#define GL_YCBCR_422_APPLE 0x85B9 -#endif /* GL_APPLE_ycbcr_422 */ - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_ATI_draw_buffers */ - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif -#endif /* GL_ATI_element_array */ - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); -#endif -#endif /* GL_ATI_envmap_bumpmap */ - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); -GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); -#endif -#endif /* GL_ATI_fragment_shader */ - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); -#endif -#endif /* GL_ATI_map_object_buffer */ - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#endif /* GL_ATI_meminfo */ - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif /* GL_ATI_pixel_format_float */ - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); -#endif -#endif /* GL_ATI_pn_triangles */ - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif -#endif /* GL_ATI_separate_stencil */ - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif /* GL_ATI_text_fragment_shader */ - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif /* GL_ATI_texture_env_combine3 */ - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif /* GL_ATI_texture_float */ - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif /* GL_ATI_texture_mirror_once */ - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); -#endif -#endif /* GL_ATI_vertex_array_object */ - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); -#endif -#endif /* GL_ATI_vertex_attrib_array_object */ - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); -GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); -GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); -#endif -#endif /* GL_ATI_vertex_streams */ - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif /* GL_EXT_422_pixels */ - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#define GL_ABGR_EXT 0x8000 -#endif /* GL_EXT_abgr */ - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif /* GL_EXT_bgra */ - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); -#endif -#endif /* GL_EXT_bindable_uniform */ - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#endif -#endif /* GL_EXT_blend_color */ - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); -#endif -#endif /* GL_EXT_blend_equation_separate */ - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif -#endif /* GL_EXT_blend_func_separate */ - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif /* GL_EXT_blend_logic_op */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_BLEND_EQUATION_EXT 0x8009 -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); -#endif -#endif /* GL_EXT_blend_minmax */ - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif /* GL_EXT_blend_subtract */ - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif /* GL_EXT_clip_volume_hint */ - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif /* GL_EXT_cmyka */ - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif -#endif /* GL_EXT_color_subtable */ - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif -#endif /* GL_EXT_compiled_vertex_array */ - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -#endif -#endif /* GL_EXT_convolution */ - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); -GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); -GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); -GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_coordinate_frame */ - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_EXT_copy_texture */ - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_cull_vertex */ - -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_EXT_debug_label */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPopGroupMarkerEXT (void); -#endif -#endif /* GL_EXT_debug_marker */ - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); -#endif -#endif /* GL_EXT_depth_bounds_test */ - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); -GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array); -GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); -GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); -GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); -GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); -GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); -GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); -#endif -#endif /* GL_EXT_direct_state_access */ - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -#endif -#endif /* GL_EXT_draw_buffers2 */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_EXT_draw_instanced */ - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -#endif -#endif /* GL_EXT_draw_range_elements */ - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_fog_coord */ - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_EXT_framebuffer_blit */ - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_EXT_framebuffer_multisample */ - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); -#endif -#endif /* GL_EXT_framebuffer_object */ - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif /* GL_EXT_framebuffer_sRGB */ - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -#endif -#endif /* GL_EXT_geometry_shader4 */ - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif -#endif /* GL_EXT_gpu_program_parameters */ - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); -#endif -#endif /* GL_EXT_gpu_shader4 */ - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogramEXT (GLenum target); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); -#endif -#endif /* GL_EXT_histogram */ - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif /* GL_EXT_index_array_formats */ - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); -#endif -#endif /* GL_EXT_index_func */ - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); -#endif -#endif /* GL_EXT_index_material */ - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif /* GL_EXT_index_texture */ - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); -GLAPI void APIENTRY glTextureLightEXT (GLenum pname); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); -#endif -#endif /* GL_EXT_light_texture */ - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif /* GL_EXT_misc_attribute */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#endif -#endif /* GL_EXT_multi_draw_arrays */ - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); -#endif -#endif /* GL_EXT_multisample */ - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#endif /* GL_EXT_packed_depth_stencil */ - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif /* GL_EXT_packed_float */ - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif /* GL_EXT_packed_pixels */ - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_paletted_texture */ - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif /* GL_EXT_pixel_buffer_object */ - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_pixel_transform */ - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif /* GL_EXT_pixel_transform_color_table */ - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_EXT_point_parameters */ - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); -#endif -#endif /* GL_EXT_polygon_offset */ - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); -#endif -#endif /* GL_EXT_provoking_vertex */ - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif /* GL_EXT_rescale_normal */ - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_secondary_color */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D -typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); -typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); -GLAPI void APIENTRY glActiveProgramEXT (GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); -#endif -#endif /* GL_EXT_separate_shader_objects */ - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif /* GL_EXT_separate_specular_color */ - -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 -#endif /* GL_EXT_shader_image_load_formatted */ - -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); -#endif -#endif /* GL_EXT_shader_image_load_store */ - -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -#endif /* GL_EXT_shader_integer_mix */ - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif /* GL_EXT_shadow_funcs */ - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif /* GL_EXT_shared_texture_palette */ - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif -#endif /* GL_EXT_stencil_clear_tag */ - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); -#endif -#endif /* GL_EXT_stencil_two_side */ - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif /* GL_EXT_stencil_wrap */ - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_EXT_subtexture */ - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif /* GL_EXT_texture */ - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_EXT_texture3D */ - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#endif /* GL_EXT_texture_array */ - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); -#endif -#endif /* GL_EXT_texture_buffer_object */ - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif /* GL_EXT_texture_compression_latc */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif /* GL_EXT_texture_cube_map */ - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif /* GL_EXT_texture_env_add */ - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif /* GL_EXT_texture_env_combine */ - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif /* GL_EXT_texture_env_dot3 */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif /* GL_EXT_texture_filter_anisotropic */ - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif -#endif /* GL_EXT_texture_integer */ - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif /* GL_EXT_texture_lod_bias */ - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif /* GL_EXT_texture_mirror_clamp */ - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif -#endif /* GL_EXT_texture_object */ - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); -#endif -#endif /* GL_EXT_texture_perturb_normal */ - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif /* GL_EXT_texture_sRGB */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif /* GL_EXT_texture_sRGB_decode */ - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif /* GL_EXT_texture_shared_exponent */ - -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#endif /* GL_EXT_texture_snorm */ - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#endif /* GL_EXT_texture_swizzle */ - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#define GL_TIME_ELAPSED_EXT 0x88BF -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -#endif -#endif /* GL_EXT_timer_query */ - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#endif -#endif /* GL_EXT_transform_feedback */ - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint i); -GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); -GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); -GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -#endif -#endif /* GL_EXT_vertex_array */ - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#endif /* GL_EXT_vertex_array_bgra */ - -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); -#endif -#endif /* GL_EXT_vertex_attrib_64bit */ - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); -GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); -GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); -GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); -GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); -GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); -GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); -GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); -GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); -GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); -GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -#endif -#endif /* GL_EXT_vertex_shader */ - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_vertex_weighting */ - -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 -#define GL_SYNC_X11_FENCE_EXT 0x90E1 -typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#endif -#endif /* GL_EXT_x11_sync_object */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); -#endif -#endif /* GL_GREMEDY_frame_terminator */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); -#endif -#endif /* GL_GREMEDY_string_marker */ - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif /* GL_HP_convolution_border_modes */ - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_HP_image_transform */ - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif /* GL_HP_occlusion_test */ - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif /* GL_HP_texture_lighting */ - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#define GL_CULL_VERTEX_IBM 103050 -#endif /* GL_IBM_cull_vertex */ - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); -#endif -#endif /* GL_IBM_multimode_draw_arrays */ - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif /* GL_IBM_rasterpos_clip */ - -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 -typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); -#endif -#endif /* GL_IBM_static_data */ - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif /* GL_IBM_texture_mirrored_repeat */ - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -#endif -#endif /* GL_IBM_vertex_array_lists */ - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif -#endif /* GL_INGR_blend_func_separate */ - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif /* GL_INGR_color_clamp */ - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#define GL_INTERLACE_READ_INGR 0x8568 -#endif /* GL_INGR_interlace_read */ - -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 -#endif /* GL_INTEL_fragment_shader_ordering */ - -#ifndef GL_INTEL_map_texture -#define GL_INTEL_map_texture 1 -#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF -#define GL_LAYOUT_DEFAULT_INTEL 0 -#define GL_LAYOUT_LINEAR_INTEL 1 -#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 -typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); -typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); -GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); -GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); -#endif -#endif /* GL_INTEL_map_texture */ - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); -GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); -#endif -#endif /* GL_INTEL_parallel_arrays */ - -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); -typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); -typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); -typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); -typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); -typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); -GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); -GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); -GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); -GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); -GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#endif -#endif /* GL_INTEL_performance_query */ - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif /* GL_MESAX_texture_stack */ - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#define GL_PACK_INVERT_MESA 0x8758 -#endif /* GL_MESA_pack_invert */ - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif -#endif /* GL_MESA_resize_buffers */ - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); -#endif -#endif /* GL_MESA_window_pos */ - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif /* GL_MESA_ycbcr_texture */ - -#ifndef GL_NVX_conditional_render -#define GL_NVX_conditional_render 1 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id); -GLAPI void APIENTRY glEndConditionalRenderNVX (void); -#endif -#endif /* GL_NVX_conditional_render */ - -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#endif /* GL_NVX_gpu_memory_info */ - -#ifndef GL_NV_bindless_multi_draw_indirect -#define GL_NV_bindless_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -#endif -#endif /* GL_NV_bindless_multi_draw_indirect */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); -#endif -#endif /* GL_NV_bindless_texture */ - -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value); -GLAPI void APIENTRY glBlendBarrierNV (void); -#endif -#endif /* GL_NV_blend_equation_advanced */ - -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#endif /* GL_NV_blend_equation_advanced_coherent */ - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif /* GL_NV_blend_square */ - -#ifndef GL_NV_compute_program5 -#define GL_NV_compute_program5 1 -#define GL_COMPUTE_PROGRAM_NV 0x90FB -#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC -#endif /* GL_NV_compute_program5 */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRenderNV (void); -#endif -#endif /* GL_NV_conditional_render */ - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif /* GL_NV_copy_depth_to_color */ - -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#endif -#endif /* GL_NV_copy_image */ - -#ifndef GL_NV_deep_texture3D -#define GL_NV_deep_texture3D 1 -#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 -#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 -#endif /* GL_NV_deep_texture3D */ - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); -#endif -#endif /* GL_NV_depth_buffer_float */ - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#define GL_DEPTH_CLAMP_NV 0x864F -#endif /* GL_NV_depth_clamp */ - -#ifndef GL_NV_draw_texture -#define GL_NV_draw_texture 1 -typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -#endif -#endif /* GL_NV_draw_texture */ - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); -#endif -#endif /* GL_NV_evaluators */ - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); -#endif -#endif /* GL_NV_explicit_multisample */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); -GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GLAPI void APIENTRY glFinishFenceNV (GLuint fence); -GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -#endif /* GL_NV_fence */ - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif /* GL_NV_float_buffer */ - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -#endif /* GL_NV_fog_distance */ - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif -#endif /* GL_NV_fragment_program */ - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif /* GL_NV_fragment_program2 */ - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#endif /* GL_NV_fragment_program4 */ - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif /* GL_NV_fragment_program_option */ - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_NV_framebuffer_multisample_coverage */ - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif -#endif /* GL_NV_geometry_program4 */ - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#endif /* GL_NV_geometry_shader4 */ - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); -#endif -#endif /* GL_NV_gpu_program4 */ - -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F -#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 -#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 -typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); -#endif -#endif /* GL_NV_gpu_program5 */ - -#ifndef GL_NV_gpu_program5_mem_extended -#define GL_NV_gpu_program5_mem_extended 1 -#endif /* GL_NV_gpu_program5_mem_extended */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -#endif /* GL_NV_gpu_shader5 */ - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -typedef unsigned short GLhalfNV; -#define GL_HALF_FLOAT_NV 0x140B -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -#endif -#endif /* GL_NV_half_float */ - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif /* GL_NV_light_max_exponent */ - -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#endif /* GL_NV_multisample_coverage */ - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif /* GL_NV_multisample_filter_hint */ - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); -#endif -#endif /* GL_NV_occlusion_query */ - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif /* GL_NV_packed_depth_stencil */ - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); -#endif -#endif /* GL_NV_parameter_buffer_object */ - -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 -#endif /* GL_NV_parameter_buffer_object2 */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); -typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); -typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); -typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); -typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); -GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); -GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); -GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); -GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); -GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); -GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); -GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); -GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); -GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); -GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); -GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); -GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); -GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); -GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); -GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); -GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); -GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); -GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); -GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -#endif -#endif /* GL_NV_path_rendering */ - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); -#endif -#endif /* GL_NV_pixel_data_range */ - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); -#endif -#endif /* GL_NV_point_sprite */ - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); -GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#endif -#endif /* GL_NV_present_video */ - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); -#endif -#endif /* GL_NV_primitive_restart */ - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); -#endif -#endif /* GL_NV_register_combiners */ - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); -#endif -#endif /* GL_NV_register_combiners2 */ - -#ifndef GL_NV_shader_atomic_counters -#define GL_NV_shader_atomic_counters 1 -#endif /* GL_NV_shader_atomic_counters */ - -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 -#endif /* GL_NV_shader_atomic_float */ - -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 -typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); -typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); -typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); -typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); -typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); -GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); -GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); -GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); -GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); -GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); -GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); -GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); -GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); -GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_NV_shader_buffer_load */ - -#ifndef GL_NV_shader_buffer_store -#define GL_NV_shader_buffer_store 1 -#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 -#endif /* GL_NV_shader_buffer_store */ - -#ifndef GL_NV_shader_storage_buffer_object -#define GL_NV_shader_storage_buffer_object 1 -#endif /* GL_NV_shader_storage_buffer_object */ - -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B -#endif /* GL_NV_shader_thread_group */ - -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 -#endif /* GL_NV_shader_thread_shuffle */ - -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 -#endif /* GL_NV_tessellation_program5 */ - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif /* GL_NV_texgen_emboss */ - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif /* GL_NV_texgen_reflection */ - -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 -typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureBarrierNV (void); -#endif -#endif /* GL_NV_texture_barrier */ - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif /* GL_NV_texture_compression_vtc */ - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif /* GL_NV_texture_env_combine4 */ - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif /* GL_NV_texture_expand_normal */ - -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#endif -#endif /* GL_NV_texture_multisample */ - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif /* GL_NV_texture_rectangle */ - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif /* GL_NV_texture_shader */ - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif /* GL_NV_texture_shader2 */ - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif /* GL_NV_texture_shader3 */ - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#define GL_LAYER_NV 0x8DAA -#define GL_NEXT_BUFFER_NV -2 -#define GL_SKIP_COMPONENTS4_NV -3 -#define GL_SKIP_COMPONENTS3_NV -4 -#define GL_SKIP_COMPONENTS2_NV -5 -#define GL_SKIP_COMPONENTS1_NV -6 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); -GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#endif -#endif /* GL_NV_transform_feedback */ - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedbackNV (void); -GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); -#endif -#endif /* GL_NV_transform_feedback2 */ - -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 -typedef GLintptr GLvdpauSurfaceNV; -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); -typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); -typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); -GLAPI void APIENTRY glVDPAUFiniNV (void); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); -GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#endif -#endif /* GL_NV_vdpau_interop */ - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); -#endif -#endif /* GL_NV_vertex_array_range */ - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif /* GL_NV_vertex_array_range2 */ - -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); -GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -#endif -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 -typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); -GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); -#endif -#endif /* GL_NV_vertex_buffer_unified_memory */ - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); -GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); -GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); -GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); -#endif -#endif /* GL_NV_vertex_program */ - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif /* GL_NV_vertex_program1_1 */ - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif /* GL_NV_vertex_program2 */ - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif /* GL_NV_vertex_program2_option */ - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif /* GL_NV_vertex_program3 */ - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); -#endif -#endif /* GL_NV_vertex_program4 */ - -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C -typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#endif -#endif /* GL_NV_video_capture */ - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif /* GL_OML_interlace */ - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif /* GL_OML_resample */ - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif /* GL_OML_subsample */ - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); -#endif -#endif /* GL_PGI_misc_hints */ - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif /* GL_PGI_vertex_hints */ - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif /* GL_REND_screen_coordinates */ - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 -#endif /* GL_S3_s3tc */ - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); -#endif -#endif /* GL_SGIS_detail_texture */ - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); -#endif -#endif /* GL_SGIS_fog_function */ - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif /* GL_SGIS_generate_mipmap */ - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); -#endif -#endif /* GL_SGIS_multisample */ - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); -#endif -#endif /* GL_SGIS_pixel_texture */ - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif /* GL_SGIS_point_line_texgen */ - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_SGIS_point_parameters */ - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); -#endif -#endif /* GL_SGIS_sharpen_texture */ - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_SGIS_texture4D */ - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif /* GL_SGIS_texture_border_clamp */ - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif -#endif /* GL_SGIS_texture_color_mask */ - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif /* GL_SGIS_texture_edge_clamp */ - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif -#endif /* GL_SGIS_texture_filter4 */ - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif /* GL_SGIS_texture_lod */ - -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif /* GL_SGIS_texture_select */ - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#define GL_ASYNC_MARKER_SGIX 0x8329 -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); -#endif -#endif /* GL_SGIX_async */ - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif /* GL_SGIX_async_histogram */ - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif /* GL_SGIX_async_pixel */ - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif /* GL_SGIX_blend_alpha_minmax */ - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif /* GL_SGIX_calligraphic_fragment */ - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif /* GL_SGIX_clipmap */ - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif /* GL_SGIX_convolution_accuracy */ - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif /* GL_SGIX_depth_pass_instrument */ - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif /* GL_SGIX_depth_texture */ - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif -#endif /* GL_SGIX_flush_raster */ - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif /* GL_SGIX_fog_offset */ - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); -GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); -#endif -#endif /* GL_SGIX_fragment_lighting */ - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); -#endif -#endif /* GL_SGIX_framezoom */ - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); -#endif -#endif /* GL_SGIX_igloo_interface */ - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); -#endif -#endif /* GL_SGIX_instruments */ - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#define GL_INTERLACE_SGIX 0x8094 -#endif /* GL_SGIX_interlace */ - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif /* GL_SGIX_ir_instrument1 */ - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#define GL_LIST_PRIORITY_SGIX 0x8182 -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); -GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); -GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); -#endif -#endif /* GL_SGIX_list_priority */ - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); -#endif -#endif /* GL_SGIX_pixel_texture */ - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif /* GL_SGIX_pixel_tiles */ - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); -#endif -#endif /* GL_SGIX_polynomial_ffd */ - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); -#endif -#endif /* GL_SGIX_reference_plane */ - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif /* GL_SGIX_resample */ - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif /* GL_SGIX_scalebias_hint */ - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif /* GL_SGIX_shadow */ - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif /* GL_SGIX_shadow_ambient */ - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); -#endif -#endif /* GL_SGIX_sprite */ - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif /* GL_SGIX_subsample */ - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif -#endif /* GL_SGIX_tag_sample_buffer */ - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif /* GL_SGIX_texture_add_env */ - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif /* GL_SGIX_texture_coordinate_clamp */ - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif /* GL_SGIX_texture_lod_bias */ - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif /* GL_SGIX_texture_multi_buffer */ - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif /* GL_SGIX_texture_scale_bias */ - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif /* GL_SGIX_vertex_preclip */ - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif /* GL_SGIX_ycrcb */ - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif /* GL_SGIX_ycrcb_subsample */ - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif /* GL_SGIX_ycrcba */ - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif /* GL_SGI_color_matrix */ - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); -#endif -#endif /* GL_SGI_color_table */ - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif /* GL_SGI_texture_color_table */ - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif -#endif /* GL_SUNX_constant_data */ - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif /* GL_SUN_convolution_border_modes */ - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); -#endif -#endif /* GL_SUN_global_alpha */ - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif -#endif /* GL_SUN_mesh_array */ - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif /* GL_SUN_slice_accum */ - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); -#endif -#endif /* GL_SUN_triangle_list */ - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif -#endif /* GL_SUN_vertex */ - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif /* GL_WIN_phong_shading */ - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif /* GL_WIN_specular_fog */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles.h deleted file mode 100644 index bcc1277..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_opengles.h - * - * This is a simple file to encapsulate the OpenGL ES 1.X API headers. - */ - -#ifdef __IPHONEOS__ -#include -#include -#else -#include -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2.h deleted file mode 100644 index edcd1a2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_opengles2.h - * - * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. - */ -#ifndef _MSC_VER - -#ifdef __IPHONEOS__ -#include -#include -#else -#include -#include -#include -#endif - -#else /* _MSC_VER */ - -/* OpenGL ES2 headers for Visual Studio */ -#include "SDL_opengles2_khrplatform.h" -#include "SDL_opengles2_gl2platform.h" -#include "SDL_opengles2_gl2.h" -#include "SDL_opengles2_gl2ext.h" - -#endif /* _MSC_VER */ - -#ifndef APIENTRY -#define APIENTRY GL_APIENTRY -#endif diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2.h deleted file mode 100644 index c62fb0a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2.h +++ /dev/null @@ -1,621 +0,0 @@ -#ifndef __gl2_h_ -#define __gl2_h_ - -/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */ - -/*#include */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -/*------------------------------------------------------------------------- - * Data type definitions - *-----------------------------------------------------------------------*/ - -typedef void GLvoid; -typedef char GLchar; -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef khronos_int8_t GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLsizei; -typedef khronos_uint8_t GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; - -/* GL types for handling large vertex buffer objects */ -typedef khronos_intptr_t GLintptr; -typedef khronos_ssize_t GLsizeiptr; - -/* OpenGL ES core versions */ -#define GL_ES_VERSION_2_0 1 - -/* ClearBufferMask */ -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 - -/* Boolean */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* BeginMode */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 - -/* AlphaFunction (not supported in ES20) */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* BlendingFactorDest */ -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 - -/* BlendingFactorSrc */ -/* GL_ZERO */ -/* GL_ONE */ -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -/* GL_SRC_ALPHA */ -/* GL_ONE_MINUS_SRC_ALPHA */ -/* GL_DST_ALPHA */ -/* GL_ONE_MINUS_DST_ALPHA */ - -/* BlendEquationSeparate */ -#define GL_FUNC_ADD 0x8006 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ -#define GL_BLEND_EQUATION_ALPHA 0x883D - -/* BlendSubtract */ -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B - -/* Separate Blend Functions */ -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 - -/* Buffer Objects */ -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 - -#define GL_STREAM_DRAW 0x88E0 -#define GL_STATIC_DRAW 0x88E4 -#define GL_DYNAMIC_DRAW 0x88E8 - -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 - -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 - -/* CullFaceMode */ -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_FRONT_AND_BACK 0x0408 - -/* DepthFunction */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* EnableCap */ -#define GL_TEXTURE_2D 0x0DE1 -#define GL_CULL_FACE 0x0B44 -#define GL_BLEND 0x0BE2 -#define GL_DITHER 0x0BD0 -#define GL_STENCIL_TEST 0x0B90 -#define GL_DEPTH_TEST 0x0B71 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_COVERAGE 0x80A0 - -/* ErrorCode */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 - -/* FrontFaceDirection */ -#define GL_CW 0x0900 -#define GL_CCW 0x0901 - -/* GetPName */ -#define GL_LINE_WIDTH 0x0B21 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -/* GL_SCISSOR_TEST */ -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -/* GL_POLYGON_OFFSET_FILL */ -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB - -/* GetTextureParameter */ -/* GL_TEXTURE_MAG_FILTER */ -/* GL_TEXTURE_MIN_FILTER */ -/* GL_TEXTURE_WRAP_S */ -/* GL_TEXTURE_WRAP_T */ - -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 - -/* HintMode */ -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* HintTarget */ -#define GL_GENERATE_MIPMAP_HINT 0x8192 - -/* DataType */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_FIXED 0x140C - -/* PixelFormat */ -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A - -/* PixelType */ -/* GL_UNSIGNED_BYTE */ -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 - -/* Shaders */ -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_SHADER_TYPE 0x8B4F -#define GL_DELETE_STATUS 0x8B80 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D - -/* StencilFunction */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 - -/* StencilOp */ -/* GL_ZERO */ -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_INVERT 0x150A -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 - -/* StringName */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* TextureMagFilter */ -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 - -/* TextureMinFilter */ -/* GL_NEAREST */ -/* GL_LINEAR */ -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 - -/* TextureParameterName */ -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 - -/* TextureTarget */ -/* GL_TEXTURE_2D */ -#define GL_TEXTURE 0x1702 - -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C - -/* TextureUnit */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 - -/* TextureWrapMode */ -#define GL_REPEAT 0x2901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MIRRORED_REPEAT 0x8370 - -/* Uniform Types */ -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 - -/* Vertex Arrays */ -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F - -/* Read Format */ -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B - -/* Shader Source */ -#define GL_COMPILE_STATUS 0x8B81 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_COMPILER 0x8DFA - -/* Shader Binary */ -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 - -/* Shader Precision-Specified Types */ -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 - -/* Framebuffer Object. */ -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 - -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGB565 0x8D62 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_STENCIL_INDEX8 0x8D48 - -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 - -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 - -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 - -#define GL_NONE 0 - -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD - -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 - -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 - -/*------------------------------------------------------------------------- - * GL core functions. - *-----------------------------------------------------------------------*/ - -GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); -GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); -GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); -GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); -GL_APICALL void GL_APIENTRY glClearStencil (GLint s); -GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); -GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); -GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); -GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); -GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); -GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisable (GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); -GL_APICALL void GL_APIENTRY glEnable (GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glFinish (void); -GL_APICALL void GL_APIENTRY glFlush (void); -GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); -GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); -GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); -GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL GLenum GL_APIENTRY glGetError (void); -GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); -GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); -GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); -GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); -GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); -GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); -GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); -GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); -GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); - -#ifdef __cplusplus -} -#endif - -#endif /* __gl2_h_ */ - diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2ext.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2ext.h deleted file mode 100644 index e8ca8b1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2ext.h +++ /dev/null @@ -1,2050 +0,0 @@ -#ifndef __gl2ext_h_ -#define __gl2ext_h_ - -/* $Revision: 22801 $ on $Date:: 2013-08-21 03:20:48 -0700 #$ */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -#ifndef GL_APIENTRYP -# define GL_APIENTRYP GL_APIENTRY* -#endif - -/* New types shared by several extensions */ - -#ifndef __gl3_h_ -/* These are defined with respect to in the - * Apple extension spec, but they are also used by non-APPLE - * extensions, and in the Khronos header we use the Khronos - * portable types in khrplatform.h, which must be defined. - */ -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef struct __GLsync *GLsync; -#endif - - -/*------------------------------------------------------------------------* - * OES extension tokens - *------------------------------------------------------------------------*/ - -/* GL_OES_compressed_ETC1_RGB8_texture */ -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_ETC1_RGB8_OES 0x8D64 -#endif - -/* GL_OES_compressed_paletted_texture */ -#ifndef GL_OES_compressed_paletted_texture -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif - -/* GL_OES_depth24 */ -#ifndef GL_OES_depth24 -#define GL_DEPTH_COMPONENT24_OES 0x81A6 -#endif - -/* GL_OES_depth32 */ -#ifndef GL_OES_depth32 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#endif - -/* GL_OES_depth_texture */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -typedef void* GLeglImageOES; -#endif - -/* GL_OES_EGL_image_external */ -#ifndef GL_OES_EGL_image_external -/* GLeglImageOES defined in GL_OES_EGL_image already. */ -#define GL_TEXTURE_EXTERNAL_OES 0x8D65 -#define GL_SAMPLER_EXTERNAL_OES 0x8D66 -#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 -#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 -#endif - -/* GL_OES_element_index_uint */ -#ifndef GL_OES_element_index_uint -#define GL_UNSIGNED_INT 0x1405 -#endif - -/* GL_OES_get_program_binary */ -#ifndef GL_OES_get_program_binary -#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE -#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF -#endif - -/* GL_OES_mapbuffer */ -#ifndef GL_OES_mapbuffer -#define GL_WRITE_ONLY_OES 0x88B9 -#define GL_BUFFER_ACCESS_OES 0x88BB -#define GL_BUFFER_MAPPED_OES 0x88BC -#define GL_BUFFER_MAP_POINTER_OES 0x88BD -#endif - -/* GL_OES_packed_depth_stencil */ -#ifndef GL_OES_packed_depth_stencil -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif - -/* GL_OES_required_internalformat */ -#ifndef GL_OES_required_internalformat -#define GL_ALPHA8_OES 0x803C -#define GL_DEPTH_COMPONENT16_OES 0x81A5 -/* reuse GL_DEPTH_COMPONENT24_OES */ -/* reuse GL_DEPTH24_STENCIL8_OES */ -/* reuse GL_DEPTH_COMPONENT32_OES */ -#define GL_LUMINANCE4_ALPHA4_OES 0x8043 -#define GL_LUMINANCE8_ALPHA8_OES 0x8045 -#define GL_LUMINANCE8_OES 0x8040 -#define GL_RGBA4_OES 0x8056 -#define GL_RGB5_A1_OES 0x8057 -#define GL_RGB565_OES 0x8D62 -/* reuse GL_RGB8_OES */ -/* reuse GL_RGBA8_OES */ -/* reuse GL_RGB10_EXT */ -/* reuse GL_RGB10_A2_EXT */ -#endif - -/* GL_OES_rgb8_rgba8 */ -#ifndef GL_OES_rgb8_rgba8 -#define GL_RGB8_OES 0x8051 -#define GL_RGBA8_OES 0x8058 -#endif - -/* GL_OES_standard_derivatives */ -#ifndef GL_OES_standard_derivatives -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B -#endif - -/* GL_OES_stencil1 */ -#ifndef GL_OES_stencil1 -#define GL_STENCIL_INDEX1_OES 0x8D46 -#endif - -/* GL_OES_stencil4 */ -#ifndef GL_OES_stencil4 -#define GL_STENCIL_INDEX4_OES 0x8D47 -#endif - -#ifndef GL_OES_surfaceless_context -#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 -#endif - -/* GL_OES_texture_3D */ -#ifndef GL_OES_texture_3D -#define GL_TEXTURE_WRAP_R_OES 0x8072 -#define GL_TEXTURE_3D_OES 0x806F -#define GL_TEXTURE_BINDING_3D_OES 0x806A -#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 -#define GL_SAMPLER_3D_OES 0x8B5F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 -#endif - -/* GL_OES_texture_float */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_float_linear */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_half_float */ -#ifndef GL_OES_texture_half_float -#define GL_HALF_FLOAT_OES 0x8D61 -#endif - -/* GL_OES_texture_half_float_linear */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_npot */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_vertex_array_object */ -#ifndef GL_OES_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 -#endif - -/* GL_OES_vertex_half_float */ -/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ - -/* GL_OES_vertex_type_10_10_10_2 */ -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 -#define GL_INT_10_10_10_2_OES 0x8DF7 -#endif - -/*------------------------------------------------------------------------* - * KHR extension tokens - *------------------------------------------------------------------------*/ - -#ifndef GL_KHR_debug -typedef void (GL_APIENTRYP GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_QUERY_KHR 0x82E3 -/* PROGRAM_PIPELINE only in GL */ -#define GL_SAMPLER_KHR 0x82E6 -/* DISPLAY_LIST only in GL */ -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -#endif - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif - -/*------------------------------------------------------------------------* - * AMD extension tokens - *------------------------------------------------------------------------*/ - -/* GL_AMD_compressed_3DC_texture */ -#ifndef GL_AMD_compressed_3DC_texture -#define GL_3DC_X_AMD 0x87F9 -#define GL_3DC_XY_AMD 0x87FA -#endif - -/* GL_AMD_compressed_ATC_texture */ -#ifndef GL_AMD_compressed_ATC_texture -#define GL_ATC_RGB_AMD 0x8C92 -#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 -#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE -#endif - -/* GL_AMD_performance_monitor */ -#ifndef GL_AMD_performance_monitor -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#endif - -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_Z400_BINARY_AMD 0x8740 -#endif - -/*------------------------------------------------------------------------* - * ANGLE extension tokens - *------------------------------------------------------------------------*/ - -/* GL_ANGLE_depth_texture */ -#ifndef GL_ANGLE_depth_texture -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_UNSIGNED_INT 0x1405 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif - -/* GL_ANGLE_framebuffer_blit */ -#ifndef GL_ANGLE_framebuffer_blit -#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA -#endif - -/* GL_ANGLE_framebuffer_multisample */ -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 -#define GL_MAX_SAMPLES_ANGLE 0x8D57 -#endif - -/* GL_ANGLE_instanced_arrays */ -#ifndef GL_ANGLE_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE -#endif - -/* GL_ANGLE_pack_reverse_row_order */ -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 -#endif - -/* GL_ANGLE_program_binary */ -#ifndef GL_ANGLE_program_binary -#define GL_PROGRAM_BINARY_ANGLE 0x93A6 -#endif - -/* GL_ANGLE_texture_compression_dxt3 */ -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#endif - -/* GL_ANGLE_texture_compression_dxt5 */ -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 -#endif - -/* GL_ANGLE_texture_usage */ -#ifndef GL_ANGLE_texture_usage -#define GL_TEXTURE_USAGE_ANGLE 0x93A2 -#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 -#endif - -/* GL_ANGLE_translated_shader_source */ -#ifndef GL_ANGLE_translated_shader_source -#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 -#endif - -/*------------------------------------------------------------------------* - * APPLE extension tokens - *------------------------------------------------------------------------*/ - -/* GL_APPLE_copy_texture_levels */ -/* No new tokens introduced by this extension. */ - -/* GL_APPLE_framebuffer_multisample */ -#ifndef GL_APPLE_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 -#define GL_MAX_SAMPLES_APPLE 0x8D57 -#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA -#endif - -/* GL_APPLE_rgb_422 */ -#ifndef GL_APPLE_rgb_422 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -/* GL_APPLE_sync */ -#ifndef GL_APPLE_sync - -#define GL_SYNC_OBJECT_APPLE 0x8A53 -#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 -#define GL_OBJECT_TYPE_APPLE 0x9112 -#define GL_SYNC_CONDITION_APPLE 0x9113 -#define GL_SYNC_STATUS_APPLE 0x9114 -#define GL_SYNC_FLAGS_APPLE 0x9115 -#define GL_SYNC_FENCE_APPLE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 -#define GL_UNSIGNALED_APPLE 0x9118 -#define GL_SIGNALED_APPLE 0x9119 -#define GL_ALREADY_SIGNALED_APPLE 0x911A -#define GL_TIMEOUT_EXPIRED_APPLE 0x911B -#define GL_CONDITION_SATISFIED_APPLE 0x911C -#define GL_WAIT_FAILED_APPLE 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 -#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull -#endif - -/* GL_APPLE_texture_format_BGRA8888 */ -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_APPLE_texture_max_level */ -#ifndef GL_APPLE_texture_max_level -#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D -#endif - -/*------------------------------------------------------------------------* - * ARM extension tokens - *------------------------------------------------------------------------*/ - -/* GL_ARM_mali_program_binary */ -#ifndef GL_ARM_mali_program_binary -#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 -#endif - -/* GL_ARM_mali_shader_binary */ -#ifndef GL_ARM_mali_shader_binary -#define GL_MALI_SHADER_BINARY_ARM 0x8F60 -#endif - -/* GL_ARM_rgba8 */ -/* No new tokens introduced by this extension. */ - -/*------------------------------------------------------------------------* - * EXT extension tokens - *------------------------------------------------------------------------*/ - -/* GL_EXT_blend_minmax */ -#ifndef GL_EXT_blend_minmax -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#endif - -/* GL_EXT_color_buffer_half_float */ -#ifndef GL_EXT_color_buffer_half_float -#define GL_RGBA16F_EXT 0x881A -#define GL_RGB16F_EXT 0x881B -#define GL_RG16F_EXT 0x822F -#define GL_R16F_EXT 0x822D -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 -#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 -#endif - -/* GL_EXT_debug_label */ -#ifndef GL_EXT_debug_label -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#endif - -/* GL_EXT_debug_marker */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_discard_framebuffer */ -#ifndef GL_EXT_discard_framebuffer -#define GL_COLOR_EXT 0x1800 -#define GL_DEPTH_EXT 0x1801 -#define GL_STENCIL_EXT 0x1802 -#endif - -#ifndef GL_EXT_disjoint_timer_query -#define GL_QUERY_COUNTER_BITS_EXT 0x8864 -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_TIMESTAMP_EXT 0x8E28 -#define GL_GPU_DISJOINT_EXT 0x8FBB -#endif - -#ifndef GL_EXT_draw_buffers -#define GL_EXT_draw_buffers 1 -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 -#define GL_DRAW_BUFFER0_EXT 0x8825 -#define GL_DRAW_BUFFER1_EXT 0x8826 -#define GL_DRAW_BUFFER2_EXT 0x8827 -#define GL_DRAW_BUFFER3_EXT 0x8828 -#define GL_DRAW_BUFFER4_EXT 0x8829 -#define GL_DRAW_BUFFER5_EXT 0x882A -#define GL_DRAW_BUFFER6_EXT 0x882B -#define GL_DRAW_BUFFER7_EXT 0x882C -#define GL_DRAW_BUFFER8_EXT 0x882D -#define GL_DRAW_BUFFER9_EXT 0x882E -#define GL_DRAW_BUFFER10_EXT 0x882F -#define GL_DRAW_BUFFER11_EXT 0x8830 -#define GL_DRAW_BUFFER12_EXT 0x8831 -#define GL_DRAW_BUFFER13_EXT 0x8832 -#define GL_DRAW_BUFFER14_EXT 0x8833 -#define GL_DRAW_BUFFER15_EXT 0x8834 -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#endif - -/* GL_EXT_map_buffer_range */ -#ifndef GL_EXT_map_buffer_range -#define GL_MAP_READ_BIT_EXT 0x0001 -#define GL_MAP_WRITE_BIT_EXT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 -#endif - -/* GL_EXT_multisampled_render_to_texture */ -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C -/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */ -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#endif - -/* GL_EXT_multiview_draw_buffers */ -#ifndef GL_EXT_multiview_draw_buffers -#define GL_COLOR_ATTACHMENT_EXT 0x90F0 -#define GL_MULTIVIEW_EXT 0x90F1 -#define GL_DRAW_BUFFER_EXT 0x0C01 -#define GL_READ_BUFFER_EXT 0x0C02 -#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 -#endif - -/* GL_EXT_multi_draw_arrays */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_occlusion_query_boolean */ -#ifndef GL_EXT_occlusion_query_boolean -#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#endif - -/* GL_EXT_read_format_bgra */ -#ifndef GL_EXT_read_format_bgra -#define GL_BGRA_EXT 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 -#endif - -/* GL_EXT_robustness */ -#ifndef GL_EXT_robustness -/* reuse GL_NO_ERROR */ -#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 -#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 -#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 -#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 -#endif - -/* GL_EXT_separate_shader_objects */ -#ifndef GL_EXT_separate_shader_objects -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_ACTIVE_PROGRAM_EXT 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -#endif - -/* GL_EXT_shader_framebuffer_fetch */ -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 -#endif - -/* GL_EXT_shader_texture_lod */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_shadow_samplers */ -#ifndef GL_EXT_shadow_samplers -#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C -#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D -#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E -#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 -#endif - -/* GL_EXT_sRGB */ -#ifndef GL_EXT_sRGB -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 -#endif - -/* GL_EXT_sRGB_write_control */ -#ifndef GL_EXT_sRGB_write_control -#define GL_EXT_sRGB_write_control 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#endif - -/* GL_EXT_texture_compression_dxt1 */ -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#endif - -/* GL_EXT_texture_filter_anisotropic */ -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_EXT_texture_rg */ -#ifndef GL_EXT_texture_rg -#define GL_RED_EXT 0x1903 -#define GL_RG_EXT 0x8227 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#endif - -/* GL_EXT_texture_sRGB_decode */ -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif - -/* GL_EXT_texture_storage */ -#ifndef GL_EXT_texture_storage -#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_ALPHA8_EXT 0x803C -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_RGBA32F_EXT 0x8814 -#define GL_RGB32F_EXT 0x8815 -#define GL_ALPHA32F_EXT 0x8816 -#define GL_LUMINANCE32F_EXT 0x8818 -#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 -/* reuse GL_RGBA16F_EXT */ -/* reuse GL_RGB16F_EXT */ -#define GL_ALPHA16F_EXT 0x881C -#define GL_LUMINANCE16F_EXT 0x881E -#define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGB10_EXT 0x8052 -#define GL_BGRA8_EXT 0x93A1 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#define GL_R32F_EXT 0x822E -#define GL_RG32F_EXT 0x8230 -#define GL_R16F_EXT 0x822D -#define GL_RG16F_EXT 0x822F -#endif - -/* GL_EXT_texture_type_2_10_10_10_REV */ -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 -#endif - -/* GL_EXT_unpack_subimage */ -#ifndef GL_EXT_unpack_subimage -#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 -#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 -#endif - -/*------------------------------------------------------------------------* - * DMP extension tokens - *------------------------------------------------------------------------*/ - -/* GL_DMP_shader_binary */ -#ifndef GL_DMP_shader_binary -#define GL_SHADER_BINARY_DMP 0x9250 -#endif - -/*------------------------------------------------------------------------* - * FJ extension tokens - *------------------------------------------------------------------------*/ - -/* GL_FJ_shader_binary_GCCSO */ -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 -#endif - -/*------------------------------------------------------------------------* - * IMG extension tokens - *------------------------------------------------------------------------*/ - -/* GL_IMG_program_binary */ -#ifndef GL_IMG_program_binary -#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 -#endif - -/* GL_IMG_read_format */ -#ifndef GL_IMG_read_format -#define GL_BGRA_IMG 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 -#endif - -/* GL_IMG_shader_binary */ -#ifndef GL_IMG_shader_binary -#define GL_SGX_BINARY_IMG 0x8C0A -#endif - -/* GL_IMG_texture_compression_pvrtc */ -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 -#endif - -/* GL_IMG_texture_compression_pvrtc2 */ -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 -#endif - -/* GL_IMG_multisampled_render_to_texture */ -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 -#define GL_MAX_SAMPLES_IMG 0x9135 -#define GL_TEXTURE_SAMPLES_IMG 0x9136 -#endif - -/*------------------------------------------------------------------------* - * NV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_NV_coverage_sample */ -#ifndef GL_NV_coverage_sample -#define GL_COVERAGE_COMPONENT_NV 0x8ED0 -#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 -#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 -#define GL_COVERAGE_BUFFERS_NV 0x8ED3 -#define GL_COVERAGE_SAMPLES_NV 0x8ED4 -#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 -#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 -#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 -#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 -#endif - -/* GL_NV_depth_nonlinear */ -#ifndef GL_NV_depth_nonlinear -#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C -#endif - -/* GL_NV_draw_buffers */ -#ifndef GL_NV_draw_buffers -#define GL_MAX_DRAW_BUFFERS_NV 0x8824 -#define GL_DRAW_BUFFER0_NV 0x8825 -#define GL_DRAW_BUFFER1_NV 0x8826 -#define GL_DRAW_BUFFER2_NV 0x8827 -#define GL_DRAW_BUFFER3_NV 0x8828 -#define GL_DRAW_BUFFER4_NV 0x8829 -#define GL_DRAW_BUFFER5_NV 0x882A -#define GL_DRAW_BUFFER6_NV 0x882B -#define GL_DRAW_BUFFER7_NV 0x882C -#define GL_DRAW_BUFFER8_NV 0x882D -#define GL_DRAW_BUFFER9_NV 0x882E -#define GL_DRAW_BUFFER10_NV 0x882F -#define GL_DRAW_BUFFER11_NV 0x8830 -#define GL_DRAW_BUFFER12_NV 0x8831 -#define GL_DRAW_BUFFER13_NV 0x8832 -#define GL_DRAW_BUFFER14_NV 0x8833 -#define GL_DRAW_BUFFER15_NV 0x8834 -#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 -#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 -#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 -#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 -#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 -#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 -#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 -#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 -#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 -#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 -#define GL_COLOR_ATTACHMENT10_NV 0x8CEA -#define GL_COLOR_ATTACHMENT11_NV 0x8CEB -#define GL_COLOR_ATTACHMENT12_NV 0x8CEC -#define GL_COLOR_ATTACHMENT13_NV 0x8CED -#define GL_COLOR_ATTACHMENT14_NV 0x8CEE -#define GL_COLOR_ATTACHMENT15_NV 0x8CEF -#endif - -/* GL_NV_draw_instanced */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_fbo_color_attachments */ -#ifndef GL_NV_fbo_color_attachments -#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF -/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */ -#endif - -/* GL_NV_fence */ -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -/* GL_NV_framebuffer_blit */ -#ifndef GL_NV_framebuffer_blit -#define GL_READ_FRAMEBUFFER_NV 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA -#endif - -/* GL_NV_framebuffer_multisample */ -#ifndef GL_NV_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 -#define GL_MAX_SAMPLES_NV 0x8D57 -#endif - -/* GL_NV_generate_mipmap_sRGB */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_instanced_arrays */ -#ifndef GL_NV_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE -#endif - -/* GL_NV_read_buffer */ -#ifndef GL_NV_read_buffer -#define GL_READ_BUFFER_NV 0x0C02 -#endif - -/* GL_NV_read_buffer_front */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_depth */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_depth_stencil */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_stencil */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_shadow_samplers_array */ -#ifndef GL_NV_shadow_samplers_array -#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 -#endif - -/* GL_NV_shadow_samplers_cube */ -#ifndef GL_NV_shadow_samplers_cube -#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 -#endif - -/* GL_NV_sRGB_formats */ -#ifndef GL_NV_sRGB_formats -#define GL_SLUMINANCE_NV 0x8C46 -#define GL_SLUMINANCE_ALPHA_NV 0x8C44 -#define GL_SRGB8_NV 0x8C41 -#define GL_SLUMINANCE8_NV 0x8C47 -#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F -#define GL_ETC1_SRGB8_NV 0x88EE -#endif - -/* GL_NV_texture_border_clamp */ -#ifndef GL_NV_texture_border_clamp -#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 -#define GL_CLAMP_TO_BORDER_NV 0x812D -#endif - -/* GL_NV_texture_compression_s3tc_update */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_texture_npot_2D_mipmap */ -/* No new tokens introduced by this extension. */ - -/*------------------------------------------------------------------------* - * QCOM extension tokens - *------------------------------------------------------------------------*/ - -/* GL_QCOM_alpha_test */ -#ifndef GL_QCOM_alpha_test -#define GL_ALPHA_TEST_QCOM 0x0BC0 -#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 -#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 -#endif - -/* GL_QCOM_binning_control */ -#ifndef GL_QCOM_binning_control -#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 -#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 -#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 -#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 -#endif - -/* GL_QCOM_driver_control */ -/* No new tokens introduced by this extension. */ - -/* GL_QCOM_extended_get */ -#ifndef GL_QCOM_extended_get -#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 -#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 -#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 -#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 -#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 -#define GL_TEXTURE_TYPE_QCOM 0x8BD7 -#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 -#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 -#define GL_TEXTURE_TARGET_QCOM 0x8BDA -#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB -#define GL_STATE_RESTORE 0x8BDC -#endif - -/* GL_QCOM_extended_get2 */ -/* No new tokens introduced by this extension. */ - -/* GL_QCOM_perfmon_global_mode */ -#ifndef GL_QCOM_perfmon_global_mode -#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 -#endif - -/* GL_QCOM_writeonly_rendering */ -#ifndef GL_QCOM_writeonly_rendering -#define GL_WRITEONLY_RENDERING_QCOM 0x8823 -#endif - -/* GL_QCOM_tiled_rendering */ -#ifndef GL_QCOM_tiled_rendering -#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 -#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 -#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 -#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 -#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 -#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 -#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 -#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 -#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 -#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 -#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 -#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 -#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 -#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 -#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 -#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 -#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 -#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 -#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 -#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 -#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 -#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 -#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 -#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 -#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 -#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 -#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 -#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 -#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 -#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 -#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 -#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 -#endif - -/*------------------------------------------------------------------------* - * VIV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_VIV_shader_binary */ -#ifndef GL_VIV_shader_binary -#define GL_SHADER_BINARY_VIV 0x8FC4 -#endif - -/*------------------------------------------------------------------------* - * End of extension tokens, start of corresponding extension functions - *------------------------------------------------------------------------*/ - -/*------------------------------------------------------------------------* - * OES extension functions - *------------------------------------------------------------------------*/ - -/* GL_OES_compressed_ETC1_RGB8_texture */ -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_OES_compressed_ETC1_RGB8_texture 1 -#endif - -/* GL_OES_compressed_paletted_texture */ -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#endif - -/* GL_OES_depth24 */ -#ifndef GL_OES_depth24 -#define GL_OES_depth24 1 -#endif - -/* GL_OES_depth32 */ -#ifndef GL_OES_depth32 -#define GL_OES_depth32 1 -#endif - -/* GL_OES_depth_texture */ -#ifndef GL_OES_depth_texture -#define GL_OES_depth_texture 1 -#endif - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - -/* GL_OES_EGL_image_external */ -#ifndef GL_OES_EGL_image_external -#define GL_OES_EGL_image_external 1 -/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ -#endif - -/* GL_OES_element_index_uint */ -#ifndef GL_OES_element_index_uint -#define GL_OES_element_index_uint 1 -#endif - -/* GL_OES_fbo_render_mipmap */ -#ifndef GL_OES_fbo_render_mipmap -#define GL_OES_fbo_render_mipmap 1 -#endif - -/* GL_OES_fragment_precision_high */ -#ifndef GL_OES_fragment_precision_high -#define GL_OES_fragment_precision_high 1 -#endif - -/* GL_OES_get_program_binary */ -#ifndef GL_OES_get_program_binary -#define GL_OES_get_program_binary 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); -#endif -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); -#endif - -/* GL_OES_mapbuffer */ -#ifndef GL_OES_mapbuffer -#define GL_OES_mapbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); -GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid **params); -#endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid **params); -#endif - -/* GL_OES_packed_depth_stencil */ -#ifndef GL_OES_packed_depth_stencil -#define GL_OES_packed_depth_stencil 1 -#endif - -/* GL_OES_required_internalformat */ -#ifndef GL_OES_required_internalformat -#define GL_OES_required_internalformat 1 -#endif - -/* GL_OES_rgb8_rgba8 */ -#ifndef GL_OES_rgb8_rgba8 -#define GL_OES_rgb8_rgba8 1 -#endif - -/* GL_OES_standard_derivatives */ -#ifndef GL_OES_standard_derivatives -#define GL_OES_standard_derivatives 1 -#endif - -/* GL_OES_stencil1 */ -#ifndef GL_OES_stencil1 -#define GL_OES_stencil1 1 -#endif - -/* GL_OES_stencil4 */ -#ifndef GL_OES_stencil4 -#define GL_OES_stencil4 1 -#endif - -#ifndef GL_OES_surfaceless_context -#define GL_OES_surfaceless_context 1 -#endif - -/* GL_OES_texture_3D */ -#ifndef GL_OES_texture_3D -#define GL_OES_texture_3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif - -/* GL_OES_texture_float */ -#ifndef GL_OES_texture_float -#define GL_OES_texture_float 1 -#endif - -/* GL_OES_texture_float_linear */ -#ifndef GL_OES_texture_float_linear -#define GL_OES_texture_float_linear 1 -#endif - -/* GL_OES_texture_half_float */ -#ifndef GL_OES_texture_half_float -#define GL_OES_texture_half_float 1 -#endif - -/* GL_OES_texture_half_float_linear */ -#ifndef GL_OES_texture_half_float_linear -#define GL_OES_texture_half_float_linear 1 -#endif - -/* GL_OES_texture_npot */ -#ifndef GL_OES_texture_npot -#define GL_OES_texture_npot 1 -#endif - -/* GL_OES_vertex_array_object */ -#ifndef GL_OES_vertex_array_object -#define GL_OES_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); -GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); -GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); -#endif -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); -#endif - -/* GL_OES_vertex_half_float */ -#ifndef GL_OES_vertex_half_float -#define GL_OES_vertex_half_float 1 -#endif - -/* GL_OES_vertex_type_10_10_10_2 */ -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_OES_vertex_type_10_10_10_2 1 -#endif - -/*------------------------------------------------------------------------* - * KHR extension functions - *------------------------------------------------------------------------*/ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); -GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, GLvoid **params); -#endif -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, GLvoid **params); -#endif - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif - - -/*------------------------------------------------------------------------* - * AMD extension functions - *------------------------------------------------------------------------*/ - -/* GL_AMD_compressed_3DC_texture */ -#ifndef GL_AMD_compressed_3DC_texture -#define GL_AMD_compressed_3DC_texture 1 -#endif - -/* GL_AMD_compressed_ATC_texture */ -#ifndef GL_AMD_compressed_ATC_texture -#define GL_AMD_compressed_ATC_texture 1 -#endif - -/* AMD_performance_monitor */ -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); -GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); -typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif - -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_AMD_program_binary_Z400 1 -#endif - -/*------------------------------------------------------------------------* - * ANGLE extension functions - *------------------------------------------------------------------------*/ - -/* GL_ANGLE_depth_texture */ -#ifndef GL_ANGLE_depth_texture -#define GL_ANGLE_depth_texture 1 -#endif - -/* GL_ANGLE_framebuffer_blit */ -#ifndef GL_ANGLE_framebuffer_blit -#define GL_ANGLE_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -/* GL_ANGLE_framebuffer_multisample */ -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_ANGLE_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_ANGLE_instanced_arrays -#define GL_ANGLE_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); -#endif - -/* GL_ANGLE_pack_reverse_row_order */ -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_ANGLE_pack_reverse_row_order 1 -#endif - -/* GL_ANGLE_program_binary */ -#ifndef GL_ANGLE_program_binary -#define GL_ANGLE_program_binary 1 -#endif - -/* GL_ANGLE_texture_compression_dxt3 */ -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_ANGLE_texture_compression_dxt3 1 -#endif - -/* GL_ANGLE_texture_compression_dxt5 */ -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_ANGLE_texture_compression_dxt5 1 -#endif - -/* GL_ANGLE_texture_usage */ -#ifndef GL_ANGLE_texture_usage -#define GL_ANGLE_texture_usage 1 -#endif - -#ifndef GL_ANGLE_translated_shader_source -#define GL_ANGLE_translated_shader_source 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -#endif -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -#endif - -/*------------------------------------------------------------------------* - * APPLE extension functions - *------------------------------------------------------------------------*/ - -/* GL_APPLE_copy_texture_levels */ -#ifndef GL_APPLE_copy_texture_levels -#define GL_APPLE_copy_texture_levels 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif - -/* GL_APPLE_framebuffer_multisample */ -#ifndef GL_APPLE_framebuffer_multisample -#define GL_APPLE_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); -#endif - -/* GL_APPLE_rgb_422 */ -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#endif - -/* GL_APPLE_sync */ -#ifndef GL_APPLE_sync -#define GL_APPLE_sync 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); -GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); -GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); -GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif -typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); -typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); -typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif - -/* GL_APPLE_texture_format_BGRA8888 */ -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_APPLE_texture_format_BGRA8888 1 -#endif - -/* GL_APPLE_texture_max_level */ -#ifndef GL_APPLE_texture_max_level -#define GL_APPLE_texture_max_level 1 -#endif - -/*------------------------------------------------------------------------* - * ARM extension functions - *------------------------------------------------------------------------*/ - -/* GL_ARM_mali_program_binary */ -#ifndef GL_ARM_mali_program_binary -#define GL_ARM_mali_program_binary 1 -#endif - -/* GL_ARM_mali_shader_binary */ -#ifndef GL_ARM_mali_shader_binary -#define GL_ARM_mali_shader_binary 1 -#endif - -/* GL_ARM_rgba8 */ -#ifndef GL_ARM_rgba8 -#define GL_ARM_rgba8 1 -#endif - -/*------------------------------------------------------------------------* - * EXT extension functions - *------------------------------------------------------------------------*/ - -/* GL_EXT_blend_minmax */ -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#endif - -/* GL_EXT_color_buffer_half_float */ -#ifndef GL_EXT_color_buffer_half_float -#define GL_EXT_color_buffer_half_float 1 -#endif - -/* GL_EXT_debug_label */ -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif - -/* GL_EXT_debug_marker */ -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); -#endif -typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#endif - -/* GL_EXT_discard_framebuffer */ -#ifndef GL_EXT_discard_framebuffer -#define GL_EXT_discard_framebuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif -typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif - -#ifndef GL_EXT_disjoint_timer_query -#define GL_EXT_disjoint_timer_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); -GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); -GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); -GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); -GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -#endif -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -#endif /* GL_EXT_disjoint_timer_query */ - -#ifndef GL_EXT_draw_buffers -#define GL_EXT_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); -#endif /* GL_EXT_draw_buffers */ - -/* GL_EXT_map_buffer_range */ -#ifndef GL_EXT_map_buffer_range -#define GL_EXT_map_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); -#endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#endif - -/* GL_EXT_multisampled_render_to_texture */ -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_EXT_multisampled_render_to_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif - -/* GL_EXT_multiview_draw_buffers */ -#ifndef GL_EXT_multiview_draw_buffers -#define GL_EXT_multiview_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); -GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); -GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); -#endif -typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); -typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); -#endif - -/* GL_EXT_occlusion_query_boolean */ -#ifndef GL_EXT_occlusion_query_boolean -#define GL_EXT_occlusion_query_boolean 1 -/* All entry points also exist in GL_EXT_disjoint_timer_query */ -#endif - -/* GL_EXT_read_format_bgra */ -#ifndef GL_EXT_read_format_bgra -#define GL_EXT_read_format_bgra 1 -#endif - -/* GL_EXT_robustness */ -#ifndef GL_EXT_robustness -#define GL_EXT_robustness 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); -GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif - -/* GL_EXT_separate_shader_objects */ -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); -GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); -GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); -GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x); -GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif - -/* GL_EXT_shader_framebuffer_fetch */ -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_EXT_shader_framebuffer_fetch 1 -#endif - -/* GL_EXT_shader_texture_lod */ -#ifndef GL_EXT_shader_texture_lod -#define GL_EXT_shader_texture_lod 1 -#endif - -/* GL_EXT_shadow_samplers */ -#ifndef GL_EXT_shadow_samplers -#define GL_EXT_shadow_samplers 1 -#endif - -/* GL_EXT_sRGB */ -#ifndef GL_EXT_sRGB -#define GL_EXT_sRGB 1 -#endif - -/* GL_EXT_texture_compression_dxt1 */ -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 -#endif - -/* GL_EXT_texture_filter_anisotropic */ -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_EXT_texture_format_BGRA8888 1 -#endif - -/* GL_EXT_texture_rg */ -#ifndef GL_EXT_texture_rg -#define GL_EXT_texture_rg 1 -#endif - -/* GL_EXT_texture_storage */ -#ifndef GL_EXT_texture_storage -#define GL_EXT_texture_storage 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif - -/* GL_EXT_texture_type_2_10_10_10_REV */ -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_EXT_texture_type_2_10_10_10_REV 1 -#endif - -/* GL_EXT_unpack_subimage */ -#ifndef GL_EXT_unpack_subimage -#define GL_EXT_unpack_subimage 1 -#endif - -/*------------------------------------------------------------------------* - * DMP extension functions - *------------------------------------------------------------------------*/ - -/* GL_DMP_shader_binary */ -#ifndef GL_DMP_shader_binary -#define GL_DMP_shader_binary 1 -#endif - -/*------------------------------------------------------------------------* - * FJ extension functions - *------------------------------------------------------------------------*/ - -/* GL_FJ_shader_binary_GCCSO */ -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_FJ_shader_binary_GCCSO 1 -#endif - -/*------------------------------------------------------------------------* - * IMG extension functions - *------------------------------------------------------------------------*/ - -/* GL_IMG_program_binary */ -#ifndef GL_IMG_program_binary -#define GL_IMG_program_binary 1 -#endif - -/* GL_IMG_read_format */ -#ifndef GL_IMG_read_format -#define GL_IMG_read_format 1 -#endif - -/* GL_IMG_shader_binary */ -#ifndef GL_IMG_shader_binary -#define GL_IMG_shader_binary 1 -#endif - -/* GL_IMG_texture_compression_pvrtc */ -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_IMG_texture_compression_pvrtc 1 -#endif - -/* GL_IMG_texture_compression_pvrtc2 */ -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_IMG_texture_compression_pvrtc2 1 -#endif - -/* GL_IMG_multisampled_render_to_texture */ -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_IMG_multisampled_render_to_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif - -/*------------------------------------------------------------------------* - * NV extension functions - *------------------------------------------------------------------------*/ - -/* GL_NV_coverage_sample */ -#ifndef GL_NV_coverage_sample -#define GL_NV_coverage_sample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); -GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); -#endif -typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); -typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); -#endif - -/* GL_NV_depth_nonlinear */ -#ifndef GL_NV_depth_nonlinear -#define GL_NV_depth_nonlinear 1 -#endif - -/* GL_NV_draw_buffers */ -#ifndef GL_NV_draw_buffers -#define GL_NV_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); -#endif - -/* GL_NV_draw_instanced */ -#ifndef GL_NV_draw_instanced -#define GL_NV_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -/* GL_NV_fbo_color_attachments */ -#ifndef GL_NV_fbo_color_attachments -#define GL_NV_fbo_color_attachments 1 -#endif - -/* GL_NV_fence */ -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); -GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -/* GL_NV_framebuffer_blit */ -#ifndef GL_NV_framebuffer_blit -#define GL_NV_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -/* GL_NV_framebuffer_multisample */ -#ifndef GL_NV_framebuffer_multisample -#define GL_NV_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -/* GL_NV_generate_mipmap_sRGB */ -#ifndef GL_NV_generate_mipmap_sRGB -#define GL_NV_generate_mipmap_sRGB 1 -#endif - -/* GL_NV_instanced_arrays */ -#ifndef GL_NV_instanced_arrays -#define GL_NV_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); -#endif -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); -#endif - -/* GL_NV_read_buffer */ -#ifndef GL_NV_read_buffer -#define GL_NV_read_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); -#endif -typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); -#endif - -/* GL_NV_read_buffer_front */ -#ifndef GL_NV_read_buffer_front -#define GL_NV_read_buffer_front 1 -#endif - -/* GL_NV_read_depth */ -#ifndef GL_NV_read_depth -#define GL_NV_read_depth 1 -#endif - -/* GL_NV_read_depth_stencil */ -#ifndef GL_NV_read_depth_stencil -#define GL_NV_read_depth_stencil 1 -#endif - -/* GL_NV_read_stencil */ -#ifndef GL_NV_read_stencil -#define GL_NV_read_stencil 1 -#endif - -/* GL_NV_shadow_samplers_array */ -#ifndef GL_NV_shadow_samplers_array -#define GL_NV_shadow_samplers_array 1 -#endif - -/* GL_NV_shadow_samplers_cube */ -#ifndef GL_NV_shadow_samplers_cube -#define GL_NV_shadow_samplers_cube 1 -#endif - -/* GL_NV_sRGB_formats */ -#ifndef GL_NV_sRGB_formats -#define GL_NV_sRGB_formats 1 -#endif - -/* GL_NV_texture_border_clamp */ -#ifndef GL_NV_texture_border_clamp -#define GL_NV_texture_border_clamp 1 -#endif - -/* GL_NV_texture_compression_s3tc_update */ -#ifndef GL_NV_texture_compression_s3tc_update -#define GL_NV_texture_compression_s3tc_update 1 -#endif - -/* GL_NV_texture_npot_2D_mipmap */ -#ifndef GL_NV_texture_npot_2D_mipmap -#define GL_NV_texture_npot_2D_mipmap 1 -#endif - -/*------------------------------------------------------------------------* - * QCOM extension functions - *------------------------------------------------------------------------*/ - -/* GL_QCOM_alpha_test */ -#ifndef GL_QCOM_alpha_test -#define GL_QCOM_alpha_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); -#endif -typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); -#endif - -/* GL_QCOM_binning_control */ -#ifndef GL_QCOM_binning_control -#define GL_QCOM_binning_control 1 -#endif - -/* GL_QCOM_driver_control */ -#ifndef GL_QCOM_driver_control -#define GL_QCOM_driver_control 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); -GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); -GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); -#endif -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -#endif - -/* GL_QCOM_extended_get */ -#ifndef GL_QCOM_extended_get -#define GL_QCOM_extended_get 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); -GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); -GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); -#endif -typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); -#endif - -/* GL_QCOM_extended_get2 */ -#ifndef GL_QCOM_extended_get2 -#define GL_QCOM_extended_get2 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); -GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); -GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif -typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif - -/* GL_QCOM_perfmon_global_mode */ -#ifndef GL_QCOM_perfmon_global_mode -#define GL_QCOM_perfmon_global_mode 1 -#endif - -/* GL_QCOM_writeonly_rendering */ -#ifndef GL_QCOM_writeonly_rendering -#define GL_QCOM_writeonly_rendering 1 -#endif - -/* GL_QCOM_tiled_rendering */ -#ifndef GL_QCOM_tiled_rendering -#define GL_QCOM_tiled_rendering 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); -#endif -typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); -#endif - -/*------------------------------------------------------------------------* - * VIV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_VIV_shader_binary */ -#ifndef GL_VIV_shader_binary -#define GL_VIV_shader_binary 1 -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __gl2ext_h_ */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2platform.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2platform.h deleted file mode 100644 index c325686..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_gl2platform.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __gl2platform_h_ -#define __gl2platform_h_ - -/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h - * - * Adopters may modify khrplatform.h and this file to suit their platform. - * You are encouraged to submit all modifications to the Khronos group so that - * they can be included in future versions of this file. Please submit changes - * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) - * by filing a bug against product "OpenGL-ES" component "Registry". - */ - -/*#include */ - -#ifndef GL_APICALL -#define GL_APICALL KHRONOS_APICALL -#endif - -#ifndef GL_APIENTRY -#define GL_APIENTRY KHRONOS_APIENTRY -#endif - -#endif /* __gl2platform_h_ */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_khrplatform.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_khrplatform.h deleted file mode 100644 index c9e6f17..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_opengles2_khrplatform.h +++ /dev/null @@ -1,282 +0,0 @@ -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by sending them to the public Khronos Bugzilla - * (http://khronos.org/bugzilla) by filing a bug against product - * "Khronos (general)" component "Registry". - * - * A predefined template which fills in some of the bug fields can be - * reached using http://tinyurl.com/khrplatform-h-bugreport, but you - * must create a Bugzilla login first. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_APIENTRY - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIENTRY - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_pixels.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_pixels.h deleted file mode 100644 index 8499c32..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_pixels.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_pixels.h - * - * Header for the enumerated pixel format definitions. - */ - -#ifndef _SDL_pixels_h -#define _SDL_pixels_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Transparency definitions - * - * These define alpha as the opacity of a surface. - */ -/* @{ */ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/* @} */ - -/** Pixel type. */ -enum -{ - SDL_PIXELTYPE_UNKNOWN, - SDL_PIXELTYPE_INDEX1, - SDL_PIXELTYPE_INDEX4, - SDL_PIXELTYPE_INDEX8, - SDL_PIXELTYPE_PACKED8, - SDL_PIXELTYPE_PACKED16, - SDL_PIXELTYPE_PACKED32, - SDL_PIXELTYPE_ARRAYU8, - SDL_PIXELTYPE_ARRAYU16, - SDL_PIXELTYPE_ARRAYU32, - SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32 -}; - -/** Bitmap pixel order, high bit -> low bit. */ -enum -{ - SDL_BITMAPORDER_NONE, - SDL_BITMAPORDER_4321, - SDL_BITMAPORDER_1234 -}; - -/** Packed component order, high bit -> low bit. */ -enum -{ - SDL_PACKEDORDER_NONE, - SDL_PACKEDORDER_XRGB, - SDL_PACKEDORDER_RGBX, - SDL_PACKEDORDER_ARGB, - SDL_PACKEDORDER_RGBA, - SDL_PACKEDORDER_XBGR, - SDL_PACKEDORDER_BGRX, - SDL_PACKEDORDER_ABGR, - SDL_PACKEDORDER_BGRA -}; - -/** Array component order, low byte -> high byte. */ -/* !!! FIXME: in 2.1, make these not overlap differently with - !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ -enum -{ - SDL_ARRAYORDER_NONE, - SDL_ARRAYORDER_RGB, - SDL_ARRAYORDER_RGBA, - SDL_ARRAYORDER_ARGB, - SDL_ARRAYORDER_BGR, - SDL_ARRAYORDER_BGRA, - SDL_ARRAYORDER_ABGR -}; - -/** Packed component layout. */ -enum -{ - SDL_PACKEDLAYOUT_NONE, - SDL_PACKEDLAYOUT_332, - SDL_PACKEDLAYOUT_4444, - SDL_PACKEDLAYOUT_1555, - SDL_PACKEDLAYOUT_5551, - SDL_PACKEDLAYOUT_565, - SDL_PACKEDLAYOUT_8888, - SDL_PACKEDLAYOUT_2101010, - SDL_PACKEDLAYOUT_1010102 -}; - -#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) - -#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ - ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ - ((bits) << 8) | ((bytes) << 0)) - -#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) -#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) -#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) -#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) -#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) -#define SDL_BYTESPERPIXEL(X) \ - (SDL_ISPIXELFORMAT_FOURCC(X) ? \ - ((((X) == SDL_PIXELFORMAT_YUY2) || \ - ((X) == SDL_PIXELFORMAT_UYVY) || \ - ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) - -#define SDL_ISPIXELFORMAT_INDEXED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) - -#define SDL_ISPIXELFORMAT_PACKED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) - -#define SDL_ISPIXELFORMAT_ARRAY(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) - -#define SDL_ISPIXELFORMAT_ALPHA(format) \ - ((SDL_ISPIXELFORMAT_PACKED(format) && \ - ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ - (SDL_ISPIXELFORMAT_ARRAY(format) && \ - ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) - -/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ -#define SDL_ISPIXELFORMAT_FOURCC(format) \ - ((format) && (SDL_PIXELFLAG(format) != 1)) - -/* Note: If you modify this list, update SDL_GetPixelFormatName() */ -enum -{ - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX1MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX4LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX4MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX8 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), - SDL_PIXELFORMAT_RGB332 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_RGB444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_RGB555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_BGR555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_ARGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_RGBA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ABGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_BGRA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ARGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_RGBA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_ABGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_BGRA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_RGB565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_BGR565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_RGB24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, - 24, 3), - SDL_PIXELFORMAT_BGR24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, - 24, 3), - SDL_PIXELFORMAT_RGB888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_RGBX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGR888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGRX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_ARGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_RGBA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ABGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_BGRA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ARGB2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_2101010, 32, 4), - - SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), - SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ - SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), - SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), - SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), - SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), - SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), - SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1') -}; - -typedef struct SDL_Color -{ - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette -{ - int ncolors; - SDL_Color *colors; - Uint32 version; - int refcount; -} SDL_Palette; - -/** - * \note Everything in the pixel format structure is read-only. - */ -typedef struct SDL_PixelFormat -{ - Uint32 format; - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 padding[2]; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - int refcount; - struct SDL_PixelFormat *next; -} SDL_PixelFormat; - -/** - * \brief Get the human readable name of a pixel format - */ -extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); - -/** - * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. - * - * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. - * - * \sa SDL_MasksToPixelFormatEnum() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, - int *bpp, - Uint32 * Rmask, - Uint32 * Gmask, - Uint32 * Bmask, - Uint32 * Amask); - -/** - * \brief Convert a bpp and RGBA masks to an enumerated pixel format. - * - * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion - * wasn't possible. - * - * \sa SDL_PixelFormatEnumToMasks() - */ -extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); - -/** - * \brief Create an SDL_PixelFormat structure from a pixel format enum. - */ -extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); - -/** - * \brief Free an SDL_PixelFormat structure. - */ -extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); - -/** - * \brief Create a palette structure with the specified number of color - * entries. - * - * \return A new palette, or NULL if there wasn't enough memory. - * - * \note The palette entries are initialized to white. - * - * \sa SDL_FreePalette() - */ -extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); - -/** - * \brief Set the palette for a pixel format structure. - */ -extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, - SDL_Palette *palette); - -/** - * \brief Set a range of colors in a palette. - * - * \param palette The palette to modify. - * \param colors An array of colors to copy into the palette. - * \param firstcolor The index of the first palette entry to modify. - * \param ncolors The number of entries to modify. - * - * \return 0 on success, or -1 if not all of the colors could be set. - */ -extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, - const SDL_Color * colors, - int firstcolor, int ncolors); - -/** - * \brief Free a palette created with SDL_AllocPalette(). - * - * \sa SDL_AllocPalette() - */ -extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); - -/** - * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. - * - * \sa SDL_MapRGBA - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b); - -/** - * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. - * - * \sa SDL_MapRGB - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \brief Get the RGB components from a pixel of the specified format. - * - * \sa SDL_GetRGBA - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b); - -/** - * \brief Get the RGBA components from a pixel of the specified format. - * - * \sa SDL_GetRGB - */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \brief Calculate a 256 entry gamma ramp for a gamma value. - */ -extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_pixels_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_platform.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_platform.h deleted file mode 100644 index c6c2139..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_platform.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_platform.h - * - * Try to get a standard set of platform defines. - */ - -#ifndef _SDL_platform_h -#define _SDL_platform_h - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if (defined(linux) || defined(__linux) || defined(__linux__)) -#undef __LINUX__ -#define __LINUX__ 1 -#endif -#if defined(ANDROID) || defined(__ANDROID__) -#undef __ANDROID__ -#undef __LINUX__ /* do we need to do this? */ -#define __ANDROID__ 1 -#endif - -#if defined(__APPLE__) -/* lets us know what version of Mac OS X we're compiling on */ -#include "AvailabilityMacros.h" -#include "TargetConditionals.h" -#if TARGET_OS_IPHONE -/* if compiling for iPhone */ -#undef __IPHONEOS__ -#define __IPHONEOS__ 1 -#undef __MACOSX__ -#else -/* if not compiling for iPhone */ -#undef __MACOSX__ -#define __MACOSX__ 1 -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 -# error SDL for Mac OS X only supports deploying on 10.5 and above. -#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ -#endif /* TARGET_OS_IPHONE */ -#endif /* defined(__APPLE__) */ - -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__sun) && defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif - -#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) -/* Try to find out if we're compiling for WinRT or non-WinRT */ -/* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */ -#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ -#include -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -#undef __WINDOWS__ -#define __WINDOWS__ 1 -/* See if we're compiling for WinRT: */ -#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) -#undef __WINRT__ -#define __WINRT__ 1 -#endif -#else -#undef __WINDOWS__ -#define __WINDOWS__ 1 -#endif /* _MSC_VER < 1700 */ -#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ - -#if defined(__WINDOWS__) -#undef __WIN32__ -#define __WIN32__ 1 -#endif -#if defined(__PSP__) -#undef __PSP__ -#define __PSP__ 1 -#endif - -/* The NACL compiler defines __native_client__ and __pnacl__ - * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi - */ -#if defined(__native_client__) -#undef __LINUX__ -#undef __NACL__ -#define __NACL__ 1 -#endif -#if defined(__pnacl__) -#undef __LINUX__ -#undef __PNACL__ -#define __PNACL__ 1 -/* PNACL with newlib supports static linking only */ -#define __SDL_NOGETPROCADDR__ -#endif - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Gets the name of the platform. - */ -extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_platform_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_power.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_power.h deleted file mode 100644 index 24c0501..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_power.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_power_h -#define _SDL_power_h - -/** - * \file SDL_power.h - * - * Header for the SDL power management routines. - */ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The basic state for the system's power supply. - */ -typedef enum -{ - SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ - SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ - SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ - SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ - SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ -} SDL_PowerState; - - -/** - * \brief Get the current power supply details. - * - * \param secs Seconds of battery life left. You can pass a NULL here if - * you don't care. Will return -1 if we can't determine a - * value, or we're not running on a battery. - * - * \param pct Percentage of battery life left, between 0 and 100. You can - * pass a NULL here if you don't care. Will return -1 if we - * can't determine a value, or we're not running on a battery. - * - * \return The state of the battery (if any). - */ -extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_power_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_quit.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_quit.h deleted file mode 100644 index cc06f28..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_quit.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_quit.h - * - * Include file for SDL quit event handling. - */ - -#ifndef _SDL_quit_h -#define _SDL_quit_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/** - * \file SDL_quit.h - * - * An ::SDL_QUIT event is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate ::SDL_QUIT events as well. There is no way - * to determine the cause of an ::SDL_QUIT event, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - * - * \sa SDL_Quit() - */ - -/* There are no functions directly affecting the quit event */ - -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) - -#endif /* _SDL_quit_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_rect.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_rect.h deleted file mode 100644 index bbcb9a3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_rect.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_rect.h - * - * Header file for SDL_rect definition and management functions. - */ - -#ifndef _SDL_rect_h -#define _SDL_rect_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_pixels.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a point - * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect - */ -typedef struct SDL_Point -{ - int x; - int y; -} SDL_Point; - -/** - * \brief A rectangle, with the origin at the upper left. - * - * \sa SDL_RectEmpty - * \sa SDL_RectEquals - * \sa SDL_HasIntersection - * \sa SDL_IntersectRect - * \sa SDL_UnionRect - * \sa SDL_EnclosePoints - */ -typedef struct SDL_Rect -{ - int x, y; - int w, h; -} SDL_Rect; - -/** - * \brief Returns true if point resides inside a rectangle. - */ -SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) -{ - return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && - (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Returns true if the rectangle has no area. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) -{ - return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Returns true if the two rectangles are equal. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) -{ - return (a && b && (a->x == b->x) && (a->y == b->y) && - (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Determine whether two rectangles intersect. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, - const SDL_Rect * B); - -/** - * \brief Calculate the intersection of two rectangles. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * \brief Calculate the union of two rectangles. - */ -extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * \brief Calculate a minimal rectangle enclosing a set of points - * - * \return SDL_TRUE if any points were within the clipping rect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, - int count, - const SDL_Rect * clip, - SDL_Rect * result); - -/** - * \brief Calculate the intersection of a rectangle and line segment. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * - rect, int *X1, - int *Y1, int *X2, - int *Y2); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_rect_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_render.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_render.h deleted file mode 100644 index e4ed2af..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_render.h +++ /dev/null @@ -1,880 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_render.h - * - * Header file for SDL 2D rendering functions. - * - * This API supports the following features: - * * single pixel points - * * single pixel lines - * * filled rectangles - * * texture images - * - * The primitives may be drawn in opaque, blended, or additive modes. - * - * The texture images may be drawn in opaque, blended, or additive modes. - * They can have an additional color tint or alpha modulation applied to - * them, and may also be stretched with linear interpolation. - * - * This API is designed to accelerate simple 2D operations. You may - * want more functionality such as polygons and particle effects and - * in that case you should use SDL's OpenGL/Direct3D support or one - * of the many good 3D engines. - * - * These functions must be called from the main thread. - * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 - */ - -#ifndef _SDL_render_h -#define _SDL_render_h - -#include "SDL_stdinc.h" -#include "SDL_rect.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Flags used when creating a rendering context - */ -typedef enum -{ - SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ - SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware - acceleration */ - SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized - with the refresh rate */ - SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports - rendering to texture */ -} SDL_RendererFlags; - -/** - * \brief Information on the capabilities of a render driver or context. - */ -typedef struct SDL_RendererInfo -{ - const char *name; /**< The name of the renderer */ - Uint32 flags; /**< Supported ::SDL_RendererFlags */ - Uint32 num_texture_formats; /**< The number of available texture formats */ - Uint32 texture_formats[16]; /**< The available texture formats */ - int max_texture_width; /**< The maximum texture width */ - int max_texture_height; /**< The maximum texture height */ -} SDL_RendererInfo; - -/** - * \brief The access pattern allowed for a texture. - */ -typedef enum -{ - SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ - SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ - SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ -} SDL_TextureAccess; - -/** - * \brief The texture channel modulation used in SDL_RenderCopy(). - */ -typedef enum -{ - SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ - SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ - SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ -} SDL_TextureModulate; - -/** - * \brief Flip constants for SDL_RenderCopyEx - */ -typedef enum -{ - SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ - SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ - SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ -} SDL_RendererFlip; - -/** - * \brief A structure representing rendering state - */ -struct SDL_Renderer; -typedef struct SDL_Renderer SDL_Renderer; - -/** - * \brief An efficient driver-specific representation of pixel data - */ -struct SDL_Texture; -typedef struct SDL_Texture SDL_Texture; - - -/* Function prototypes */ - -/** - * \brief Get the number of 2D rendering drivers available for the current - * display. - * - * A render driver is a set of code that handles rendering and texture - * management on a particular display. Normally there is only one, but - * some drivers may have several available with different capabilities. - * - * \sa SDL_GetRenderDriverInfo() - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); - -/** - * \brief Get information about a specific 2D rendering driver for the current - * display. - * - * \param index The index of the driver to query information about. - * \param info A pointer to an SDL_RendererInfo struct to be filled with - * information on the rendering driver. - * - * \return 0 on success, -1 if the index was out of range. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, - SDL_RendererInfo * info); - -/** - * \brief Create a window and default renderer - * - * \param width The width of the window - * \param height The height of the window - * \param window_flags The flags used to create the window - * \param window A pointer filled with the window, or NULL on error - * \param renderer A pointer filled with the renderer, or NULL on error - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( - int width, int height, Uint32 window_flags, - SDL_Window **window, SDL_Renderer **renderer); - - -/** - * \brief Create a 2D rendering context for a window. - * - * \param window The window where rendering is displayed. - * \param index The index of the rendering driver to initialize, or -1 to - * initialize the first one supporting the requested flags. - * \param flags ::SDL_RendererFlags. - * - * \return A valid rendering context or NULL if there was an error. - * - * \sa SDL_CreateSoftwareRenderer() - * \sa SDL_GetRendererInfo() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, - int index, Uint32 flags); - -/** - * \brief Create a 2D software rendering context for a surface. - * - * \param surface The surface where rendering is done. - * - * \return A valid rendering context or NULL if there was an error. - * - * \sa SDL_CreateRenderer() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); - -/** - * \brief Get the renderer associated with a window. - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); - -/** - * \brief Get information about a rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, - SDL_RendererInfo * info); - -/** - * \brief Get the output size in pixels of a rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, - int *w, int *h); - -/** - * \brief Create a texture for a rendering context. - * - * \param renderer The renderer. - * \param format The format of the texture. - * \param access One of the enumerated values in ::SDL_TextureAccess. - * \param w The width of the texture in pixels. - * \param h The height of the texture in pixels. - * - * \return The created texture is returned, or NULL if no rendering context was - * active, the format was unsupported, or the width or height were out - * of range. - * - * \sa SDL_QueryTexture() - * \sa SDL_UpdateTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, - Uint32 format, - int access, int w, - int h); - -/** - * \brief Create a texture from an existing surface. - * - * \param renderer The renderer. - * \param surface The surface containing pixel data used to fill the texture. - * - * \return The created texture is returned, or NULL on error. - * - * \note The surface is not modified or freed by this function. - * - * \sa SDL_QueryTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); - -/** - * \brief Query the attributes of a texture - * - * \param texture A texture to be queried. - * \param format A pointer filled in with the raw format of the texture. The - * actual format may differ, but pixel transfers will use this - * format. - * \param access A pointer filled in with the actual access to the texture. - * \param w A pointer filled in with the width of the texture in pixels. - * \param h A pointer filled in with the height of the texture in pixels. - * - * \return 0 on success, or -1 if the texture is not valid. - */ -extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, - Uint32 * format, int *access, - int *w, int *h); - -/** - * \brief Set an additional color value used in render copy operations. - * - * \param texture The texture to update. - * \param r The red color value multiplied into copy operations. - * \param g The green color value multiplied into copy operations. - * \param b The blue color value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or color modulation - * is not supported. - * - * \sa SDL_GetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \brief Get the additional color value used in render copy operations. - * - * \param texture The texture to query. - * \param r A pointer filled in with the current red color value. - * \param g A pointer filled in with the current green color value. - * \param b A pointer filled in with the current blue color value. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \brief Set an additional alpha value used in render copy operations. - * - * \param texture The texture to update. - * \param alpha The alpha value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or alpha modulation - * is not supported. - * - * \sa SDL_GetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, - Uint8 alpha); - -/** - * \brief Get the additional alpha value used in render copy operations. - * - * \param texture The texture to query. - * \param alpha A pointer filled in with the current alpha value. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, - Uint8 * alpha); - -/** - * \brief Set the blend mode used for texture copy operations. - * - * \param texture The texture to update. - * \param blendMode ::SDL_BlendMode to use for texture blending. - * - * \return 0 on success, or -1 if the texture is not valid or the blend mode is - * not supported. - * - * \note If the blend mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for texture copy operations. - * - * \param texture The texture to query. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode *blendMode); - -/** - * \brief Update the given texture rectangle with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param pixels The raw pixel data. - * \param pitch The number of bytes in a row of pixel data, including padding between lines. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note This is a fairly slow function. - */ -extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const void *pixels, int pitch); - -/** - * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param Yplane The raw pixel data for the Y plane. - * \param Ypitch The number of bytes between rows of pixel data for the Y plane. - * \param Uplane The raw pixel data for the U plane. - * \param Upitch The number of bytes between rows of pixel data for the U plane. - * \param Vplane The raw pixel data for the V plane. - * \param Vpitch The number of bytes between rows of pixel data for the V plane. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note You can use SDL_UpdateTexture() as long as your pixel data is - * a contiguous block of Y and U/V planes in the proper order, but - * this function is available if your pixel data is not contiguous. - */ -extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch); - -/** - * \brief Lock a portion of the texture for write-only pixel access. - * - * \param texture The texture to lock for access, which was created with - * ::SDL_TEXTUREACCESS_STREAMING. - * \param rect A pointer to the rectangle to lock for access. If the rect - * is NULL, the entire texture will be locked. - * \param pixels This is filled in with a pointer to the locked pixels, - * appropriately offset by the locked area. - * \param pitch This is filled in with the pitch of the locked pixels. - * - * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. - * - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, - const SDL_Rect * rect, - void **pixels, int *pitch); - -/** - * \brief Unlock a texture, uploading the changes to video memory, if needed. - * - * \sa SDL_LockTexture() - */ -extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); - -/** - * \brief Determines whether a window supports the use of render targets - * - * \param renderer The renderer that will be checked - * - * \return SDL_TRUE if supported, SDL_FALSE if not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); - -/** - * \brief Set a texture as the current rendering target. - * - * \param renderer The renderer. - * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target - * - * \return 0 on success, or -1 on error - * - * \sa SDL_GetRenderTarget() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, - SDL_Texture *texture); - -/** - * \brief Get the current render target or NULL for the default render target. - * - * \return The current render target - * - * \sa SDL_SetRenderTarget() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); - -/** - * \brief Set device independent resolution for rendering - * - * \param renderer The renderer for which resolution should be set. - * \param w The width of the logical resolution - * \param h The height of the logical resolution - * - * This function uses the viewport and scaling functionality to allow a fixed logical - * resolution for rendering, regardless of the actual output resolution. If the actual - * output resolution doesn't have the same aspect ratio the output rendering will be - * centered within the output display. - * - * If the output display is a window, mouse events in the window will be filtered - * and scaled so they seem to arrive within the logical resolution. - * - * \note If this function results in scaling or subpixel drawing by the - * rendering backend, it will be handled using the appropriate - * quality hints. - * - * \sa SDL_RenderGetLogicalSize() - * \sa SDL_RenderSetScale() - * \sa SDL_RenderSetViewport() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); - -/** - * \brief Get device independent resolution for rendering - * - * \param renderer The renderer from which resolution should be queried. - * \param w A pointer filled with the width of the logical resolution - * \param h A pointer filled with the height of the logical resolution - * - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); - -/** - * \brief Set the drawing area for rendering on the current target. - * - * \param renderer The renderer for which the drawing area should be set. - * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. - * - * The x,y of the viewport rect represents the origin for rendering. - * - * \return 0 on success, or -1 on error - * - * \note If the window associated with the renderer is resized, the viewport is automatically reset. - * - * \sa SDL_RenderGetViewport() - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Get the drawing area for the current target. - * - * \sa SDL_RenderSetViewport() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * \brief Set the clip rectangle for the current target. - * - * \param renderer The renderer for which clip rectangle should be set. - * \param rect A pointer to the rectangle to set as the clip rectangle, or - * NULL to disable clipping. - * - * \return 0 on success, or -1 on error - * - * \sa SDL_RenderGetClipRect() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Get the clip rectangle for the current target. - * - * \param renderer The renderer from which clip rectangle should be queried. - * \param rect A pointer filled in with the current clip rectangle, or - * an empty rectangle if clipping is disabled. - * - * \sa SDL_RenderSetClipRect() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * \brief Get whether clipping is enabled on the given renderer. - * - * \param renderer The renderer from which clip state should be queried. - * - * \sa SDL_RenderGetClipRect() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); - - -/** - * \brief Set the drawing scale for rendering on the current target. - * - * \param renderer The renderer for which the drawing scale should be set. - * \param scaleX The horizontal scaling factor - * \param scaleY The vertical scaling factor - * - * The drawing coordinates are scaled by the x/y scaling factors - * before they are used by the renderer. This allows resolution - * independent drawing with a single coordinate system. - * - * \note If this results in scaling or subpixel drawing by the - * rendering backend, it will be handled using the appropriate - * quality hints. For best results use integer scaling factors. - * - * \sa SDL_RenderGetScale() - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, - float scaleX, float scaleY); - -/** - * \brief Get the drawing scale for the current target. - * - * \param renderer The renderer from which drawing scale should be queried. - * \param scaleX A pointer filled in with the horizontal scaling factor - * \param scaleY A pointer filled in with the vertical scaling factor - * - * \sa SDL_RenderSetScale() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, - float *scaleX, float *scaleY); - -/** - * \brief Set the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer The renderer for which drawing color should be set. - * \param r The red value used to draw on the rendering target. - * \param g The green value used to draw on the rendering target. - * \param b The blue value used to draw on the rendering target. - * \param a The alpha value used to draw on the rendering target, usually - * ::SDL_ALPHA_OPAQUE (255). - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \brief Get the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer The renderer from which drawing color should be queried. - * \param r A pointer to the red value used to draw on the rendering target. - * \param g A pointer to the green value used to draw on the rendering target. - * \param b A pointer to the blue value used to draw on the rendering target. - * \param a A pointer to the alpha value used to draw on the rendering target, - * usually ::SDL_ALPHA_OPAQUE (255). - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \brief Set the blend mode used for drawing operations (Fill and Line). - * - * \param renderer The renderer for which blend mode should be set. - * \param blendMode ::SDL_BlendMode to use for blending. - * - * \return 0 on success, or -1 on error - * - * \note If the blend mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for drawing operations. - * - * \param renderer The renderer from which blend mode should be queried. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 on error - * - * \sa SDL_SetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode *blendMode); - -/** - * \brief Clear the current rendering target with the drawing color - * - * This function clears the entire rendering target, ignoring the viewport. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); - -/** - * \brief Draw a point on the current rendering target. - * - * \param renderer The renderer which should draw a point. - * \param x The x coordinate of the point. - * \param y The y coordinate of the point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, - int x, int y); - -/** - * \brief Draw multiple points on the current rendering target. - * - * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * \brief Draw a line on the current rendering target. - * - * \param renderer The renderer which should draw a line. - * \param x1 The x coordinate of the start point. - * \param y1 The y coordinate of the start point. - * \param x2 The x coordinate of the end point. - * \param y2 The y coordinate of the end point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, - int x1, int y1, int x2, int y2); - -/** - * \brief Draw a series of connected lines on the current rendering target. - * - * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * \brief Draw a rectangle on the current rendering target. - * - * \param renderer The renderer which should draw a rectangle. - * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Draw some number of rectangles on the current rendering target. - * - * \param renderer The renderer which should draw multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * \brief Fill a rectangle on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill a rectangle. - * \param rect A pointer to the destination rectangle, or NULL for the entire - * rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Fill some number of rectangles on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * \brief Copy a portion of the texture to the current rendering target. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); - -/** - * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect - * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). - * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect, - const double angle, - const SDL_Point *center, - const SDL_RendererFlip flip); - -/** - * \brief Read pixels from the current rendering target. - * - * \param renderer The renderer from which pixels should be read. - * \param rect A pointer to the rectangle to read, or NULL for the entire - * render target. - * \param format The desired format of the pixel data, or 0 to use the format - * of the rendering target - * \param pixels A pointer to be filled in with the pixel data - * \param pitch The pitch of the pixels parameter. - * - * \return 0 on success, or -1 if pixel reading is not supported. - * - * \warning This is a very slow operation, and should not be used frequently. - */ -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, - const SDL_Rect * rect, - Uint32 format, - void *pixels, int pitch); - -/** - * \brief Update the screen with rendering performed. - */ -extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); - -/** - * \brief Destroy the specified texture. - * - * \sa SDL_CreateTexture() - * \sa SDL_CreateTextureFromSurface() - */ -extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); - -/** - * \brief Destroy the rendering context for a window and free associated - * textures. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); - - -/** - * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with - * OpenGL instructions. - * - * \param texture The SDL texture to bind - * \param texw A pointer to a float that will be filled with the texture width - * \param texh A pointer to a float that will be filled with the texture height - * - * \return 0 on success, or -1 if the operation is not supported - */ -extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); - -/** - * \brief Unbind a texture from the current OpenGL/ES/ES2 context. - * - * \param texture The SDL texture to unbind - * - * \return 0 on success, or -1 if the operation is not supported - */ -extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_render_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_revision.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_revision.h deleted file mode 100644 index 6d7163d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_revision.h +++ /dev/null @@ -1,2 +0,0 @@ -#define SDL_REVISION "hg-10001:e12c38730512" -#define SDL_REVISION_NUMBER 10001 diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_rwops.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_rwops.h deleted file mode 100644 index f460ae7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_rwops.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_rwops.h - * - * This file provides a general interface for SDL to read and write - * data streams. It can easily be extended to files, memory, etc. - */ - -#ifndef _SDL_rwops_h -#define _SDL_rwops_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* RWops Types */ -#define SDL_RWOPS_UNKNOWN 0 /* Unknown stream type */ -#define SDL_RWOPS_WINFILE 1 /* Win32 file */ -#define SDL_RWOPS_STDFILE 2 /* Stdio file */ -#define SDL_RWOPS_JNIFILE 3 /* Android asset */ -#define SDL_RWOPS_MEMORY 4 /* Memory stream */ -#define SDL_RWOPS_MEMORY_RO 5 /* Read-Only memory stream */ - -/** - * This is the read/write operation structure -- very basic. - */ -typedef struct SDL_RWops -{ - /** - * Return the size of the file in this rwops, or -1 if unknown - */ - Sint64 (SDLCALL * size) (struct SDL_RWops * context); - - /** - * Seek to \c offset relative to \c whence, one of stdio's whence values: - * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - * - * \return the final offset in the data stream, or -1 on error. - */ - Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, - int whence); - - /** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. - * - * \return the number of objects read, or 0 at error or end of file. - */ - size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, - size_t size, size_t maxnum); - - /** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. - * - * \return the number of objects written, or 0 at error or end of file. - */ - size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, - size_t size, size_t num); - - /** - * Close and free an allocated SDL_RWops structure. - * - * \return 0 if successful or -1 on write error when flushing data. - */ - int (SDLCALL * close) (struct SDL_RWops * context); - - Uint32 type; - union - { -#if defined(__ANDROID__) - struct - { - void *fileNameRef; - void *inputStreamRef; - void *readableByteChannelRef; - void *readMethod; - void *assetFileDescriptorRef; - long position; - long size; - long offset; - int fd; - } androidio; -#elif defined(__WIN32__) - struct - { - SDL_bool append; - void *h; - struct - { - void *data; - size_t size; - size_t left; - } buffer; - } windowsio; -#endif - -#ifdef HAVE_STDIO_H - struct - { - SDL_bool autoclose; - FILE *fp; - } stdio; -#endif - struct - { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct - { - void *data1; - void *data2; - } unknown; - } hidden; - -} SDL_RWops; - - -/** - * \name RWFrom functions - * - * Functions to create SDL_RWops structures from various data streams. - */ -/* @{ */ - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, - const char *mode); - -#ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, - SDL_bool autoclose); -#else -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, - SDL_bool autoclose); -#endif - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, - int size); - -/* @} *//* RWFrom functions */ - - -extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); - -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ - -/** - * \name Read/write macros - * - * Macros to easily read and write from an SDL_RWops structure. - */ -/* @{ */ -#define SDL_RWsize(ctx) (ctx)->size(ctx) -#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) -#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) -#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -#define SDL_RWclose(ctx) (ctx)->close(ctx) -/* @} *//* Read/write macros */ - - -/** - * \name Read endian functions - * - * Read an item of the specified endianness and return in native format. - */ -/* @{ */ -extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); -/* @} *//* Read endian functions */ - -/** - * \name Write endian functions - * - * Write an item of native format to the specified endianness. - */ -/* @{ */ -extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); -/* @} *//* Write endian functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_rwops_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_scancode.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_scancode.h deleted file mode 100644 index 0af1dd5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_scancode.h +++ /dev/null @@ -1,401 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_scancode.h - * - * Defines keyboard scancodes. - */ - -#ifndef _SDL_scancode_h -#define _SDL_scancode_h - -#include "SDL_stdinc.h" - -/** - * \brief The SDL keyboard scancode representation. - * - * Values of this type are used to represent keyboard keys, among other places - * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the - * SDL_Event structure. - * - * The values in this enumeration are based on the USB usage page standard: - * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf - */ -typedef enum -{ - SDL_SCANCODE_UNKNOWN = 0, - - /** - * \name Usage page 0x07 - * - * These values are from usage page 0x07 (USB keyboard page). - */ - /* @{ */ - - SDL_SCANCODE_A = 4, - SDL_SCANCODE_B = 5, - SDL_SCANCODE_C = 6, - SDL_SCANCODE_D = 7, - SDL_SCANCODE_E = 8, - SDL_SCANCODE_F = 9, - SDL_SCANCODE_G = 10, - SDL_SCANCODE_H = 11, - SDL_SCANCODE_I = 12, - SDL_SCANCODE_J = 13, - SDL_SCANCODE_K = 14, - SDL_SCANCODE_L = 15, - SDL_SCANCODE_M = 16, - SDL_SCANCODE_N = 17, - SDL_SCANCODE_O = 18, - SDL_SCANCODE_P = 19, - SDL_SCANCODE_Q = 20, - SDL_SCANCODE_R = 21, - SDL_SCANCODE_S = 22, - SDL_SCANCODE_T = 23, - SDL_SCANCODE_U = 24, - SDL_SCANCODE_V = 25, - SDL_SCANCODE_W = 26, - SDL_SCANCODE_X = 27, - SDL_SCANCODE_Y = 28, - SDL_SCANCODE_Z = 29, - - SDL_SCANCODE_1 = 30, - SDL_SCANCODE_2 = 31, - SDL_SCANCODE_3 = 32, - SDL_SCANCODE_4 = 33, - SDL_SCANCODE_5 = 34, - SDL_SCANCODE_6 = 35, - SDL_SCANCODE_7 = 36, - SDL_SCANCODE_8 = 37, - SDL_SCANCODE_9 = 38, - SDL_SCANCODE_0 = 39, - - SDL_SCANCODE_RETURN = 40, - SDL_SCANCODE_ESCAPE = 41, - SDL_SCANCODE_BACKSPACE = 42, - SDL_SCANCODE_TAB = 43, - SDL_SCANCODE_SPACE = 44, - - SDL_SCANCODE_MINUS = 45, - SDL_SCANCODE_EQUALS = 46, - SDL_SCANCODE_LEFTBRACKET = 47, - SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return - * key on ISO keyboards and at the right end - * of the QWERTY row on ANSI keyboards. - * Produces REVERSE SOLIDUS (backslash) and - * VERTICAL LINE in a US layout, REVERSE - * SOLIDUS and VERTICAL LINE in a UK Mac - * layout, NUMBER SIGN and TILDE in a UK - * Windows layout, DOLLAR SIGN and POUND SIGN - * in a Swiss German layout, NUMBER SIGN and - * APOSTROPHE in a German layout, GRAVE - * ACCENT and POUND SIGN in a French Mac - * layout, and ASTERISK and MICRO SIGN in a - * French Windows layout. - */ - SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code - * instead of 49 for the same key, but all - * OSes I've seen treat the two codes - * identically. So, as an implementor, unless - * your keyboard generates both of those - * codes and your OS treats them differently, - * you should generate SDL_SCANCODE_BACKSLASH - * instead of this code. As a user, you - * should not rely on this code because SDL - * will never generate it with most (all?) - * keyboards. - */ - SDL_SCANCODE_SEMICOLON = 51, - SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI - * and ISO keyboards). Produces GRAVE ACCENT and - * TILDE in a US Windows layout and in US and UK - * Mac layouts on ANSI keyboards, GRAVE ACCENT - * and NOT SIGN in a UK Windows layout, SECTION - * SIGN and PLUS-MINUS SIGN in US and UK Mac - * layouts on ISO keyboards, SECTION SIGN and - * DEGREE SIGN in a Swiss German layout (Mac: - * only on ISO keyboards), CIRCUMFLEX ACCENT and - * DEGREE SIGN in a German layout (Mac: only on - * ISO keyboards), SUPERSCRIPT TWO and TILDE in a - * French Windows layout, COMMERCIAL AT and - * NUMBER SIGN in a French Mac layout on ISO - * keyboards, and LESS-THAN SIGN and GREATER-THAN - * SIGN in a Swiss German, German, or French Mac - * layout on ANSI keyboards. - */ - SDL_SCANCODE_COMMA = 54, - SDL_SCANCODE_PERIOD = 55, - SDL_SCANCODE_SLASH = 56, - - SDL_SCANCODE_CAPSLOCK = 57, - - SDL_SCANCODE_F1 = 58, - SDL_SCANCODE_F2 = 59, - SDL_SCANCODE_F3 = 60, - SDL_SCANCODE_F4 = 61, - SDL_SCANCODE_F5 = 62, - SDL_SCANCODE_F6 = 63, - SDL_SCANCODE_F7 = 64, - SDL_SCANCODE_F8 = 65, - SDL_SCANCODE_F9 = 66, - SDL_SCANCODE_F10 = 67, - SDL_SCANCODE_F11 = 68, - SDL_SCANCODE_F12 = 69, - - SDL_SCANCODE_PRINTSCREEN = 70, - SDL_SCANCODE_SCROLLLOCK = 71, - SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but - does send code 73, not 117) */ - SDL_SCANCODE_HOME = 74, - SDL_SCANCODE_PAGEUP = 75, - SDL_SCANCODE_DELETE = 76, - SDL_SCANCODE_END = 77, - SDL_SCANCODE_PAGEDOWN = 78, - SDL_SCANCODE_RIGHT = 79, - SDL_SCANCODE_LEFT = 80, - SDL_SCANCODE_DOWN = 81, - SDL_SCANCODE_UP = 82, - - SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards - */ - SDL_SCANCODE_KP_DIVIDE = 84, - SDL_SCANCODE_KP_MULTIPLY = 85, - SDL_SCANCODE_KP_MINUS = 86, - SDL_SCANCODE_KP_PLUS = 87, - SDL_SCANCODE_KP_ENTER = 88, - SDL_SCANCODE_KP_1 = 89, - SDL_SCANCODE_KP_2 = 90, - SDL_SCANCODE_KP_3 = 91, - SDL_SCANCODE_KP_4 = 92, - SDL_SCANCODE_KP_5 = 93, - SDL_SCANCODE_KP_6 = 94, - SDL_SCANCODE_KP_7 = 95, - SDL_SCANCODE_KP_8 = 96, - SDL_SCANCODE_KP_9 = 97, - SDL_SCANCODE_KP_0 = 98, - SDL_SCANCODE_KP_PERIOD = 99, - - SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO - * keyboards have over ANSI ones, - * located between left shift and Y. - * Produces GRAVE ACCENT and TILDE in a - * US or UK Mac layout, REVERSE SOLIDUS - * (backslash) and VERTICAL LINE in a - * US or UK Windows layout, and - * LESS-THAN SIGN and GREATER-THAN SIGN - * in a Swiss German, German, or French - * layout. */ - SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ - SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, - * not a physical key - but some Mac keyboards - * do have a power key. */ - SDL_SCANCODE_KP_EQUALS = 103, - SDL_SCANCODE_F13 = 104, - SDL_SCANCODE_F14 = 105, - SDL_SCANCODE_F15 = 106, - SDL_SCANCODE_F16 = 107, - SDL_SCANCODE_F17 = 108, - SDL_SCANCODE_F18 = 109, - SDL_SCANCODE_F19 = 110, - SDL_SCANCODE_F20 = 111, - SDL_SCANCODE_F21 = 112, - SDL_SCANCODE_F22 = 113, - SDL_SCANCODE_F23 = 114, - SDL_SCANCODE_F24 = 115, - SDL_SCANCODE_EXECUTE = 116, - SDL_SCANCODE_HELP = 117, - SDL_SCANCODE_MENU = 118, - SDL_SCANCODE_SELECT = 119, - SDL_SCANCODE_STOP = 120, - SDL_SCANCODE_AGAIN = 121, /**< redo */ - SDL_SCANCODE_UNDO = 122, - SDL_SCANCODE_CUT = 123, - SDL_SCANCODE_COPY = 124, - SDL_SCANCODE_PASTE = 125, - SDL_SCANCODE_FIND = 126, - SDL_SCANCODE_MUTE = 127, - SDL_SCANCODE_VOLUMEUP = 128, - SDL_SCANCODE_VOLUMEDOWN = 129, -/* not sure whether there's a reason to enable these */ -/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ -/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ -/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ - SDL_SCANCODE_KP_COMMA = 133, - SDL_SCANCODE_KP_EQUALSAS400 = 134, - - SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see - footnotes in USB doc */ - SDL_SCANCODE_INTERNATIONAL2 = 136, - SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ - SDL_SCANCODE_INTERNATIONAL4 = 138, - SDL_SCANCODE_INTERNATIONAL5 = 139, - SDL_SCANCODE_INTERNATIONAL6 = 140, - SDL_SCANCODE_INTERNATIONAL7 = 141, - SDL_SCANCODE_INTERNATIONAL8 = 142, - SDL_SCANCODE_INTERNATIONAL9 = 143, - SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ - SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ - SDL_SCANCODE_LANG3 = 146, /**< Katakana */ - SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ - SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ - SDL_SCANCODE_LANG6 = 149, /**< reserved */ - SDL_SCANCODE_LANG7 = 150, /**< reserved */ - SDL_SCANCODE_LANG8 = 151, /**< reserved */ - SDL_SCANCODE_LANG9 = 152, /**< reserved */ - - SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ - SDL_SCANCODE_SYSREQ = 154, - SDL_SCANCODE_CANCEL = 155, - SDL_SCANCODE_CLEAR = 156, - SDL_SCANCODE_PRIOR = 157, - SDL_SCANCODE_RETURN2 = 158, - SDL_SCANCODE_SEPARATOR = 159, - SDL_SCANCODE_OUT = 160, - SDL_SCANCODE_OPER = 161, - SDL_SCANCODE_CLEARAGAIN = 162, - SDL_SCANCODE_CRSEL = 163, - SDL_SCANCODE_EXSEL = 164, - - SDL_SCANCODE_KP_00 = 176, - SDL_SCANCODE_KP_000 = 177, - SDL_SCANCODE_THOUSANDSSEPARATOR = 178, - SDL_SCANCODE_DECIMALSEPARATOR = 179, - SDL_SCANCODE_CURRENCYUNIT = 180, - SDL_SCANCODE_CURRENCYSUBUNIT = 181, - SDL_SCANCODE_KP_LEFTPAREN = 182, - SDL_SCANCODE_KP_RIGHTPAREN = 183, - SDL_SCANCODE_KP_LEFTBRACE = 184, - SDL_SCANCODE_KP_RIGHTBRACE = 185, - SDL_SCANCODE_KP_TAB = 186, - SDL_SCANCODE_KP_BACKSPACE = 187, - SDL_SCANCODE_KP_A = 188, - SDL_SCANCODE_KP_B = 189, - SDL_SCANCODE_KP_C = 190, - SDL_SCANCODE_KP_D = 191, - SDL_SCANCODE_KP_E = 192, - SDL_SCANCODE_KP_F = 193, - SDL_SCANCODE_KP_XOR = 194, - SDL_SCANCODE_KP_POWER = 195, - SDL_SCANCODE_KP_PERCENT = 196, - SDL_SCANCODE_KP_LESS = 197, - SDL_SCANCODE_KP_GREATER = 198, - SDL_SCANCODE_KP_AMPERSAND = 199, - SDL_SCANCODE_KP_DBLAMPERSAND = 200, - SDL_SCANCODE_KP_VERTICALBAR = 201, - SDL_SCANCODE_KP_DBLVERTICALBAR = 202, - SDL_SCANCODE_KP_COLON = 203, - SDL_SCANCODE_KP_HASH = 204, - SDL_SCANCODE_KP_SPACE = 205, - SDL_SCANCODE_KP_AT = 206, - SDL_SCANCODE_KP_EXCLAM = 207, - SDL_SCANCODE_KP_MEMSTORE = 208, - SDL_SCANCODE_KP_MEMRECALL = 209, - SDL_SCANCODE_KP_MEMCLEAR = 210, - SDL_SCANCODE_KP_MEMADD = 211, - SDL_SCANCODE_KP_MEMSUBTRACT = 212, - SDL_SCANCODE_KP_MEMMULTIPLY = 213, - SDL_SCANCODE_KP_MEMDIVIDE = 214, - SDL_SCANCODE_KP_PLUSMINUS = 215, - SDL_SCANCODE_KP_CLEAR = 216, - SDL_SCANCODE_KP_CLEARENTRY = 217, - SDL_SCANCODE_KP_BINARY = 218, - SDL_SCANCODE_KP_OCTAL = 219, - SDL_SCANCODE_KP_DECIMAL = 220, - SDL_SCANCODE_KP_HEXADECIMAL = 221, - - SDL_SCANCODE_LCTRL = 224, - SDL_SCANCODE_LSHIFT = 225, - SDL_SCANCODE_LALT = 226, /**< alt, option */ - SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ - SDL_SCANCODE_RCTRL = 228, - SDL_SCANCODE_RSHIFT = 229, - SDL_SCANCODE_RALT = 230, /**< alt gr, option */ - SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ - - SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered - * by any of the above, but since there's a - * special KMOD_MODE for it I'm adding it here - */ - - /* @} *//* Usage page 0x07 */ - - /** - * \name Usage page 0x0C - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIONEXT = 258, - SDL_SCANCODE_AUDIOPREV = 259, - SDL_SCANCODE_AUDIOSTOP = 260, - SDL_SCANCODE_AUDIOPLAY = 261, - SDL_SCANCODE_AUDIOMUTE = 262, - SDL_SCANCODE_MEDIASELECT = 263, - SDL_SCANCODE_WWW = 264, - SDL_SCANCODE_MAIL = 265, - SDL_SCANCODE_CALCULATOR = 266, - SDL_SCANCODE_COMPUTER = 267, - SDL_SCANCODE_AC_SEARCH = 268, - SDL_SCANCODE_AC_HOME = 269, - SDL_SCANCODE_AC_BACK = 270, - SDL_SCANCODE_AC_FORWARD = 271, - SDL_SCANCODE_AC_STOP = 272, - SDL_SCANCODE_AC_REFRESH = 273, - SDL_SCANCODE_AC_BOOKMARKS = 274, - - /* @} *//* Usage page 0x0C */ - - /** - * \name Walther keys - * - * These are values that Christian Walther added (for mac keyboard?). - */ - /* @{ */ - - SDL_SCANCODE_BRIGHTNESSDOWN = 275, - SDL_SCANCODE_BRIGHTNESSUP = 276, - SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display - switch, video mode switch */ - SDL_SCANCODE_KBDILLUMTOGGLE = 278, - SDL_SCANCODE_KBDILLUMDOWN = 279, - SDL_SCANCODE_KBDILLUMUP = 280, - SDL_SCANCODE_EJECT = 281, - SDL_SCANCODE_SLEEP = 282, - - SDL_SCANCODE_APP1 = 283, - SDL_SCANCODE_APP2 = 284, - - /* @} *//* Walther keys */ - - /* Add any other keys here. */ - - SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes - for array bounds */ -} SDL_Scancode; - -#endif /* _SDL_scancode_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_shape.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_shape.h deleted file mode 100644 index db10a8f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_shape.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_shape_h -#define _SDL_shape_h - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** \file SDL_shape.h - * - * Header file for the shaped window API. - */ - -#define SDL_NONSHAPEABLE_WINDOW -1 -#define SDL_INVALID_SHAPE_ARGUMENT -2 -#define SDL_WINDOW_LACKS_SHAPE -3 - -/** - * \brief Create a window that can be shaped with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window. - * \param h The height of the window. - * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: - * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, - * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, - * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. - * - * \return The window created, or NULL if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); - -/** - * \brief Return whether the given window is a shaped window. - * - * \param window The window to query for being shaped. - * - * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. - * \sa SDL_CreateShapedWindow - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); - -/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ -typedef enum { - /** \brief The default mode, a binarized alpha cutoff of 1. */ - ShapeModeDefault, - /** \brief A binarized alpha cutoff with a given integer value. */ - ShapeModeBinarizeAlpha, - /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ - ShapeModeReverseBinarizeAlpha, - /** \brief A color key is applied. */ - ShapeModeColorKey -} WindowShapeMode; - -#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) - -/** \brief A union containing parameters for shaped windows. */ -typedef union { - /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */ - Uint8 binarizationCutoff; - SDL_Color colorKey; -} SDL_WindowShapeParams; - -/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ -typedef struct SDL_WindowShapeMode { - /** \brief The mode of these window-shape parameters. */ - WindowShapeMode mode; - /** \brief Window-shape parameters. */ - SDL_WindowShapeParams parameters; -} SDL_WindowShapeMode; - -/** - * \brief Set the shape and parameters of a shaped window. - * - * \param window The shaped window whose parameters should be set. - * \param shape A surface encoding the desired shape for the window. - * \param shape_mode The parameters to set for the shaped window. - * - * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW - * if the SDL_Window* given does not reference a valid shaped window. - * - * \sa SDL_WindowShapeMode - * \sa SDL_GetShapedWindowMode. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); - -/** - * \brief Get the shape parameters of a shaped window. - * - * \param window The shaped window whose parameters should be retrieved. - * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. - * - * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode - * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if - * the SDL_Window* given is a shapeable window currently lacking a shape. - * - * \sa SDL_WindowShapeMode - * \sa SDL_SetWindowShape - */ -extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_shape_h */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_stdinc.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_stdinc.h deleted file mode 100644 index c149bc5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_stdinc.h +++ /dev/null @@ -1,532 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_stdinc.h - * - * This is a general header that includes C language support. - */ - -#ifndef _SDL_stdinc_h -#define _SDL_stdinc_h - -#include "SDL_config.h" - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#if defined(STDC_HEADERS) -# include -# include -# include -#else -# if defined(HAVE_STDLIB_H) -# include -# elif defined(HAVE_MALLOC_H) -# include -# endif -# if defined(HAVE_STDDEF_H) -# include -# endif -# if defined(HAVE_STDARG_H) -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#if defined(HAVE_INTTYPES_H) -# include -#elif defined(HAVE_STDINT_H) -# include -#endif -#ifdef HAVE_CTYPE_H -# include -#endif -#ifdef HAVE_MATH_H -# if defined(__WINRT__) -/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on - WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx - for more information. -*/ -# define _USE_MATH_DEFINES -# endif -# include -#endif -#ifdef HAVE_FLOAT_H -# include -#endif -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -# include -#endif - -/** - * The number of elements in an array. - */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/** - * \name Cast operators - * - * Use proper C++ casts when compiled as C++ to be compatible with the option - * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). - */ -/* @{ */ -#ifdef __cplusplus -#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) -#define SDL_static_cast(type, expression) static_cast(expression) -#define SDL_const_cast(type, expression) const_cast(expression) -#else -#define SDL_reinterpret_cast(type, expression) ((type)(expression)) -#define SDL_static_cast(type, expression) ((type)(expression)) -#define SDL_const_cast(type, expression) ((type)(expression)) -#endif -/* @} *//* Cast operators */ - -/* Define a four character code as a Uint32 */ -#define SDL_FOURCC(A, B, C, D) \ - ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) - -/** - * \name Basic data types - */ -/* @{ */ - -typedef enum -{ - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; - -/** - * \brief A signed 8-bit integer type. - */ -typedef int8_t Sint8; -/** - * \brief An unsigned 8-bit integer type. - */ -typedef uint8_t Uint8; -/** - * \brief A signed 16-bit integer type. - */ -typedef int16_t Sint16; -/** - * \brief An unsigned 16-bit integer type. - */ -typedef uint16_t Uint16; -/** - * \brief A signed 32-bit integer type. - */ -typedef int32_t Sint32; -/** - * \brief An unsigned 32-bit integer type. - */ -typedef uint32_t Uint32; - -/** - * \brief A signed 64-bit integer type. - */ -typedef int64_t Sint64; -/** - * \brief An unsigned 64-bit integer type. - */ -typedef uint64_t Uint64; - -/* @} *//* Basic data types */ - -/* Make sure we have macros for printing 64 bit values. - * should define these but this is not true all platforms. - * (for example win32) */ -#ifndef SDL_PRIs64 -#ifdef PRIs64 -#define SDL_PRIs64 PRIs64 -#elif defined(__WIN32__) -#define SDL_PRIs64 "I64d" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIs64 "ld" -#else -#define SDL_PRIs64 "lld" -#endif -#endif -#ifndef SDL_PRIu64 -#ifdef PRIu64 -#define SDL_PRIu64 PRIu64 -#elif defined(__WIN32__) -#define SDL_PRIu64 "I64u" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIu64 "lu" -#else -#define SDL_PRIu64 "llu" -#endif -#endif -#ifndef SDL_PRIx64 -#ifdef PRIx64 -#define SDL_PRIx64 PRIx64 -#elif defined(__WIN32__) -#define SDL_PRIx64 "I64x" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIx64 "lx" -#else -#define SDL_PRIx64 "llx" -#endif -#endif -#ifndef SDL_PRIX64 -#ifdef PRIX64 -#define SDL_PRIX64 PRIX64 -#elif defined(__WIN32__) -#define SDL_PRIX64 "I64X" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIX64 "lX" -#else -#define SDL_PRIX64 "llX" -#endif -#endif - -/* Annotations to help code analysis tools */ -#ifdef SDL_DISABLE_ANALYZE_MACROS -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#else -#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ -#include - -#define SDL_IN_BYTECAP(x) _In_bytecount_(x) -#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) -#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) -#define SDL_OUT_CAP(x) _Out_cap_(x) -#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) -#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) - -#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ -#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ -#else -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#endif -#if defined(__GNUC__) -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#else -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#endif -#endif /* SDL_DISABLE_ANALYZE_MACROS */ - -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_dummy_ ## name[(x) * 2 - 1] -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -/* Check to make sure enums are the size of ints, for structure packing. - For both Watcom C/C++ and Borland C/C++ the compiler option that makes - enums having the size of an int must be enabled. - This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). -*/ - -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -#if !defined(__ANDROID__) - /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ -typedef enum -{ - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -// char checker(int); -// void ____(void) { -// char checkSizeOfInt[sizeof(int)]={checker(&checkSizeOfInt)}; -// char checkSizeOfEnum[sizeof(SDL_DUMMY_ENUM)]={checker(&checkSizeOfEnum)}; -// } -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include -# define alloca _alloca -# elif defined(__WATCOMC__) -# include -# elif defined(__BORLANDC__) -# include -# elif defined(__DMC__) -# include -# elif defined(__AIX__) -#pragma alloca -# elif defined(__MRC__) -void *alloca(unsigned); -# else -char *alloca(); -# endif -#endif -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); -extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); -extern DECLSPEC void SDLCALL SDL_free(void *mem); - -extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); -extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); - -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); - -extern DECLSPEC int SDLCALL SDL_abs(int x); - -/* !!! FIXME: these have side effects. You probably shouldn't use them. */ -/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) - -extern DECLSPEC int SDLCALL SDL_isdigit(int x); -extern DECLSPEC int SDLCALL SDL_isspace(int x); -extern DECLSPEC int SDLCALL SDL_toupper(int x); -extern DECLSPEC int SDLCALL SDL_tolower(int x); - -extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); - -#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) -#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) - -/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ -SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) -{ -#if defined(__GNUC__) && defined(i386) - int u0, u1, u2; - __asm__ __volatile__ ( - "cld \n\t" - "rep ; stosl \n\t" - : "=&D" (u0), "=&a" (u1), "=&c" (u2) - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) - : "memory" - ); -#else - size_t _n = (dwords + 3) / 4; - Uint32 *_p = SDL_static_cast(Uint32 *, dst); - Uint32 _val = (val); - if (dwords == 0) - return; - switch (dwords % 4) - { - case 0: do { *_p++ = _val; - case 3: *_p++ = _val; - case 2: *_p++ = _val; - case 1: *_p++ = _val; - } while ( --_n ); - } -#endif -} - - -extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); - -extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); - -extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); -extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); - -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); -extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); -extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); -extern DECLSPEC char *SDLCALL SDL_strrev(char *str); -extern DECLSPEC char *SDLCALL SDL_strupr(char *str); -extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); -extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); - -extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); - -extern DECLSPEC int SDLCALL SDL_atoi(const char *str); -extern DECLSPEC double SDLCALL SDL_atof(const char *str); -extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); -extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); - -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); - -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); -extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); - -#ifndef HAVE_M_PI -#ifndef M_PI -#define M_PI 3.14159265358979323846264338327950288 /* pi */ -#endif -#endif - -extern DECLSPEC double SDLCALL SDL_acos(double x); -extern DECLSPEC double SDLCALL SDL_asin(double x); -extern DECLSPEC double SDLCALL SDL_atan(double x); -extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); -extern DECLSPEC double SDLCALL SDL_ceil(double x); -extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); -extern DECLSPEC double SDLCALL SDL_cos(double x); -extern DECLSPEC float SDLCALL SDL_cosf(float x); -extern DECLSPEC double SDLCALL SDL_fabs(double x); -extern DECLSPEC double SDLCALL SDL_floor(double x); -extern DECLSPEC double SDLCALL SDL_log(double x); -extern DECLSPEC double SDLCALL SDL_pow(double x, double y); -extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); -extern DECLSPEC double SDLCALL SDL_sin(double x); -extern DECLSPEC float SDLCALL SDL_sinf(float x); -extern DECLSPEC double SDLCALL SDL_sqrt(double x); -extern DECLSPEC float SDLCALL SDL_sqrtf(float x); -extern DECLSPEC double SDLCALL SDL_tan(double x); -extern DECLSPEC float SDLCALL SDL_tanf(float x); - -/* The SDL implementation of iconv() returns these error codes */ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 - -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, - const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); -/** - * This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. - */ -extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, - const char *fromcode, - const char *inbuf, - size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) - -/* force builds using Clang's static analysis tools to use literal C runtime - here, since there are possibly tests that are ineffective otherwise. */ -#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) -#define SDL_malloc malloc -#define SDL_calloc calloc -#define SDL_realloc realloc -#define SDL_free free -#define SDL_memset memset -#define SDL_memcpy memcpy -#define SDL_memmove memmove -#define SDL_memcmp memcmp -#define SDL_strlen strlen -#define SDL_strlcpy strlcpy -#define SDL_strlcat strlcat -#define SDL_strdup strdup -#define SDL_strchr strchr -#define SDL_strrchr strrchr -#define SDL_strstr strstr -#define SDL_strcmp strcmp -#define SDL_strncmp strncmp -#define SDL_strcasecmp strcasecmp -#define SDL_strncasecmp strncasecmp -#define SDL_sscanf sscanf -#define SDL_vsscanf vsscanf -#define SDL_snprintf snprintf -#define SDL_vsnprintf vsnprintf -#endif - -SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) -{ - return SDL_memcpy(dst, src, dwords * 4); -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_stdinc_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_surface.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_surface.h deleted file mode 100644 index e63ca89..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_surface.h +++ /dev/null @@ -1,503 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_surface.h - * - * Header file for ::SDL_Surface definition and management functions. - */ - -#ifndef _SDL_surface_h -#define _SDL_surface_h - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_blendmode.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Surface flags - * - * These are the currently supported flags for the ::SDL_Surface. - * - * \internal - * Used internally (read-only). - */ -/* @{ */ -#define SDL_SWSURFACE 0 /**< Just here for compatibility */ -#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ -#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ -#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ -/* @} *//* Surface flags */ - -/** - * Evaluates to true if the surface needs to be locked before access. - */ -#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) - -/** - * \brief A collection of pixels used in software blitting. - * - * \note This structure should be treated as read-only, except for \c pixels, - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface -{ - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - int pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - - /** Application data associated with the surface */ - void *userdata; /**< Read-write */ - - /** information needed for surfaces requiring locks */ - int locked; /**< Read-only */ - void *lock_data; /**< Read-only */ - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - - /** info for fast blit mapping to other surfaces */ - struct SDL_BlitMap *map; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** - * \brief The type of function used for surface blitting functions. - */ -typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, - struct SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * Allocate and free an RGB surface. - * - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * - * If the function runs out of memory, it will return NULL. - * - * \param flags The \c flags are obsolete and should be set to 0. - * \param width The width in pixels of the surface to create. - * \param height The height in pixels of the surface to create. - * \param depth The depth in bits of the surface to create. - * \param Rmask The red mask of the surface to create. - * \param Gmask The green mask of the surface to create. - * \param Bmask The blue mask of the surface to create. - * \param Amask The alpha mask of the surface to create. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, - int height, - int depth, - int pitch, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); - -/** - * \brief Set the palette used by a surface. - * - * \return 0, or -1 if the surface format doesn't use a palette. - * - * \note A single palette can be shared with many surfaces. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, - SDL_Palette * palette); - -/** - * \brief Sets up a surface for directly accessing the pixels. - * - * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write - * to and read from \c surface->pixels, using the pixel format stored in - * \c surface->format. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. - * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. - * - * \sa SDL_UnlockSurface() - */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); -/** \sa SDL_LockSurface() */ -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); - -/** - * Load a surface from a seekable SDL data stream (memory or file). - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The new surface should be freed with SDL_FreeSurface(). - * - * \return the new surface, or NULL if there was an error. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, - int freesrc); - -/** - * Load a surface from a file. - * - * Convenience macro. - */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Save a surface to a seekable SDL data stream (memory or file). - * - * If \c freedst is non-zero, the stream will be closed after being written. - * - * \return 0 if successful or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface * surface, SDL_RWops * dst, int freedst); - -/** - * Save a surface to a file. - * - * Convenience macro. - */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * \brief Sets the RLE acceleration hint for a surface. - * - * \return 0 on success, or -1 if the surface is not valid - * - * \note If RLE is enabled, colorkey and alpha blending blits are much faster, - * but the surface must be locked before directly accessing the pixels. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, - int flag); - -/** - * \brief Sets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param flag Non-zero to enable colorkey and 0 to disable colorkey - * \param key The transparent pixel in the native surface format - * - * \return 0 on success, or -1 if the surface is not valid - * - * You can pass SDL_RLEACCEL to enable RLE accelerated blits. - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, - int flag, Uint32 key); - -/** - * \brief Gets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param key A pointer filled in with the transparent pixel in the native - * surface format - * - * \return 0 on success, or -1 if the surface is not valid or colorkey is not - * enabled. - */ -extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, - Uint32 * key); - -/** - * \brief Set an additional color value used in blit operations. - * - * \param surface The surface to update. - * \param r The red color value multiplied into blit operations. - * \param g The green color value multiplied into blit operations. - * \param b The blue color value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_GetSurfaceColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \brief Get the additional color value used in blit operations. - * - * \param surface The surface to query. - * \param r A pointer filled in with the current red color value. - * \param g A pointer filled in with the current green color value. - * \param b A pointer filled in with the current blue color value. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \brief Set an additional alpha value used in blit operations. - * - * \param surface The surface to update. - * \param alpha The alpha value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_GetSurfaceAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 alpha); - -/** - * \brief Get the additional alpha value used in blit operations. - * - * \param surface The surface to query. - * \param alpha A pointer filled in with the current alpha value. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 * alpha); - -/** - * \brief Set the blend mode used for blit operations. - * - * \param surface The surface to update. - * \param blendMode ::SDL_BlendMode to use for blit blending. - * - * \return 0 on success, or -1 if the parameters are not valid. - * - * \sa SDL_GetSurfaceBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for blit operations. - * - * \param surface The surface to query. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode *blendMode); - -/** - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, - const SDL_Rect * rect); - -/** - * Gets the clipping rectangle for the destination surface in a blit. - * - * \c rect must be a pointer to a valid rectangle which will be filled - * with the correct values. - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, - SDL_Rect * rect); - -/** - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface - (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat - (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); - -/** - * \brief Copy a block of pixels of one format to another format - * - * \return 0 on success, or -1 if there was an error - */ -extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, - Uint32 src_format, - const void * src, int src_pitch, - Uint32 dst_format, - void * dst, int dst_pitch); - -/** - * Performs a fast fill of the given rectangle with \c color. - * - * If \c rect is NULL, the whole surface will be filled with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); -extern DECLSPEC int SDLCALL SDL_FillRects - (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); - -/** - * Performs a fast blit from the source surface to the destination surface. - * - * This assumes that the source and destination rectangles are - * the same size. If either \c srcrect or \c dstrect are NULL, the entire - * surface (\c src or \c dst) is copied. The final blit rectangles are saved - * in \c srcrect and \c dstrect after all clipping is performed. - * - * \return If the blit is successful, it returns 0, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without blending and colorkey - * are defined as follows: - * \verbatim - RGBA->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB, set destination alpha to source per-surface alpha value. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - - RGBA->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy all of RGBA to the destination. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - \endverbatim - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. - */ -#define SDL_BlitSurface SDL_UpperBlit - -/** - * This is the public blit function, SDL_BlitSurface(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlit() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * This is a semi-private blit function and it performs low-level surface - * blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief Perform a fast, low quality, stretch blit between two surfaces of the - * same pixel format. - * - * \note This function uses a static buffer, and is not thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, - const SDL_Rect * dstrect); - -#define SDL_BlitScaled SDL_UpperBlitScaled - -/** - * This is the public scaled blit function, SDL_BlitScaled(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlitScaled - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * This is a semi-private blit function and it performs low-level surface - * scaled blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlitScaled - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_surface_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_system.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_system.h deleted file mode 100644 index 5da9adb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_system.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_system.h - * - * Include file for platform specific SDL API functions - */ - -#ifndef _SDL_system_h -#define _SDL_system_h - -#include "SDL_stdinc.h" -#include "SDL_keyboard.h" -#include "SDL_render.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* Platform specific functions for Windows */ -#ifdef __WIN32__ - -/** - \brief Set a function that is called for every windows message, before TranslateMessage() -*/ -typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); -extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); - -/** - \brief Returns the D3D9 adapter index that matches the specified display index. - - This adapter index can be passed to IDirect3D9::CreateDevice and controls - on which monitor a full screen application will appear. -*/ -extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); - -typedef struct IDirect3DDevice9 IDirect3DDevice9; -/** - \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. - - Once you are done using the device, you should release it to avoid a resource leak. - */ -extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); - -/** - \brief Returns the DXGI Adapter and Output indices for the specified display index. - - These can be passed to EnumAdapters and EnumOutputs respectively to get the objects - required to create a DX10 or DX11 device and swap chain. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); - -#endif /* __WIN32__ */ - - -/* Platform specific functions for iOS */ -#if defined(__IPHONEOS__) && __IPHONEOS__ - -#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); - -#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) -extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); - -#endif /* __IPHONEOS__ */ - - -/* Platform specific functions for Android */ -#if defined(__ANDROID__) && __ANDROID__ - -/** - \brief Get the JNI environment for the current thread - - This returns JNIEnv*, but the prototype is void* so we don't need jni.h - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); - -/** - \brief Get the SDL Activity object for the application - - This returns jobject, but the prototype is void* so we don't need jni.h - The jobject returned by SDL_AndroidGetActivity is a local reference. - It is the caller's responsibility to properly release it - (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(); - -/** - See the official Android developer guide for more information: - http://developer.android.com/guide/topics/data/data-storage.html -*/ -#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 -#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 - -/** - \brief Get the path used for internal storage for this application. - - This path is unique to your application and cannot be written to - by other applications. - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(); - -/** - \brief Get the current state of external storage, a bitmask of these values: - SDL_ANDROID_EXTERNAL_STORAGE_READ - SDL_ANDROID_EXTERNAL_STORAGE_WRITE - - If external storage is currently unavailable, this will return 0. -*/ -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(); - -/** - \brief Get the path used for external storage for this application. - - This path is unique to your application, but is public and can be - written to by other applications. - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(); - -#endif /* __ANDROID__ */ - -/* Platform specific functions for WinRT */ -#if defined(__WINRT__) && __WINRT__ - -/** - * \brief WinRT / Windows Phone path types - */ -typedef enum -{ - /** \brief The installed app's root directory. - Files here are likely to be read-only. */ - SDL_WINRT_PATH_INSTALLED_LOCATION, - - /** \brief The app's local data store. Files may be written here */ - SDL_WINRT_PATH_LOCAL_FOLDER, - - /** \brief The app's roaming data store. Unsupported on Windows Phone. - Files written here may be copied to other machines via a network - connection. - */ - SDL_WINRT_PATH_ROAMING_FOLDER, - - /** \brief The app's temporary data store. Unsupported on Windows Phone. - Files written here may be deleted at any time. */ - SDL_WINRT_PATH_TEMP_FOLDER -} SDL_WinRT_Path; - - -/** - * \brief Retrieves a WinRT defined path on the local file system - * - * \note Documentation on most app-specific path types on WinRT - * can be found on MSDN, at the URL: - * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType The type of path to retrieve. - * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL - * if the path is not available for any reason. Not all paths are - * available on all versions of Windows. This is especially true on - * Windows Phone. Check the documentation for the given - * SDL_WinRT_Path for more information on which path types are - * supported where. - */ -extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); - -/** - * \brief Retrieves a WinRT defined path on the local file system - * - * \note Documentation on most app-specific path types on WinRT - * can be found on MSDN, at the URL: - * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType The type of path to retrieve. - * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL - * if the path is not available for any reason. Not all paths are - * available on all versions of Windows. This is especially true on - * Windows Phone. Check the documentation for the given - * SDL_WinRT_Path for more information on which path types are - * supported where. - */ -extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); - -#endif /* __WINRT__ */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_system_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_syswm.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_syswm.h deleted file mode 100644 index 1056e52..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_syswm.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_syswm.h - * - * Include file for SDL custom system window manager hooks. - */ - -#ifndef _SDL_syswm_h -#define _SDL_syswm_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_version.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_syswm.h - * - * Your application has access to a special type of event ::SDL_SYSWMEVENT, - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState(). - */ -#ifdef SDL_PROTOTYPES_ONLY -struct SDL_SysWMinfo; -#else - -#if defined(SDL_VIDEO_DRIVER_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif - -#if defined(SDL_VIDEO_DRIVER_WINRT) -#include -#endif - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) -#if defined(__APPLE__) && defined(__MACH__) -/* conflicts with Quickdraw.h */ -#define Cursor X11Cursor -#endif - -#include -#include - -#if defined(__APPLE__) && defined(__MACH__) -/* matches the re-define above */ -#undef Cursor -#endif - -#endif /* defined(SDL_VIDEO_DRIVER_X11) */ - -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) -#include -#endif - -#if defined(SDL_VIDEO_DRIVER_COCOA) -#ifdef __OBJC__ -@class NSWindow; -#else -typedef struct _NSWindow NSWindow; -#endif -#endif - -#if defined(SDL_VIDEO_DRIVER_UIKIT) -#ifdef __OBJC__ -#include -#else -typedef struct _UIWindow UIWindow; -typedef struct _UIViewController UIViewController; -#endif -typedef Uint32 GLuint; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) -typedef struct ANativeWindow ANativeWindow; -typedef void *EGLSurface; -#endif - -/** - * These are the various supported windowing subsystems - */ -typedef enum -{ - SDL_SYSWM_UNKNOWN, - SDL_SYSWM_WINDOWS, - SDL_SYSWM_X11, - SDL_SYSWM_DIRECTFB, - SDL_SYSWM_COCOA, - SDL_SYSWM_UIKIT, - SDL_SYSWM_WAYLAND, - SDL_SYSWM_MIR, - SDL_SYSWM_WINRT, - SDL_SYSWM_ANDROID -} SDL_SYSWM_TYPE; - -/** - * The custom event structure. - */ -struct SDL_SysWMmsg -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct { - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct { - XEvent event; - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct { - DFBEvent event; - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { - /* Latest version of Xcode clang complains about empty structs in C v. C++: - error: empty struct has size 0 in C, size 1 in C++ - */ - int dummy; - /* No Cocoa window events yet */ - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { - int dummy; - /* No UIKit window events yet */ - } uikit; -#endif - /* Can't have an empty union */ - int dummy; - } msg; -}; - -/** - * The custom window manager information structure. - * - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct - { - HWND window; /**< The window handle */ - HDC hdc; /**< The window device context */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_WINRT) - struct - { - IInspectable * window; /**< The WinRT CoreWindow */ - } winrt; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct - { - Display *display; /**< The X11 display */ - Window window; /**< The X11 window */ - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct - { - IDirectFB *dfb; /**< The directfb main interface */ - IDirectFBWindow *window; /**< The directfb window handle */ - IDirectFBSurface *surface; /**< The directfb client surface */ - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { -#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) - NSWindow __unsafe_unretained *window; /* The Cocoa window */ -#else - NSWindow *window; /* The Cocoa window */ -#endif - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { -#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) - UIWindow __unsafe_unretained *window; /* The UIKit window */ -#else - UIWindow *window; /* The UIKit window */ -#endif - GLuint framebuffer; /* The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ - GLuint colorbuffer; /* The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ - GLuint resolveFramebuffer; /* The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_WAYLAND) - struct - { - struct wl_display *display; /**< Wayland display */ - struct wl_surface *surface; /**< Wayland surface */ - struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */ - } wl; -#endif -#if defined(SDL_VIDEO_DRIVER_MIR) - struct - { - struct MirConnection *connection; /**< Mir display server connection */ - struct MirSurface *surface; /**< Mir surface */ - } mir; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) - struct - { - ANativeWindow *window; - EGLSurface surface; - } android; -#endif - - /* Can't have an empty union */ - int dummy; - } info; -}; - -#endif /* SDL_PROTOTYPES_ONLY */ - -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - -/* Function prototypes */ -/** - * \brief This function allows access to driver-dependent window information. - * - * \param window The window about which information is being requested - * \param info This structure must be initialized with the SDL version, and is - * then filled in with information about the given window. - * - * \return SDL_TRUE if the function is implemented and the version member of - * the \c info struct is valid, SDL_FALSE otherwise. - * - * You typically use this function like this: - * \code - * SDL_SysWMinfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } - * \endcode - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, - SDL_SysWMinfo * info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_syswm_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test.h deleted file mode 100644 index 217847b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -#ifndef _SDL_test_h -#define _SDL_test_h - -#include "SDL.h" -#include "SDL_test_common.h" -#include "SDL_test_font.h" -#include "SDL_test_random.h" -#include "SDL_test_fuzzer.h" -#include "SDL_test_crc32.h" -#include "SDL_test_md5.h" -#include "SDL_test_log.h" -#include "SDL_test_assert.h" -#include "SDL_test_harness.h" -#include "SDL_test_images.h" -#include "SDL_test_compare.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Global definitions */ - -/* - * Note: Maximum size of SDLTest log message is less than SDL's limit - * to ensure we can fit additional information such as the timestamp. - */ -#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_assert.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_assert.h deleted file mode 100644 index 29277e1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_assert.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_assert.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - * - * Assert API for test code and test cases - * - */ - -#ifndef _SDL_test_assert_h -#define _SDL_test_assert_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Fails the assert. - */ -#define ASSERT_FAIL 0 - -/** - * \brief Passes the assert. - */ -#define ASSERT_PASS 1 - -/** - * \brief Assert that logs and break execution flow on failures. - * - * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). - * \param assertDescription Message to log with the assert describing it. - */ -void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. - * - * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). - * \param assertDescription Message to log with the assert describing it. - * - * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired. - */ -int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. - * - * \param assertDescription Message to log with the assert describing it. - */ -void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Resets the assert summary counters to zero. - */ -void SDLTest_ResetAssertSummary(); - -/** - * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. - */ -void SDLTest_LogAssertSummary(); - - -/** - * \brief Converts the current assert summary state to a test result. - * - * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT - */ -int SDLTest_AssertSummaryToTestResult(); - -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_assert_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_common.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_common.h deleted file mode 100644 index 0ebf31c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_common.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_common.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* Ported from original test\common.h file. */ - -#ifndef _SDL_test_common_h -#define _SDL_test_common_h - -#include "SDL.h" - -#if defined(__PSP__) -#define DEFAULT_WINDOW_WIDTH 480 -#define DEFAULT_WINDOW_HEIGHT 272 -#else -#define DEFAULT_WINDOW_WIDTH 640 -#define DEFAULT_WINDOW_HEIGHT 480 -#endif - -#define VERBOSE_VIDEO 0x00000001 -#define VERBOSE_MODES 0x00000002 -#define VERBOSE_RENDER 0x00000004 -#define VERBOSE_EVENT 0x00000008 -#define VERBOSE_AUDIO 0x00000010 - -typedef struct -{ - /* SDL init flags */ - char **argv; - Uint32 flags; - Uint32 verbose; - - /* Video info */ - const char *videodriver; - int display; - const char *window_title; - const char *window_icon; - Uint32 window_flags; - int window_x; - int window_y; - int window_w; - int window_h; - int window_minW; - int window_minH; - int window_maxW; - int window_maxH; - int logical_w; - int logical_h; - float scale; - int depth; - int refresh_rate; - int num_windows; - SDL_Window **windows; - - /* Renderer info */ - const char *renderdriver; - Uint32 render_flags; - SDL_bool skip_renderer; - SDL_Renderer **renderers; - SDL_Texture **targets; - - /* Audio info */ - const char *audiodriver; - SDL_AudioSpec audiospec; - - /* GL settings */ - int gl_red_size; - int gl_green_size; - int gl_blue_size; - int gl_alpha_size; - int gl_buffer_size; - int gl_depth_size; - int gl_stencil_size; - int gl_double_buffer; - int gl_accum_red_size; - int gl_accum_green_size; - int gl_accum_blue_size; - int gl_accum_alpha_size; - int gl_stereo; - int gl_multisamplebuffers; - int gl_multisamplesamples; - int gl_retained_backing; - int gl_accelerated; - int gl_major_version; - int gl_minor_version; - int gl_debug; - int gl_profile_mask; -} SDLTest_CommonState; - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -/** - * \brief Parse command line parameters and create common state. - * - * \param argv Array of command line parameters - * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) - * - * \returns Returns a newly allocated common state object. - */ -SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); - -/** - * \brief Process one common argument. - * - * \param state The common state describing the test window to create. - * \param index The index of the argument to process in argv[]. - * - * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error. - */ -int SDLTest_CommonArg(SDLTest_CommonState * state, int index); - -/** - * \brief Returns common usage information - * - * \param state The common state describing the test window to create. - * - * \returns String with usage information - */ -const char *SDLTest_CommonUsage(SDLTest_CommonState * state); - -/** - * \brief Open test window. - * - * \param state The common state describing the test window to create. - * - * \returns True if initialization succeeded, false otherwise - */ -SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); - -/** - * \brief Common event handler for test windows. - * - * \param state The common state used to create test window. - * \param event The event to handle. - * \param done Flag indicating we are done. - * - */ -void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); - -/** - * \brief Close test window. - * - * \param state The common state used to create test window. - * - */ -void SDLTest_CommonQuit(SDLTest_CommonState * state); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_common_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_compare.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_compare.h deleted file mode 100644 index 772cf9f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_compare.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_compare.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Defines comparison functions (i.e. for surfaces). - -*/ - -#ifndef _SDL_test_compare_h -#define _SDL_test_compare_h - -#include "SDL.h" - -#include "SDL_test_images.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Compares a surface and with reference image data for equality - * - * \param surface Surface used in comparison - * \param referenceSurface Test Surface used in comparison - * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. - * - * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. - */ -int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_compare_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_crc32.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_crc32.h deleted file mode 100644 index 572a3d9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_crc32.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_crc32.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Implements CRC32 calculations (default output is Perl String::CRC32 compatible). - -*/ - -#ifndef _SDL_test_crc32_h -#define _SDL_test_crc32_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* ------------ Definitions --------- */ - -/* Definition shared by all CRC routines */ - -#ifndef CrcUint32 - #define CrcUint32 unsigned int -#endif -#ifndef CrcUint8 - #define CrcUint8 unsigned char -#endif - -#ifdef ORIGINAL_METHOD - #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ -#else - #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ -#endif - -/** - * Data structure for CRC32 (checksum) computation - */ - typedef struct { - CrcUint32 crc32_table[256]; /* CRC table */ - } SDLTest_Crc32Context; - -/* ---------- Function Prototypes ------------- */ - -/** - * \brief Initialize the CRC context - * - * Note: The function initializes the crc table required for all crc calculations. - * - * \param crcContext pointer to context variable - * - * \returns 0 for OK, -1 on error - * - */ - int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); - - -/** - * \brief calculate a crc32 from a data block - * - * \param crcContext pointer to context variable - * \param inBuf input buffer to checksum - * \param inLen length of input buffer - * \param crc32 pointer to Uint32 to store the final CRC into - * - * \returns 0 for OK, -1 on error - * - */ -int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); - -/* Same routine broken down into three steps */ -int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); -int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); -int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); - - -/** - * \brief clean up CRC context - * - * \param crcContext pointer to context variable - * - * \returns 0 for OK, -1 on error - * -*/ - -int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_crc32_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_font.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_font.h deleted file mode 100644 index 3378ea8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_font.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_font.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -#ifndef _SDL_test_font_h -#define _SDL_test_font_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -#define FONT_CHARACTER_SIZE 8 - -/** - * \brief Draw a string in the currently set font. - * - * \param renderer The renderer to draw on. - * \param x The X coordinate of the upper left corner of the character. - * \param y The Y coordinate of the upper left corner of the character. - * \param c The character to draw. - * - * \returns Returns 0 on success, -1 on failure. - */ -int SDLTest_DrawCharacter( SDL_Renderer *renderer, int x, int y, char c ); - -/** - * \brief Draw a string in the currently set font. - * - * \param renderer The renderer to draw on. - * \param x The X coordinate of the upper left corner of the string. - * \param y The Y coordinate of the upper left corner of the string. - * \param s The string to draw. - * - * \returns Returns 0 on success, -1 on failure. - */ -int SDLTest_DrawString( SDL_Renderer * renderer, int x, int y, const char *s ); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_font_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_fuzzer.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_fuzzer.h deleted file mode 100644 index 9603652..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_fuzzer.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_fuzzer.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Data generators for fuzzing test data in a reproducible way. - -*/ - -#ifndef _SDL_test_fuzzer_h -#define _SDL_test_fuzzer_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* - Based on GSOC code by Markus Kauppila -*/ - - -/** - * \file - * Note: The fuzzer implementation uses a static instance of random context - * internally which makes it thread-UNsafe. - */ - -/** - * Initializes the fuzzer for a test - * - * \param execKey Execution "Key" that initializes the random number generator uniquely for the test. - * - */ -void SDLTest_FuzzerInit(Uint64 execKey); - - -/** - * Returns a random Uint8 - * - * \returns Generated integer - */ -Uint8 SDLTest_RandomUint8(); - -/** - * Returns a random Sint8 - * - * \returns Generated signed integer - */ -Sint8 SDLTest_RandomSint8(); - - -/** - * Returns a random Uint16 - * - * \returns Generated integer - */ -Uint16 SDLTest_RandomUint16(); - -/** - * Returns a random Sint16 - * - * \returns Generated signed integer - */ -Sint16 SDLTest_RandomSint16(); - - -/** - * Returns a random integer - * - * \returns Generated integer - */ -Sint32 SDLTest_RandomSint32(); - - -/** - * Returns a random positive integer - * - * \returns Generated integer - */ -Uint32 SDLTest_RandomUint32(); - -/** - * Returns random Uint64. - * - * \returns Generated integer - */ -Uint64 SDLTest_RandomUint64(); - - -/** - * Returns random Sint64. - * - * \returns Generated signed integer - */ -Sint64 SDLTest_RandomSint64(); - -/** - * \returns random float in range [0.0 - 1.0[ - */ -float SDLTest_RandomUnitFloat(); - -/** - * \returns random double in range [0.0 - 1.0[ - */ -double SDLTest_RandomUnitDouble(); - -/** - * \returns random float. - * - */ -float SDLTest_RandomFloat(); - -/** - * \returns random double. - * - */ -double SDLTest_RandomDouble(); - -/** - * Returns a random boundary value for Uint8 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or 0 with error set - */ -Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Uint16 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or 0 with error set - */ -Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Uint32 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or 0 with error set - */ -Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Uint64 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or 0 with error set - */ -Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Sint8 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 - * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or SINT8_MIN with error set - */ -Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); - - -/** - * Returns a random boundary value for Sint16 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 - * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or SINT16_MIN with error set - */ -Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Sint32 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 - * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or SINT32_MIN with error set - */ -Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Sint64 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 - * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns Random boundary value for the given range and domain or SINT64_MIN with error set - */ -Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); - - -/** - * Returns integer in range [min, max] (inclusive). - * Min and max values can be negative values. - * If Max in smaller than min, then the values are swapped. - * Min and max are the same value, that value will be returned. - * - * \param min Minimum inclusive value of returned random number - * \param max Maximum inclusive value of returned random number - * - * \returns Generated random integer in range - */ -Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); - - -/** - * Generates random null-terminated string. The minimum length for - * the string is 1 character, maximum length for the string is 255 - * characters and it can contain ASCII characters from 32 to 126. - * - * Note: Returned string needs to be deallocated. - * - * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated. - */ -char * SDLTest_RandomAsciiString(); - - -/** - * Generates random null-terminated string. The maximum length for - * the string is defined by the maxLength parameter. - * String can contain ASCII characters from 32 to 126. - * - * Note: Returned string needs to be deallocated. - * - * \param maxLength The maximum length of the generated string. - * - * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. - */ -char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); - - -/** - * Generates random null-terminated string. The length for - * the string is defined by the size parameter. - * String can contain ASCII characters from 32 to 126. - * - * Note: Returned string needs to be deallocated. - * - * \param size The length of the generated string - * - * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated. - */ -char * SDLTest_RandomAsciiStringOfSize(int size); - -/** - * Returns the invocation count for the fuzzer since last ...FuzzerInit. - */ -int SDLTest_GetFuzzerInvocationCount(); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_fuzzer_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_harness.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_harness.h deleted file mode 100644 index 74c0950..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_harness.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_harness.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - Defines types for test case definitions and the test execution harness API. - - Based on original GSOC code by Markus Kauppila -*/ - -#ifndef _SDL_test_harness_h -#define _SDL_test_harness_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* ! Definitions for test case structures */ -#define TEST_ENABLED 1 -#define TEST_DISABLED 0 - -/* ! Definition of all the possible test return values of the test case method */ -#define TEST_ABORTED -1 -#define TEST_STARTED 0 -#define TEST_COMPLETED 1 -#define TEST_SKIPPED 2 - -/* ! Definition of all the possible test results for the harness */ -#define TEST_RESULT_PASSED 0 -#define TEST_RESULT_FAILED 1 -#define TEST_RESULT_NO_ASSERT 2 -#define TEST_RESULT_SKIPPED 3 -#define TEST_RESULT_SETUP_FAILURE 4 - -/* !< Function pointer to a test case setup function (run before every test) */ -typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); - -/* !< Function pointer to a test case function */ -typedef int (*SDLTest_TestCaseFp)(void *arg); - -/* !< Function pointer to a test case teardown function (run after every test) */ -typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); - -/** - * Holds information about a single test case. - */ -typedef struct SDLTest_TestCaseReference { - /* !< Func2Stress */ - SDLTest_TestCaseFp testCase; - /* !< Short name (or function name) "Func2Stress" */ - char *name; - /* !< Long name or full description "This test pushes func2() to the limit." */ - char *description; - /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ - int enabled; -} SDLTest_TestCaseReference; - -/** - * Holds information about a test suite (multiple test cases). - */ -typedef struct SDLTest_TestSuiteReference { - /* !< "PlatformSuite" */ - char *name; - /* !< The function that is run before each test. NULL skips. */ - SDLTest_TestCaseSetUpFp testSetUp; - /* !< The test cases that are run as part of the suite. Last item should be NULL. */ - const SDLTest_TestCaseReference **testCases; - /* !< The function that is run after each test. NULL skips. */ - SDLTest_TestCaseTearDownFp testTearDown; -} SDLTest_TestSuiteReference; - - -/** - * \brief Execute a test suite using the given run seed and execution key. - * - * \param testSuites Suites containing the test case. - * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. - * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. - * \param filter Filter specification. NULL disables. Case sensitive. - * \param testIterations Number of iterations to run each test case. - * - * \returns Test run result; 0 when all tests passed, 1 if any tests failed. - */ -int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_harness_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_images.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_images.h deleted file mode 100644 index 8c64b4f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_images.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_images.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Defines some images for tests. - -*/ - -#ifndef _SDL_test_images_h -#define _SDL_test_images_h - -#include "SDL.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - *Type for test images. - */ -typedef struct SDLTest_SurfaceImage_s { - int width; - int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - const char *pixel_data; -} SDLTest_SurfaceImage_t; - -/* Test images */ -SDL_Surface *SDLTest_ImageBlit(); -SDL_Surface *SDLTest_ImageBlitColor(); -SDL_Surface *SDLTest_ImageBlitAlpha(); -SDL_Surface *SDLTest_ImageBlitBlendAdd(); -SDL_Surface *SDLTest_ImageBlitBlend(); -SDL_Surface *SDLTest_ImageBlitBlendMod(); -SDL_Surface *SDLTest_ImageBlitBlendNone(); -SDL_Surface *SDLTest_ImageBlitBlendAll(); -SDL_Surface *SDLTest_ImageFace(); -SDL_Surface *SDLTest_ImagePrimitives(); -SDL_Surface *SDLTest_ImagePrimitivesBlend(); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_images_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_log.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_log.h deleted file mode 100644 index 73a5c01..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_log.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_log.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - * - * Wrapper to log in the TEST category - * - */ - -#ifndef _SDL_test_log_h -#define _SDL_test_log_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Prints given message with a timestamp in the TEST category and INFO priority. - * - * \param fmt Message to be logged - */ -void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. - * - * \param fmt Message to be logged - */ -void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_log_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_md5.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_md5.h deleted file mode 100644 index f2d9a7d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_md5.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_md5.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - *********************************************************************** - ** Header file for implementation of MD5 ** - ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** - ** Created: 2/17/90 RLR ** - ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** - ** Revised (for MD5): RLR 4/27/91 ** - ** -- G modified to have y&~z instead of y&z ** - ** -- FF, GG, HH modified to add in last register done ** - ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** - ** -- distinct additive constant for each step ** - ** -- round 4 added, working mod 7 ** - *********************************************************************** -*/ - -/* - *********************************************************************** - ** Message-digest routines: ** - ** To form the message digest for a message M ** - ** (1) Initialize a context buffer mdContext using MD5Init ** - ** (2) Call MD5Update on mdContext and M ** - ** (3) Call MD5Final on mdContext ** - ** The message digest is now in mdContext->digest[0...15] ** - *********************************************************************** -*/ - -#ifndef _SDL_test_md5_h -#define _SDL_test_md5_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------ Definitions --------- */ - -/* typedef a 32-bit type */ - typedef unsigned long int MD5UINT4; - -/* Data structure for MD5 (Message-Digest) computation */ - typedef struct { - MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ - MD5UINT4 buf[4]; /* scratch buffer */ - unsigned char in[64]; /* input buffer */ - unsigned char digest[16]; /* actual digest after Md5Final call */ - } SDLTest_Md5Context; - -/* ---------- Function Prototypes ------------- */ - -/** - * \brief initialize the context - * - * \param mdContext pointer to context variable - * - * Note: The function initializes the message-digest context - * mdContext. Call before each new use of the context - - * all fields are set to zero. - */ - void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); - - -/** - * \brief update digest from variable length data - * - * \param mdContext pointer to context variable - * \param inBuf pointer to data array/string - * \param inLen length of data array/string - * - * Note: The function updates the message-digest context to account - * for the presence of each of the characters inBuf[0..inLen-1] - * in the message whose digest is being computed. -*/ - - void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, - unsigned int inLen); - - -/** - * \brief complete digest computation - * - * \param mdContext pointer to context variable - * - * Note: The function terminates the message-digest computation and - * ends with the desired message digest in mdContext.digest[0..15]. - * Always call before using the digest[] variable. -*/ - - void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_md5_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_random.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_random.h deleted file mode 100644 index 91c3652..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_test_random.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_test_random.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - A "32-bit Multiply with carry random number generator. Very fast. - Includes a list of recommended multipliers. - - multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. - period: (a*2^31)-1 - -*/ - -#ifndef _SDL_test_random_h -#define _SDL_test_random_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* --- Definitions */ - -/* - * Macros that return a random number in a specific format. - */ -#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) - -/* - * Context structure for the random number generator state. - */ - typedef struct { - unsigned int a; - unsigned int x; - unsigned int c; - unsigned int ah; - unsigned int al; - } SDLTest_RandomContext; - - -/* --- Function prototypes */ - -/** - * \brief Initialize random number generator with two integers. - * - * Note: The random sequence of numbers returned by ...Random() is the - * same for the same two integers and has a period of 2^31. - * - * \param rndContext pointer to context structure - * \param xi integer that defines the random sequence - * \param ci integer that defines the random sequence - * - */ - void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, - unsigned int ci); - -/** - * \brief Initialize random number generator based on current system time. - * - * \param rndContext pointer to context structure - * - */ - void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); - - -/** - * \brief Initialize random number generator based on current system time. - * - * Note: ...RandomInit() or ...RandomInitTime() must have been called - * before using this function. - * - * \param rndContext pointer to context structure - * - * \returns A random number (32bit unsigned integer) - * - */ - unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_test_random_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_thread.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_thread.h deleted file mode 100644 index 377e6c7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_thread.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_thread_h -#define _SDL_thread_h - -/** - * \file SDL_thread.h - * - * Header for the SDL thread management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_atomic.h" -#include "SDL_mutex.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/* The SDL thread ID */ -typedef unsigned long SDL_threadID; - -/* Thread local storage ID, 0 is the invalid ID */ -typedef unsigned int SDL_TLSID; - -/** - * The SDL thread priority. - * - * \note On many systems you require special privileges to set high priority. - */ -typedef enum { - SDL_THREAD_PRIORITY_LOW, - SDL_THREAD_PRIORITY_NORMAL, - SDL_THREAD_PRIORITY_HIGH -} SDL_ThreadPriority; - -/** - * The function passed to SDL_CreateThread(). - * It is passed a void* user context parameter and returns an int. - */ -typedef int (SDLCALL * SDL_ThreadFunction) (void *data); - -#if defined(__WIN32__) && !defined(HAVE_LIBC) -/** - * \file SDL_thread.h - * - * We compile SDL into a DLL. This means, that it's the DLL which - * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL.DLL will - * be initialized for those threads, and not the RTL of the calling - * application! - * - * To solve this, we make a little hack here. - * - * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL.DLL which uses this API, - * then the RTL of SDL.DLL will be used to create the new thread, and if it's - * the application, then the RTL of the application will be used. - * - * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime - * library! - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#include /* This has _beginthread() and _endthread() defined! */ - -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall * - func) (void - *), - void *arg, unsigned, - unsigned *threadID); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); - -/** - * Create a thread. - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -/** - * Create a thread. - */ -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#endif - -#else - -/** - * Create a thread. - * - * Thread naming is a little complicated: Most systems have very small - * limits for the string length (Haiku has 32 bytes, Linux currently has 16, - * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll - * have to see what happens with your system's debugger. The name should be - * UTF-8 (but using the naming limits of C identifiers is a better bet). - * There are no requirements for thread naming conventions, so long as the - * string is null-terminated UTF-8, but these guidelines are helpful in - * choosing a name: - * - * http://stackoverflow.com/questions/149932/naming-conventions-for-threads - * - * If a system imposes requirements, SDL will try to munge the string for - * it (truncate, etc), but the original string contents will be available - * from SDL_GetThreadName(). - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); - -#endif - -/** - * Get the thread name, as it was specified in SDL_CreateThread(). - * This function returns a pointer to a UTF-8 string that names the - * specified thread, or NULL if it doesn't have a name. This is internal - * memory, not to be free()'d by the caller, and remains valid until the - * specified thread is cleaned up by SDL_WaitThread(). - */ -extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); - -/** - * Get the thread identifier for the current thread. - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); - -/** - * Get the thread identifier for the specified thread. - * - * Equivalent to SDL_ThreadID() if the specified thread is NULL. - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); - -/** - * Set the priority for the current thread - */ -extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); - -/** - * Wait for a thread to finish. Threads that haven't been detached will - * remain (as a "zombie") until this function cleans them up. Not doing so - * is a resource leak. - * - * Once a thread has been cleaned up through this function, the SDL_Thread - * that references it becomes invalid and should not be referenced again. - * As such, only one thread may call SDL_WaitThread() on another. - * - * The return code for the thread function is placed in the area - * pointed to by \c status, if \c status is not NULL. - * - * You may not wait on a thread that has been used in a call to - * SDL_DetachThread(). Use either that function or this one, but not - * both, or behavior is undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); - -/** - * A thread may be "detached" to signify that it should not remain until - * another thread has called SDL_WaitThread() on it. Detaching a thread - * is useful for long-running threads that nothing needs to synchronize - * with or further manage. When a detached thread is done, it simply - * goes away. - * - * There is no way to recover the return code of a detached thread. If you - * need this, don't detach the thread and instead use SDL_WaitThread(). - * - * Once a thread is detached, you should usually assume the SDL_Thread isn't - * safe to reference again, as it will become invalid immediately upon - * the detached thread's exit, instead of remaining until someone has called - * SDL_WaitThread() to finally clean it up. As such, don't detach the same - * thread more than once. - * - * If a thread has already exited when passed to SDL_DetachThread(), it will - * stop waiting for a call to SDL_WaitThread() and clean up immediately. - * It is not safe to detach a thread that might be used with SDL_WaitThread(). - * - * You may not call SDL_WaitThread() on a thread that has been detached. - * Use either that function or this one, but not both, or behavior is - * undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - */ -extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); - -/** - * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. - * - * \return The newly created thread local storage identifier, or 0 on error - * - * \code - * static SDL_SpinLock tls_lock; - * static SDL_TLSID thread_local_storage; - * - * void SetMyThreadData(void *value) - * { - * if (!thread_local_storage) { - * SDL_AtomicLock(&tls_lock); - * if (!thread_local_storage) { - * thread_local_storage = SDL_TLSCreate(); - * } - * SDL_AtomicUnlock(&tls_lock); - * } - * SDL_TLSSet(thread_local_storage, value, 0); - * } - * - * void *GetMyThreadData(void) - * { - * return SDL_TLSGet(thread_local_storage); - * } - * \endcode - * - * \sa SDL_TLSGet() - * \sa SDL_TLSSet() - */ -extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); - -/** - * \brief Get the value associated with a thread local storage ID for the current thread. - * - * \param id The thread local storage ID - * - * \return The value associated with the ID for the current thread, or NULL if no value has been set. - * - * \sa SDL_TLSCreate() - * \sa SDL_TLSSet() - */ -extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); - -/** - * \brief Set the value associated with a thread local storage ID for the current thread. - * - * \param id The thread local storage ID - * \param value The value to associate with the ID for the current thread - * \param destructor A function called when the thread exits, to free the value. - * - * \return 0 on success, -1 on error - * - * \sa SDL_TLSCreate() - * \sa SDL_TLSGet() - */ -extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*)); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_thread_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_timer.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_timer.h deleted file mode 100644 index e0d3785..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_timer.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -#ifndef _SDL_timer_h -#define _SDL_timer_h - -/** - * \file SDL_timer.h - * - * Header for the SDL time management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Get the number of milliseconds since the SDL library initialization. - * - * \note This value wraps if the program runs for more than ~49 days. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/** - * \brief Compare SDL ticks values, and return true if A has passed B - * - * e.g. if you want to wait 100 ms, you could do this: - * Uint32 timeout = SDL_GetTicks() + 100; - * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { - * ... do work until timeout has elapsed - * } - */ -#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) - -/** - * \brief Get the current value of the high resolution counter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); - -/** - * \brief Get the count per second of the high resolution counter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); - -/** - * \brief Wait a specified number of milliseconds before returning. - */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** - * Function prototype for the timer callback function. - * - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); - -/** - * Definition of the timer ID type. - */ -typedef int SDL_TimerID; - -/** - * \brief Add a new timer to the pool of timers already running. - * - * \return A timer ID, or 0 when an error occurs. - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, - SDL_TimerCallback callback, - void *param); - -/** - * \brief Remove a timer knowing its ID. - * - * \return A boolean value indicating success or failure. - * - * \warning It is not safe to remove a timer multiple times. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_timer_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_touch.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_touch.h deleted file mode 100644 index 2643e36..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_touch.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_touch.h - * - * Include file for SDL touch event handling. - */ - -#ifndef _SDL_touch_h -#define _SDL_touch_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_TouchID; -typedef Sint64 SDL_FingerID; - -typedef struct SDL_Finger -{ - SDL_FingerID id; - float x; - float y; - float pressure; -} SDL_Finger; - -/* Used as the device ID for mouse events simulated with touch input */ -#define SDL_TOUCH_MOUSEID ((Uint32)-1) - - -/* Function prototypes */ - -/** - * \brief Get the number of registered touch devices. - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); - -/** - * \brief Get the touch ID with the given index, or 0 if the index is invalid. - */ -extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); - -/** - * \brief Get the number of active fingers for a given touch device. - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); - -/** - * \brief Get the finger object of the given touch, with the given index. - */ -extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_touch_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_types.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_types.h deleted file mode 100644 index 5118af2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_types.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_types.h - * - * \deprecated - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_version.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_version.h deleted file mode 100644 index de1f160..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_version.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_version.h - * - * This header defines the current SDL version. - */ - -#ifndef _SDL_version_h -#define _SDL_version_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Information the version of SDL in use. - * - * Represents the library's version as three levels: major revision - * (increments with massive changes, additions, and enhancements), - * minor revision (increments with backwards-compatible changes to the - * major revision), and patchlevel (increments with fixes to the minor - * revision). - * - * \sa SDL_VERSION - * \sa SDL_GetVersion - */ -typedef struct SDL_version -{ - Uint8 major; /**< major version */ - Uint8 minor; /**< minor version */ - Uint8 patch; /**< update version */ -} SDL_version; - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -#define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 4 - -/** - * \brief Macro to determine SDL version program was compiled against. - * - * This macro fills in a SDL_version structure with the version of the - * library you compiled against. This is determined by what header the - * compiler uses. Note that if you dynamically linked the library, you might - * have a slightly newer or older version at runtime. That version can be - * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), - * is not a macro. - * - * \param x A pointer to a SDL_version struct to initialize. - * - * \sa SDL_version - * \sa SDL_GetVersion - */ -#define SDL_VERSION(x) \ -{ \ - (x)->major = SDL_MAJOR_VERSION; \ - (x)->minor = SDL_MINOR_VERSION; \ - (x)->patch = SDL_PATCHLEVEL; \ -} - -/** - * This macro turns the version numbers into a numeric value: - * \verbatim - (1,2,3) -> (1203) - \endverbatim - * - * This assumes that there will never be more than 100 patchlevels. - */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/** - * This is the version number macro for the current SDL version. - */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) - -/** - * This macro will evaluate to true if compiled with SDL at least X.Y.Z. - */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) - -/** - * \brief Get the version of SDL that is linked against your program. - * - * If you are linking to SDL dynamically, then it is possible that the - * current version will be different than the version you compiled against. - * This function returns the current version, while SDL_VERSION() is a - * macro that tells you what version you compiled with. - * - * \code - * SDL_version compiled; - * SDL_version linked; - * - * SDL_VERSION(&compiled); - * SDL_GetVersion(&linked); - * printf("We compiled against SDL version %d.%d.%d ...\n", - * compiled.major, compiled.minor, compiled.patch); - * printf("But we linked against SDL version %d.%d.%d.\n", - * linked.major, linked.minor, linked.patch); - * \endcode - * - * This function may be called safely at any time, even before SDL_Init(). - * - * \sa SDL_VERSION - */ -extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); - -/** - * \brief Get the code revision of SDL that is linked against your program. - * - * Returns an arbitrary string (a hash value) uniquely identifying the - * exact revision of the SDL library in use, and is only useful in comparing - * against other revisions. It is NOT an incrementing number. - */ -extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); - -/** - * \brief Get the revision number of SDL that is linked against your program. - * - * Returns a number uniquely identifying the exact revision of the SDL - * library in use. It is an incrementing number based on commits to - * hg.libsdl.org. - */ -extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_version_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_video.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_video.h deleted file mode 100644 index 52dbbc7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_video.h +++ /dev/null @@ -1,1103 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file SDL_video.h - * - * Header file for SDL video functions. - */ - -#ifndef _SDL_video_h -#define _SDL_video_h - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a display mode - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - * \sa SDL_GetDesktopDisplayMode() - * \sa SDL_GetCurrentDisplayMode() - * \sa SDL_GetClosestDisplayMode() - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -typedef struct -{ - Uint32 format; /**< pixel format */ - int w; /**< width, in screen coordinates */ - int h; /**< height, in screen coordinates */ - int refresh_rate; /**< refresh rate (or zero for unspecified) */ - void *driverdata; /**< driver-specific data, initialize to 0 */ -} SDL_DisplayMode; - -/** - * \brief The type used to identify a window - * - * \sa SDL_CreateWindow() - * \sa SDL_CreateWindowFrom() - * \sa SDL_DestroyWindow() - * \sa SDL_GetWindowData() - * \sa SDL_GetWindowFlags() - * \sa SDL_GetWindowGrab() - * \sa SDL_GetWindowPosition() - * \sa SDL_GetWindowSize() - * \sa SDL_GetWindowTitle() - * \sa SDL_HideWindow() - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - * \sa SDL_RaiseWindow() - * \sa SDL_RestoreWindow() - * \sa SDL_SetWindowData() - * \sa SDL_SetWindowFullscreen() - * \sa SDL_SetWindowGrab() - * \sa SDL_SetWindowIcon() - * \sa SDL_SetWindowPosition() - * \sa SDL_SetWindowSize() - * \sa SDL_SetWindowBordered() - * \sa SDL_SetWindowTitle() - * \sa SDL_ShowWindow() - */ -typedef struct SDL_Window SDL_Window; - -/** - * \brief The flags on a window - * - * \sa SDL_GetWindowFlags() - */ -typedef enum -{ - SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ - SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ - SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ - SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ - SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ - SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ - SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ - SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ - SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ - SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ - SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ - SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), - SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ - SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported */ - SDL_WINDOW_MOUSE_CAPTURE = 0x00004000 /**< window has mouse captured (unrelated to INPUT_GRABBED) */ -} SDL_WindowFlags; - -/** - * \brief Used to indicate that you don't care what the window position is. - */ -#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000 -#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) -#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) -#define SDL_WINDOWPOS_ISUNDEFINED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) - -/** - * \brief Used to indicate that the window position should be centered. - */ -#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000 -#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) -#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) -#define SDL_WINDOWPOS_ISCENTERED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) - -/** - * \brief Event subtype for window events - */ -typedef enum -{ - SDL_WINDOWEVENT_NONE, /**< Never used */ - SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ - SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ - SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be - redrawn */ - SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 - */ - SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ - SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as - a result of an API call or through the - system or user changing the window size. */ - SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ - SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ - SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size - and position */ - SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ - SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ - SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ - SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ - SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the - window be closed */ -} SDL_WindowEventID; - -/** - * \brief An opaque handle to an OpenGL context. - */ -typedef void *SDL_GLContext; - -/** - * \brief OpenGL configuration attributes - */ -typedef enum -{ - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR -} SDL_GLattr; - -typedef enum -{ - SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, - SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, - SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /* GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ -} SDL_GLprofile; - -typedef enum -{ - SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, - SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, - SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, - SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 -} SDL_GLcontextFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 -} SDL_GLcontextReleaseFlag; - - -/* Function prototypes */ - -/** - * \brief Get the number of video drivers compiled into SDL - * - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); - -/** - * \brief Get the name of a built in video driver. - * - * \note The video drivers are presented in the order in which they are - * normally checked during initialization. - * - * \sa SDL_GetNumVideoDrivers() - */ -extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); - -/** - * \brief Initialize the video subsystem, optionally specifying a video driver. - * - * \param driver_name Initialize a specific driver by name, or NULL for the - * default video driver. - * - * \return 0 on success, -1 on error - * - * This function initializes the video subsystem; setting up a connection - * to the window manager, etc, and determines the available display modes - * and pixel formats, but does not initialize a window or graphics mode. - * - * \sa SDL_VideoQuit() - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); - -/** - * \brief Shuts down the video subsystem. - * - * This function closes all windows, and restores the original video mode. - * - * \sa SDL_VideoInit() - */ -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); - -/** - * \brief Returns the name of the currently initialized video driver. - * - * \return The name of the current video driver or NULL if no driver - * has been initialized - * - * \sa SDL_GetNumVideoDrivers() - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); - -/** - * \brief Returns the number of available video displays. - * - * \sa SDL_GetDisplayBounds() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); - -/** - * \brief Get the name of a display in UTF-8 encoding - * - * \return The name of a display, or NULL for an invalid display index. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); - -/** - * \brief Get the desktop area represented by a display, with the primary - * display located at 0,0 - * - * \return 0 on success, or -1 if the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); - -/** - * \brief Get the dots/pixels-per-inch for a display - * - * \note Diagonal, horizontal and vertical DPI can all be optionally - * returned if the parameter is non-NULL. - * - * \return 0 on success, or -1 if no DPI information is available or the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); - -/** - * \brief Returns the number of available display modes. - * - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); - -/** - * \brief Fill in information about a specific display mode. - * - * \note The display modes are sorted in this priority: - * \li bits per pixel -> more colors to fewer colors - * \li width -> largest to smallest - * \li height -> largest to smallest - * \li refresh rate -> highest to lowest - * - * \sa SDL_GetNumDisplayModes() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, - SDL_DisplayMode * mode); - -/** - * \brief Fill in information about the desktop display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); - -/** - * \brief Fill in information about the current display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); - - -/** - * \brief Get the closest match to the requested display mode. - * - * \param displayIndex The index of display from which mode should be queried. - * \param mode The desired display mode - * \param closest A pointer to a display mode to be filled in with the closest - * match of the available display modes. - * - * \return The passed in value \c closest, or NULL if no matching video mode - * was available. - * - * The available display modes are scanned, and \c closest is filled in with the - * closest mode matching the requested mode and returned. The mode format and - * refresh_rate default to the desktop mode if they are 0. The modes are - * scanned with size being first priority, format being second priority, and - * finally checking the refresh_rate. If all the available modes are too - * small, then NULL is returned. - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); - -/** - * \brief Get the display index associated with a window. - * - * \return the display index of the display containing the center of the - * window, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); - -/** - * \brief Set the display mode used when a fullscreen window is visible. - * - * By default the window's dimensions and the desktop format and refresh rate - * are used. - * - * \param window The window for which the display mode should be set. - * \param mode The mode to use, or NULL for the default mode. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_GetWindowDisplayMode() - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, - const SDL_DisplayMode - * mode); - -/** - * \brief Fill in information about the display mode used when a fullscreen - * window is visible. - * - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, - SDL_DisplayMode * mode); - -/** - * \brief Get the pixel format associated with the window. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); - -/** - * \brief Create a window with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window, in screen coordinates. - * \param h The height of the window, in screen coordinates. - * \param flags The flags for the window, a mask of any of the following: - * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, - * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, - * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_ALLOW_HIGHDPI. - * - * \return The id of the window created, or zero if window creation failed. - * - * If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size - * in pixels may differ from its size in screen coordinates on platforms with - * high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query - * the client area's size in screen coordinates, and SDL_GL_GetDrawableSize() - * or SDL_GetRendererOutputSize() to query the drawable size in pixels. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, - int x, int y, int w, - int h, Uint32 flags); - -/** - * \brief Create an SDL window from an existing native window. - * - * \param data A pointer to driver-dependent window creation data - * - * \return The id of the window created, or zero if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); - -/** - * \brief Get the numeric ID of a window, for logging purposes. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); - -/** - * \brief Get a window from a stored ID, or NULL if it doesn't exist. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); - -/** - * \brief Get the window flags. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); - -/** - * \brief Set the title of a window, in UTF-8 format. - * - * \sa SDL_GetWindowTitle() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, - const char *title); - -/** - * \brief Get the title of a window, in UTF-8 format. - * - * \sa SDL_SetWindowTitle() - */ -extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); - -/** - * \brief Set the icon for a window. - * - * \param window The window for which the icon should be set. - * \param icon The icon for the window. - */ -extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, - SDL_Surface * icon); - -/** - * \brief Associate an arbitrary named pointer with a window. - * - * \param window The window to associate with the pointer. - * \param name The name of the pointer. - * \param userdata The associated pointer. - * - * \return The previous value associated with 'name' - * - * \note The name is case-sensitive. - * - * \sa SDL_GetWindowData() - */ -extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, - const char *name, - void *userdata); - -/** - * \brief Retrieve the data pointer associated with a window. - * - * \param window The window to query. - * \param name The name of the pointer. - * - * \return The value associated with 'name' - * - * \sa SDL_SetWindowData() - */ -extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, - const char *name); - -/** - * \brief Set the position of a window. - * - * \param window The window to reposition. - * \param x The x coordinate of the window in screen coordinates, or - * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y coordinate of the window in screen coordinates, or - * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. - * - * \note The window coordinate origin is the upper left of the display. - * - * \sa SDL_GetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, - int x, int y); - -/** - * \brief Get the position of a window. - * - * \param window The window to query. - * \param x Pointer to variable for storing the x position, in screen - * coordinates. May be NULL. - * \param y Pointer to variable for storing the y position, in screen - * coordinates. May be NULL. - * - * \sa SDL_SetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, - int *x, int *y); - -/** - * \brief Set the size of a window's client area. - * - * \param window The window to resize. - * \param w The width of the window, in screen coordinates. Must be >0. - * \param h The height of the window, in screen coordinates. Must be >0. - * - * \note You can't change the size of a fullscreen window, it automatically - * matches the size of the display mode. - * - * The window size in screen coordinates may differ from the size in pixels, if - * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with - * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * \sa SDL_GetWindowSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, - int h); - -/** - * \brief Get the size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the width, in screen - * coordinates. May be NULL. - * \param h Pointer to variable for storing the height, in screen - * coordinates. May be NULL. - * - * The window size in screen coordinates may differ from the size in pixels, if - * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with - * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * \sa SDL_SetWindowSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, - int *h); - -/** - * \brief Set the minimum size of a window's client area. - * - * \param window The window to set a new minimum size. - * \param min_w The minimum width of the window, must be >0 - * \param min_h The minimum height of the window, must be >0 - * - * \note You can't change the minimum size of a fullscreen window, it - * automatically matches the size of the display mode. - * - * \sa SDL_GetWindowMinimumSize() - * \sa SDL_SetWindowMaximumSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, - int min_w, int min_h); - -/** - * \brief Get the minimum size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the minimum width, may be NULL - * \param h Pointer to variable for storing the minimum height, may be NULL - * - * \sa SDL_GetWindowMaximumSize() - * \sa SDL_SetWindowMinimumSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, - int *w, int *h); - -/** - * \brief Set the maximum size of a window's client area. - * - * \param window The window to set a new maximum size. - * \param max_w The maximum width of the window, must be >0 - * \param max_h The maximum height of the window, must be >0 - * - * \note You can't change the maximum size of a fullscreen window, it - * automatically matches the size of the display mode. - * - * \sa SDL_GetWindowMaximumSize() - * \sa SDL_SetWindowMinimumSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, - int max_w, int max_h); - -/** - * \brief Get the maximum size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the maximum width, may be NULL - * \param h Pointer to variable for storing the maximum height, may be NULL - * - * \sa SDL_GetWindowMinimumSize() - * \sa SDL_SetWindowMaximumSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, - int *w, int *h); - -/** - * \brief Set the border state of a window. - * - * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and - * add or remove the border from the actual window. This is a no-op if the - * window's border already matches the requested state. - * - * \param window The window of which to change the border state. - * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. - * - * \note You can't change the border state of a fullscreen window. - * - * \sa SDL_GetWindowFlags() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, - SDL_bool bordered); - -/** - * \brief Show a window. - * - * \sa SDL_HideWindow() - */ -extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); - -/** - * \brief Hide a window. - * - * \sa SDL_ShowWindow() - */ -extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); - -/** - * \brief Raise a window above other windows and set the input focus. - */ -extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); - -/** - * \brief Make a window as large as possible. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); - -/** - * \brief Minimize a window to an iconic representation. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); - -/** - * \brief Restore the size and position of a minimized or maximized window. - * - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - */ -extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); - -/** - * \brief Set a window's fullscreen state. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, - Uint32 flags); - -/** - * \brief Get the SDL surface associated with the window. - * - * \return The window's framebuffer surface, or NULL on error. - * - * A new surface will be created with the optimal format for the window, - * if necessary. This surface will be freed when the window is destroyed. - * - * \note You may not combine this with 3D or the rendering API on this window. - * - * \sa SDL_UpdateWindowSurface() - * \sa SDL_UpdateWindowSurfaceRects() - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); - -/** - * \brief Copy the window surface to the screen. - * - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetWindowSurface() - * \sa SDL_UpdateWindowSurfaceRects() - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); - -/** - * \brief Copy a number of rectangles on the window surface to the screen. - * - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetWindowSurface() - * \sa SDL_UpdateWindowSurfaceRect() - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, - const SDL_Rect * rects, - int numrects); - -/** - * \brief Set a window's input grab mode. - * - * \param window The window for which the input grab mode should be set. - * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. - * - * If the caller enables a grab while another window is currently grabbed, - * the other window loses its grab in favor of the caller's window. - * - * \sa SDL_GetWindowGrab() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, - SDL_bool grabbed); - -/** - * \brief Get a window's input grab mode. - * - * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); - -/** - * \brief Get the window that currently has an input grab enabled. - * - * \return This returns the window if input is grabbed, and NULL otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); - -/** - * \brief Set the brightness (gamma correction) for a window. - * - * \return 0 on success, or -1 if setting the brightness isn't supported. - * - * \sa SDL_GetWindowBrightness() - * \sa SDL_SetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); - -/** - * \brief Get the brightness (gamma correction) for a window. - * - * \return The last brightness value passed to SDL_SetWindowBrightness() - * - * \sa SDL_SetWindowBrightness() - */ -extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); - -/** - * \brief Set the gamma ramp for a window. - * - * \param window The window for which the gamma ramp should be set. - * \param red The translation table for the red channel, or NULL. - * \param green The translation table for the green channel, or NULL. - * \param blue The translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * \sa SDL_GetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, - const Uint16 * red, - const Uint16 * green, - const Uint16 * blue); - -/** - * \brief Get the gamma ramp for a window. - * - * \param window The window from which the gamma ramp should be queried. - * \param red A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the red channel, or NULL. - * \param green A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the green channel, or NULL. - * \param blue A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * \sa SDL_SetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, - Uint16 * red, - Uint16 * green, - Uint16 * blue); - -/** - * \brief Possible return values from the SDL_HitTest callback. - * - * \sa SDL_HitTest - */ -typedef enum -{ - SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ - SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ - SDL_HITTEST_RESIZE_TOPLEFT, - SDL_HITTEST_RESIZE_TOP, - SDL_HITTEST_RESIZE_TOPRIGHT, - SDL_HITTEST_RESIZE_RIGHT, - SDL_HITTEST_RESIZE_BOTTOMRIGHT, - SDL_HITTEST_RESIZE_BOTTOM, - SDL_HITTEST_RESIZE_BOTTOMLEFT, - SDL_HITTEST_RESIZE_LEFT -} SDL_HitTestResult; - -/** - * \brief Callback used for hit-testing. - * - * \sa SDL_SetWindowHitTest - */ -typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, - const SDL_Point *area, - void *data); - -/** - * \brief Provide a callback that decides if a window region has special properties. - * - * Normally windows are dragged and resized by decorations provided by the - * system window manager (a title bar, borders, etc), but for some apps, it - * makes sense to drag them from somewhere else inside the window itself; for - * example, one might have a borderless window that wants to be draggable - * from any part, or simulate its own title bar, etc. - * - * This function lets the app provide a callback that designates pieces of - * a given window as special. This callback is run during event processing - * if we need to tell the OS to treat a region of the window specially; the - * use of this callback is known as "hit testing." - * - * Mouse input may not be delivered to your application if it is within - * a special area; the OS will often apply that input to moving the window or - * resizing the window and not deliver it to the application. - * - * Specifying NULL for a callback disables hit-testing. Hit-testing is - * disabled by default. - * - * Platforms that don't support this functionality will return -1 - * unconditionally, even if you're attempting to disable hit-testing. - * - * Your callback may fire at any time, and its firing does not indicate any - * specific behavior (for example, on Windows, this certainly might fire - * when the OS is deciding whether to drag your window, but it fires for lots - * of other reasons, too, some unrelated to anything you probably care about - * _and when the mouse isn't actually at the location it is testing_). - * Since this can fire at any time, you should try to keep your callback - * efficient, devoid of allocations, etc. - * - * \param window The window to set hit-testing on. - * \param callback The callback to call when doing a hit-test. - * \param callback_data An app-defined void pointer passed to the callback. - * \return 0 on success, -1 on error (including unsupported). - */ -extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, - SDL_HitTest callback, - void *callback_data); - -/** - * \brief Destroy a window. - */ -extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); - - -/** - * \brief Returns whether the screensaver is currently enabled (default on). - * - * \sa SDL_EnableScreenSaver() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); - -/** - * \brief Allow the screen to be blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); - -/** - * \brief Prevent the screen from being blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_EnableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); - - -/** - * \name OpenGL support functions - */ -/* @{ */ - -/** - * \brief Dynamically load an OpenGL library. - * - * \param path The platform dependent OpenGL library name, or NULL to open the - * default OpenGL library. - * - * \return 0 on success, or -1 if the library couldn't be loaded. - * - * This should be done after initializing the video driver, but before - * creating any OpenGL windows. If no OpenGL library is loaded, the default - * library will be loaded upon creation of the first OpenGL window. - * - * \note If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). - * - * \sa SDL_GL_GetProcAddress() - * \sa SDL_GL_UnloadLibrary() - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * \brief Get the address of an OpenGL function. - */ -extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); - -/** - * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). - * - * \sa SDL_GL_LoadLibrary() - */ -extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); - -/** - * \brief Return true if an OpenGL extension is supported for the current - * context. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char - *extension); - -/** - * \brief Reset all previously set OpenGL context attributes to their default values - */ -extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); - -/** - * \brief Set an OpenGL window attribute before window creation. - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * \brief Get the actual value for an attribute from the current context. - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); - -/** - * \brief Create an OpenGL context for use with an OpenGL window, and make it - * current. - * - * \sa SDL_GL_DeleteContext() - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * - window); - -/** - * \brief Set up an OpenGL context for rendering into an OpenGL window. - * - * \note The context must have been created with a compatible window. - */ -extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, - SDL_GLContext context); - -/** - * \brief Get the currently active OpenGL window. - */ -extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); - -/** - * \brief Get the currently active OpenGL context. - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); - -/** - * \brief Get the size of a window's underlying drawable in pixels (for use - * with glViewport). - * - * \param window Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, may be NULL - * \param h Pointer to variable for storing the height in pixels, may be NULL - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a - * platform with high-DPI support (Apple calls this "Retina"), and not disabled - * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. - * - * \sa SDL_GetWindowSize() - * \sa SDL_CreateWindow() - */ -extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, - int *h); - -/** - * \brief Set the swap interval for the current OpenGL context. - * - * \param interval 0 for immediate updates, 1 for updates synchronized with the - * vertical retrace. If the system supports it, you may - * specify -1 to allow late swaps to happen immediately - * instead of waiting for the next retrace. - * - * \return 0 on success, or -1 if setting the swap interval is not supported. - * - * \sa SDL_GL_GetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); - -/** - * \brief Get the swap interval for the current OpenGL context. - * - * \return 0 if there is no vertical retrace synchronization, 1 if the buffer - * swap is synchronized with the vertical retrace, and -1 if late - * swaps happen immediately instead of waiting for the next retrace. - * If the system can't determine the swap interval, or there isn't a - * valid current context, this will return 0 as a safe default. - * - * \sa SDL_GL_SetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); - -/** - * \brief Swap the OpenGL buffers for a window, if double-buffering is - * supported. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); - -/** - * \brief Delete an OpenGL context. - * - * \sa SDL_GL_CreateContext() - */ -extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); - -/* @} *//* OpenGL support functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/begin_code.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/begin_code.h deleted file mode 100644 index 04e78c6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/begin_code.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file begin_code.h - * - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) - */ - -/* This shouldn't be nested -- included it around code only. */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -#ifndef SDL_DEPRECATED -# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ -# define SDL_DEPRECATED __attribute__((deprecated)) -# else -# define SDL_DEPRECATED -# endif -#endif - -#ifndef SDL_UNUSED -# ifdef __GNUC__ -# define SDL_UNUSED __attribute__((unused)) -# else -# define SDL_UNUSED -# endif -#endif - -/* Some compilers use a special export keyword */ -#ifndef DECLSPEC -# if defined(__WIN32__) || defined(__WINRT__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/* By default SDL uses the C calling convention */ -#ifndef SDLCALL -#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) -#define SDLCALL __cdecl -#else -#define SDLCALL -#endif -#endif /* SDLCALL */ - -/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ -#ifdef __SYMBIAN32__ -#undef DECLSPEC -#define DECLSPEC -#endif /* __SYMBIAN32__ */ - -/* Force structure packing at 4 byte alignment. - This is necessary if the header is included in code which has structure - packing set to an alternate value, say for loading structures from disk. - The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#ifdef _M_X64 -/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ -#pragma pack(push,8) -#else -#pragma pack(push,4) -#endif -#endif /* Compiler needs structure packing set */ - -#ifndef SDL_INLINE -#if defined(__GNUC__) -#define SDL_INLINE __inline__ -#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) -#define SDL_INLINE __inline -#ifndef __inline__ -#define __inline__ __inline -#endif -#else -#define SDL_INLINE inline -#ifndef __inline__ -#define __inline__ inline -#endif -#endif -#endif /* SDL_INLINE not defined */ - -#ifndef SDL_FORCE_INLINE -#if defined(_MSC_VER) -#define SDL_FORCE_INLINE __forceinline -#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) -#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ -#else -#define SDL_FORCE_INLINE static SDL_INLINE -#endif -#endif /* SDL_FORCE_INLINE not defined */ - -/* Apparently this is needed by several Windows compilers */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/close_code.h b/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/close_code.h deleted file mode 100644 index d908b00..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/close_code.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - 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. -*/ - -/** - * \file close_code.h - * - * This file reverses the effects of begin_code.h and should be included - * after you finish any function and structure declarations in your headers - */ - -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#pragma pack(pop) -#endif /* Compiler needs structure packing set */ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp deleted file mode 100644 index 9aa3671..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Application.hpp +++ /dev/null @@ -1,395 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Application.hpp - * - * Declares the application class. - */ -#ifndef TOUCHGFX_APPLICATION_HPP -#define TOUCHGFX_APPLICATION_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -class Drawable; -class Screen; -class Transition; - -/** - * The Application class is the main interface for manipulating screen contents. It holds a - * pointer to the currently displayed Screen, and delegates draw requests and events to - * that Screen. Additionally it contains some global application settings. - */ -class Application : public UIEventListener -{ -public: - /** - * Gets the single instance application. - * - * @return The instance of this application. - */ - static Application* getInstance(); - - /** - * Gets the current screen. - * - * @return The current screen. - */ - static Screen* getCurrentScreen() - { - return currentScreen; - } - - /** - * This function can be called to send your application back to - * the start screen. The simulator will call this function when F5 - * is pressed. To make this work, please implement this function - * in FrontendApplication. - * - * @note The application will not make a complete restart - if - * your Model contains data, this will not be reset, unless - * this is explicitly done in your - * FrontendApplication::changeToStartScreen(). - */ - virtual void changeToStartScreen() - { - } - - /** - * Switch to another Screen. Will call tearDownScreen on current Screen before switching, - * and subsequently call setupScreen and draw automatically for the new Screen. - * - * @param [in] newScreen A pointer to the new screen. - */ - virtual void switchScreen(Screen* newScreen); - - /** - * An application specific function for switching screen. Overloading this can provide a - * means to switch screen from places that does not have access to a pointer to the new - * screen. Base implementation is empty. - * - * @param screenId An id that maps to the desired screen. - */ - virtual void appSwitchScreen(uint8_t screenId) - { - (void)screenId; // Unused variable - } - - /** An application specific function for requesting redraw of entire screen. */ - virtual void requestRedraw(); - - /** - * An application specific function for requesting redraw of given Rect. - * - * @param [in,out] rect The Rect that must be redrawn. - */ - virtual void requestRedraw(Rect& rect) - { - redraw = rect; - } - - /** - * Handle a click event. Standard implementation is to delegate the event to the current - * screen. Called by the framework when a click is detected by some platform specific - * means. - * - * @param event The ClickEvent. - */ - virtual void handleClickEvent(const ClickEvent& event); - - /** - * Handle drag events. Called by the framework when a drag is detected by some platform - * specific means. Standard implementation is to delegate drag event to current screen. - * - * @param event The drag event, expressed in absolute coordinates. - */ - virtual void handleDragEvent(const DragEvent& event); - - /** - * Handle gestures. Called by the framework when a gesture is detected by some platform - * specific means. Standard implementation is to delegate drag event to current screen. - * - * @param event The gesture event. - */ - virtual void handleGestureEvent(const GestureEvent& event); - - /** - * Handle tick. Standard implementation is to delegate tick to the widgets that have - * registered to receive one. Called by some platform specific means. - */ - virtual void handleTickEvent(); - - /** - * Handle an incoming character received by the HAL layer. Standard implementation - * delegates to current screen (which, in turn, does nothing). - * - * @param c The incoming character to handle. - */ - virtual void handleKeyEvent(uint8_t c); - - /** - * Evaluates the pending Callback instances. If a callback is valid, it is executed and - * a Screen transition is executed. This base implementation is empty and does nothing. - */ - virtual void handlePendingScreenTransition(); - - /** - * Clears the cached areas so coming calls to invalidate are collected for future drawing. - * - * @see drawCachedAreas - */ - virtual void clearCachedAreas(); - - /** - * Draws all cached, invalidated areas on the screen. - * - * @see clearCachedAreas - */ - virtual void drawCachedAreas(); - - /** - * This function copies the parts that were updated in the - * previous frame (in the TFT buffer) to the active framebuffer - * (client buffer). - * - * This function only copies pixels in double buffering mode. - */ - void copyInvalidatedAreasFromTFTToClientBuffer(); - - /** - * Adds a widget to the list of widgets receiving ticks every frame (typically - * 16.67ms) - * - * @param [in] w The widget to add. - * - * @see unregisterTimerWidget - * - * @note The framework keeps track of the number of times a specific widget is registered. - */ - void registerTimerWidget(Drawable* w) - { - timerWidgets.add(w); - } - - /** Clears all currently registered timer widgets. */ - - void clearAllTimerWidgets() - { - timerWidgets.clear(); - } - - /** - * Removes a widget from the list of widgets receiving ticks every frame (typically - * 16.67ms) milliseconds. - * - * @param [in] w The widget to remove. - * - * @note If widget has been registered multiple times, an equal number of calls to unregister - * are required to stop widget from receiving tick events. - */ - void unregisterTimerWidget(const Drawable* w) - { - timerWidgets.remove(w); - } - - /** - * gets the number of timer widgets that are registered and active. - * - * @return The size of timerWidgets. - */ - uint16_t getNumberOfRegisteredTimerWidgets() const - { - return timerWidgets.getNumberOfActiveTimerWidgets(); - } - - /** - * Gets the number of timer events registered to a widget, i.e. how many times a - * drawable must be unregistered until it no longer receives timer ticks. - * - * @param w The widget to to get count from. - * - * @return 0 if the drawable is not registered as a timer widget, otherwise returns how - * many times the drawable is currently registered. - */ - uint16_t getTimerWidgetCountForDrawable(const Drawable* w) const - { - return timerWidgets.getCounter(w); - } - - static const uint8_t MAX_TIMER_WIDGETS = 32; ///< Maximum number of widgets receiving ticks. @remarks Memory impact: x * (sizeof(Drawable*)+1) - static const uint16_t TICK_INTERVAL_MS = 10; ///< Deprecated, do not use this constant. Tick interval depends on VSYNC of your target platform. - - /** - * Sets the DebugPrinter object to be used by the application to print debug messages. - * - * @param [in] printer The debug printer to configure. - */ - static void setDebugPrinter(DebugPrinter* printer) - { - debugPrinter = printer; - } - - /** - * Returns the DebugPrinter object associated with the application. - * - * @return DebugPrinter The DebugPrinter object. - */ - static DebugPrinter* getDebugPrinter() - { - return debugPrinter; - } - - /** - * Sets the debug string to be displayed onscreen on top of the framebuffer. - */ - static void invalidateDebugRegion() - { - if (debugPrinter) - { - debugRegionInvalidRect.expandToFit(debugPrinter->getRegion()); - } - } - - /** - * Sets the debug string to be displayed onscreen on top of the framebuffer. - * - * @param [in] string The debug string to display onscreen. - */ - static void setDebugString(const char* string) - { - if (debugPrinter) - { - debugPrinter->setString(string); - invalidateDebugRegion(); - } - } - - /** - * Invalidates the entire screen. - * - * @param area The area to invalidate. - */ - void invalidate(); - - /** - * Invalidates the given area. - * - * @param area The area to invalidate. - */ - void invalidateArea(Rect area); - -protected: - /** Protected constructor. */ - Application(); - - /** - * Initiate a draw operation of the entire screen. Standard implementation is to - * delegate draw request to the current Screen. - */ - virtual void draw(); - - /** - * Initiate a draw operation of the specified region of the screen. Standard - * implementation is to delegate draw request to the current Screen. - * - * @param [in] rect The area to draw. - * - * @note Unlike Widget::draw this is safe to call from user code as it will properly traverse - * widgets in z-order. - * @note The coordinates given must be absolute coordinates. - */ - virtual void draw(Rect& rect); - - typedef Vector RectVector_t; ///< Type to ensure the same number of rects are in the Vector - - /** A class to handle and manage timer widgets. */ - class TimerWidgets - { - public: - /** - * Tick all active timer widgets. Adding and removing timer widgets during ticks is supported. - */ - void tickActive(); - - /** - * Adds timer widget. If a timer widget is added from a handleTickEvent(), the timer will not be - * ticket until the next tick (unless that same widget is already registered, and has not yet - * been ticked in this tick). - * - * @param [in] w The timer widget to add. - */ - void add(Drawable* w); - - /** - * Removes the given timer widget. - * - * @param w The timer widget to remove. - */ - void remove(const Drawable* w); - - /** Clears all timer widgets. */ - void clear(); - - /** - * Gets a counter for a given timer widget. Normally the counter is 1 unless a timer widget has - * been registered several times. - * - * @param w The timer widget to get the counter for. - * - * @return The counter. - */ - uint16_t getCounter(const Drawable* w) const; - - /** - * Gets number of active timer widgets. - * - * @return The number of active timer widgets. - */ - uint16_t getNumberOfActiveTimerWidgets() const; - - /** - * Compacts the timer widgets. All widgets with a counter of 0 will be removed from the list, - * and the list will be compacted. Compacting the timer widgets during traversal (in - * tickActive()) is handled properly. - */ - void compact(); - - private: - Vector widgets; ///< List of widgets that receive timer ticks. - uint8_t counters[MAX_TIMER_WIDGETS]; ///< A counter for each potentially registered timer widget. Increase when registering for timer events, decrease when unregistering. - uint16_t currentWidget; ///< The current widget, used in tickActive(). - uint16_t lastWidget; ///< The last widget, used in tickActive(). - } timerWidgets; ///< The timer widgets - - RectVector_t cachedDirtyAreas; ///< When draw caching is enabled, these rects keeps track of the dirty screen area. - RectVector_t lastRects; ///< The dirty areas from last frame that needs to be redrawn because we have swapped frame buffers. - Rect redraw; ///< Rect describing application requested invalidate area - bool transitionHandled; ///< True if the transition is done and Screen::afterTransition has been called. - static Screen* currentScreen; ///< Pointer to currently displayed Screen. - static Transition* currentTransition; ///< Pointer to current transition. - static Application* instance; ///< Pointer to the instance of the Application-derived subclass. @note Must be set by subclass constructor! - static DebugPrinter* debugPrinter; ///< Pointer to the DebugPrinter instance. - static Rect debugRegionInvalidRect; ///< Invalidated Debug Region -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_APPLICATION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp deleted file mode 100644 index e682eb4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Bitmap.hpp +++ /dev/null @@ -1,560 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Bitmap.hpp - * - * Declares the touchgfx::Bitmap class. - */ -#ifndef TOUCHGFX_BITMAP_HPP -#define TOUCHGFX_BITMAP_HPP - -#include - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000) -// Keil5 compiler issues irrelevant warning relating to missing ctor initialization for BitmapData. -#pragma diag_suppress 368 -#endif - -namespace touchgfx -{ -/** - * This type shall be used by the application to define unique IDs for all bitmaps in the - * system. The application shall define bitmap IDs in the range [0, number of bitmaps - - * 1]. - */ -typedef uint16_t BitmapId; - -const BitmapId BITMAP_ANIMATION_STORAGE = 0xFFFEU; ///< A virtual id representing animation storage. -const BitmapId BITMAP_INVALID = 0xFFFFU; ///< Define the bitmapId of an invalid bitmap - -/** - * This class provides a proxy object for a bitmap image stored in the application specific - * bitmap database. The proxy provides access to the raw bitmap data as well as metadata. - */ -class Bitmap -{ -public: - /** Color data of a clut can be stored in the following formats. */ - enum ClutFormat - { - CLUT_FORMAT_L8_ARGB8888, ///< 32-bit, 8 bits for each of red, green, blue and alpha - CLUT_FORMAT_L8_RGB888, ///< 24-bit, 8 bits for each of red, green and blue. No per pixel alpha channel - CLUT_FORMAT_L8_RGB565 ///< 16-bit, 5 bits for red, 6 bits for green, 5 bits for blue. No per pixel alpha channel - }; - - /** Data of a bitmap can be stored in the following formats. */ - enum BitmapFormat - { - RGB565, ///< 16-bit, 5 bits for red, 6 bits for green, 5 bits for blue. No alpha channel - RGB888, ///< 24-bit, 8 bits for each of red, green and blue. No alpha channel - ARGB8888, ///< 32-bit, 8 bits for each of red, green, blue and alpha channel - BW, ///< 1-bit, black / white. No alpha channel - BW_RLE, ///< 1-bit, black / white. No alpha channel. Image is compressed with horizontal RLE - GRAY2, ///< 2-bit grayscale - GRAY4, ///< 4-bit grayscale - ARGB2222, ///< 8-bit color - ABGR2222, ///< 8-bit color - RGBA2222, ///< 8-bit color - BGRA2222, ///< 8-bit color - L8, ///< 8-bit indexed color - A4, ///< 4-bit alpha level - CUSTOM ///< Non-standard platform specific format - }; - - /** Data of a bitmap. */ - struct BitmapData - { - const uint8_t* const data; ///< The data of this Bitmap - const uint8_t* const extraData; ///< The data of either the alpha channel (if present) or clut data in case of indexed color bitmap. 0 if not used - const uint16_t width; ///< The width of the Bitmap - const uint16_t height; ///< The height of the Bitmap - const uint16_t solidRect_x; ///< The x coordinate of the maximum solid rectangle of the Bitmap - const uint16_t solidRect_y; ///< The y coordinate of the maximum solid rectangle of the Bitmap - const uint16_t solidRect_width : 13; ///< The width of the maximum solid rectangle of the Bitmap - const uint16_t format_hi : 3; ///< Determine the format of the data (high 3 bits) - const uint16_t solidRect_height : 13; ///< The height of the maximum solid rectangle of the Bitmap - const uint16_t format_lo : 3; ///< Determine the format of the data (low 3 bits) - - /** - * Gets the Bitmap format by combining the high and low parts (format_hi << 3) | format_lo. - * - * @return The BitmapFormat - */ - BitmapFormat getFormat() const - { - return (BitmapFormat)((format_hi << 3) | format_lo); - } - }; - - /** Data of a dynamic Bitmap. */ - struct DynamicBitmapData - { - Rect solid; ///< The solidRect of this Bitmap - uint16_t width; ///< The width of the Bitmap - uint16_t height; ///< The height of the Bitmap - uint8_t format : 5; ///< Determine the format of the data - uint8_t inuse : 1; ///< Zero if not in use - uint8_t extra : 2; ///< Extra data field, dependent on format - uint8_t customSubformat; ///< Custom format specifier (or L8 palette length) - }; - - /** Cache bookkeeping. */ - struct CacheTableEntry - { - uint8_t* data; ///< Pointer to location of image data for this Bitmap in the cache. 0 if bitmap not cached. - }; - - /** - * Creates and binds a Bitmap instance to the corresponding entry in the BitmapData - * array. - * - * @param id (Optional) The unique bitmap identifier. - */ - Bitmap(const BitmapId id = BITMAP_INVALID) - : bitmapId(id) - { - } - - /** - * Gets the id of this Bitmap. - * - * @return The id of this Bitmap. - */ - BitmapId getId() const - { - assert(bitmaps != 0 && "Bitmap database has not been initialized."); - return bitmapId; - } - - /** - * Gets the id of this Bitmap. - * - * @return The id of this Bitmap. - */ - operator BitmapId() const - { - return getId(); - } - - /** - * Gets a pointer to the Bitmap data. - * - * @return A pointer to the raw Bitmap data. - * - * @note If this Bitmap is cached, it will return the cached version of Bitmap data. - */ - const uint8_t* getData() const; - - /** - * Gets a pointer to the extra (alpha) data, if present in the Bitmap. For images stored - * in L8 format, a pointer to the CLUT will be returned. For non-opaque RGB565 images, a - * pointer to the alpha channel will be returned. - * - * @return A pointer to the raw alpha channel data or CLUT. If no alpha channel or CLUT - * exist for the given Bitmap, 0 is returned. - * - * @note If this Bitmap is cached, it will return the cached version of alpha data for this - * Bitmap. - */ - const uint8_t* getExtraData() const; - - /** - * Gets the format of how the Bitmap is stored. - * - * @return The format of how the Bitmap data is stored. - */ - BitmapFormat getFormat() const; - - /** - * Gets the width of the Bitmap in pixels. - * - * @return The Bitmap width in pixels. - */ - int16_t getWidth() const; - - /** - * Gets the height of the Bitmap in pixels. - * - * @return The Bitmap height in pixels. - */ - int16_t getHeight() const; - - /** - * Gets the rectangle describing the dimensions of the Bitmap. - * - * @return a Rect describing the dimensions of this Bitmap. - */ - Rect getRect() const - { - return Rect(0, 0, getWidth(), getHeight()); - } - - /** - * Query if this object has an alpha channel. - * - * @return True if the bitmap contains an alpha channel (an alpha value for each pixel) - */ - bool isAlphaPerPixel() const - { - assert(bitmaps != 0 && "Bitmap database has not been initialized."); - if (getFormat() == L8) - { - return false; // No Alpha channel for indexed L8 bitmaps - } - return ((bitmaps != 0) && (bitmapId < numberOfBitmaps)) ? (bitmaps[bitmapId].extraData != 0) : false; - } - - /** - * Gets the largest solid, i.e. not transparent, rectangle in the Bitmap. - * - * @return The maximum solid rectangle of the Bitmap. - */ - Rect getSolidRect() const; - - /** - * Query if this object has transparent pixels. - * - * @return True if this bitmap has transparent pixels. - */ - bool hasTransparentPixels() const; - - /** - * Registers an array of bitmaps. All Bitmap instances are bound to this database. This - * function is called automatically from HAL::touchgfx_generic_init(). - * - * @param data A reference to the BitmapData storage array. - * @param n The number of bitmaps in the array. - * @param [in] cachep (Optional) Pointer to memory region in which bitmap - * data can be cached. - * @param csize (Optional) Size of cache memory region in bytes (0 if - * unused) - * @param numberOfDynamicBitmaps (Optional) Number of dynamic bitmaps to be allowed in - * the cache. - */ - static void registerBitmapDatabase(const BitmapData* data, const uint16_t n, uint16_t* cachep = 0, uint32_t csize = 0, - uint32_t numberOfDynamicBitmaps = 0); - - /** - * Cache this Bitmap into unused RAM in the bitmap cache. A memory region large enough - * to hold this bitmap must be configured and a large enough part of it must be - * available. Caching of a bitmap may involve a defragmentation of the bitmap cache. - * - * @param id The id of the Bitmap to cache. - * - * @return true if caching went well, false otherwise. - * - * @see registerBitmapDatabase, compactCache - */ - static bool cache(BitmapId id); - - /** - * Replace a Bitmap in RAM with another Bitmap. The Bitmaps must have same size. - * - * @param out The id of the Bitmap to remove from the cache. - * @param in The id of the Bitmap to cache. - * - * @return true if the replacement went well, false otherwise. - */ - static bool cacheReplaceBitmap(BitmapId out, BitmapId in); - - /** - * Remove this Bitmap from the RAM cache. Unless the Bitmap is - * otherwise stored in (slower) memory it can not be drawn anymore - * and must be cached again before use. The RAM freed can be used - * for caching of another bitmap. - * - * @param id The id of the Bitmap to cache. - * - * @return true if Bitmap was found and removed, false otherwise. - * - * @see registerBitmapDatabase - */ - static bool cacheRemoveBitmap(BitmapId id); - - /** - * Get address of cache buffer for this Bitmap. - * - * @param id The id of the Bitmap in cache. - * - * @return Address if Bitmap was found, zero otherwise. - * - * @note The address is only valid until next Bitmap::cache() call. - */ - static uint8_t* cacheGetAddress(BitmapId id); - - /** - * Check if the Bitmap is cached. - * - * @param id The id of the Bitmap. - * - * @return true if Bitmap is cached. - */ - static bool cacheIsCached(BitmapId id); - - /** - * Cache all bitmaps from the Bitmap Database into RAM. A memory region large enough to - * hold all bitmaps must be configured. - * - * @return True if all bitmaps where cached. - * - * @see cache - */ - static bool cacheAll(); - - /** Clears the cached bitmaps from RAM. */ - static void clearCache(); - - /** - * Create a dynamic Bitmap. The clutFormat parameter is ignored for bitmaps not in L8 format - * (consider using dynamicBitmapCreateL8 instead). Creation of a new dynamic bitmap may cause - * existing dynamic bitmaps to be moved in memory. Do not rely on bitmap memory addresses of - * dynamic bitmaps obtained from dynamicBitmapGetAddress() to be valid across calls to - * dynamicBitmapCreate(). - * - * @param width Width of the Bitmap. - * @param height Height of the Bitmap. - * @param format Bitmap format of the Bitmap. - * @param clutFormat (Optional) Color LookUp Table format of the Bitmap (only used if format - * is Bitmap::L8). - * - * @return BitmapId of the new Bitmap or #BITMAP_INVALID if cache memory is full. - * - * @see DynamicBitmapData, dynamicBitmapCreateL8, dynamicBitmapCreateCopy - */ - static BitmapId dynamicBitmapCreate(const uint16_t width, const uint16_t height, BitmapFormat format, ClutFormat clutFormat = CLUT_FORMAT_L8_ARGB8888); - - /** - * Create a dynamic Bitmap as a copy of an existing bitmap. - * - * @param id The ID of the bitmap to copy. - * - * @return BitmapId of the new Bitmap or #BITMAP_INVALID if cache memory is full. - * - * @see dynamicBitmapCreate - */ - static BitmapId dynamicBitmapCreateCopy(const BitmapId id); - - /** - * Create a dynamic L8 Bitmap. Creation of a new dynamic bitmap may cause existing dynamic - * bitmaps to be moved in memory. Do not rely on bitmap memory addresses of dynamic bitmaps - * obtained from dynamicBitmapGetAddress() to be valid across calls to dynamicBitmapCreate(). - * - * @param width Width of the Bitmap. - * @param height Height of the Bitmap. - * @param clutFormat Color LookUp Table format of the L8 Bitmap. - * @param clutSize (Optional) Color LookUp Table palette size (default=256). - * - * @return BitmapId of the new Bitmap or #BITMAP_INVALID if cache memory is full. - * - * @see DynamicBitmapData, dynamicBitmapCreate - */ - static BitmapId dynamicBitmapCreateL8(const uint16_t width, const uint16_t height, ClutFormat clutFormat, uint16_t clutSize = 256); - - /** - * Create a dynamic bitmap in custom format. size number of bytes - * is reserved in the dynamic bitmap cache. A more specific format - * can be given in the customSubformat parameter for use when - * handling more than one CUSTOM format. Set the solid rect if - * applicable. - * - * @param width Width of the bitmap. - * @param height Height of the bitmap. - * @param customSubformat Custom format specifier - * @param size Size in bytes of the dynamic bitmap - * - * @return BitmapId of the new bitmap or BITMAP_INVALID if cache memory is full. - * - * @note Creation of a new dynamic bitmap may cause existing dynamic bitmaps to be moved in - * memory. Do not rely on bitmap memory addresses of dynamic bitmaps obtained from - * dynamicBitmapGetAddress() to be valid across calls to dynamicBitmapCreateCustom() . - * - * @see dynamicBitmapGetAddress, dynamicBitmapCreate, dynamicBitmapSetSolidRect - */ - static BitmapId dynamicBitmapCreateCustom(const uint16_t width, const uint16_t height, uint8_t customSubformat, uint32_t size); - - /** - * Create a dynamic bitmap without reserving memory in the dynamic - * bitmap cache. The pixels must be already available in the - * memory, e.g. in flash. No copying is performed. - * - * @param width Width of the bitmap. - * @param height Height of the bitmap. - * @param pixels Pointer to the bitmap pixels. - * @param format Bitmap format of the bitmap. - * @param customSubformat Custom format specifier - * - * @return BitmapId of the new bitmap or BITMAP_INVALID if not possible. - * - * @see dynamicBitmapGetAddress, dynamicBitmapCreate, dynamicBitmapSetSolidRect - */ - static BitmapId dynamicBitmapCreateExternal(const uint16_t width, const uint16_t height, const void* pixels, BitmapFormat format, uint8_t customSubformat = 0); - - /** - * Fill a dynamic Bitmap with a color. If alpha is less than 255, the color will be blended onto - * the existing data in the dynamic bitmap. - * - * @param id The ID of the dynamic bitmap to fill. - * @param color The color. - * @param alpha (Optional) The alpha (default is 255, i.e. solid). - * - * @see dynamicBitmapCreateCopy, dynamicBitmapFillRect - */ - static void dynamicBitmapFill(const BitmapId id, const colortype color, const uint8_t alpha = 255); - - /** - * Fill parts of a dynamic Bitmap with a color. If alpha is less than 255, the color will be - * blended onto the existing data in the dynamic bitmap. - * - * @param id The ID of the dynamic bitmap to fill. - * @param rect The rectangle to fill. - * @param color The color. - * @param alpha (Optional) The alpha (default is 255, i.e. solid). - * - * @see dynamicBitmapCreateCopy, dynamicBitmapFill - */ - static void dynamicBitmapFillRect(const BitmapId id, const Rect& rect, const colortype color, const uint8_t alpha = 255); - - /** - * Delete a dynamic bitmap. - * - * @param id The BitmapId of the dynamic Bitmap. - * - * @return true if it succeeds, false if it fails. - */ - static bool dynamicBitmapDelete(BitmapId id); - - /** - * Check if a given bitmap id is the id of a dynamic bitmap. - * - * @param id The BitmapId of the dynamic Bitmap. - * - * @return true if the bitmap is dynamic, false otherwise. - */ - static bool isDynamicBitmap(BitmapId id); - - /** - * Get the address of the dynamic Bitmap data. It is important that the address of a - * dynamic Bitmap is not stored elsewhere as a dynamic Bitmap may be moved in memory - * when other bitmaps are added and removed. Only store the BitmapId and ask for the - * address of the Bitmap data when needed. The address of a dynamic bitmap may change - * when other dynamic bitmaps are added and removed. - * - * @param id The BitmapId of the dynamic bitmap. - * - * @return null if it fails, else an uint8_t*. - * - * @note Never keep the address of dynamic images, only store the BitmapId as that will not - * change. - */ - static uint8_t* dynamicBitmapGetAddress(BitmapId id); - - /** - * Set the solid rectangle of a dynamic Bitmap. Only relevant for ARGB8888 Bitmap and - * 8bpp Bitmap formats, as these formats include an alpha channel. The solid part of the - * Bitmap is drawn faster than the transparent parts. - * - * @param id The identifier. - * @param solidRect The solid rectangle. - * - * @return true if it succeeds, false if it fails. - */ - static bool dynamicBitmapSetSolidRect(BitmapId id, const Rect& solidRect); - - /** - * Updates the solid rectangle of a dynamic Bitmap to include the given rectangle. Only - * relevant for ARGB8888 bitmap and 8bpp bitmap formats, as these formats include an - * alpha channel. The solid part of the Bitmap is drawn faster than the transparent - * parts. - * - * @param id The identifier. - * @param solidRect The solid rectangle. - * - * @return true if it succeeds, false if it fails. - */ - static bool dynamicBitmapAddSolidRect(BitmapId id, const Rect& solidRect); - - /// @cond - /** - * Gets the subformat of the dynamic bitmap. Zero is returned if - * the subformat was not set. - * - * @return the subformat - */ - static uint8_t dynamicBitmapGetCustomSubformat(BitmapId id); - - /** - * @return The number of dynamic bitmaps. - */ - static uint32_t dynamicBitmapGetNumberOfBitmaps(); - /// @endcond - - /** - * Register a memory region in which Bitmap data can be cached. - * - * @param [in] cachep Pointer to memory region in which bitmap data can be - * cached. - * @param csize Size of cache memory region in bytes. - * @param numberOfDynamicBitmaps (Optional) Number of dynamic bitmaps to be allowed in - * the cache. - */ - static void setCache(uint16_t* cachep, uint32_t csize, uint32_t numberOfDynamicBitmaps = 0); - - /** - * Removes the Bitmap cache. The memory can hereafter be used for other purposes. All - * dynamic Bitmap IDs are invalid after this. - */ - static void removeCache(); - - /** - * Gets the address of the first unused memory in the cache. Can be used in advanced - * application to reduce power consumption of external RAM by turning off unused RAM. - * - * @return Returns the highest used address in the cache. - */ - static uint8_t* getCacheTopAddress() - { - return nextFreeData; - } - - /** - * Compact the bitmap cache to get continuous free memory on top. This method is called - * by Bitmap::cache when required. - */ - static void compactCache(); - -private: - static uint32_t getSizeOfBitmap(BitmapId id); - static uint32_t getSizeOfBitmapData(BitmapId id); - static uint32_t getSizeOfBitmapExtraData(BitmapId id); - static bool cacheInternal(BitmapId id, uint32_t size); - static bool isCustomDynamicBitmap(BitmapId id); - static bool copyBitmapToCache(BitmapId id, uint8_t* const dst); - static uint32_t firstFreeDynamicBitmapId(); - - BitmapId bitmapId; - static const BitmapData* bitmaps; - static DynamicBitmapData* dynBitmaps; - static CacheTableEntry* cacheTable; ///< Address of allocation point cache - static BitmapId* allocationTable; ///< Order of allocations in cache - static uint8_t* nextFreeData; - static uint16_t nextAllocationIndex; - static uint32_t memoryRemaining; - static uint32_t totalMemory; - static uint16_t numberOfBitmaps; - static uint16_t numberOfDynamicBitmaps; - static uint16_t uncachedCount; ///< Uncached images, sort of ... -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp deleted file mode 100644 index 39bd5b5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Callback.hpp +++ /dev/null @@ -1,471 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Callback.hpp - * - * Declares the touchgfx::GenericCallback and touchgfx::Callback classes. - */ -#ifndef TOUCHGFX_CALLBACK_HPP -#define TOUCHGFX_CALLBACK_HPP - -namespace touchgfx -{ -/** - * GenericCallback is the base class for callbacks. - * - * The reason this base class exists, is that a normal Callback requires the class type - * where the callback function resides to be known. This is problematic for ie. - * framework widgets like AbstractButton, on which it should be possible to register a - * callback on object types that are user-specific and thus unknown to AbstractButton. - * This is solved by having AbstractButton contain a pointer to a GenericCallback - * instead. This pointer must then be initialized to point on an instance of Callback, - * created by the user, which is initialized with the appropriate object type. - * - * @tparam T1 The type of the first argument in the member function, or void if none. - * @tparam T2 The type of the second argument in the member function, or void if none. - * @tparam T3 The type of the third argument in the member function, or void if none. - * - * @see Callback - * - * @note As with Callback, this class exists in four versions to support callback functions - * taking zero, one, two or three arguments. - */ -template -class GenericCallback -{ -public: - /** Finalizes an instance of the GenericCallback class. */ - virtual ~GenericCallback() - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - * - * @param val1 This value will be passed as the first argument in the function call. - * @param val2 This value will be passed as the second argument in the function call. - * @param val3 This value will be passed as the third argument in the function call. - */ - virtual void execute(T1 val1, T2 val2, T3 val3) = 0; - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const = 0; -}; - -/** - * GenericCallback is the base class for callbacks. - * - * The reason this base class exists, is that a normal Callback requires the class type - * where the callback function resides to be known. This is problematic for ie. - * framework widgets like AbstractButton, on which it should be possible to register a - * callback on object types that are user-specific and thus unknown to AbstractButton. - * This is solved by having AbstractButton contain a pointer to a GenericCallback - * instead. This pointer must then be initialized to point on an instance of Callback, - * created by the user, which is initialized with the appropriate object type. - * - * @tparam T1 The type of the first argument in the member function, or void if none. - * @tparam T2 The type of the second argument in the member function, or void if none. - * - * @see Callback - * - * @note As with Callback, this class exists in four versions to support callback functions - * taking zero, one, two or three arguments. - */ -template -class GenericCallback -{ -public: - /** Finalizes an instance of the void> class. */ - virtual ~GenericCallback() - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - * - * @param val1 This value will be passed as the first argument in the function call. - * @param val2 This value will be passed as the second argument in the function call. - */ - virtual void execute(T1 val1, T2 val2) = 0; - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const = 0; -}; - -/** - * GenericCallback is the base class for callbacks. - * - * The reason this base class exists, is that a normal Callback requires the class type - * where the callback function resides to be known. This is problematic for ie. - * framework widgets like AbstractButton, on which it should be possible to register a - * callback on object types that are user-specific and thus unknown to AbstractButton. - * This is solved by having AbstractButton contain a pointer to a GenericCallback - * instead. This pointer must then be initialized to point on an instance of Callback, - * created by the user, which is initialized with the appropriate object type. - * - * @tparam T1 The type of the first argument in the member function, or void if none. - * - * @see Callback - * - * @note As with Callback, this class exists in four versions to support callback functions - * taking zero, one, two or three arguments. - */ -template -class GenericCallback -{ -public: - /** Finalizes an instance of the void> class. */ - virtual ~GenericCallback() - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - * - * @param val1 This value will be passed as the first argument in the function call. - */ - virtual void execute(T1 val1) = 0; - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const = 0; -}; - -/** - * GenericCallback is the base class for callbacks. - * - * The reason this base class exists, is that a normal Callback requires the class type - * where the callback function resides to be known. This is problematic for ie. - * framework widgets like AbstractButton, on which it should be possible to register a - * callback on object types that are user-specific and thus unknown to AbstractButton. - * This is solved by having AbstractButton contain a pointer to a GenericCallback - * instead. This pointer must then be initialized to point on an instance of Callback, - * created by the user, which is initialized with the appropriate object type. - * - * @see Callback - * - * @note As with Callback, this class exists in four versions to support callback functions - * taking zero, one, two or three arguments. - */ -template <> -class GenericCallback -{ -public: - /** Finalizes an instance of the GenericCallback class. */ - virtual ~GenericCallback() - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - */ - virtual void execute() = 0; - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const = 0; -}; - -/** - * A Callback is basically a wrapper of a pointer-to-member-function. - * - * It is used for registering callbacks between widgets. For instance, a Button can be - * configured to call a member function when it is clicked. - * - * The class is templated in order to provide the class type of the object in which the - * member function resides, and the argument types of the function to call. - * - * The Callback class exists in four versions, for supporting member functions with 0, - * 1, 2 or 3 arguments. The compiler will infer which type to use automatically. - * - * @tparam dest_type The type of the class in which the member function resides. - * @tparam T1 The type of the first argument in the member function, or void if none. - * @tparam T2 The type of the second argument in the member function, or void if none. - * @tparam T3 The type of the third argument in the member function, or void if none. - * - * @note The member function to call must return void. The function can have zero, one, two or - * three arguments of any type. - */ -template -struct Callback : public GenericCallback -{ - /** Initializes a new instance of the Callback class. */ - Callback() - : pobject(0), pmemfun(0) - { - } - - /** - * Initializes a Callback with an object and a pointer to the member function in that object to - * call. - * - * Initializes a Callback with an object and a pointer to the member function in that object to - * call. - * - * @param [in] pObject Pointer to the object on which the function should be called. - * @param [in] pmemfun_3 Address of member function. This is the version where function takes - * three arguments. - */ - Callback(dest_type* pObject, void (dest_type::*pmemfun_3)(T1, T2, T3)) - : pobject(pObject), pmemfun(pmemfun_3) - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - * - * @param t1 This value will be passed as the first argument in the function call. - * @param t2 This value will be passed as the second argument in the function call. - * @param t3 This value will be passed as the third argument in the function call. - */ - virtual void execute(T1 t1, T2 t2, T3 t3) - { - (pobject->*pmemfun)(t1, t2, t3); - } - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const - { - return (pobject != 0) && (pmemfun != 0); - } - -private: - dest_type* pobject; - void (dest_type::*pmemfun)(T1, T2, T3); -}; - -/** - * A Callback is basically a wrapper of a pointer-to-member-function. - * - * It is used for registering callbacks between widgets. For instance, a Button can be - * configured to call a member function when it is clicked. - * - * The class is templated in order to provide the class type of the object in which the - * member function resides, and the argument types of the function to call. - * - * The Callback class exists in four versions, for supporting member functions with 0, 1, - * 2 or 3 arguments. The compiler will infer which type to use automatically. - * - * @tparam dest_type The type of the class in which the member function resides. - * @tparam T1 The type of the first argument in the member function, or void if none. - * @tparam T2 The type of the second argument in the member function, or void if none. - * - * @note The member function to call must return void. The function can have zero, one, two or - * three arguments of any type. - */ -template -struct Callback : public GenericCallback -{ - /** Initializes a new instance of the Callback class. */ - Callback() - : pobject(0), pmemfun(0) - { - } - - /** - * Initializes a Callback with an object and a pointer to the member function in that object to - * call. - * - * @param [in] pObject Pointer to the object on which the function should be called. - * @param [in] pmemfun_2 Address of member function. This is the version where function takes two - * arguments. - */ - Callback(dest_type* pObject, void (dest_type::*pmemfun_2)(T1, T2)) - : pobject(pObject), pmemfun(pmemfun_2) - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - * - * @param t1 This value will be passed as the first argument in the function call. - * @param t2 This value will be passed as the second argument in the function call. - */ - virtual void execute(T1 t1, T2 t2) - { - (pobject->*pmemfun)(t1, t2); - } - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const - { - return (pobject != 0) && (pmemfun != 0); - } - -private: - dest_type* pobject; - void (dest_type::*pmemfun)(T1, T2); -}; - -/** - * A Callback is basically a wrapper of a pointer-to-member-function. - * - * It is used for registering callbacks between widgets. For instance, a Button can be - * configured to call a member function when it is clicked. - * - * The class is templated in order to provide the class type of the object in which the - * member function resides, and the argument types of the function to call. - * - * The Callback class exists in four versions, for supporting member functions with 0, 1, - * 2 or 3 arguments. The compiler will infer which type to use automatically. - * - * @tparam dest_type The type of the class in which the member function resides. - * @tparam T1 The type of the first argument in the member function, or void if none. - * - * @note The member function to call must return void. The function can have zero, one, two or - * three arguments of any type. - */ -template -struct Callback : public GenericCallback -{ - /** Initializes a new instance of the Callback class. */ - Callback() - : pobject(0), pmemfun(0) - { - } - - /** - * Initializes a Callback with an object and a pointer to the member function in that object to - * call. - * - * @param [in] pObject Pointer to the object on which the function should be called. - * @param [in] pmemfun_1 Address of member function. This is the version where function takes one - * argument. - */ - Callback(dest_type* pObject, void (dest_type::*pmemfun_1)(T1)) - : pobject(pObject), pmemfun(pmemfun_1) - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - * - * @param t1 This value will be passed as the first argument in the function call. - * - * @see isValid - */ - virtual void execute(T1 t1) - { - (pobject->*pmemfun)(t1); - } - - /** - * Query if this object is valid. - * - * @return true if valid, false if not. - */ - virtual bool isValid() const - { - return (pobject != 0) && (pmemfun != 0); - } - -private: - dest_type* pobject; - void (dest_type::*pmemfun)(T1); -}; - -/** - * A Callback is basically a wrapper of a pointer-to-member-function. - * - * It is used for registering callbacks between widgets. For instance, a Button can be - * configured to call a member function when it is clicked. - * - * The class is templated in order to provide the class type of the object in which the - * member function resides, and the argument types of the function to call. - * - * The Callback class exists in four versions, for supporting member functions with 0, 1, - * 2 or 3 arguments. The compiler will infer which type to use automatically. - * - * @tparam dest_type The type of the class in which the member function resides. - * - * @note The member function to call must return void. The function can have zero, one, two or - * three arguments of any type. - */ -template -struct Callback : public GenericCallback<> -{ - /** Initializes a new instance of the Callback class. */ - Callback() - : pobject(0), pmemfun(0) - { - } - - /** - * Initializes a Callback with an object and a pointer to the member function in that object to - * call. - * - * @param [in] pObject Pointer to the object on which the function should be called. - * @param [in] pmemfun_0 Address of member function. This is the version where function takes zero - * arguments. - */ - Callback(dest_type* pObject, void (dest_type::*pmemfun_0)()) - : pobject(pObject), pmemfun(pmemfun_0) - { - } - - /** - * Calls the member function. Do not call execute unless isValid() returns true (ie. a - * pointer to the object and the function has been set). - */ - virtual void execute() - { - (pobject->*pmemfun)(); - } - - /** - * Function to check whether the Callback has been initialized with values. - * - * @return true If the callback is valid (i.e. safe to call execute). - */ - virtual bool isValid() const - { - return (pobject != 0) && (pmemfun != 0); - } - -private: - dest_type* pobject; - void (dest_type::*pmemfun)(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CALLBACK_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp deleted file mode 100644 index 5e972fb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Color.hpp +++ /dev/null @@ -1,420 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Color.hpp - * - * Declares the touchgfx::Color class - */ -#ifndef TOUCHGFX_COLOR_HPP -#define TOUCHGFX_COLOR_HPP - -#include -#include - -namespace touchgfx -{ -/** Contains functionality for color conversion. */ -class Color -{ -public: - /** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. The - * embedded alpha value is set to 255. - * - * @param red Value of the red part (0 to 255). - * @param green Value of the green part (0 to 255). - * @param blue Value of the blue part (0 to 255). - * - * @return The color representation depending on LCD color format. - */ - FORCE_INLINE_FUNCTION static colortype getColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) - { - return 0xFF000000 | (red << 16) | (green << 8) | (blue); - } - - /** - * Gets the red color part of a color. - * - * @param color The color value. - * - * @return The red part of the color (0 to 255). - */ - FORCE_INLINE_FUNCTION static uint8_t getRed(colortype color) - { - return color >> 16; - } - - /** - * Gets the green color part of a color. - * - * @param color The color value. - * - * @return The green part of the color (0 to 255). - */ - FORCE_INLINE_FUNCTION static uint8_t getGreen(colortype color) - { - return color >> 8; - } - - /** - * Gets the blue color part of a color. - * - * @param color The color value. - * - * @return The blue part of the color (0 to 255). - */ - FORCE_INLINE_FUNCTION static uint8_t getBlue(colortype color) - { - return color; - } - - /** - * Convert a given color from HSV (Hue, Saturation, Value) to RGB (Red, Green, Blue). - * - * @param hue The input Hue (0 to 255). - * @param saturation The input Saturation (0 to 255). - * @param value The input Value (0 to 255). - * @param [out] red The output Red (0 to 255). - * @param [out] green The output Green (0 to 255). - * @param [out] blue The output Blue (0 to 255). - * - * @note The conversion is an approximation. - */ - static void getRGBFromHSV(uint8_t hue, uint8_t saturation, uint8_t value, uint8_t& red, uint8_t& green, uint8_t& blue) - { - if (saturation == 0) - { - red = green = blue = value; - return; - } - - const uint8_t region = (hue * 6) >> 8; - const int next_region_start = ((((region + 1) << 8) + 5) / 6); // Can go up to 256, uint8_t not enough - const uint8_t region_size = next_region_start - (((region << 8) + 5) / 6); - const uint8_t remainder = 255 - (next_region_start - hue) * 255 / region_size; - - const uint8_t p = LCD::div255(value * (255 - saturation)); - const uint8_t q = LCD::div255(value * (255 - LCD::div255(saturation * remainder))); - const uint8_t t = LCD::div255(value * (255 - LCD::div255(saturation * (255 - remainder)))); - - switch (region) - { - case 0: - red = value; - green = t; - blue = p; - break; - case 1: - red = q; - green = value; - blue = p; - break; - case 2: - red = p; - green = value; - blue = t; - break; - case 3: - red = p; - green = q; - blue = value; - break; - case 4: - red = t; - green = p; - blue = value; - break; - default: - red = value; - green = p; - blue = q; - break; - } - } - - /** - * Convert a given color from RGB (Red, Green, Blue) to HSV (Hue, Saturation, Value). - * - * @param red The input Red (0 to 255). - * @param green The input Green (0 to 255). - * @param blue The input Blue (0 to 255). - * @param [out] hue The output Hue (0 to 255). - * @param [out] saturation The output Saturation (0 to 255). - * @param [out] value The output Value (0 to 255). - * - * @note The conversion is an approximation. - */ - static void getHSVFromRGB(uint8_t red, uint8_t green, uint8_t blue, uint8_t& hue, uint8_t& saturation, uint8_t& value) - { - const uint8_t rgbMin = MIN(MIN(red, green), blue); - const uint8_t rgbMax = MAX(MAX(red, green), blue); - const uint8_t rgbRange = rgbMax - rgbMin; - - value = rgbMax; - if (value == 0) - { - hue = 0; - saturation = 0; - return; - } - - saturation = 255 * rgbRange / value; - if (saturation == 0) - { - hue = 0; - } - else if (rgbMax == red) - { - if (green < blue) - { - hue = 0 + (42 * (green - blue) + rgbRange / 2) / rgbRange; // [0-42; 0] = [214; 0] - } - else - { - hue = 0 + (43 * (green - blue) + rgbRange / 2) / rgbRange; // [0; 0+43] = [0; 43] - } - } - else if (rgbMax == green) - { - if (blue < red) - { - hue = 86 + (43 * (blue - red) + rgbRange / 2) / rgbRange; // [86-43; 86] = [43; 86] - } - else - { - hue = 86 + (42 * (blue - red) + rgbRange / 2) / rgbRange; // [86; 86+42] = [86; 128] - } - } - else - { - hue = 171 + (43 * (red - green) + rgbRange / 2) / rgbRange; // [171-43; 171+43] = [128; 214] - } - } - - /** - * Convert a given color from HSV (Hue, Saturation, Value) to colortype. - * - * @param hue The input Hue (0 to 255). - * @param saturation The input Saturation (0 to 255). - * @param value The input Value (0 to 255). - * - * @return The colortype color. - * @note The conversion is an approximation. - */ - FORCE_INLINE_FUNCTION static colortype getColorFromHSV(uint8_t hue, uint8_t saturation, uint8_t value) - { - uint8_t red, green, blue; - getRGBFromHSV(hue, saturation, value, red, green, blue); - return getColorFromRGB(red, green, blue); - } - - /** - * Split a given colortype color to its RGB (Red, Green, Blue) components. - * - * @param color The input color. - * @param [out] red The output Red (0 to 255). - * @param [out] green The output Green (0 to 255). - * @param [out] blue The output Blue (0 to 255). - */ - FORCE_INLINE_FUNCTION static void getRGBFromColor(colortype color, uint8_t& red, uint8_t& green, uint8_t& blue) - { - red = getRed(color); - green = getGreen(color); - blue = getBlue(color); - } - - /** - * Convert a given colortype color to HSV (Hue, Saturation, Value). - * - * @param color The input color. - * @param [out] hue The output Hue (0 to 255). - * @param [out] saturation The output Saturation (0 to 255). - * @param [out] value The output Value (0 to 255). - * - * @note The conversion is an approximation. - */ - FORCE_INLINE_FUNCTION static void getHSVFromColor(colortype color, uint8_t& hue, uint8_t& saturation, uint8_t& value) - { - getHSVFromRGB(getRed(color), getGreen(color), getBlue(color), hue, saturation, value); - } - - /** - * Convert HSL (Hue, Saturation, Luminance) to HSV (Hue, Saturation, Value). - * - * @param hsl_hue The input HSL hue (0 to 255). - * @param hsl_saturation The input HSL saturation (0 to 255). - * @param hsl_luminance The input HSL luminance (0 to 255). - * @param [out] hsv_hue The output HSV hue (0 to 255). - * @param [out] hsv_saturation The output HSV saturation (0 to 255). - * @param [out] hsv_value The output HSV value (0 to 255). - */ - FORCE_INLINE_FUNCTION static void getHSVFromHSL(uint8_t hsl_hue, uint8_t hsl_saturation, uint8_t hsl_luminance, uint8_t& hsv_hue, uint8_t& hsv_saturation, uint8_t& hsv_value) - { - hsv_hue = hsl_hue; - hsv_value = hsl_luminance + LCD::div255(hsl_saturation * MIN(hsl_luminance, 255 - hsl_luminance)); - hsv_saturation = hsv_value == 0 ? 0 : 510 - ((hsl_luminance * 510) / hsv_value); - } - - /** - * Convert HSV (Hue, Saturation, Value) to HSL (Hue, Saturation, Luminance). - * - * @param hsv_hue The input HSV hue (0 to 255). - * @param hsv_saturation The input HSV saturation (0 to 255). - * @param hsv_value The input HSV value (0 to 255). - * @param [out] hsl_hue The output HSL hue (0 to 255). - * @param [out] hsl_saturation The output HSL saturation (0 to 255). - * @param [out] hsl_luminance The output HSL luminance (0 to 255). - */ - FORCE_INLINE_FUNCTION static void getHSLFromHSV(uint8_t hsv_hue, uint8_t hsv_saturation, uint8_t hsv_value, uint8_t& hsl_hue, uint8_t& hsl_saturation, uint8_t& hsl_luminance) - { - hsl_hue = hsv_hue; - uint16_t luminance2 = (hsv_value * (510 - hsv_saturation)) / 255; - hsl_luminance = luminance2 >> 1; - hsl_saturation = (hsl_luminance == 0 || hsl_luminance == 255) ? 0 : (uint8_t)(((hsv_value * 2 - luminance2) * 255) / MIN(luminance2, 510 - luminance2)); - } - - /** - * Convert a given color from HSV (Hue, Saturation, Value) to RGB (Red, Green, Blue). - * - * @param hue The input Hue (0 to 255). - * @param saturation The input Saturation (0 to 255). - * @param luminance The input Value (0 to 255). - * @param [out] red The output Red (0 to 255). - * @param [out] green The output Green (0 to 255). - * @param [out] blue The output Blue (0 to 255). - * - * @note The conversion is an approximation. - */ - FORCE_INLINE_FUNCTION static void getRGBFromHSL(uint8_t hue, uint8_t saturation, uint8_t luminance, uint8_t& red, uint8_t& green, uint8_t& blue) - { - uint8_t hsv_hue, hsv_saturation, hsv_value; - getHSVFromHSL(hue, saturation, luminance, hsv_hue, hsv_saturation, hsv_value); - getRGBFromHSV(hsv_hue, hsv_saturation, hsv_value, red, green, blue); - } - - /** - * Convert a given color from RGB (Red, Green, Blue) to HSV (Hue, Saturation, Value). - * - * @param red The input Red (0 to 255). - * @param green The input Green (0 to 255). - * @param blue The input Blue (0 to 255). - * @param [out] hue The output Hue (0 to 255). - * @param [out] saturation The output Saturation (0 to 255). - * @param [out] luminance The output Value (0 to 255). - * - * @note The conversion is an approximation. - */ - FORCE_INLINE_FUNCTION static void getHSLFromRGB(uint8_t red, uint8_t green, uint8_t blue, uint8_t& hue, uint8_t& saturation, uint8_t& luminance) - { - uint8_t hsv_hue, hsv_saturation, hsv_value; - getHSVFromRGB(red, green, blue, hsv_hue, hsv_saturation, hsv_value); - getHSLFromHSV(hsv_hue, hsv_saturation, hsv_value, hue, saturation, luminance); - } - - /** - * Convert a given color from HSV (Hue, Saturation, Value) to colortype. - * - * @param hue The input Hue (0 to 255). - * @param saturation The input Saturation (0 to 255). - * @param luminance The input Value (0 to 255). - * - * @return The colortype color. - * - * @note The conversion is an approximation. - */ - FORCE_INLINE_FUNCTION static colortype getColorFromHSL(uint8_t hue, uint8_t saturation, uint8_t luminance) - { - uint8_t red, green, blue; - getRGBFromHSL(hue, saturation, luminance, red, green, blue); - return getColorFromRGB(red, green, blue); - } - - /** - * Convert a given colortype color to HSV (Hue, Saturation, Value). - * - * @param color The input color. - * @param [out] hue The output Hue (0 to 255). - * @param [out] saturation The output Saturation (0 to 255). - * @param [out] luminance The output Value (0 to 255). - * - * @note The conversion is an approximation. - */ - FORCE_INLINE_FUNCTION static void getHSLFromColor(colortype color, uint8_t& hue, uint8_t& saturation, uint8_t& luminance) - { - getHSLFromRGB(getRed(color), getGreen(color), getBlue(color), hue, saturation, luminance); - } - - /** - * Gets the red color part of a 16bpp color also known as - * RGB565. The red part (5 bits) is extracted and scaled to the - * full 0-255 byte range. - * - * @param color The color value in RGB565. - * - * @return The red part of the color (0 to 255). - */ - FORCE_INLINE_FUNCTION static uint8_t getRedFromRGB565(uint16_t color) - { - const uint8_t red = (color >> 8) & 0xF8; - return red | (red >> 5); - } - - /** - * Gets the green color part of a 16bpp color also known as - * RGB565. The green part (6 bits) is extracted and scaled to the - * full 0-255 byte range. - * - * @param color The color value in RGB565. - * - * @return The green part of the color (0 to 255). - */ - FORCE_INLINE_FUNCTION static uint8_t getGreenFromRGB565(uint16_t color) - { - const uint8_t green = (color >> 3) & 0xFC; - return green | (green >> 6); - } - - /** - * Gets the blue color part of a 16bpp color also known as - * RGB565. The blue part (5 bits) is extracted and scaled to the - * full 0-255 byte range. - * - * @param color The color value in RGB565. - * - * @return The blue part of the color (0 to 255). - */ - FORCE_INLINE_FUNCTION static uint8_t getBlueFromRGB565(uint16_t color) - { - const uint8_t blue = color << 3; - return blue | (blue >> 5); - } - - /** - * Convert 16bit RGB565 color to 32bit ARGB8888 color by expanding the 5,6,5 colors to full 8,8, - * 8 colors. The alpha value is set to zero. - * - * @param rgb565 The 16bit RGB565 color. - * - * @return The 32bit color value. - * - * @see getRedFromRGB565, getGreenFromRGB565, getBlueFromRGB565 - */ - FORCE_INLINE_FUNCTION static uint32_t rgb565toXrgb8888(uint16_t rgb565) - { - return (getRedFromRGB565(rgb565) << 16) | (getGreenFromRGB565(rgb565) << 8) | getBlueFromRGB565(rgb565); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_COLOR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp deleted file mode 100644 index 11d91d8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/ConstFont.hpp - * - * Declares the touchgfx::ConstFont class. - */ -#ifndef TOUCHGFX_CONSTFONT_HPP -#define TOUCHGFX_CONSTFONT_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A ConstFont is a Font implementation that has its contents defined at compile-time and - * usually placed in read-only memory. - * - * @see Font - * - * @note Pure virtual class. Create an application-specific implementation of getPixelData(). - */ -class ConstFont : public Font -{ -public: - /** - * Initializes a new instance of the ConstFont class. - * - * @param glyphs The array of glyphs known to this font. - * @param numGlyphs The number of glyphs in list. - * @param height The height of the font. - * @param baseline The pixel position of the baseline. - * @param pixAboveTop The maximum number of pixels above the top of the text. - * @param pixBelowBottom The maximum number of pixels that can be drawn below the baseline in - * this font. - * @param bitsPerPixel The number of bits per pixel in this font. - * @param byteAlignRow The glyphs are saved with each row byte aligned. - * @param maxLeft The maximum a character extends to the left. - * @param maxRight The maximum a character extends to the right. - * @param fallbackChar The fallback character for the typography in case no glyph is available. - * @param ellipsisChar The ellipsis character used for truncating long texts. - */ - ConstFont(const GlyphNode* glyphs, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar); - - using Font::getGlyph; - - virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const; - - /** - * Gets the pixel date associated with this glyph. - * - * @param glyph The glyph to get the pixels data from. - * - * @return Pointer to the pixel data of this glyph. - */ - virtual const uint8_t* getPixelData(const GlyphNode* glyph) const = 0; - - virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const = 0; - - /** - * Finds the glyph data associated with the specified unicode. - * - * @param unicode The character to look up. - * - * @return A pointer to the glyph node or null if the glyph was not found. - */ - const GlyphNode* find(Unicode::UnicodeChar unicode) const; - -protected: - const GlyphNode* glyphList; ///< The list of glyphs - uint16_t listSize; ///< The size of the list of glyphs - -private: - ConstFont() - : Font(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), glyphList(0), listSize(0) - { - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CONSTFONT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp deleted file mode 100644 index ba1dd74..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Drawable.hpp +++ /dev/null @@ -1,718 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Drawable.hpp - * - * Declares the touchgfx::Drawable class. - */ -#ifndef TOUCHGFX_DRAWABLE_HPP -#define TOUCHGFX_DRAWABLE_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The Drawable class is an abstract definition of something that can be drawn. In the composite - * design pattern, the Drawable is the component interface. Drawables can be added to a - * screen as a tree structure through the leaf node class Widget and the Container - * class. A Drawable contains a pointer to its next sibling and a pointer to its parent - * node. These are maintained by the Container to which the Drawable is added. - * - * The Drawable interface contains two pure virtual functions which must be implemented - * by widgets, namely draw() and getSolidRect(). In addition it contains general - * functionality for receiving events and navigating the tree structure. - * - * The coordinates of a Drawable are always relative to its parent node. - * - * @see Widget, Container - */ -class Drawable -{ -public: - /** Initializes a new instance of the Drawable class. */ - Drawable() - : rect(), - cachedVisibleRect(), - parent(0), - nextSibling(0), - nextDrawChainElement(0), - cachedAbsX(0), - cachedAbsY(0), - touchable(false), - visible(true) - { - } - - /** Finalizes an instance of the Drawable class. */ - virtual ~Drawable() - { - } - - /** - * Draw this drawable. It is a requirement that the draw implementation does not draw - * outside the region specified by invalidatedArea. - * - * @param invalidatedArea The sub-region of this drawable that needs to be redrawn, - * expressed in coordinates relative to its parent (e.g. for a - * complete redraw, invalidatedArea will be (0, 0, width, - * height). - */ - virtual void draw(const Rect& invalidatedArea) const = 0; - - /** - * Get (the largest possible) rectangle that is guaranteed to be solid (opaque). This - * information is important, as any Drawable underneath the solid area does not need to - * be drawn. - * - * @return The solid rectangle part of the Drawable. - * - * @note The rectangle returned must be relative to upper left corner of the Drawable, meaning - * that a completely solid widget should return the full size Rect(0, 0, - * getWidth(), getHeight()). If no area can be guaranteed to be solid, an empty - * Rect must be returned. Failing to return the correct rectangle - * may result in errors on the display. - */ - virtual Rect getSolidRect() const = 0; - - /** - * Request that a region of this drawable is redrawn. All invalidated regions are collected - * and possibly merged with other regions that have been invalidated. Before the next tick, - * these regions will then be redrawn by the drawables, widgets and containers, covering the - * regions. - * - * To invalidate the entire Drawable, use invalidate() - * - * @param [in] invalidatedArea The area of this drawable to redraw expressed in relative - * coordinates. - * - * @see invalidate - */ - virtual void invalidateRect(Rect& invalidatedArea) const; - - /** - * Tell the framework that this entire Drawable needs to be redrawn. It is the same as - * calling invalidateRect() with Rect(0, 0, getWidth(), getHeight()) as argument. - * - * @see invalidateRect - */ - virtual void invalidate() const; - - /** - * Tell the framework that the contents of the Drawable needs to be redrawn. If the Drawable is - * invisible, nothing happens. Subclasses of Drawable are encouraged to implement this function - * and invalidate as little as possible, i.e. the smallest rectangle covering the visual element(s) - * drawn by the widget. - */ - virtual void invalidateContent() const - { - // Consider checking if *this is in the draw chain - if (visible) - { - invalidate(); - } - } - - /** - * Gets the next sibling node. This will be the next Drawable that has been added to the - * same Container as this Drawable. - * - * @return The next sibling. If there are no more siblings, the return value is 0. - */ - Drawable* getNextSibling() - { - return nextSibling; - } - - /** - * Function for obtaining the first child of this drawable if any. - * - * @return A pointer on the first child drawable if any. - * @see Container::getFirstChild - */ - virtual Drawable* getFirstChild() - { - return 0; - } - - /** - * Helper function for obtaining the largest solid rect (as implemented by - * getSolidRect()) expressed in absolute coordinates. Will recursively traverse to the - * root of the tree to find the proper location of the rectangle on the display. - * - * @return The (largest) solid rect (as implemented by getSolidRect()) expressed in absolute - * coordinates. - */ - virtual Rect getSolidRectAbsolute(); - - /** - * Function for obtaining the the last child of this drawable that intersects with the - * specified point. The last child is the Drawable that is drawn last and therefore the - * topmost child. Used in input event handling for obtaining the appropriate drawable - * that should receive the event. - * - * @param x The point of intersection expressed in coordinates relative to the - * parent. - * @param y The point of intersection expressed in coordinates relative to the - * parent. - * @param [out] last Last (topmost) Drawable on the given coordinate. - * - * @note Input events must be delegated to the last drawable of the tree (meaning highest z- - * order / front-most drawable). - */ - virtual void getLastChild(int16_t x, int16_t y, Drawable** last) = 0; - - /** - * Function for finding the visible part of this drawable. If the parent node has a - * smaller area than this Drawable, or if the Drawable is placed "over the edge" of the - * parent, the parent will act as a view port, cutting off the parts of this Drawable - * that are outside the region. Traverses the tree and yields a result expressed in - * absolute coordinates. - * - * @param [out] rect The region of the Drawable that is visible. - */ - virtual void getVisibleRect(Rect& rect) const; - - /** - * Gets the rectangle this Drawable covers, in coordinates relative to its parent. - * - * @return The rectangle this Drawable covers expressed in coordinates relative to its - * parent. - * - * @see getAbsoluteRect - */ - const Rect& getRect() const - { - return rect; - } - - /** - * Helper function for obtaining the rectangle this Drawable covers, expressed in - * absolute coordinates. - * - * @return The rectangle this Drawable covers expressed in absolute coordinates. - * - * @see getRect, translateRectToAbsolute - */ - Rect getAbsoluteRect() const; - - /** - * Helper function for converting a region of this Drawable to absolute coordinates. - * - * @param [in,out] r The Rect to translate. - */ - virtual void translateRectToAbsolute(Rect& r) const; - - /** - * Sets the size and position of this Drawable, relative to its parent. The same as - * calling setXY(), setWidth() and setHeight() in that order. - * - * @param x The x coordinate of this Drawable relative to its parent. - * @param y The y coordinate of this Drawable relative to its parent. - * @param width The width of this Drawable. - * @param height The height of this Drawable. - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - * - * @see setXY,setWidthHeight,setPosition(const Drawable&) - */ - void setPosition(int16_t x, int16_t y, int16_t width, int16_t height) - { - setXY(x, y); - setWidthHeight(width, height); - } - - /** - * Expands the Drawable to have the same size as its parent with a given margin around - * the edge. If there is no parent, the position is set to the size of the entire display. - * - * @param margin (Optional) The margin. - */ - void expand(int margin = 0); - - /** Centers the Drawable inside its parent. */ - void center() - { - centerX(); - centerY(); - } - - /** Center the Drawable horizontally inside its parent. */ - void centerX() - { - assert(parent && "Cannot center a Drawable with no parent"); - setX((parent->getWidth() - getWidth()) / 2); - } - - /** Center the Drawable vertically inside its parent. */ - void centerY() - { - assert(parent && "Cannot center a Drawable with no parent"); - setY((parent->getHeight() - getHeight()) / 2); - } - - /** - * Gets the x coordinate of this Drawable, relative to its parent. - * - * @return The x value, relative to the parent. - */ - int16_t getX() const - { - return rect.x; - } - - /** - * Gets the y coordinate of this Drawable, relative to its parent. - * - * @return The y value, relative to the parent. - */ - int16_t getY() const - { - return rect.y; - } - - /** - * Gets the width of this Drawable. - * - * @return The width of this Drawable. - */ - int16_t getWidth() const - { - return rect.width; - } - - /** - * Gets the height of this Drawable. - * - * @return The height of this Drawable. - */ - int16_t getHeight() const - { - return rect.height; - } - - /** - * Sets the x coordinate of this Drawable, relative to its parent. - * - * @param x The new x value, relative to the parent. A negative value is allowed. - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - */ - virtual void setX(int16_t x) - { - rect.x = x; - } - - /** - * Sets the y coordinate of this Drawable, relative to its parent. - * - * @param y The new y value, relative to the parent. A negative value is allowed. - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - */ - virtual void setY(int16_t y) - { - rect.y = y; - } - - /** - * Sets the x and y coordinates of this Drawable, relative to its parent. The same as - * calling setX() followed by calling setY(). - * - * @param x The new x value, relative to the parent. A negative value is allowed. - * @param y The new y value, relative to the parent. A negative value is allowed. - * - * @see moveTo - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - */ - void setXY(int16_t x, int16_t y) - { - setX(x); - setY(y); - } - - /** - * Sets the width of this drawable. - * - * @param width The new width. - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - */ - virtual void setWidth(int16_t width) - { - rect.width = width; - } - - /** - * Sets the height of this drawable. - * - * @param height The new height. - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - */ - virtual void setHeight(int16_t height) - { - rect.height = height; - } - - /** - * This function can be called on parent nodes to signal that the size or position of - * one or more of its children has changed. Currently only used in ScrollableContainer - * to redraw scrollbars when the size of the scrolling contents changes. - */ - virtual void childGeometryChanged() - { - } - - /** - * Defines the event handler interface for ClickEvents. The default implementation - * ignores the event. The event is only received if the Drawable is touchable and - * visible. - * - * @param event The ClickEvent received from the HAL. - */ - virtual void handleClickEvent(const ClickEvent& event) - { - (void)event; // Unused variable - } - - /** - * Defines the event handler interface for GestureEvents. The default implementation - * ignores the event. The event is only received if the Drawable is touchable and - * visible. - * - * @param event The GestureEvent received from the HAL. - */ - virtual void handleGestureEvent(const GestureEvent& event) - { - (void)event; // Unused variable - } - - /** - * Sets the dimensions (width and height) of the Drawable without changing the x and y - * coordinates). - * - * @param width The width. - * @param height The height. - */ - void setWidthHeight(int16_t width, int16_t height) - { - setWidth(width); - setHeight(height); - } - - /** - * Sets the position of the Drawable to the same as the given Drawable. This will copy - * the x, y, width and height. - * - * @param drawable The Drawable. - * - * @see setPosition(int16_t,int16_t,int16_t,int16_t) - */ - void setPosition(const Drawable& drawable) - { - setPosition(drawable.getX(), drawable.getY(), drawable.getWidth(), drawable.getHeight()); - } - - /** - * Sets the x and y coordinates of this Drawable. - * - * @param drawable The Drawable to copy the x and y coordinates from. - * - * @see setXY(int16_t,int16_t) - */ - void setXY(const Drawable& drawable) - { - setXY(drawable.getX(), drawable.getY()); - } - - /** - * Sets the dimensions (width and height) of the Drawable without changing the x and y - * coordinates). - * - * @param drawable The Drawable to copy the width and height from. - * - * @see setWidthHeight(int16_t,int16_t) - */ - void setWidthHeight(const Drawable& drawable) - { - setWidthHeight(drawable.getWidth(), drawable.getHeight()); - } - - /** - * Sets the dimensions (width and height) of the Drawable without changing the x and y - * coordinates). - * - * @param bitmap The Bitmap to copy the width and height from. - * - * @see setWidthHeight(int16_t,int16_t) - */ - void setWidthHeight(const Bitmap& bitmap) - { - setWidthHeight(bitmap.getWidth(), bitmap.getHeight()); - } - - /** - * Sets the dimensions (width and height) of the Drawable without changing the x and y - * coordinates). - * - * @param other The Rect to copy the width and height from. - * - * @see setWidthHeight(int16_t,int16_t) - */ - void setWidthHeight(const Rect& other) - { - setWidthHeight(other.width, other.height); - } - - /** - * Defines the event handler interface for DragEvents. The default implementation - * ignores the event. The event is only received if the drawable is touchable and - * visible. - * - * @param event The DragEvent received from the HAL. - */ - virtual void handleDragEvent(const DragEvent& event) - { - (void)event; // Unused variable - } - - /** - * Called periodically by the framework if the Drawable instance has subscribed to timer - * ticks. - * - * @see Application::registerTimerWidget - */ - virtual void handleTickEvent() - { - } - - /** - * Controls whether this Drawable should be visible. Only visible Drawables will have - * their draw function called. Additionally, invisible drawables will not receive input - * events. - * - * @param vis true if this Drawable should be visible. By default, drawables are visible - * unless this function has been called with false as argument. - * - * @note For most Drawable widgets, changing this does normally not automatically yield a redraw. - */ - void setVisible(bool vis) - { - visible = vis; - } - - /** - * Controls whether this Drawable receives touch events or not. - * - * @param touch If true it will receive touch events, if false it will not. - */ - void setTouchable(bool touch) - { - touchable = touch; - } - - /** - * Gets whether this Drawable is visible. - * - * @return true if the Drawable is visible. - * - * @see setVisible - */ - bool isVisible() const - { - return visible; - } - - /** - * Gets whether this Drawable receives touch events or not. - * - * @return True if touch events are received. - * - * @see setTouchable - */ - bool isTouchable() const - { - return touchable; - } - - /** - * Returns the parent node. For the root container, the return value is 0. - * - * @return The parent node. For the root container, the return value is 0. - * - * @note A disconnected Drawable also has parent 0 which may cause strange side effects. - */ - Drawable* getParent() const - { - return parent; - } - - /** - * Moves the drawable. - * - * @param x The relative position to move to. - * @param y The relative position to move to. - * - * @see moveTo, setXY - * - * @note Will redraw the appropriate areas of the screen. - */ - virtual void moveRelative(int16_t x, int16_t y); - - /** - * Moves the drawable. - * - * @param x The absolute position to move to. - * @param y The absolute position to move to. - * - * @see moveRelative, setXY - * - * @note Will redraw the appropriate areas of the screen. - */ - virtual void moveTo(int16_t x, int16_t y) - { - moveRelative(x - rect.x, y - rect.y); - } - - /** - * Render the Drawable object into a dynamic bitmap. - * - * @param id The target dynamic bitmap to use for rendering. - */ - void drawToDynamicBitmap(BitmapId id); - -protected: - Rect rect; ///< The coordinates of this Drawable, relative to its parent. - /// @cond - Rect cachedVisibleRect; ///< Cached representation of currently visible area. For TouchGFX internal use. - /// @endcond - Drawable* parent; ///< Pointer to this drawable's parent. - Drawable* nextSibling; ///< Pointer to the next Drawable. Maintained by containers. - /// @cond - Drawable* nextDrawChainElement; ///< Next in draw chain. For TouchGFX internal use. - int16_t cachedAbsX; ///< Cached value of absolute x coordinate. For TouchGFX internal use. - int16_t cachedAbsY; ///< Cached value of absolute y coordinate. For TouchGFX internal use. - /// @endcond - bool touchable; ///< True if this drawable should receive touch events. - bool visible; ///< True if this drawable should be drawn. - - /// @cond - static const int16_t UNCACHED_INDICATOR = -1; ///< Constant representing uncached value. For TouchGFX internal use. - - /** - * For TouchGFX internal use only. - * - * Reset cached coordinate data. - * - * @note For TouchGFX internal use only. - */ - void resetDrawChainCache() - { - // Resetting the cached indicators - cachedVisibleRect.x = UNCACHED_INDICATOR; - cachedAbsX = UNCACHED_INDICATOR; - cachedAbsY = UNCACHED_INDICATOR; - } - - /** - * For TouchGFX internal use only. - * - * Obtain cached version of visible rect. - * - * @return The Visible rect for this drawable. Only calculated once. - * - * @note For TouchGFX internal use only. - */ - Rect& getCachedVisibleRect() - { - if (cachedVisibleRect.x == UNCACHED_INDICATOR) - { - Rect visibleRect(0, 0, getWidth(), getHeight()); - getVisibleRect(visibleRect); - cachedVisibleRect = visibleRect; - } - return cachedVisibleRect; - } - - /** - * For TouchGFX internal use only. - * - * Obtain cached version of absolute X-coord. - * - * @return The absolute x coordinate for this drawable. Only calculated once. - * - * @note For TouchGFX internal use only. - */ - int16_t getCachedAbsX() - { - if (cachedAbsX == UNCACHED_INDICATOR) - { - Rect absRect = getAbsoluteRect(); - cachedAbsX = absRect.x; - cachedAbsY = absRect.y; - } - return cachedAbsX; - } - - /** - * For TouchGFX internal use only. - * - * Obtain cached version of absolute Y-coord. - * - * @return The absolute y coordinate for this drawable. Only calculated once. - * - * @note For TouchGFX internal use only. - */ - int16_t getCachedAbsY() - { - if (cachedAbsY == UNCACHED_INDICATOR) - { - Rect absRect = getAbsoluteRect(); - cachedAbsX = absRect.x; - cachedAbsY = absRect.y; - } - return cachedAbsY; - } - - /** - * For TouchGFX internal use only. - * - * Configure linked list for draw chain. - * - * @param invalidatedArea Include drawables that intersect with this area only. - * @param [in,out] nextPreviousElement Modifiable element in linked list. - * - * @note For TouchGFX internal use only. - */ - virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement) - { - (void)invalidatedArea; // Unused variable - resetDrawChainCache(); - nextDrawChainElement = *nextPreviousElement; - *nextPreviousElement = this; - } - /// @endcond - - friend class Container; - friend class Screen; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DRAWABLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp deleted file mode 100644 index 2b18cb5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/EasingEquations.hpp +++ /dev/null @@ -1,467 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/EasingEquations.hpp - * - * Declares the touchgfx::EasingEquations class - */ -#ifndef TOUCHGFX_EASINGEQUATIONS_HPP -#define TOUCHGFX_EASINGEQUATIONS_HPP - -#include - -namespace touchgfx -{ -/** - * This function pointer typedef matches the signature for all easing equations. Thereby - * #EasingEquation is a convenient shorthand for a pointer to any easing equation. - */ -typedef int16_t (*EasingEquation)(uint16_t, int16_t, int16_t, uint16_t); - -/** - * Defines the "Penner easing functions", which are a de facto standard for computing - * aesthetically pleasing motion animations. See http://easings.net/ for visual - * illustrations of the easing equations. - */ -class EasingEquations -{ -public: - /** - * Back easing in: Overshooting cubic easing: (s+1)*t^3 - s*t^2. Backtracking slightly, - * then reversing direction and moving to target. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t backEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Back easing out: Overshooting cubic easing: (s+1)*t^3 - s*t^2. Moving towards target, - * overshooting it slightly, then reversing and coming back to target. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t backEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Back easing in/out: Overshooting cubic easing: (s+1)*t^3 - s*t^2. Backtracking - * slightly, then reversing direction and moving to target, then overshooting target, - * reversing, and finally coming back to target. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t backEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Bounce easing in - exponentially decaying parabolic bounce. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t bounceEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Bounce easing out - exponentially decaying parabolic bounce. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t bounceEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Bounce easing in/out - exponentially decaying parabolic bounce. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t bounceEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Circular easing in: sqrt(1-t^2). Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t circEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Circular easing out: sqrt(1-t^2). Decelerating to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t circEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Circular easing in/out: sqrt(1-t^2). Acceleration until halfway, then deceleration. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t circEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Cubic easing in: t^3. Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t cubicEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Cubic easing out: t^3. Decelerating to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t cubicEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Cubic easing in/out: t^3. Acceleration until halfway, then deceleration. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t cubicEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Elastic easing in - exponentially decaying sine wave. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t elasticEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Elastic easing out - exponentially decaying sine wave. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t elasticEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Elastic easing in/out - exponentially decaying sine wave. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t elasticEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Exponential easing in: 2^t. Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t expoEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Exponential easing out: 2^t. Deceleration to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t expoEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Exponential easing in/out: 2^t. Accelerating until halfway, then decelerating. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t expoEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Simple linear tweening - no easing. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t linearEaseNone(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Simple linear tweening - no easing. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t linearEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Simple linear tweening - no easing. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t linearEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Simple linear tweening - no easing. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t linearEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quadratic easing in: t^2. Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quadEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quadratic easing out: t^2. Decelerating to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quadEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quadratic easing in/out: t^2. Acceleration until halfway, then deceleration. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quadEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quartic easing in: t^4. Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quartEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quartic easing out: t^4. Decelerating to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quartEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quartic easing in/out: t^4. Acceleration until halfway, then deceleration. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quartEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quintic/strong easing in: t^5. Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quintEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quintic/strong easing out: t^5. Decelerating to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quintEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Quintic/strong easing in/out: t^5. Acceleration until halfway, then deceleration. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t quintEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Sinusoidal easing in: sin(t). Accelerating from zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t sineEaseIn(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Sinusoidal easing out: sin(t). Decelerating to zero velocity. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t sineEaseOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - - /** - * Sinusoidal easing in/out: sin(t). Acceleration until halfway, then deceleration. - * - * @param t Time. The current time or step. - * @param b Beginning. The beginning value. - * @param c Change. The change between the beginning value and the destination value. - * @param d Duration. The total time or total number of steps. - * - * @return The current value as a function of the current time or step. - */ - static int16_t sineEaseInOut(uint16_t t, int16_t b, int16_t c, uint16_t d); - -private: - /** - * Round respect sign. - * - * @param resultFloating The result floating. - * - * @return An int16_t. - */ - FORCE_INLINE_FUNCTION static int16_t roundRespectSign(float resultFloating) - { - return static_cast((resultFloating > 0.0f) ? (resultFloating + 0.5f) : (resultFloating - 0.5f)); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_EASINGEQUATIONS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp deleted file mode 100644 index 52e2ee7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Event.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Event.hpp - * - * Declares the touchgfx::Event class. - */ -#ifndef TOUCHGFX_EVENT_HPP -#define TOUCHGFX_EVENT_HPP - -namespace touchgfx -{ -/** Simple base class for events. */ -class Event -{ -public: - /** The event types. */ - enum EventType - { - EVENT_CLICK, ///< A click - EVENT_DRAG, ///< A drag - EVENT_GESTURE ///< A gesture - }; - - /** Default constructor. */ - Event() - { - } - - /** Destructor. */ - virtual ~Event() - { - } - - /** - * Gets event type. - * - * @return The type of this event. - */ - virtual EventType getEventType() const = 0; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_EVENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp deleted file mode 100644 index bec49fe..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Font.hpp +++ /dev/null @@ -1,560 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Font.hpp - * - * Declares the touchgfx::Font class. - */ -#ifndef TOUCHGFX_FONT_HPP -#define TOUCHGFX_FONT_HPP - -#include -#include - -namespace touchgfx -{ -/** Glyph flag definitions. */ -enum GlyphFlags -{ - GLYPH_DATA_KERNINGTABLEPOS_BIT8_10 = 0x07, ///< The 8th, 9th and 10th bit of the kerningTablePos - GLYPH_DATA_WIDTH_BIT8 = 0x08, ///< The 9th bit of "width" - GLYPH_DATA_HEIGHT_BIT8 = 0x10, ///< The 9th bit of "height" - GLYPH_DATA_TOP_BIT8 = 0x20, ///< The 9th bit of "top" - GLYPH_DATA_TOP_BIT9 = 0x40, ///< The sign bit of "top" - GLYPH_DATA_ADVANCE_BIT8 = 0x80 ///< The 9th bit of "advance" -}; - -#pragma pack(2) - -/** struct providing information about a glyph. Used by LCD when rendering. */ -struct GlyphNode -{ - uint32_t dataOffset; ///< The index to the data of this glyph - Unicode::UnicodeChar unicode; ///< The Unicode of this glyph. - uint8_t _width; ///< Width of the actual glyph data - uint8_t _height; ///< Height of the actual glyph data - uint8_t _top; ///< Vertical offset from baseline of the glyph - int8_t left; ///< Horizontal offset from the left of the glyph - uint8_t _advance; ///< Width of the glyph (including space to the left and right) - uint8_t _kerningTablePos; ///< Where are the kerning information for this glyph stored in the kerning table - uint8_t kerningTableSize; ///< How many entries are there in the kerning table (following kerningTablePos) for this glyph - uint8_t flags; ///< Additional glyph flags (font encoding and extra precision for width/height/top/advance) - - /** - * Gets the "kerningTablePos" value where the 8th and 9th bits are stored in flags. - * - * @return the right value of "kerningTablePos". - */ - FORCE_INLINE_FUNCTION uint16_t kerningTablePos() const - { - return ((flags & GLYPH_DATA_KERNINGTABLEPOS_BIT8_10) << 8) | _kerningTablePos; - } - - /** - * Gets the "width" value where the 9th bit is stored in flags. - * - * @return the right value of "width". - */ - FORCE_INLINE_FUNCTION int16_t width() const - { - return ((flags & GLYPH_DATA_WIDTH_BIT8) << 5) | _width; - } - - /** - * Gets the "height" value where the 9th bit is stored in flags. - * - * @return the right value of "height". - */ - FORCE_INLINE_FUNCTION int16_t height() const - { - return ((flags & GLYPH_DATA_HEIGHT_BIT8) << 4) | _height; - } - - /** - * Gets the "top" value where the 9th bit and the sign bit are stored in flags. - * - * @return the right value of "top". - */ - FORCE_INLINE_FUNCTION int16_t top() const - { - int16_t num = ((flags & GLYPH_DATA_TOP_BIT8) << 3) | _top; - return (flags & GLYPH_DATA_TOP_BIT9) ? num - 512 : num; - } - - /** - * Sets a new value for top. Used to adjust the vertical position of a glyph - this is - * used when positioning some Thai glyphs and some Arabic glyphs. - * - * @param newTop The new top. - */ - FORCE_INLINE_FUNCTION void setTop(int16_t newTop) - { - _top = newTop & 0xFF; - flags &= ~(GLYPH_DATA_TOP_BIT8 | GLYPH_DATA_TOP_BIT9); - flags |= (newTop & 0x300) >> 3; - } - - /** - * Gets the "advance" value where the 9th bit is stored in flags. - * - * @return the right value of "advance". - */ - FORCE_INLINE_FUNCTION uint16_t advance() const - { - return ((flags & GLYPH_DATA_ADVANCE_BIT8) << 1) | _advance; - } -}; - -#pragma pack() - -#pragma pack(2) - -/** - * Structure providing information about a kerning for a given pair of characters. Used by LCD - * when rendering, calculating text width etc. - */ -struct KerningNode -{ - Unicode::UnicodeChar unicodePrevChar; ///< The Unicode for the first character in the kerning pair - int8_t distance; ///< The kerning distance -}; - -#pragma pack() - -/** Defines an alias representing a Font ID. */ -typedef uint16_t FontId; - -/** - * Structure providing information about the contextual forms - * available in a font. - */ -struct FontContextualFormsTable -{ - /** Defines pointer to array of 5 unicodes type */ - typedef const Unicode::UnicodeChar (*arrayOf5UnicodesPtr)[5]; - - /** Defines pointer to array of 4 unicodes type */ - typedef const Unicode::UnicodeChar (*arrayOf4UnicodesPtr)[4]; - - const Unicode::UnicodeChar (*contextualForms4Long)[5]; ///< Table of contextual forms for sequences of 4 glyphs - const Unicode::UnicodeChar (*contextualForms3Long)[5]; ///< Table of contextual forms for sequences of 3 glyphs - const Unicode::UnicodeChar (*contextualForms2Long)[5]; ///< Table of contextual forms for sequences of 2 glyphs - const Unicode::UnicodeChar (*contextualForms0621_063a)[4]; ///< Table of contextual forms for glyphs 0x0621 to 0x63A - const Unicode::UnicodeChar (*contextualForms0641_064a)[4]; ///< Table of contextual forms for glyphs 0x0641 to 0x64A - const Unicode::UnicodeChar (*contextualForms06XX)[5]; ///< Table of contextual forms for remaining glyphs 0x06XX - uint16_t contextualForms4LongSize; ///< Length of the table - uint16_t contextualForms3LongSize; ///< Length of the table - uint16_t contextualForms2LongSize; ///< Length of the table - uint16_t contextualForms06XXSize; ///< Length of the table -}; - -/** - * The font base class. This class is abstract and requires the implementation of getGlyph. It - * provides utility functions such as obtaining string width and font height. - */ -class Font -{ -public: - /** Finalizes an instance of the Font class. */ - virtual ~Font() - { - } - - /** - * Gets the glyph data associated with the specified Unicode. Please note that in case - * of Thai letters and Arabic letters where diacritics can be placed relative to the - * previous character(s), please use TextProvider::getNextLigature() instead as it will - * create a temporary GlyphNode that will be adjusted with respect to X/Y position. - * - * @param unicode The character to look up. - * @param pixelData Pointer to the pixel data for the glyph if the glyph is - * found. This is set by this method. - * @param [out] bitsPerPixel Reference where to place the number of bits per pixel. - * - * @return A pointer to the glyph node or null if the glyph was not found. - */ - virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const = 0; - - /** - * Gets the glyph data associated with the specified Unicode. Please note that in case - * of Thai letters and Arabic letters where diacritics can be placed relative to the - * previous character(s), please use TextProvider::getNextLigature() instead as it will - * create a temporary GlyphNode that will be adjusted with respect to X/Y position. - * - * @param unicode The character to look up. - * - * @return A pointer to the glyph node or null if the glyph was not found. - * - * @see TextProvider::getNextLigature - */ - virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode) const - { - if (unicode == 0) - { - return 0; - } - const uint8_t* dummyPixelDataPointer = 0; - uint8_t bitsPerPixelDummy = 0; - const GlyphNode* glyph = getGlyph(unicode, dummyPixelDataPointer, bitsPerPixelDummy); - return glyph; - } - - /** - * Gets fallback character for the given font. The fallback character is the character - * used when no glyph is available for some character. If 0 (zero) is returned, there is - * no default character. - * - * @return The default character for the typography in case no glyph is available. - */ - virtual Unicode::UnicodeChar getFallbackChar() const - { - return fallbackCharacter; - } - - /** - * Gets ellipsis character for the given font. This is the character which is used when - * truncating long lines. - * - * @return The ellipsis character for the typography. - * - * @see TextArea::setWideTextAction - */ - virtual Unicode::UnicodeChar getEllipsisChar() const - { - return ellipsisCharacter; - } - - /** - * Gets the width in pixels of the specified string. If the string contains multiple - * lines, the width of the widest line is found. Please note that the correct number of - * arguments must be given if the text contains wildcards. - * - * It is recommended to use the getStringWidth() implementation with the TextDirection - * parameter to ensure correct calculation of the width. Kerning could result in - * different results depending on the TextDirection. This method assumes TextDirection - * to be TEXT_DIRECTION_LTR. - * - * @param text A null-terminated Unicode string with arguments to insert if the text - * contains wildcards. - * @param ... Variable arguments providing additional information inserted at wildcard - * placeholders. - * - * @return The width in pixels of the longest line of the specified string. - */ - virtual uint16_t getStringWidth(const Unicode::UnicodeChar* text, ...) const; - - /** - * Gets the width in pixels of the specified string. If the string contains multiple - * lines, the width of the widest line is found. Please note that the correct number of - * arguments must be given if the text contains wildcards. - * - * The TextDirection should be set correctly for the text supplied. For example the - * string "10 20 30" will be calculated differently depending on the TextDirection. If - * TextDirection is TEXT_DIRECTION_LTR the width is calculated as the with of "10 - * 20 30" (with kerning between all characters) but for TEXT_DIRECTION_RTL it is - * calculated as "10"+" "+"20"+" "+"30" (with kerning only between characters in the - * substrings and not between substrings). For most fonts there might not be a - * difference between the two calculations, but some fonts might cause slightly - * different results. - * - * @param textDirection The text direction. - * @param text A null-terminated Unicode string with arguments to insert if the text - * contains wildcards. - * @param ... Variable arguments providing additional information inserted at - * wildcard placeholders. - * - * @return The width in pixels of the longest line of the specified string. - */ - virtual uint16_t getStringWidth(TextDirection textDirection, const Unicode::UnicodeChar* text, ...) const; - - /** - * Gets the width in pixels of the specified character. - * - * @param c The Unicode character. - * - * @return The width in pixels of the specified character. - */ - virtual uint16_t getCharWidth(const Unicode::UnicodeChar c) const; - - /** - * Gets the number of blank pixels at the top of the given text. - * - * @param text A null-terminated Unicode string. - * @param ... Variable arguments providing additional information inserted at wildcard - * placeholders. - * - * @return The number of blank pixels above the text. - */ - virtual int16_t getSpacingAbove(const Unicode::UnicodeChar* text, ...) const; - - /** - * Gets the height of the highest character in a given string. The height includes the - * spacing above the text which is included in the font. - * - * @return The height if the given text. - * - * @deprecated Please use getHeight instead. - */ - TOUCHGFX_DEPRECATED("Please use getHeight() instead.", virtual uint16_t getMaxTextHeight(const Unicode::UnicodeChar* text, ...) const); - - /** - * Returns the height in pixels of this font. The returned value corresponds to the maximum - * height occupied by a character in the font. - * - * @return The height in pixels of this font. - * - * @note It is not sufficient to allocate text areas with this height. Use getMinimumTextHeight - * for this. - * - * @deprecated Please use getBaseline() instead. - */ - TOUCHGFX_DEPRECATED("Please use getBaseline() instead.", virtual uint16_t getFontHeight() const); - - /** - * Returns the position of the baseline of this font. The returned value corresponds to the - * maximum height occupied by a character in the font. - * - * @return The height in pixels of this font. - * - * @note It is not sufficient to allocate text areas with this height. Use - * getMinimumTextHeight for this. - */ - FORCE_INLINE_FUNCTION virtual uint16_t getBaseline() const - { - return baselineHeight; - } - - /** - * Returns the height of a font. The font may exceed the top by getPixelsAboveTop(). - * - * @return The font height. - * - * @deprecated Please use getHeight() instead. - */ - TOUCHGFX_DEPRECATED("Please use getHeight() instead.", virtual uint16_t getMinimumTextHeight() const); - - /** - * Returns the height of a font. The font may exceed the top by getPixelsAboveTop() or the - * bottom by getPixelsBelowBottom. - * - * @return The font height. - */ - FORCE_INLINE_FUNCTION virtual uint16_t getHeight() const - { - return fontHeight; - } - - /** - * Gets pixels above top of the normal text height. For most fonts this is 0, for some 'wedding' - * fonts the number may be positive. - * - * @return The pixels above top of normal text. - */ - FORCE_INLINE_FUNCTION uint16_t getPixelsAboveTop() const - { - return pixelsAboveTop; - } - - /** - * Gets number of pixel rows below the bottom of the font. - * - * @return The pixels below bottom. - */ - FORCE_INLINE_FUNCTION uint16_t getPixelsBelowBottom() const - { - return pixelsBelowBottom; - } - - /** - * Gets bits per pixel for this font. - * - * @return The number of bits used per pixel in this font. - */ - FORCE_INLINE_FUNCTION virtual uint8_t getBitsPerPixel() const - { - return bPerPixel; - } - - /** - * Are the glyphs saved with each glyph row byte aligned? - * - * @return True if each glyph row is stored byte aligned, false otherwise. - */ - FORCE_INLINE_FUNCTION virtual uint8_t getByteAlignRow() const - { - return bAlignRow; - } - - /** - * Gets maximum pixels left of any glyph in the font. This is the max value of "left" - * for all glyphs. The value is negated so if a "g" has left=-6 maxPixelsLeft is 6. This - * value is calculated by the font converter. - * - * @return The maximum pixels left. - */ - FORCE_INLINE_FUNCTION uint8_t getMaxPixelsLeft() const - { - return maxPixelsLeft; - } - - /** - * Gets maximum pixels right of any glyph in the font. This is the max value of - * "width+left-advance" for all glyphs. The is the number of pixels a glyph reaches to - * the right of its normal area. This value is calculated by the font converter. - * - * @return The maximum pixels right. - */ - FORCE_INLINE_FUNCTION uint8_t getMaxPixelsRight() const - { - return maxPixelsRight; - } - - /** - * Gets the kerning distance between two characters. - * - * @param prevChar The Unicode value of the previous character. - * @param glyph the glyph object for the current character. - * - * @return The kerning distance between prevChar and glyph char. - */ - virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const - { - (void)prevChar; // Unused variable - (void)glyph; // Unused variable - return 0; - } - - /** - * Count the number of lines in a given text. - * - * @param text The text. - * @param ... Variable arguments providing additional information. - * - * @return The number of lines. - */ - virtual uint16_t getNumberOfLines(const Unicode::UnicodeChar* text, ...) const; - - /** - * Gets GSUB table. Currently only used for Devanagari fonts. - * - * @return The GSUB table or null if font has GSUB no table. - */ - virtual const uint16_t* getGSUBTable() const - { - return 0; - } - - /** - * Gets the contextual forms table used in arabic fonts. - * - * @return The FontContextualFormsTable or null if the font has no table. - */ - virtual const FontContextualFormsTable* getContextualFormsTable() const - { - return 0; - } - - /** - * Query if 'character' is invisible, zero width. - * - * @param character The character. - * - * @return True if invisible, zero width, false if not. - */ - FORCE_INLINE_FUNCTION static bool isInvisibleZeroWidth(Unicode::UnicodeChar character) - { - return character == 0xFEFF || character == 0x200B; - } - -protected: - /** - * Gets the width in pixels of the specified string. If the string contains multiple - * lines, the width of the widest line is found. Please note that the correct number of - * arguments must be given if the text contains wildcards. - * - * @param textDirection The text direction. - * @param text A null-terminated Unicode string with arguments to insert if the text - * contains wildcards. - * @param pArg Variable arguments providing additional information inserted at - * wildcard placeholders. - * - * @return The width in pixels of the longest line of the specified string. - * - * @note The string is assumed to be purely left-to-right. - */ - uint16_t getStringWidthLTR(TextDirection textDirection, const Unicode::UnicodeChar* text, va_list pArg) const; - - /** - * Gets the width in pixels of the specified string. If the string contains multiple - * lines, the width of the widest line is found. Please note that the correct number of - * arguments must be given if the text contains wildcards. - * - * The string is handled as a right-to-left string and subdivided into smaller text - * strings to correctly handle mixing of left-to-right and right-to-left strings. - * - * @param textDirection The text direction. - * @param text A null-terminated Unicode string with arguments to insert if the text - * contains wildcards. - * @param pArg Variable arguments providing additional information inserted at - * wildcard placeholders. - * - * @return The string width RTL. - */ - uint16_t getStringWidthRTL(TextDirection textDirection, const Unicode::UnicodeChar* text, va_list pArg) const; - - /** - * Initializes a new instance of the Font class. The protected constructor of a Font. - * - * @param height The font height in pixels. - * @param baseline The baseline. - * @param pixAboveTop The maximum number of pixels above the top of the text. - * @param pixBelowBottom The number of pixels below the base line. - * @param bitsPerPixel The number of bits per pixel. - * @param byteAlignRow The glyphs are saved with each row byte aligned. - * @param maxLeft The maximum left extend for a glyph in the font. - * @param maxRight The maximum right extend for a glyph in the font. - * @param fallbackChar The fallback character for the typography in case no glyph is available. - * @param ellipsisChar The ellipsis character used for truncating long texts. - */ - Font(uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar) - : fontHeight(height), - baselineHeight(baseline), - pixelsAboveTop(pixAboveTop), - pixelsBelowBottom(pixBelowBottom), - bPerPixel(bitsPerPixel), - bAlignRow(byteAlignRow), - maxPixelsLeft(maxLeft), - maxPixelsRight(maxRight), - fallbackCharacter(fallbackChar), - ellipsisCharacter(ellipsisChar) - { - } - - uint16_t fontHeight; ///< The font height in pixels - uint16_t baselineHeight; ///< The baseline - uint8_t pixelsAboveTop; ///< The number of pixels above the top - uint8_t pixelsBelowBottom; ///< The number of pixels below the bottom - uint8_t bPerPixel : 7; ///< The number of bits per pixel - uint8_t bAlignRow : 1; ///< The glyphs are saved with each row byte aligned - uint8_t maxPixelsLeft; ///< The maximum number of pixels a glyph extends to the left - uint8_t maxPixelsRight; ///< The maximum number of pixels a glyph extends to the right - Unicode::UnicodeChar fallbackCharacter; ///< The fallback character to use when no glyph exists for the wanted character - Unicode::UnicodeChar ellipsisCharacter; ///< The ellipsis character used for truncating long texts. - -private: - Font(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_FONT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp deleted file mode 100644 index 8f83415..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/FontManager.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/FontManager.hpp - * - * Declares the touchgfx::FontProvider class. - */ -#ifndef TOUCHGFX_FONTMANAGER_HPP -#define TOUCHGFX_FONTMANAGER_HPP - -#include - -namespace touchgfx -{ -/** - * A generic pure virtual definition of a FontProvider, which is a class capable of returning a - * Font based on a FontId. An application-specific derivation of this class must be - * implemented. - */ -class FontProvider -{ -public: - /** - * Gets a Font. - * - * @param fontId The FontId of the font to get. - * - * @return The font with a font id of fontId. - */ - virtual Font* getFont(FontId fontId) = 0; - - /** Finalizes an instance of the FontProvider class. */ - virtual ~FontProvider() - { - } - -private: -}; - -/** - * This class is the entry point for looking up a font based on a font id. Must be initialized - * with the appropriate FontProvider by the application. - */ -class FontManager -{ -public: - /** - * Sets the font provider. Must be initialized with the appropriate FontProvider by the - * application. - * - * @param [in] fontProvider Sets the font provider. Must be initialized with the - * appropriate FontProvider by the application. - */ - static void setFontProvider(FontProvider* fontProvider); - - /** - * Gets a font. - * - * @param fontId The FontId of the font to get. - * - * @return The font with a FontId of fontId. - */ - static Font* getFont(FontId fontId); - -private: - static FontProvider* provider; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_FONTMANAGER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp deleted file mode 100644 index 9fa25c8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/InternalFlashFont.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/InternalFlashFont.hpp - * - * Declares the touchgfx::InternalFlashFont class. - */ -#ifndef TOUCHGFX_INTERNALFLASHFONT_HPP -#define TOUCHGFX_INTERNALFLASHFONT_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * An InternalFlashFont has both glyph table and glyph data placed in a flash which supports - * random access read (i.e. not a NAND flash) - * - * @see Font, ConstFont - */ -class InternalFlashFont : public ConstFont -{ -public: - /** - * Initializes a new instance of the InternalFlashFont class. - * - * @param glyphs The array of glyphs known to this font. - * @param numGlyphs The number of glyphs in list. - * @param height The height in pixels of the highest character in this font. - * @param baseline The baseline in pixel. - * @param pixAboveTop The maximum number of pixels above the top of the text. - * @param pixBelowBottom The maximum number of pixels that can be drawn below the bottom - * in this font. - * @param bitsPerPixel The number of bits per pixel in this font. - * @param byteAlignRow The glyphs are saved with each row byte aligned. - * @param maxLeft The maximum a character extends to the left. - * @param maxRight The maximum a character extends to the right. - * @param glyphDataInternalFlash Pointer to the glyph data for the font, placed in internal flash. - * @param kerningList pointer to the kerning data for the font, placed in internal - * flash. - * @param fallbackChar The fallback character for the typography in case no glyph is - * available. - * @param ellipsisChar The ellipsis character used for truncating long texts. - */ - InternalFlashFont(const GlyphNode* glyphs, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* glyphDataInternalFlash, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar); - - virtual const uint8_t* getPixelData(const GlyphNode* glyph) const; - - virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const; - -private: - InternalFlashFont() - : ConstFont(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), glyphData(0), kerningData(0) - { - } - - const uint8_t* glyphData; ///< Information describing the glyph - const KerningNode* kerningData; ///< Information describing the kerning -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_INTERNALFLASHFONT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp deleted file mode 100644 index 27ce0ef..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/JSMOCHelper.hpp +++ /dev/null @@ -1,187 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#ifndef TOUCHGFX_JSMOCHELPER_HPP -#define TOUCHGFX_JSMOCHELPER_HPP - -#include -#include - -/// @cond -namespace touchgfx -{ -/** - * Helper class providing caching of certain information while the JSMOC algorithm runs during - * draw operations. - * - * @note Not intended for application-level use. - * @note JSMOC is an abbreviation of Jesper, Søren & Martin's Occlusion Culling. - */ -class JSMOCHelper -{ -public: - /** Initializes a new instance of the JSMOCHelper class. */ - JSMOCHelper() - { - } - - /** - * Sets a widget. - * - * @param [in] newWidget The widget to operate on. - */ - void setWidget(Drawable* newWidget) - { - widget = newWidget; - - // Resetting the cached indicators - cachedVisibleRect.x = CACHED_INDICATOR; - cachedAbsX = CACHED_INDICATOR; - cachedAbsY = CACHED_INDICATOR; - } - - /** - * Gets the widget. - * - * @return The widget this helper operates on. - */ - Drawable* getWidget() - { - return widget; - } - - /** - * Gets the visible rect for the widget of this helper. - * - * @return The visible rect for the widget of this helper. Only calculated once. - */ - Rect& getCachedVisibleRect() - { - assert(widget != 0); - - if (!hasCachedVisibleRect()) - { - Rect visibleRect(0, 0, widget->getWidth(), widget->getHeight()); - widget->getVisibleRect(visibleRect); - cachedVisibleRect = visibleRect; - } - return cachedVisibleRect; - } - - /** - * Gets the absolute x coordinate for the widget of this helper. - * - * @return The absolute x coordinate for the widget of this helper. Only calculated once. - */ - int16_t getCachedAbsX() - { - if (!hasCachedAbsX()) - { - Rect absRect = widget->getAbsoluteRect(); - cachedAbsX = absRect.x; - cachedAbsY = absRect.y; - } - return cachedAbsX; - } - - /** - * Gets the absolute y coordinate for the widget of this helper. - * - * @return The absolute y coordinate for the widget of this helper. Only calculated once. - */ - int16_t getCachedAbsY() - { - if (!hasCachedAbsY()) - { - Rect absRect = widget->getAbsoluteRect(); - cachedAbsX = absRect.x; - cachedAbsY = absRect.y; - } - return cachedAbsY; - } - - /** - * Gets the width of the widget of this helper. - * - * @return The width of the widget of this helper. - */ - int16_t getWidth() - { - return widget->getWidth(); - } - - /** - * Gets the height of the widget of this helper. - * - * @return The height of the widget of this helper. - */ - int16_t getHeight() - { - return widget->getHeight(); - } - - /** - * Draws the widget of this helper. - * - * @param invalidatedArea The area of the widget to draw. - */ - void draw(const Rect& invalidatedArea) - { - widget->draw(invalidatedArea); - } - -private: - static const int16_t CACHED_INDICATOR = -1; - - Drawable* widget; - - Rect cachedVisibleRect; - - /** - * Query if this object has cached visible rectangle. - * - * @return True if cached visible rectangle, false if not. - */ - bool hasCachedVisibleRect() - { - return cachedVisibleRect.x != CACHED_INDICATOR; - } - - int16_t cachedAbsX; - int16_t cachedAbsY; - - /** - * Query if this object has cached abs x coordinate. - * - * @return True if cached abs x coordinate, false if not. - */ - bool hasCachedAbsX() - { - return cachedAbsX != CACHED_INDICATOR; - } - - /** - * Query if this object has cached abs y coordinate. - * - * @return True if cached abs y coordinate, false if not. - */ - bool hasCachedAbsY() - { - return cachedAbsY != CACHED_INDICATOR; - } -}; - -} // namespace touchgfx - -/// @endcond - -#endif // TOUCHGFX_JSMOCHELPER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp deleted file mode 100644 index a105512..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Math3D.hpp +++ /dev/null @@ -1,383 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Math3D.hpp - * - * Declares the touchgfx::Quadruple, touchgfx::Point4, touchgfx::Vector4 - * and touchgfx::Matrix4x4 classes. - */ -#ifndef TOUCHGFX_MATH3D_HPP -#define TOUCHGFX_MATH3D_HPP - -#include - -namespace touchgfx -{ -class Point4; -class Vector4; -class Matrix4x4; - -/** - * Multiplication operator. - * - * @param multiplicand The first value to multiply. - * @param multiplier The second value to multiply. - * - * @return The result of the operation. - */ -Matrix4x4 operator*(const Matrix4x4& multiplicand, const Matrix4x4& multiplier); - -/** - * Multiplication operator. - * - * @param multiplicand The first value to multiply. - * @param multiplier The second value to multiply. - * - * @return The result of the operation. - */ -Point4 operator*(const Matrix4x4& multiplicand, const Point4& multiplier); - -/** Base class for homogeneous vectors and points. */ -class Quadruple -{ -public: - /** - * Gets an element. - * - * @param row The row (0-3). - * - * @return The element. - */ - FORCE_INLINE_FUNCTION float getElement(int row) const - { - return elements[row]; - } - - /** - * Get x coordinate. - * - * @return The x coordinate. - */ - FORCE_INLINE_FUNCTION float getX() const - { - return elements[0]; - } - - /** - * Get y coordinate. - * - * @return The y coordinate. - */ - FORCE_INLINE_FUNCTION float getY() const - { - return elements[1]; - } - - /** - * Get z coordinate. - * - * @return The z coordinate. - */ - FORCE_INLINE_FUNCTION float getZ() const - { - return elements[2]; - } - - /** - * Get w coordinate. - * - * @return The w coordinate. - */ - FORCE_INLINE_FUNCTION float getW() const - { - return elements[3]; - } - - /** - * Sets an element. - * - * @param row The row (0-3). - * @param value The new value. - */ - FORCE_INLINE_FUNCTION void setElement(int row, float value) - { - elements[row] = value; - } - - /** - * Sets an x coordinate. - * - * @param value The new value. - */ - FORCE_INLINE_FUNCTION void setX(float value) - { - elements[0] = value; - } - - /** - * Sets a y coordinate. - * - * @param value The new value. - */ - FORCE_INLINE_FUNCTION void setY(float value) - { - elements[1] = value; - } - - /** - * Sets a z coordinate. - * - * @param value The new value. - */ - FORCE_INLINE_FUNCTION void setZ(float value) - { - elements[2] = value; - } - - /** - * Sets a w coordinate. - * - * @param value The new value. - */ - FORCE_INLINE_FUNCTION void setW(float value) - { - elements[3] = value; - } - -protected: - /** Initializes a new instance of the Quadruple class. */ - FORCE_INLINE_FUNCTION Quadruple() - { - elements[0] = elements[1] = elements[2] = elements[3] = 0; ///< The elements[ 3] - } - - /** - * Initializes a new instance of the Quadruple class. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param z The z coordinate. - * @param w The w coordinate. - */ - FORCE_INLINE_FUNCTION Quadruple(float x, float y, float z, float w) - { - elements[0] = x; - elements[1] = y; - elements[2] = z; - elements[3] = w; - } - - float elements[4]; ///< The elements[4] -}; - -/** - * This class represents a homogeneous 3D point. - * - * @see Quadruple - */ -class Point4 : public Quadruple -{ -public: - /** Initializes a new instance of the Point4 class. */ - FORCE_INLINE_FUNCTION Point4() - : Quadruple(0, 0, 0, 1) - { - } - - /** - * Initializes a new instance of the Point4 class. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param z The z coordinate. - */ - FORCE_INLINE_FUNCTION Point4(float x, float y, float z) - : Quadruple(x, y, z, 1) - { - } -}; - -/** - * This class represents a homogeneous 3D vector. - * - * @see Quadruple - */ -class Vector4 : public Quadruple -{ -public: - /** Initializes a new instance of the Vector4 class. */ - FORCE_INLINE_FUNCTION Vector4() - : Quadruple(0, 0, 0, 0) - { - } - - /** - * Initializes a new instance of the Vector4 class. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param z The z coordinate. - */ - FORCE_INLINE_FUNCTION Vector4(float x, float y, float z) - : Quadruple(x, y, z, 0) - { - } - - /** - * Cross product. - * - * @param operand The second operand. - * - * @return The result of the operation. - */ - FORCE_INLINE_FUNCTION Vector4 crossProduct(const Vector4& operand) - { - float X = getY() * operand.getZ() - getZ() * operand.getY(); - float Y = getZ() * operand.getX() - getX() * operand.getZ(); - float Z = getX() * operand.getY() - getY() * operand.getX(); - - return Vector4(X, Y, Z); - } -}; - -/** This class represents row major 4x4 homogeneous matrices. */ -class Matrix4x4 -{ -public: - /** Initializes a new instance of the Point4 class. */ - Matrix4x4(); - - /** - * Gets an element. - * - * @param row The row (0-3). - * @param column The column (0-3). - * - * @return The element. - */ - FORCE_INLINE_FUNCTION float getElement(int row, int column) const - { - return elements[row][column]; - } - - /** - * Sets view distance. - * - * @param distance The distance. - */ - void setViewDistance(float distance); - - /** - * Sets an element. - * - * @param row The row. - * @param column The column. - * @param value The value. - * - * @return A matrix_4x4& - */ - FORCE_INLINE_FUNCTION Matrix4x4 setElement(int row, int column, float value) - { - elements[row][column] = value; - - return *this; - } - - /** - * Concatenate x coordinate rotation. - * - * @param radians The radians. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateXRotation(float radians); - - /** - * Concatenate y coordinate rotation. - * - * @param radians The radians. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateYRotation(float radians); - - /** - * Concatenate z coordinate rotation. - * - * @param radians The radians. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateZRotation(float radians); - - /** - * Concatenate x coordinate translation. - * - * @param distance The distance. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateXTranslation(float distance); - - /** - * Concatenate y coordinate translation. - * - * @param distance The distance. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateYTranslation(float distance); - - /** - * Concatenate z coordinate translation. - * - * @param distance The distance. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateZTranslation(float distance); - - /** - * Concatenate x coordinate scale. - * - * @param distance The distance. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateXScale(float distance); - - /** - * Concatenate y coordinate scale. - * - * @param distance The distance. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateYScale(float distance); - - /** - * Concatenate z coordinate scale. - * - * @param distance The distance. - * - * @return A matrix_4x4& - */ - Matrix4x4& concatenateZScale(float distance); - -protected: - float elements[4][4]; ///< The elements[4][4] -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_MATH3D_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp deleted file mode 100644 index f03e496..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Matrix3x3.hpp +++ /dev/null @@ -1,250 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Matrix3x3.hpp - * - * Declares touchgfx::Matrix3x3 class and touchgfx::Matrix3x3::Point struct. - */ -#ifndef TOUCHGFX_MATRIX3X3_HPP -#define TOUCHGFX_MATRIX3X3_HPP - -#include - -namespace touchgfx -{ -/** - * Class representing a 3x3 matrix of floats. - * - * The class is used to define affine transformations for 2D graphics. - */ -class Matrix3x3 -{ -public: - /** A simple struct containing coordinates. */ - struct Point - { - float x; ///< The x coordinate - float y; ///< The y coordinate - }; - - /** - * Initialize a new instance of the Matrix3x3 class. - * The matrix is initialized to the identity matrix. - */ - Matrix3x3(); - - /** - * Get an element. - * - * @param row The row (0-2). - * @param column The column (0-2). - * - * @return The element. - */ - FORCE_INLINE_FUNCTION float getElement(int row, int column) const - { - return elements[row][column]; - } - - /** - * Get the internal matrix elements. - * - * Return value Internal representation - * elements[0] <= elements[0][0] - * elements[1] <= elements[0][1] - * elements[2] <= elements[0][2] - * elements[3] <= elements[1][0] - * elements[4] <= elements[1][1] - * elements[5] <= elements[1][2] - * elements[6] <= elements[2][0] - * elements[7] <= elements[2][1] - * elements[8] <= elements[2][2] - * - * @return A pointer to the internal matrix elements. - */ - FORCE_INLINE_FUNCTION float* getElements() - { - return &elements[0][0]; - } - - /** - * Set an element. - * - * @param row The row. - * @param column The column. - * @param value The value. - */ - FORCE_INLINE_FUNCTION void setElement(int row, int column, float value) - { - elements[row][column] = value; - } - - /** - * Reset to identity matrix - */ - void reset(); - - /** - * Sets affine transformation from a row-major matrix. - * - * @param transformation The transformation. - */ - void setAffineTransformation(const float transformation[6]) - { - elements[0][0] = transformation[0]; - elements[0][1] = transformation[2]; - elements[0][2] = transformation[4]; - elements[1][0] = transformation[1]; - elements[1][1] = transformation[3]; - elements[1][2] = transformation[5]; - elements[2][0] = 0.f; - elements[2][1] = 0.f; - elements[2][2] = 1.f; - } - - /** - * Apply scale transformation - * - * @param scaleX Scale factor in the direction of X - * @param scaleY Scale factor in the direction of Y - * - */ - void scale(float scaleX, float scaleY); - - /** - * Apply scale transformation - * - * @param scaleXY Scale factor in the direction of both X and Y - * - */ - void scale(float scaleXY) - { - scale(scaleXY, scaleXY); - } - - /** - * Apply rotation transformation - * - * @param angleInDegrees Angle to rotate in degrees (positive => clockwise, negative => counterclockwise) - */ - void rotate(float angleInDegrees); - - /** - * Apply rotation around a pivot point. - * - * @param angleInDegrees Angle to rotate in degrees (positive => clockwise, negative => - * counterclockwise) - * @param x X coordinate of the pivot point. - * @param y Y coordinate of the pivot point. - * - * @note This will overwrite the matrix elements set prior to this call. - */ - void rotatePivot(float angleInDegrees, float x, float y); - - /** - * Apply translate transformation - * - * @param deltaX Delta distance in the direction of X - * @param deltaY Delta distance in the direction of Y - */ - void translate(float deltaX, float deltaY); - - /** - * Do projective transformation of 2D point - * - * Projective transformation does not preserve parallelism, length, and angle. - * But it still preserves collinearity and incidence. - * - * The Matrix includes the projective part (g, h, i), see below. - * - * |x'| |a b c| |x/w| - * |y'| = |d e f| * |y/w| - * |1 | |g h i| |1/w| - * - * w = g*x + h*y + i - * x = x coordinate of the 2D point - * y = y coordinate of the 2D point - * x' = x coordinate of the transformed 2D point - * y' = y coordinate of the transformed 2D point - * - * @param point 2D Point to transform - * - * @return The transformed 2D point - */ - Matrix3x3::Point projectiveTransform(const Matrix3x3::Point& point) const; - - /** - * Do affine transformation of 2D point - * - * Affine transformation is a special case of the projective transformation, - * it has the same properties. However unlike projective transformation, - * it preserves parallelism. - * - * The Matrix does not include the projective part (g, h, i), see below. - * - * |x'| = |a b c| * |x| - * |y'| |d e f| |y| - * |1| - * - * x = x coordinate of the 2D point - * y = y coordinate of the 2D point - * x' = x coordinate of the transformed 2D point - * y' = y coordinate of the transformed 2D point - * - * @param point 2D Point to transform - * - * @return The transformed 2D point - */ - Matrix3x3::Point affineTransform(const Matrix3x3::Point& point) const; - - /** - * Do affine transformation of 2D point - * - * Affine transformation is a special case of the projective transformation, - * it has the same properties. However unlike projective transformation, - * it preserves parallelism. - * - * The Matrix does not include the projective part (g, h, i), see below. - * - * |x'| = |a b c| * |x| - * |y'| |d e f| |y| - * |1| - * - * x = x coordinate of the 2D point - * y = y coordinate of the 2D point - * x' = x coordinate of the transformed 2D point - * y' = y coordinate of the transformed 2D point - * - * @param x X-coordinate of the point to transform - * @param y Y-coordinate of the point to transform - * - * @return The transformed 2D point - */ - Matrix3x3::Point affineTransform(const float x, const float y) const; - - /** - * Multiply with another Matrix3x3 - * - * @param rhs Right hand side Matrix3x3 to multiply with - * - * @return The resulting Matrix3x3 - */ - Matrix3x3 multiply(const Matrix3x3& rhs) const; - -private: - float elements[3][3]; ///< The matrix elements -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_MATRIX3X3_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp deleted file mode 100644 index 56d3524..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Screen.hpp +++ /dev/null @@ -1,295 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Screen.hpp - * - * Declares the touchgfx::Screen class. - */ -#ifndef TOUCHGFX_SCREEN_HPP -#define TOUCHGFX_SCREEN_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -class Drawable; -class Transition; - -/** - * A Screen represents a full-screen drawable area. Applications create specific screens by - * subclassing this class. Each Screen has a root container to which drawables are - * added. The Screen makes sure to delegate draw requests and various events to the - * appropriate drawables in correct order. - */ -class Screen -{ -public: - /** Initializes a new instance of the Screen class. */ - Screen(); - - /** Finalizes an instance of the Screen class. */ - virtual ~Screen() - { - } - - /** - * Tells the screen to draw its entire area. - * - * @note The more specific draw(Rect&) version is preferred when possible. - */ - void draw(); - - /** - * Starts a JSMOC run, analyzing what parts of what widgets should be redrawn. - * - * @param [in] invalidatedArea The area to redraw, expressed in absolute coordinates. - * - * @note SMOC is an abbreviation of Søren & Martin's Occlusion Culling. - */ - void startSMOC(const Rect& invalidatedArea); - - /** - * Recursive JSMOC function. This is the actual occlusion culling implementation. - * - * @param [in] invalidatedArea The area to redraw, expressed in absolute coordinates. - * @param [in] widgetToDraw Widget currently being drawn. - * - * @note JSMOC is an abbreviation of Jesper, Søren & Martin's Occlusion Culling. - */ - void JSMOC(const Rect& invalidatedArea, Drawable* widgetToDraw); - - /** - * Tell the screen to draw the specified area. Will traverse the drawables tree from in - * z-order and delegate draw to them. - * - * @param [in] rect The area in absolute coordinates. - * - * @note The given rect must be in absolute coordinates. - */ - virtual void draw(Rect& rect); - - /** - * Called by Application::switchScreen() when this screen is going to be displayed. Base - * version does nothing, but place any screen specific initialization code in an - * overridden version. - * - * @see Application::switchScreen - */ - virtual void setupScreen() - { - } - - /** - * Called by Application::handleTickEvent() when the transition to the screen is done. Base - * version does nothing, but override to do screen specific initialization code that has - * to be done after the transition to the screen. - * - * @see Application::handleTickEvent - */ - virtual void afterTransition() - { - } - - /** - * Called by Application::switchScreen() when this screen will no longer be displayed. - * Base version does nothing, but place any screen specific cleanup code in an - * overridden version. - * - * @see Application::switchScreen - */ - virtual void tearDownScreen() - { - } - - /** - * Traverse the drawables in reverse z-order and notify them of a click event. - * - * @param event The event to handle. - */ - virtual void handleClickEvent(const ClickEvent& event); - - /** - * Traverse the drawables in reverse z-order and notify them of a drag event. - * - * @param event The event to handle. - */ - virtual void handleDragEvent(const DragEvent& event); - - /** - * Handle gestures. Traverses drawables in reverse-z and notifies them of the gesture. - * - * @param event The event to handle. - */ - virtual void handleGestureEvent(const GestureEvent& event); - - /** - * Called by the Application on the current screen with a frequency of - * Application::TICK_INTERVAL_MS. - */ - virtual void handleTickEvent() - { - } - - /** - * Called by the Application on the reception of a "key", the meaning of which is - * platform/application specific. Default implementation does nothing. - * - * @param key The key to handle. - */ - virtual void handleKeyEvent(uint8_t key) - { - (void)key; // Unused variable - } - - /** - * Determines if using JSMOC. - * - * @return true if this screen uses the JSMOC drawing algorithm. - */ - bool usingSMOC() const - { - return useSMOC; - } - - /** - * Enables the transition to access the containers. - * - * @param [in] trans The transition to bind. - */ - void bindTransition(Transition& trans); - - /** - * Obtain a reference to the root container of this screen. - * - * @return The root container. - */ - Container& getRootContainer() - { - return container; - } - - /** - * Gets width of the current screen. In most cases, this is the same as HAL::DISPLAY_WIDTH. - * - * @return The screen width. - */ - int16_t getScreenWidth() const - { - return HAL::DISPLAY_WIDTH; - } - - /** - * Gets height of the current screen. In most cases, this is the same as HAL::DISPLAY_HEIGHT. - * - * @return The screen height. - */ - int16_t getScreenHeight() const - { - return HAL::DISPLAY_HEIGHT; - } - -protected: - /** - * Determines whether to use JSMOC or painter's algorithm for drawing. - * - * @param enabled true if JSMOC should be enabled, false if disabled (meaning painter's - * algorithm is employed instead). - */ - void useSMOCDrawing(bool enabled); - - /** - * Add a drawable to the content container. - * - * @param [in] d The Drawable to add. - * - * @note Must not be called with a Drawable that was already added to the screen. If in doubt, - * call remove() first. - */ - void add(Drawable& d) - { - container.add(d); - } - - /** - * Inserts a Drawable after a specific child node. See Container::insert. - * - * @param [in] previous The Drawable to insert after. If null, insert as header. - * @param [in] d The Drawable to insert. - * - * @see Container::insert - * - * @note As with add, do not add the same drawable twice. - */ - void insert(Drawable* previous, Drawable& d) - { - container.insert(previous, d); - } - - /** - * Request that a region of this root container on the screen is redrawn. See - * Container::invalidateRect. - * - * To invalidate the entire Screen, use invalidate() - * - * @param [in] invalidatedArea The area of this drawable to redraw expressed in coordinates - * relative to the root container. - * - * @see Container::invalidateRect - * - * @note The invalidatedArea position is relative to the root container, which is usually the - * same as the Screen coordinates. - */ - void invalidateRect(Rect& invalidatedArea) const - { - container.invalidateRect(invalidatedArea); - } - - /** - * Tell the framework that this entire Screen needs to be redrawn. - * - * @see Container::invalidate - */ - void invalidate() const - { - container.invalidate(); - } - - /** - * Removes a drawable from the content container. Safe to call even if the drawable was - * never added (in which case nothing happens). - * - * @param [in] d The Drawable to remove. - */ - void remove(Drawable& d) - { - container.remove(d); - } - - Container container; ///< The container contains the contents of the screen. - - Drawable* focus; ///< The drawable currently in focus (set when DOWN_PRESSED is received). - -private: - int16_t fingerAdjustmentX; - int16_t fingerAdjustmentY; - bool useSMOC; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCREEN_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp deleted file mode 100644 index abd88af..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TextProvider.hpp +++ /dev/null @@ -1,340 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/TextProvider.hpp - * - * Declares the touchgfx::TextProvider class. - */ -#ifndef TOUCHGFX_TEXTPROVIDER_HPP -#define TOUCHGFX_TEXTPROVIDER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * The TextProvider is used in drawing basic strings and strings with one or two wildcards. The - * TextProvider enables wildcard expansion of the string at the time it is written to - * the LCD. - * - * Wildcards specified as <placeholder> are converted to Unicode value 2 by the - * text converter tool, and the placeholders are automatically expanded with the - * specified wildcard buffers at runtime. - */ -class TextProvider -{ -public: - static const uint32_t MAX_32BIT_INTEGER_DIGITS = 33U; ///< Max number of digits used for the text representation of a 32 bit integer. - - /** - * Initializes a new instance of the TextProvider class. - * - * @note The user must call initialize() before characters can be provided. - */ - TextProvider(); - - /** - * Initializes the TextProvider. Each '\2' character in the format is replaced by one - * UnicodeChar* argument from pArg. - * - * @param stringFormat The string to format. - * @param pArg Format arguments in the form of a va_list. - * @param gsubTable (Optional) Pointer to GSUB table with Unicode substitution rules. - * @param formsTable (Optional) Pointer to contextual forms table with Unicode substitution rules (for arabic). - */ - void initialize(const Unicode::UnicodeChar* stringFormat, va_list pArg, const uint16_t* gsubTable = 0, const FontContextualFormsTable* formsTable = 0); - - /** - * Initializes the TextProvider. Each '\2' character in the format is replaced by one - * UnicodeChar* argument from pArg. - * - * @param stringFormat The string to format. - * @param gsubTable (Optional) Pointer to GSUB table with Unicode substitution rules. - * @param formsTable (Optional) Pointer to contextual forms table with Unicode substitution rules (for arabic). - * @param ... Variable arguments providing additional information. - */ - void initialize(const Unicode::UnicodeChar* stringFormat, const uint16_t* gsubTable = 0, const FontContextualFormsTable* formsTable = 0, ...); - - /** - * Gets the next character. For Arabic and Thai, it is important to use the - * getNextLigature instead. - * - * @return The next character of the expanded string or 0 if end of string is reached. - * - * @see TextProvider::getNextLigature - */ - Unicode::UnicodeChar getNextChar(); - - /** - * Tells if the end of the string has been reached. - * - * @return True if the end of the string has been reached, false if not. - * - * @see TextProvider::getNextLigature() - */ - bool endOfString(); - - /** - * Gets the next ligature. For most languages this is simply the next Unicode character - * from the buffer, but e.g. Arabic has different ligatures for each character. Thai - * character placement might also depend on previous characters. It is recommended to - * use getNextLigature with font and glyph parameters to ensure coming glyphs in a text - * are placed correctly. - * - * @param direction The direction. - * - * @return The next character of the expanded string or 0 if end of string is reached. - * - * @see TextProvider::getNextChar - * - * @note Functions getNextLigature() and getNextChar() will advance through the same buffer - * and mixing the use of those functions is not recommended and may cause - * undesired results. Instead create two TextProviders and user getNextChar() on - * one and getNextLigature() on the other. - */ - Unicode::UnicodeChar getNextLigature(TextDirection direction); - - /** - * Gets the next ligature. For most languages this is simply the next Unicode character - * from the buffer, but e.g. Arabic has different ligatures for each character. - * - * Also gets a glyph for the ligature in a font. For non-Thai Unicodes, this is - * identical to using Font::getGlyph(), but for Thai characters where diacritics glyphs - * are not always placed at the same relative position, an adjusted GlyphNode will be - * generated with correct relative X/Y coordinates. - * - * @param direction The direction. - * @param font The font. - * @param [out] glyph The glyph. - * - * @return The next character of the expanded string or 0 if end of string i reached. - * - * @see TextProvider::getNextChar, Font::getGlyph - * - * @note Functions getNextLigature() and getNextChar() will advance through the same buffer - * and mixing the use of those functions is not recommended and may cause - * undesired results. Instead create two TextProviders and user getNextChar() on - * one and getNextLigature() on the other. - */ - Unicode::UnicodeChar getNextLigature(TextDirection direction, const Font* font, const GlyphNode*& glyph); - - /** - * Gets the next ligature. For most languages this is simply the next Unicode character - * from the buffer, but e.g. Arabic has different ligatures for each character. - * - * Also gets a glyph for the ligature in a font. For non-Thai Unicodes, this is - * identical to using Font::getGlyph(), but for Thai characters where diacritics glyphs - * are not always placed at the same relative position, an adjusted GlyphNode will be - * generated with correct relative X/Y coordinates. - * - * Furthermore a pointer to the glyph data and the bit depth of the font are returned in - * parameters. - * - * @param direction The direction. - * @param font The font. - * @param [out] glyph The glyph. - * @param [out] pixelData Information describing the pixel. - * @param [out] bitsPerPixel The bits per pixel. - * - * @return The next character of the expanded string or 0 if end of string is reached. - * - * @see TextProvider::getNextChar, Font::getGlyph - * - * @note Functions getNextLigature() and getNextChar() will advance through the same buffer - * and mixing the use of those functions is not recommended and may cause - * undesired results. Instead create two TextProviders and user getNextChar() on - * one and getNextLigature() on the other. - */ - Unicode::UnicodeChar getNextLigature(TextDirection direction, const Font* font, const GlyphNode*& glyph, const uint8_t*& pixelData, uint8_t& bitsPerPixel); - -private: - Unicode::UnicodeChar getNextCharInternal(); - const Unicode::UnicodeChar* original_format_string; - const Unicode::UnicodeChar* format; - const Unicode::UnicodeChar* subString[2]; - uint8_t nextSubString; - const Unicode::UnicodeChar* substringPointer; - bool isWritingWildcard; - - template - class circularBuffer - { - public: - circularBuffer() - : pos(0), used(0) - { - } - - FORCE_INLINE_FUNCTION void flush() - { - used = 0; - } - - FORCE_INLINE_FUNCTION bool isEmpty() const - { - return used == 0; - } - - FORCE_INLINE_FUNCTION bool isFull() const - { - return used == size; - } - - FORCE_INLINE_FUNCTION Unicode::UnicodeChar peekChar() - { - assert(used > 0); - return buffer[pos]; - } - - FORCE_INLINE_FUNCTION Unicode::UnicodeChar peekChar(uint16_t offset) - { - assert(offset < used); - const uint16_t index = pos + offset; - return buffer[index < size ? index : index - size]; - } - - FORCE_INLINE_FUNCTION void dropFront(uint16_t num = 1) - { - assert(used >= num); - used -= num; - pos += num; - if (pos >= size) - { - pos -= size; - } - } - - Unicode::UnicodeChar popFront() - { - assert(used > 0); - const Unicode::UnicodeChar ch = buffer[pos]; - used--; - pos++; - if (pos >= size) - { - pos -= size; - } - return ch; - } - - Unicode::UnicodeChar popBack() - { - assert(used > 0); - return peekChar(used-- - 1); - } - - void allocateFront(uint16_t num) - { - assert(used + num <= size); - used += num; - if (pos < num) - { - pos += size; - } - pos -= num; - } - - void pushFrontForce(Unicode::UnicodeChar newChar) - { - // "use" one more entry, if already full overwrite back entry ("used" is unchanged) - if (used < size) - { - used++; - } - // Move "pos" one back with overflow check - if (pos == 0) - { - pos += size; - } - pos--; - replaceAt0(newChar); - } - - void pushFront(Unicode::UnicodeChar newChar) - { - allocateFront(1); - replaceAt0(newChar); - } - - FORCE_INLINE_FUNCTION void pushBack(Unicode::UnicodeChar newChar) - { - assert(used < size); - replaceAt(++used - 1, newChar); - } - - FORCE_INLINE_FUNCTION void replaceAt0(Unicode::UnicodeChar newChar) - { - buffer[pos] = newChar; - } - - FORCE_INLINE_FUNCTION void replaceAt1(Unicode::UnicodeChar newChar) - { - assert(used > 1); - const uint16_t index = pos + 1; - buffer[index < size ? index : 0] = newChar; - } - - FORCE_INLINE_FUNCTION void replaceAt(uint16_t offset, Unicode::UnicodeChar newChar) - { - assert(used > offset); - const uint16_t index = pos + offset; - buffer[index < size ? index : index - size] = newChar; - } - - private: - Unicode::UnicodeChar buffer[size]; - uint16_t pos; - uint16_t used; - }; - - static const int NUM_PREV_CHARS = 2; - static const int NUM_NEXT_CHARS = 10; // input + lookahead + delta(substitution) - static const int NUM_XTRA_CHARS = 2; - circularBuffer prevCharacters; - circularBuffer nextCharacters; - circularBuffer xtraCharacters; // In case we insert - void replaceInputCharacters(uint16_t existingNumChars, uint16_t newNumChars, const Unicode::UnicodeChar* newChars); - void fillInputBuffer(); - const uint16_t* fontGsubTable; - const FontContextualFormsTable* contextualFormsTable; - void substituteGlyphs(); - uint16_t gsubTableBinarySearch(const uint16_t numEntries, const uint16_t* unicodeLookupTable, const Unicode::UnicodeChar key) const; - bool applyGsubRules(const uint16_t* nextTableEntry, const Unicode::UnicodeChar key); - bool gsubRuleMatch(const uint16_t* tableEntry, uint16_t backtrack, uint16_t input, uint16_t lookahead); - - void initializeInternal(); - void unicodeConverterInit(); - Unicode::UnicodeChar unicodeConverter(const TextDirection direction); - - FORCE_INLINE_FUNCTION const Unicode::UnicodeChar* binarySearch(uint16_t key, const Unicode::UnicodeChar contextualFormTable[][5], int maxIndex) const; - FORCE_INLINE_FUNCTION const Unicode::UnicodeChar* contextualFormForChar(const Unicode::UnicodeChar currChar) const; - - FORCE_INLINE_FUNCTION void adjustGlyph(Unicode::UnicodeChar originalCharacter, Unicode::UnicodeChar currentCharacter, const GlyphNode*& glyph, const Font* font); - const GlyphNode* adjustHindiGlyph(const GlyphNode* glyph); - const GlyphNode* thaiLookupGlyph(const GlyphNode* glyph, const Font* font, Unicode::UnicodeChar unicode) const; - const GlyphNode* adjustThaiGlyph(const Font* font, const GlyphNode* glyph); - const GlyphNode* adjustArabicGlyph(const Font* font, const GlyphNode* glyph, Unicode::UnicodeChar originalUnicode); - GlyphNode modifiedGlyph; - int16_t glyphPosTop; - int16_t glyphPosBottom; - int16_t glyphPosLeft; - - bool isContextualBeginning; - bool lastGlyphIsAccent; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTPROVIDER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp deleted file mode 100644 index 7f608da..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Texts.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Texts.hpp - * - * Declares the touchgfx::Texts class. - */ -#ifndef TOUCHGFX_TEXTS_HPP -#define TOUCHGFX_TEXTS_HPP - -#include -#include - -namespace touchgfx -{ -/** Language IDs generated by the text converter are uint16_t typedef'ed. */ -typedef uint16_t LanguageId; - -/** - * Class for setting language and getting texts. The language set will determine which texts - * will be used in the application. - */ -class Texts -{ -public: - /** - * Sets the current language for texts. - * - * @param id The id of the language. - */ - static void setLanguage(LanguageId id); - - /** - * Gets the current language. - * - * @return The id of the language. - */ - static LanguageId getLanguage() - { - return currentLanguage; - } - - /** - * Get text in the set language. - * - * @param id The id of the text to lookup. - * - * @return The text. - * - * @see setLanguage - */ - const Unicode::UnicodeChar* getText(TypedTextId id) const; - - /** - * Adds or replaces a translation. This function allows an application to add a - * translation at runtime. - * - * @param id The id of the language to add or replace. - * @param translation A pointer to the translation in flash or RAM. - */ - static void setTranslation(LanguageId id, const void* translation); - -private: - static LanguageId currentLanguage; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp deleted file mode 100644 index 205c4a9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp +++ /dev/null @@ -1,269 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/TextureMapTypes.hpp - * - * Declares the Gradients and Edge structs. Also declares functions for handling touchgfx::float28_4 types. - */ -#ifndef TOUCHGFX_TEXTUREMAPTYPES_HPP -#define TOUCHGFX_TEXTUREMAPTYPES_HPP - -#include - -namespace touchgfx -{ -/** - * Gradients contains all the data to interpolate u,v texture coordinates and z coordinates - * across a planar surface. - */ -struct Gradients -{ - /** - * Initializes a new instance of the TextureMapTypes class. Construct the gradients - * using three 3D vertices. - * - * @param vertices The vertices. - * - * @see Point3D - */ - Gradients(const Point3D* vertices); - - float oneOverZ[3]; ///< 1/z for each vertex - float UOverZ[3]; ///< u/z for each vertex - float VOverZ[3]; ///< v/z for each vertex - float dOneOverZdX; ///< d(1/z)/dX - float dOneOverZdY; ///< d(1/z)/dY - float dUOverZdX; ///< d(u/z)/dX - float dUOverZdY; ///< d(u/z)/dY - float dVOverZdX; ///< d(v/z)/dX - float dVOverZdY; ///< d(v/z)/dY - fixed16_16 dUdXModifier; ///< The dUdX x coordinate modifier - fixed16_16 dVdXModifier; ///< The dVdX x coordinate modifier -}; - -/** - * An edge contains information about one edge, between two points, of a triangle, as well as - * information about how to interpolate values when moving in the vertical direction. - */ -struct Edge -{ - /** - * Initializes a new instance of the TextureMapTypes class. Construct the edge between - * two vertices and uses the gradients for calculating the interpolation values. - * - * @param gradients The gradients for the triangle. - * @param vertices The vertices for the triangle. - * @param top The index in the vertices array of the top vertex of this edge. - * @param bottom The index in the vertices array of the bottom vertex of this edge. - */ - Edge(const Gradients& gradients, const Point3D* vertices, int top, int bottom); - - /** - * Perform a step along the edge. Increase the Y and decrease the height. - * - * @return The remaining height. - */ - FORCE_INLINE_FUNCTION int step() - { - X += XStep; - Y++; - height--; - UOverZ += UOverZStep; - VOverZ += VOverZStep; - oneOverZ += oneOverZStep; - - errorTerm += numerator; - if (errorTerm >= denominator) - { - X++; - errorTerm -= denominator; - oneOverZ += oneOverZStepExtra; - UOverZ += UOverZStepExtra; - VOverZ += VOverZStepExtra; - } - - return height; - } - - /** - * Performs a number of steps along the edge. - * - * @param steps The number of steps the perform. - * - * @return The remaining height. - */ - FORCE_INLINE_FUNCTION int step(int steps) - { - while (steps-- > 0) - { - step(); - } - return height; - } - - int32_t X; ///< The X coordinate - int32_t XStep; ///< Amount to increment x - int32_t numerator; ///< The numerator - int32_t denominator; ///< The denominator - int32_t errorTerm; ///< The error term - int Y; ///< The Y coordinate - int height; ///< The height - float oneOverZ; ///< The one over z coordinate - float oneOverZStep; ///< The one over z coordinate step - float oneOverZStepExtra; ///< The one over z coordinate step extra - float UOverZ; ///< The over z coordinate - float UOverZStep; ///< The over z coordinate step - float UOverZStepExtra; ///< The over z coordinate step extra - float VOverZ; ///< The over z coordinate - float VOverZStep; ///< The over z coordinate step - float VOverZStepExtra; ///< The over z coordinate step extra -}; - -/** - * Convert fixed28_4 to float. - * - * @param value The fixed28_4 value. - * - * @return The value as float. - */ -FORCE_INLINE_FUNCTION float fixed28_4ToFloat(fixed28_4 value) -{ - return (float)value / 16.0f; -} - -/** - * Convert float to fixed28_4. - * - * @param value The float value. - * - * @return The value as fixed28_4. - */ -FORCE_INLINE_FUNCTION fixed28_4 floatToFixed28_4(float value) -{ - return (fixed28_4)(value * 16); -} - -/** - * Convert float to fixed16_16. - * - * @param value The float value. - * - * @return The value as fixed16_16. - */ -FORCE_INLINE_FUNCTION fixed16_16 floatToFixed16_16(float value) -{ - return (fixed16_16)(value * 65536); -} - -/** - * Multiply two fixed28_4 numbers. - * - * @param a The fixed28_4 to process. - * @param b The fixed28_4 to process. - * - * @return the result. - */ -FORCE_INLINE_FUNCTION fixed28_4 fixed28_4Mul(fixed28_4 a, fixed28_4 b) -{ - if (a == 0 || b == 0) - { - return 0; - } - if ((a * b) / b == a) - { - return (a * b) / 16; - } - - // Rewrite "b = max_b * num_max_b + rem_b" so that a * max_b does not overflow. - int sign = 1; - if (b < 0) - { - sign = -sign; - b = -b; - } - if (a < 0) - { - sign = -sign; - a = -a; - } - if (a < b) - { - fixed28_4 tmp = a; - a = b; - b = tmp; - } - int32_t max_b = 0x7FFFFFFF / a; // Max b value that can be multiplied with a without overflow - int32_t num_max_b = b / max_b; // How many times do we have to multiply with "max_b" to get to "b" - int32_t rem_b = b - max_b * num_max_b; // plus some remainder. - int32_t max_prod = a * max_b; - int32_t result = sign * (num_max_b * (max_prod / 16) + (num_max_b * (max_prod % 16) + rem_b * a) / 16); - return result; -} - -/** - * Round up a fixed28_4 value. - * - * @param value The fixed28_4 value. - * - * @return The ceil result. - */ -FORCE_INLINE_FUNCTION int32_t ceil28_4(fixed28_4 value) -{ - int32_t returnValue; - int32_t numerator = value - 1 + 16; - if (numerator >= 0) - { - returnValue = numerator / 16; - } - else - { - // Deal with negative numerators correctly - returnValue = -((-numerator) / 16); - returnValue -= ((-numerator) % 16) ? 1 : 0; - } - return returnValue; -} - -/** - * Divides two fixed28_4 numbers and returns the result as well as the remainder. - * - * @param numerator The numerator. - * @param denominator The denominator. - * @param [out] floor numerator/denominator. - * @param [out] mod numerator\%denominator. - */ -FORCE_INLINE_FUNCTION void floorDivMod(int32_t numerator, int32_t denominator, int32_t& floor, int32_t& mod) -{ - assert(denominator > 0); // We assume it's positive - if (numerator >= 0) - { - // Positive case, C is okay - floor = numerator / denominator; - mod = numerator % denominator; - } - else - { - // Numerator is negative, do the right thing - floor = -((-numerator) / denominator); - mod = (-numerator) % denominator; - if (mod) - { - // There is a remainder - floor--; - mod = denominator - mod; - } - } -} -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTUREMAPTYPES_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp deleted file mode 100644 index 2d2a453..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/TypedText.hpp +++ /dev/null @@ -1,187 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/TypedText.hpp - * - * Declares the touchgfx::TypedText class. - */ -#ifndef TOUCHGFX_TYPEDTEXT_HPP -#define TOUCHGFX_TYPEDTEXT_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -const TypedTextId TYPED_TEXT_INVALID = 0xFFFFU; ///< The ID of an invalid text - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000) -// Keil5 compiler issues irrelevant warning relating to missing ctor initialization for TypedTextData. -#pragma diag_suppress 368 -#endif - -/** - * TypedText represents text (for characters) and typography (for font and alignment). - * TypedText provides methods for adjusting the text, font and alignment. - * - * @see TextArea - */ -class TypedText -{ -public: - /** - * The data structure for typed texts. - */ - struct TypedTextData - { - const unsigned char fontIdx; ///< The ID of the font associated with the typed text - const Alignment alignment : 2; ///< The alignment of the typed text (LEFT,CENTER,RIGHT) - const TextDirection direction : 2; ///< The text direction (LTR,RTL,...) of the typed text - }; - - /** - * Initializes a new instance of the TypedText class. - * - * @param id (Optional) The identifier. - */ - TypedText(const TypedTextId id = TYPED_TEXT_INVALID) - : typedTextId(id) - { - } - - /** Finalizes an instance of the TypedText class. */ - virtual ~TypedText() - { - } - - /** - * Gets the id of the typed text. - * - * @return The id. - */ - FORCE_INLINE_FUNCTION TypedTextId getId() const - { - return typedTextId; - } - - /** - * Has the TypedText been set to a proper value? - * - * @return Is the id valid. - */ - FORCE_INLINE_FUNCTION bool hasValidId() const - { - return typedTextId < numberOfTypedTexts; - } - - /** - * Gets the text associated with this TypedText. - * - * @return The text. - */ - FORCE_INLINE_FUNCTION const Unicode::UnicodeChar* getText() const - { - assert(typedTexts != 0 && "TypedText database has not been initialized."); - assert(hasValidId() && "typedTextId larger than numberOfTypedTexts."); - return texts->getText(typedTextId); - } - - /** - * Gets the font associated with this TypedText. - * - * @return The font. - */ - FORCE_INLINE_FUNCTION const Font* getFont() const - { - assert(typedTexts != 0 && "TypedText database has not been initialized."); - assert(hasValidId() && "typedTextId larger than numberOfTypedTexts."); - return fonts[typedTexts[typedTextId].fontIdx]; - } - - /** - * Gets the font ID associated with this TypedText. - * - * @return The font. - */ - FORCE_INLINE_FUNCTION FontId getFontId() const - { - assert(typedTexts != 0 && "TypedText database has not been initialized."); - assert(hasValidId() && "typedTextId larger than numberOfTypedTexts."); - return typedTexts[typedTextId].fontIdx; - } - - /** - * Gets the alignment associated with this TypedText. - * - * @return The alignment. - */ - FORCE_INLINE_FUNCTION Alignment getAlignment() const - { - assert(typedTexts != 0 && "TypedText database has not been initialized."); - assert(hasValidId() && "typedTextId larger than numberOfTypedTexts."); - return typedTexts[typedTextId].alignment; - } - - /** - * Gets the text direction associated with this TypedText. - * - * @return The alignment. - */ - FORCE_INLINE_FUNCTION TextDirection getTextDirection() const - { - assert(typedTexts != 0 && "TypedText database has not been initialized."); - assert(hasValidId() && "typedTextId larger than numberOfTypedTexts."); - return typedTexts[typedTextId].direction; - } - - /** - * Registers an array of typed texts. All typed text instances are bound to this - * database. This function is called automatically when setting a new language. Use - * Texts::setLanguage() instead of calling this function directly. - * - * @param data A reference to the TypedTextData storage array. - * @param f The fonts associated with the array. - * @param n The number of typed texts in the array. - */ - static void registerTypedTextDatabase(const TypedTextData* data, const Font* const* f, const uint16_t n) - { - typedTexts = data; - fonts = f; - numberOfTypedTexts = n; - } - - /** - * Registers an array of texts. This function is called automatically from - * touchgfx_generic_init(). Should not be called under normal circumstances. - * - * @param t The array of texts. - */ - static void registerTexts(const Texts* t) - { - texts = t; - } - -private: - TypedTextId typedTextId; - - static const TypedTextData* typedTexts; - static const Texts* texts; - static const Font* const* fonts; - static uint16_t numberOfTypedTexts; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TYPEDTEXT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp deleted file mode 100644 index cea8d19..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/UIEventListener.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/UIEventListener.hpp - * - * Declares the touchgfx::ClickEvent, touchgfx::DragEvent, touchgfx::GestureEvent and - * touchgfx::UIEventListener classes. - */ -#ifndef TOUCHGFX_UIEVENTLISTENER_HPP -#define TOUCHGFX_UIEVENTLISTENER_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class declares a handler interface for user interface events, i.e. events generated by - * the users interaction with the device. With the exception of the system timer tick, - * all other system events, which are not related to the user interface device - * peripherals (display, keys etc.) are not part of this interface. - */ -class UIEventListener -{ -public: - /** - * This handler is invoked when a mouse click or display touch event has been detected - * by the system. - * - * @param event The event data. - */ - virtual void handleClickEvent(const ClickEvent& event) - { - (void)event; // Unused variable - } - - /** - * This handler is invoked when a drag event has been detected by the system. - * - * @param event The event data. - */ - virtual void handleDragEvent(const DragEvent& event) - { - (void)event; // Unused variable - } - - /** - * This handler is invoked when a gesture event has been detected by the system. - * - * @param event The event data. - */ - virtual void handleGestureEvent(const GestureEvent& event) - { - (void)event; // Unused variable - } - - /** - * This handler is invoked when a key (or button) event has been detected by the system. - * - * @param c The key or button pressed. - */ - virtual void handleKeyEvent(uint8_t c) - { - (void)c; // Unused variable - } - - /** - * This handler is invoked when a system tick event has been generated. The system tick - * period is configured in the HAL. - */ - virtual void handleTickEvent() - { - } - - /** This handler is invoked when a change screen event is pending. */ - virtual void handlePendingScreenTransition() - { - } - - /** Finalizes an instance of the UIEventListener class. */ - virtual ~UIEventListener() - { - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_UIEVENTLISTENER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp deleted file mode 100644 index 3af9834..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Unicode.hpp +++ /dev/null @@ -1,485 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Unicode.hpp - * - * Declares the touchgfx::Unicode class. - */ -#ifndef TOUCHGFX_UNICODE_HPP -#define TOUCHGFX_UNICODE_HPP - -#include -#include - -namespace touchgfx -{ -/** - * This class provides simple helper functions for working with strings which are stored as a - * null-terminated array of 16-bit characters. - */ -class Unicode -{ -public: - /** Use the UnicodeChar typename when referring to characters in a string. */ - typedef uint16_t UnicodeChar; - - /** - * Gets the length of a null-terminated Unicode string. - * - * @param str The string in question. - * - * @return Length of string. - */ - static uint16_t strlen(const UnicodeChar* str); - - /** - * Gets the length of a null-terminated string. - * - * @param str The string. - * - * @return Length of string. - */ - static uint16_t strlen(const char* str); - - /** - * Copy a string to a destination buffer, UnicodeChar to UnicodeChar version. Stops - * after copying maxchars Unicode characters or after copying the ending zero - * termination UnicodeChar. - * - * @param [out] dst The destination buffer. Must have a size of at least maxchars. - * @param [in] src The source string. - * @param maxchars Maximum number of UnicodeChars to copy. - * - * @return The number of characters copied (excluding null-termination if encountered) - * - * @note If there is no null-termination among the first n UnicodeChars of src, the string - * placed in destination will NOT be null-terminated! - */ - static uint16_t strncpy(UnicodeChar* RESTRICT dst, const UnicodeChar* RESTRICT src, uint16_t maxchars); - - /** - * Copy a string to a destination buffer, char to UnicodeChar version. Stops after - * copying maxchars Unicode characters or after copying the ending null-termination - * UnicodeChar. - * - * @param [out] dst The destination buffer. Must have a size of at least maxchars. - * @param [in] src The source string. - * @param maxchars Maximum number of chars to copy. - * - * @return The number of characters copied (excluding null-termination if encountered) - * - * @note If there is no null-termination among the first n UnicodeChars of src, the string - * placed in destination will NOT be null-terminated! - */ - static uint16_t strncpy(UnicodeChar* RESTRICT dst, const char* RESTRICT src, uint16_t maxchars); - - /** - * Integer to ASCII conversion. Supports radix 2 to radix 36. - * - * @param value to convert. - * @param [out] buffer to place result in. - * @param bufferSize Size of buffer (number of UnicodeChar's). - * @param radix to use (8 for octal, 10 for decimal, 16 for hex) - */ - static void itoa(int32_t value, UnicodeChar* buffer, uint16_t bufferSize, int radix); - - /** - * Integer to ASCII conversion. Supports radix 2 to radix 36. - * - * @param value to convert. - * @param [out] buffer to place result in. - * @param bufferSize Size of buffer (number of UnicodeChar's). - * @param radix to use (8 for octal, 10 for decimal, 16 for hex) - */ - static void utoa(uint32_t value, UnicodeChar* buffer, uint16_t bufferSize, int radix); - - /** - * String to integer conversion. Starts conversion at the start of the string. Running - * digits from here are converted. Only radix 10 supported. - * - * @param s Radix 10, null-terminated Unicode string to convert. - * - * @return The converted integer value of the string, 0 if the string does not start - * with a digit. - */ - static int atoi(const UnicodeChar* s); - - /** - * Formats a string and adds null termination. The string is formatted like when the - * standard printf is used. - * - * Support formats: \%c (element type: char), \%s (element type: null-terminated - * UnicodeChar list), \%u, \%i, \%d, \%o, \%x (all these are integers formatted in radix - * 10, 10, 10, 8, 16 respectively). - * - * The number formats (\%u, \%i, \%d, \%o and \%x) all support \%[0][length]X to specify - * the size of the generated field (length) and whether the number should be prefixed - * with zeros (or blanks). - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string. - * @param ... The values to insert in the format string. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintfFloat, snprintfFloats - * - * @note \%f is not supported by this function because floats are converted to doubles when - * given as parameters in a variable argument list (va_list). Use snprintfFloat - * or snprintfFloats instead. - */ - static UnicodeChar* snprintf(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* format, ...); - - /** - * Variant of snprintf. - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string. - * @param pArg The values to insert in the format string. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintf - */ - static UnicodeChar* vsnprintf(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* format, va_list pArg); - - /** - * Formats a string and adds null termination. The string is formatted like when the - * standard printf is used. - * - * Support formats: \%c (element type: char), \%s (element type: null-terminated - * UnicodeChar list), \%u, \%i, \%d, \%o, \%x (all these are integers formatted in radix - * 10, 10, 10, 8, 16 respectively). - * - * The number formats (\%u, \%i, \%d, \%o and \%x) all support - * - * \%[flags][width][.precision]X - * - * Where flags can be: - * - '-': left justify the field (see width). - * - '+': force sign. - * - ' ': insert space if value is positive. - * - '0': left pad with zeros instead of spaces (see width). - * - * Where width is the desired width of the output. If the value is larger, more - * characters may be generated, but not more than the parameter dstSize. If width is '*' - * the actual width is read from the parameters passed to this function. - * - * Where precision is the number of number of digits after the decimal point, default is - * 3. Use "\%.f" to not generate any numbers after the decimal point. If precision is '*' - * the actual precision is read from the parameters passed to this function. - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string. - * @param ... The values to insert in the format string. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintfFloat, snprintfFloats - * - * @note \%f is not supported by this function because floats are converted to doubles when - * given as parameters in a variable argument list (va_list). Use snprintfFloat or - * snprintfFloats instead. - * - * @see snprintfFloat, snprintfFloats - */ - static UnicodeChar* snprintf(UnicodeChar* dst, uint16_t dstSize, const char* format, ...); - - /** - * Variant of snprintf. - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string. - * @param pArg The values to insert in the format string. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintf - */ - static UnicodeChar* vsnprintf(UnicodeChar* dst, uint16_t dstSize, const char* format, va_list pArg); - - /** - * Variant of snprintf for floats only. The format supports several \%f with - * flags/modifiers. The following is supported: - * - * \%[flags][width][.precision]f - * - * Where flags can be: - * - '-': left justify the field (see width). - * - '+': force sign. - * - ' ': insert space if value is positive - * - '\#': insert decimal point even if there are not decimals - * - '0': left pad with zeros instead of spaces (see width) - * - * Where width is the desired width of the output. If the value is larger, more - * characters may be generated, but not more than the parameter dstSize. If width is '*' - * the actual width is read from the list of values passed to this function. - * - * Where precision is the number of number of digits after the decimal point, default is - * 3. Use "\%.f" to not generate any numbers after the decimal point. If precision is '*' - * the actual precision is read from the list of values passed to this function. - * @code{.cpp} - * float param1[3] = { 6.0f, 4.0f, 3.14159f }; - * Unicode::snprintfFloats(buffer, 20, "%*.*f", param1); - * // buffer="3.1416" float param2[2] = { 3.14159f, -123.4f }; - * Unicode::snprintfFloats(buffer, 20, "%f %f", param2); - * // buffer="3.142 -123.400" - * @endcode - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string containing %f's. - * @param [in] values The floating point values to insert for %f. The number of elements in - * the array must match the number of %f's in the format string. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintf, snprintfFloat - */ - static UnicodeChar* snprintfFloats(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* format, const float* values); - - /** - * Variant of snprintfFloats() for exactly one float only. - * - * The number format supports only one \%f with flags/modifiers. The following is - * supported: - * - * \%[flags][width][.precision]f - * - * Where flags can be: - * - '-': left justify the field (see width). - * - '+': force sign. - * - ' ': insert space if value is positive. - * - '\#': insert decimal point even if there are not decimals. - * - '0': left pad with zeros instead of spaces (see width). - * - * Where width is the desired width of the output. If the value is larger, more - * characters may be generated, but not more than the parameter dstSize. - * - * Where precision is the number of number of digits after the decimal point, default is - * "3". Use "\%.f" to not generate any numbers after the decimal point. - * @code{.cpp} - * Unicode::UnicodeChar buffer[20]; - * Unicode::snprintfFloat(buffer, 20, "%6.4f", 3.14159f); - * // buffer="3.1416" - * Unicode::snprintfFloat(buffer, 20, "%#6.f", 3.14159f); - * // buffer=" 3." - * Unicode::snprintfFloat(buffer, 20, "%6f", 3.14159f); - * // buffer=" 3.142" - * Unicode::snprintfFloat(buffer, 20, "%+06.f", 3.14159f); - * // buffer="+00003" - * @endcode - * - * If more control over the output is needed, see snprintfFloats which can have more - * than a single "\%f" in the string and also supports "*" in place of a number. - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string containing exactly on occurrence of %f. - * @param value The floating point value to insert for %f. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintf, snprintfFloats - */ - static UnicodeChar* snprintfFloat(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* format, const float value) - { - return snprintfFloats(dst, dstSize, format, &value); - } - - /** - * Variant of snprintf for floats only. The format supports several \%f with - * flags/modifiers. The following is supported: - * - * \%[flags][width][.precision]f - * - * Where flags can be: - * - '-': left justify the field (see width). - * - '+': force sign. - * - ' ': insert space if value is positive - * - '\#': insert decimal point even if there are not decimals - * - '0': left pad with zeros instead of spaces (see width) - * - * Where width is the desired width of the output. If the value is larger, more - * characters may be generated, but not more than the parameter dstSize. If width is '*' - * the actual width is read from the list of values passed to this function. - * - * Where precision is the number of number of digits after the decimal point, default is - * 3. Use "\%.f" to not generate any numbers after the decimal point. If precision is '*' - * the actual precision is read from the list of values passed to this function. - * @code{.cpp} - * float param1[3] = { 6.0f, 4.0f, 3.14159f }; - * Unicode::snprintfFloats(buffer, 20, "%*.*f", param1); - * // buffer="3.1416" float param2[2] = { 3.14159f, -123.4f }; - * Unicode::snprintfFloats(buffer, 20, "%f %f", param2); - * // buffer="3.142 -123.400" - * @endcode - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string containing %f's. - * @param [in] values The floating point values to insert for %f. The number of elements in - * the array must match the number of %f's in the format string. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintf, snprintfFloat - */ - static UnicodeChar* snprintfFloats(UnicodeChar* dst, uint16_t dstSize, const char* format, const float* values); - - /** - * Variant of snprintfFloats() for exactly one float only. - * - * The number format supports only one \%f with flags/modifiers. The following is - * supported: - * - * \%[flags][width][.precision]f - * - * Where flags can be: - * - '-': left justify the field (see width). - * - '+': force sign. - * - ' ': insert space if value is positive. - * - '\#': insert decimal point even if there are not decimals. - * - '0': left pad with zeros instead of spaces (see width). - * - * Where width is the desired width of the output. If the value is larger, more - * characters may be generated, but not more than the parameter dstSize. - * - * Where precision is the number of number of digits after the decimal point, default is - * "3". Use "\%.f" to not generate any numbers after the decimal point. - * @code{.cpp} - * Unicode::UnicodeChar buffer[20]; - * Unicode::snprintfFloat(buffer, 20, "%6.4f", 3.14159f); - * // buffer="3.1416" - * Unicode::snprintfFloat(buffer, 20, "%#6.f", 3.14159f); - * // buffer=" 3." - * Unicode::snprintfFloat(buffer, 20, "%6f", 3.14159f); - * // buffer=" 3.142" - * Unicode::snprintfFloat(buffer, 20, "%+06.f", 3.14159f); - * // buffer="+00003" - * @endcode - * - * If more control over the output is needed, see snprintfFloats which can have more - * than a single "\%f" in the string and also supports "*" in place of a number. - * - * @param [out] dst Buffer for the formatted string. - * @param dstSize Size of the dst buffer measured by number of UnicodeChars the buffer - * can hold. - * @param [in] format The format string containing exactly on occurrence of %f. - * @param value The floating point value to insert for %f. - * - * @return pointer to the first element in the buffer where the formatted string is - * placed. - * - * @see snprintf, snprintfFloats - */ - static UnicodeChar* snprintfFloat(UnicodeChar* dst, uint16_t dstSize, const char* format, const float value) - { - return snprintfFloats(dst, dstSize, format, &value); - } - - /** - * Compares up to maxchars characters in two strings. One character from each buffer is - * compared, one at a time until the characters differ, until a terminating null- - * character is reached, or until maxchars characters match in both strings, whichever - * happens first. - * - * @param str1 The first string. - * @param str2 The second string. - * @param maxchars The maximum number of chars to compare. - * - * @return Returns an integral value indicating the relationship between the strings: A - * zero value indicates that the characters compared in both strings are all - * equal. A value greater than zero indicates that the first character that does - * not match has a greater value in str1 than in str2; And a value less than - * zero indicates the opposite. - */ - static int strncmp(const UnicodeChar* RESTRICT str1, const UnicodeChar* RESTRICT str2, uint16_t maxchars); - - /** - * Like strncmp except that ignore any whitespaces in the two strings. - * - * @param str1 The first string. - * @param str2 The second string. - * @param maxchars The maximum number of chars to compare. - * - * @return Returns an integral value indicating the relationship between the strings: A - * zero value indicates that the characters compared in both strings are all - * equal. A value greater than zero indicates that the first character that does - * not match has a greater value in str1 than in str2; And a value less than - * zero indicates the opposite. - */ - static int strncmp_ignore_whitespace(const UnicodeChar* RESTRICT str1, const UnicodeChar* RESTRICT str2, uint16_t maxchars); - - /** - * Convert a string from UTF8 to Unicode. The conversion stops if there is no more room - * in the destination or if the terminating zero character has been converted. - * - * @param utf8 The UTF8 string. - * @param [out] dst The destination buffer for the converted string. - * @param maxchars The maximum number of chars that the dst array can hold. - * - * @return The number of characters successfully converted from UTF8 to Unicode - * including the terminating zero. - */ - static uint16_t fromUTF8(const uint8_t* utf8, UnicodeChar* dst, uint16_t maxchars); - - /** - * Converts a string from Unicode to UTF8. The conversion stops if there is no more room - * in the destination or if the terminating zero character has been converted. U+10000 - * through U+10FFFF are skipped. - * - * @param unicode The Unicode string. - * @param [out] utf8 The destination buffer for the converted string. - * @param maxbytes The maximum number of bytes that the UTF8 array can hold. - * - * @return The number of characters successfully converted from Unicode to UTF8 - * including the terminating zero. - */ - static uint16_t toUTF8(const UnicodeChar* unicode, uint8_t* utf8, uint16_t maxbytes); - -private: - static void composeString(const UnicodeChar*& bufptr, UnicodeChar sign, UnicodeChar formatChar, bool hasPrecision, bool zeroPrefix, int precision, bool hasWidth, int width, bool alignLeft, int& charNumber, uint16_t dstSize, UnicodeChar* dst); - - static void parseFlagsAndPrecision(const UnicodeChar*& ucFormat, const char*& cFormat, UnicodeChar& sign, bool& alignLeft, bool& forceDecimalPoint, bool& zeroPrefix, bool& hasWidth, int& width, bool& hasPrecision, int& precision); - - static const UnicodeChar* skip_spaces(const UnicodeChar* str); - static const UnicodeChar* skip_whitespace(const UnicodeChar* str); - - FORCE_INLINE_FUNCTION static UnicodeChar peekChar(const UnicodeChar* ucFormat, const char* cFormat); - FORCE_INLINE_FUNCTION static void nextChar(const UnicodeChar*& ucFormat, const char*& cFormat); - static UnicodeChar* vsnprintf(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* ucFormat, const char* cFormat, va_list pArg); - static UnicodeChar* snprintfFloats(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* ucFormat, const char* cFormat, const float* values); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_UNICODE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp deleted file mode 100644 index b1e3dda..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Utils.hpp +++ /dev/null @@ -1,232 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Utils.hpp - * - * Declares various helper functions. - */ -#ifndef TOUCHGFX_UTILS_HPP -#define TOUCHGFX_UTILS_HPP - -#include -#include - -#if defined(SIMULATOR) && !defined(__linux__) - -/** - * Ensure there is a console window to print to and read from. - * - * The console window is used to print to using touchgfx_printf(), printf() or std::cout, - * and read from using e.g. fgets() or std::cin. Alternatively, instead of using - * printf(), simply use touchgfx_printf() which will ensure there is a console to write - * to. After the first call to touchgfx_printf(), it will also be possible to read from - * stdin. - * - * @see touchgfx_printf - * - * @note This function is called automatically from HALSDL2::sdl_init(). It is therefore no - * longer necessary to call this function from user code. - */ -void touchgfx_enable_stdio(); -#else -#define touchgfx_enable_stdio() -#endif - -#ifdef SIMULATOR - -/** - * TouchGFX printf that will only work on simulators. On Windows systems, a new console window - * will be created where the output is printed. On Linux systems, output will be sent to - * /var/log/syslog. For target systems, calls to touchgfx_printf() will be removed and - * will not cause any use of memory. Unlike printf(), touchfgx_printf() does not return - * number of characters written. - * - * @param format Describes the format to use, see printf(). - * @param ... Variable arguments providing additional information. - * - * @see touchgfx_enable_stdio - */ -void touchgfx_printf(const char* format, ...); -#else -#define touchgfx_printf(format, ...) -#endif - -namespace touchgfx -{ -/** - * Simple implementation of the standard memset function. Will write the value of 'c' in 'size' - * consecutive bytes starting from 'data'. - * - * @param [out] data Address of data to set. - * @param c Value to set. - * @param size Number of bytes to set. - */ -void memset(void* data, uint8_t c, uint32_t size); - -/** - * Returns the associated nearest neighbor render variant based on the bitmap format. This is - * used for quick determination of the type of bitmap during TextureMapper drawing. - * - * @param bitmap The bitmap. - * - * @return A RenderingVariant based on the bitmap format. - */ -RenderingVariant lookupNearestNeighborRenderVariant(const Bitmap& bitmap); - -/** - * Returns the associated bilinear render variant based on the bitmap format. This is used for - * quick determination of the type of bitmap during TextureMapper drawing. - * - * @param bitmap The bitmap. - * - * @return A RenderingVariant based on the bitmap format. - */ -RenderingVariant lookupBilinearRenderVariant(const Bitmap& bitmap); - -/** - * Simple implementation of the standard abs function. - * - * @tparam T The type on which to perform the abs. - * @param d The entity on which to perform the abs. - * - * @return The absolute (non-negative) value of d. - */ -template -T abs(T d) -{ - return (d < 0) ? -d : d; -} - -/** - * Simple implementation of the standard sign function. - * - * @tparam T The type on which to perform the sign. - * @param d The entity on which to perform the sign. - * - * @return -1, +1 or 0 depending on the sign of the given value of d. - */ -template -T sign(T d) -{ - return (d < 0) ? -1 : ((d > 0) ? 1 : 0); -} - -/** - * Find greatest common divisor of two given numbers. - * - * @tparam T Generic type parameter. - * @param a The first number. - * @param b The second number. - * - * @return The greatest common divisor. - */ -template -T gcd(T a, T b) -{ - for (;;) - { - if (a == 0) - { - return b; - } - b %= a; - if (b == 0) - { - return a; - } - a %= b; - } -} - -/** - * Count leading zeros in the binary representation of absolute value of the given int32_t. - * - * @param x The value to count the number of leading zeros in. - * - * @return The number of leading zeros (from 0 to 31). - * - * @see clzu - */ -int32_t clz(int32_t x); - -/** - * Count leading zeros in the binary representation of absolute value of the given uint32_t. - * - * @param x The value to count the number of leading zeros in. - * - * @return The number of leading zeros (from 0 to 32). - * - * @see clz - */ -int32_t clzu(uint32_t x); - -/** - * Multiply and divide without causing overflow. Multiplying two large values and subsequently - * dividing the result with another large value might cause an overflow in the intermediate - * result. The function muldiv() will multiply factor1 and factor2 and divide the result by - * divisor without causing overflow (unless the final result would overflow). The remainder from - * the division is returned. - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * @param divisor The divisor. - * @param [out] remainder The remainder. - * - * @return (factor1 * factor2) / divisor. - * - * @see muldivu - * - * @note For large numbers close to the limit of int32_t, the calculation may not be correct. - */ -int32_t muldiv(int32_t factor1, int32_t factor2, int32_t divisor, int32_t& remainder); - -/** - * Multiply and divide without causing overflow. Multiplying two large values and subsequently - * dividing the result with another large value might cause an overflow in the intermediate - * result. The function muldiv() will multiply factor1 and factor2 and divide the result by - * divisor without causing overflow (unless the final result would overflow). The remainder from - * the division is returned. - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * @param divisor The divisor. - * @param [out] remainder The remainder. - * - * @return (factor1 * factor2) / divisor. - * - * @see muldiv - * - * @note For large numbers close to the limit of uint32_t, the calculation may not be correct. - */ -uint32_t muldivu(uint32_t factor1, uint32_t factor2, uint32_t divisor, uint32_t& remainder); - -/** - * Multiply and divide without causing overflow. Multiplying two large values and subsequently - * dividing the result with another large value might cause an overflow in the intermediate - * result. The function muldiv() will multiply factor1 and factor2 and divide the result by - * divisor without causing overflow (unless the final result would overflow). The remainder is - * used to round the result up or down. - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * @param divisor The divisor. - * - * @return (factor1 * factor2) / divisor rounded. - * - * @see muldiv(int32_t,int32_t,int32_t,int32_t&) - */ -int32_t muldiv(int32_t factor1, int32_t factor2, int32_t divisor); - -} // namespace touchgfx - -#endif // TOUCHGFX_UTILS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp deleted file mode 100644 index 30d4f57..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/Version.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#ifndef TOUCHGFX_VERSION_HPP -#define TOUCHGFX_VERSION_HPP - -#define TOUCHGFX_VERSION 42102 -#define TOUCHGFX_VERSION_MAJOR 4 -#define TOUCHGFX_VERSION_MINOR 21 -#define TOUCHGFX_VERSION_PATCH 2 - -#endif // TOUCHGFX_VERSION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp deleted file mode 100644 index 83d2a5b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp - * - * Declares the touchgfx::CanvasWidgetRenderer class. - */ -#ifndef TOUCHGFX_CANVASWIDGETRENDERER_HPP -#define TOUCHGFX_CANVASWIDGETRENDERER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * Class for supporting drawing of figures. This class holds the memory which is used by the - * underlying algorithms. CanvasWidget will not allocate memory dynamically, but will - * use memory from the buffer passed to CanvasWidgetRenderer. When using the TouchGFX - * simulator, it is also possible to get a report on the actual amount of memory used - * for drawing with CanvasWidgetRenderer to help adjusting the buffer size. - * - * @see Widget, setWriteMemoryUsageReport, getWriteMemoryUsageReport - */ -class CanvasWidgetRenderer -{ -public: - /** - * Setup the buffers used by CanvasWidget. - * - * @param [in] buffer Buffer reserved for CanvasWidget. - * @param bufferSize The size of the buffer. - */ - static void setupBuffer(uint8_t* buffer, unsigned bufferSize); - - /** - * Removes references to a buffer previously setup using setupBuffer(). - * - * @see setupBuffer - */ - static void resetBuffer(); - - /** - * Query if CanvasWidgetRenderer has been initialized with a buffer. - * - * @return True if a buffer has been setup. - */ - static bool hasBuffer(); - - /** - * Gets pointer to memory used for Cell objects in Outline. - * - * @return Pointer to memory used internally by Outline. - */ - static Cell* getOutlineBuffer(); - - /** - * Gets size of memory area used for Cell objects in Outline. - * - * @return Size of memory area used internally by Outline. - */ - static unsigned int getOutlineBufferSize(); - /// @endcond - -#ifdef SIMULATOR - /** - * Memory reporting. - * - * Memory reporting can be turned on (and off) using this method. CWR will try to work - * with the given amount of memory passed when calling setupBuffer(). If the outline of - * the figure is too complex, this will be reported. - * - * "CWR requires X bytes" means that X bytes is the highest number of bytes required by - * CWR so far, but since the size of the invalidated area and the shape of things draw - * can influence this, this may be reported several times with a higher and higher - * number. Leave your app running for a long time to find out what the memory - * requirements are. - * - * "CWR requires X bytes (Y bytes missing)" means the same as the report above, but - * there as was not enough memory to render the entire shape. To get around this, CWR - * will split the shape into two separate drawings of half size. This means that less - * memory is required, but drawing will be (somewhat) - * slower. After you see this message all future draws will be split into smaller chunks, - * so memory requirements might not get as high. This is followed by: - * - * "CWR will split draw into multiple draws due to limited memory." actually just means - * that CWR will try to work with a smaller amount of memory. - * - * In general, if there is enough memory available to run the simulation and never see - * the message "CWR will split draw ...", this is preferred. The size of the buffer - * required will be the highest number X reported as "CWR requires X bytes". Good - * numbers can also be around half of X. - * - * @param writeUsageReport true to write report. - * - * @see setupBuffer - */ - static void setWriteMemoryUsageReport(bool writeUsageReport); - - /** - * Gets write memory usage report flag. - * - * @return true if it CWR writes memory reports, false if not. - */ - static bool getWriteMemoryUsageReport(); - - /// @cond - /** - * Called after a shape (Circle, Line, etc.) has been drawn to keep track of the memory - * requirements of CanvasWidgets. - * - * @param used Number of Cell objects used from the dedicated buffer. - */ - static void numCellsUsed(unsigned used); - - /** - * Called after a shape (Circle, Line, etc.) has been drawn to keep track of the memory - * requirements of CanvasWidgets. - * - * @param missing Number of Cell objects required, but not available. - */ - static void numCellsMissing(unsigned missing); - /// @endcond - - /** - * Calculate how much memory has been required by CanvasWidgets. This can be used to - * fine tune the size of the buffer passed to CanvasWidgetRenderer upon initialization. - * - * @return The number of bytes required. - */ - static unsigned getUsedBufferSize(); - - /** - * Calculate how much memory was required by CanvasWidgets, but was unavailable. If the - * value returned is greater than 0 it means the This can be used to fine tune the size - * of the buffer passed to CanvasWidgetRenderer upon initialization. - * - * @return The number of bytes required. - */ - static unsigned getMissingBufferSize(); -#endif - -private: - static Cell* memoryBuffer; - static unsigned int memoryBufferSize; -#ifdef SIMULATOR - static unsigned int maxCellsUsed; - static unsigned int maxCellsMissing; - static bool writeReport; -#endif -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CANVASWIDGETRENDERER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp deleted file mode 100644 index 9e6de65..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Cell.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/canvas_widget_renderer/Cell.hpp - * - * Declares the touchgfx::Cell struct. Used internally by CanvasWidgetRenderer. - */ -#ifndef TOUCHGFX_CELL_HPP -#define TOUCHGFX_CELL_HPP - -#include - -/// @cond -namespace touchgfx -{ -/** - * A pixel cell. There are no constructors defined and it was done intentionally in order to - * avoid extra overhead when allocating an array of cells. - */ -struct Cell -{ - int16_t x; ///< The x coordinate - int16_t y; ///< The y coordinate - int16_t cover; ///< The cover (see http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithm for further information). - int16_t area; ///< The area (see http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithm for further information). - - /** - * Sets all the Cell parameters. - * - * @param cellX The x coordinate. - * @param cellY The y coordinate. - * @param cellCover The cover. - * @param cellArea The area. - */ - FORCE_INLINE_FUNCTION void set(int cellX, int cellY, int cellCover, int cellArea) - { - setCoord(cellX, cellY); - setCover(cellCover, cellArea); - } - - /** - * Sets the coordinate of the Cell. - * - * @param cellX The Cell's x coordinate. - * @param cellY The Cell's y coordinate. - */ - FORCE_INLINE_FUNCTION void setCoord(int cellX, int cellY) - { - x = (int16_t)cellX; - y = (int16_t)cellY; - } - - /** - * Sets the cover of area cell. - * - * @param cellCover The cover. - * @param cellArea The area. - */ - FORCE_INLINE_FUNCTION void setCover(int cellCover, int cellArea) - { - cover = cellCover; - area = cellArea; - } - - /** - * Adds a cover to a Cell. - * - * @param cellCover The cover to add to the Cell. - * @param cellArea The area to add to the Cell. - */ - FORCE_INLINE_FUNCTION void addCover(int cellCover, int cellArea) - { - cover += cellCover; - area += cellArea; - } -}; // struct Cell - -} // namespace touchgfx - -/// @endcond - -#endif // TOUCHGFX_CELL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp deleted file mode 100644 index 62a17a7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Outline.hpp +++ /dev/null @@ -1,194 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/canvas_widget_renderer/Outline.hpp - * - * Declares the touchgfx::Outline class. Used internally by CanvasWidgetRenderer. - */ -#ifndef TOUCHGFX_OUTLINE_HPP -#define TOUCHGFX_OUTLINE_HPP - -#include - -/// @cond -namespace touchgfx -{ -/** - * An internal class that implements the main rasterization algorithm. Used in the Rasterizer. - * Should not be used directly. - */ -class Outline -{ -public: - /** Defines an alias representing the outline flags. */ - typedef unsigned int OutlineFlags_t; - - static const OutlineFlags_t OUTLINE_NOT_CLOSED = 1U; ///< If this bit is set in flags, the current Outline has not yet been closed. Used for automatic closing an Outline before rendering the Outline. - static const OutlineFlags_t OUTLINE_SORT_REQUIRED = 2U; ///< If this bit is set in flags, Cell objects have been added to the Outline requiring the Cell list needs to be sorted. - - /** Initializes a new instance of the Outline class. */ - Outline(); - - /** Finalizes an instance of the Outline class. */ - virtual ~Outline(); - - /** - * Resets this object. This implies removing the current Cell objects and preparing for - * a new Outline. - */ - void reset(); - - /** - * Move a virtual pen to the specified coordinate. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void moveTo(int x, int y); - - /** - * Create a line from the current virtual pen coordinate to the given coordinate - * creating an Outline. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void lineTo(int x, int y); - - /** - * Gets number of cells registered in the current drawn path for the Outline. - * - * @return The number of cells. - */ - unsigned getNumCells() const - { - return numCells; - } - - /** - * Gets a pointer to the the Cell objects in the Outline. If the Outline is not closed, - * it is closed. If the Outline is unsorted, it will be quick sorted first. - * - * @return A pointer to the sorted list of Cell objects in the Outline. - */ - const Cell* closeOutlineAndSortCells(); - - /** - * Sets maximum render y coordinate. This is used to avoid registering any Cell that has - * a y coordinate less than zero of higher than the given y. - * - * @param y The max y coordinate to render for the Outline. - */ - void setMaxRender(int x, int y) - { - maxRenderX = x; - maxRenderY = y; - } - - /** - * Determines if there was enough memory to register the entire outline, of if the - * outline was too complex. - * - * @return false if the buffer for Outline Cell objects was too small. - */ - FORCE_INLINE_FUNCTION bool wasOutlineTooComplex() - { - return numCells > maxCells; - } - -private: - /** - * Sets coordinate of the current Cell. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setCurCell(int x, int y); - - /** - * Sets coordinate of the current Cell without checking if x,y differs from the curCell's x,y. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setCurCellNew(int x, int y); - - /** Adds current cell to the Outline. */ - void addCurCell(); - - /** - * Render the scanline in the special case where the line is on the same scanline, - * though it might not be 100% horizontal as the fraction of the y endpoints might - * differ making the line tilt ever so slightly. - * - * @param ey The entire part of the from/to y coordinate (same for both from y and to y as - * it is a horizontal scanline). - * @param x1 The from x coordinate in poly format. - * @param y1 The from y coordinate fraction part in poly format. - * @param x2 The to x coordinate in poly format. - * @param y2 The to y coordinate fraction part in poly format. - */ - void renderScanline(int ey, int x1, int y1, int x2, int y2); - - /** - * Render the line. This is the general case which handles all cases regardless of the - * position of the from coordinate and the to coordinate. - * - * @param x1 The from x coordinate in poly format. - * @param y1 The from y coordinate in poly format. - * @param x2 The to x coordinate in poly format. - * @param y2 The to y coordinate in poly format. - */ - void renderLine(int x1, int y1, int x2, int y2); - - FORCE_INLINE_FUNCTION static void swapCells(Cell* a, Cell* b) - { - const Cell temp = *a; - *a = *b; - *b = temp; - } - - FORCE_INLINE_FUNCTION static bool lessThan(const Cell* a, const Cell* b) - { - return a->y < b->y || (a->y == b->y && a->x < b->x); - } - - /** - * Quick sort Outline cells. - * - * @param [in] start The first Cell object in the Cell array to sort. - * @param num Number of Cell objects to sort. - */ - static void qsortCells(Cell* const start, unsigned num); - - unsigned maxCells; - unsigned numCells; - Cell* cells; - Cell* curCellPtr; - int curX; - int curY; - int closeX; - int closeY; - unsigned int flags; - int maxRenderX; - int maxRenderY; -#ifdef SIMULATOR - unsigned maxNumCells; -#endif -}; - -} // namespace touchgfx - -/// @endcond - -#endif // TOUCHGFX_OUTLINE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp deleted file mode 100644 index 64821a2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/Rasterizer.hpp +++ /dev/null @@ -1,342 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/canvas_widget_renderer/Rasterizer.hpp - * - * Declares the touchgfx::Rasterizer class. Used internally by CanvasWidgetRenderer. - */ -#ifndef TOUCHGFX_RASTERIZER_HPP -#define TOUCHGFX_RASTERIZER_HPP - -#include -#include - -/// @cond -namespace touchgfx -{ -/** - * Polygon Rasterizer that is used to render filled polygons with high-quality Anti- Aliasing. - * - * Polygon Rasterizer that is used to render filled polygons with high-quality Anti- - * Aliasing. Internally, by default, the class uses integer coordinates in format 24.8, - * i.e. 24 bits for integer part and 8 bits for fractional - see POLY_BASE_SHIFT. This - * class can be used in the following way: - * - * 1. setFillingRule(FillingRule fr) - optional. - * - * 2. reset() - * - * 3. moveTo(x, y) / lineTo(x, y) - make the polygon. One can create - * more than one contour, but each contour must consist of at least 3 vertices, i.e. - * moveTo(x1, y1); lineTo(x2, y2); lineTo(x3, y3); - * is the absolute minimum of vertices that define a triangle. The algorithm does not - * check either the number of vertices nor coincidence of their coordinates, but in - * the worst case it just won't draw anything. The order of the vertices (clockwise - * or counterclockwise) - * is important when using the non-zero filling rule (fill_non_zero). In this case - * the vertex order of all the contours must be the same if you want your - * intersecting polygons to be without "holes". You actually can use different - * vertices order. If the contours do not intersect each other the order is not - * important anyway. If they do, contours with the same vertex order will be rendered - * without "holes" while the intersecting contours with different orders will have - * "holes". - * - * setFillingRule() can be called anytime before "sweeping". - */ -class Rasterizer -{ -public: - /** - * Determine the sub pixel accuracy, to be more precise, the number of bits of the - * fractional part of the coordinates. - */ - enum - { - POLY_BASE_SHIFT = 5, ///< Number of bits reserved for fraction part - POLY_BASE_SIZE = 1 << POLY_BASE_SHIFT, ///< The value to divide or multiply with to convert to / from this format - POLY_BASE_MASK = POLY_BASE_SIZE - 1 ///< The value used to mask the fraction - }; - - /** - * Determine the area accuracy, to be more precise, the number of bits of the fractional - * part of the areas when calculating scan lines. - */ - enum - { - AA_SHIFT = 8, ///< Number of bits reserved for fraction part when calculating the area - AA_NUM = 1 << AA_SHIFT, ///< The value to divide or multiply with to convert to / from this format - AA_MASK = AA_NUM - 1, ///< The value used to mask the fraction - AA_2NUM = AA_NUM * 2, ///< Number of fraction bits when multiplying two area numbers - AA_2MASK = AA_2NUM - 1 ///< Mask for fraction bits when multiplying two area numbers - }; - - /** Values that represent filling rules. */ - enum FillingRule - { - FILL_NON_ZERO, ///< Filling rule to fill anything inside the outermost border of the outline. - FILL_EVEN_ODD ///< Filling rule to fill using xor rule inside the outline. - }; - - /** Initializes a new instance of the Rasterizer class. */ - Rasterizer() - : outline(), fillingRule(FILL_NON_ZERO), offsetX(0), offsetY(0), width(0) - { - } - - /** Resets this object. Basically this is done by resetting the the Outline. */ - void reset(int16_t offset_x, int16_t offset_y) - { - offsetX = offset_x; - offsetY = offset_y; - outline.reset(); - } - - /** - * Sets the filling rule to be used when rendering the outline. - * - * @param rule The filling rule. - * - * @see getFillingRule - */ - void setFillingRule(FillingRule rule) - { - fillingRule = rule; - } - - /** - * Gets the filling rule being used when rendering the outline. - * - * @return The filling rule. - * - * @see setFillingRule - */ - FillingRule getFillingRule() const - { - return fillingRule; - } - - /** - * Move to. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void moveTo(int x, int y) - { -#ifndef SIMULATOR - if (!outline.wasOutlineTooComplex()) -#endif - { - outline.moveTo(x, y); - } - } - - /** - * Line to. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void lineTo(int x, int y) - { -#ifndef SIMULATOR - if (!outline.wasOutlineTooComplex()) -#endif - { - outline.lineTo(x, y); - } - } - - /** - * Calculates the alpha. - * - * @param area The area. - * - * @return The calculated alpha. - */ - unsigned calculateAlpha(int area) const - { - int cover = area >> (POLY_BASE_SHIFT * 2 + 1 - AA_SHIFT); - - if (cover < 0) - { - cover = -cover; - } - if (fillingRule == FILL_EVEN_ODD) - { - cover &= AA_2MASK; - if (cover > AA_NUM) - { - cover = AA_2NUM - cover; - } - } - if (cover > AA_MASK) - { - cover = AA_MASK; - } - return cover; - } - - /** - * Renders this object. - * - * @return true there was enough memory available to draw the outline and render the - * graphics, false if there was insufficient memory and nothing was drawn. - */ - bool render(const AbstractPainter* const painter, uint8_t* buf, int16_t stride, uint8_t xAdjust, uint8_t global_alpha) - { - const Cell* curCell = outline.closeOutlineAndSortCells(); // has side effects, so it must be first in this function - unsigned numCells = outline.getNumCells(); - if (numCells == 0) - { - return true; - } - - // Not enough memory allocated, the outline will look wrong. Do not proceed with the drawing. - if (outline.wasOutlineTooComplex()) - { - return false; - } - - int cover = 0; - int old_y = curCell->y; - int widget_y = old_y + offsetY; - uint8_t* buf_ptr = buf + old_y * stride; - numCells--; - for (;;) - { - const Cell* startCell = curCell; - - const int start_x = curCell->x; - int x = start_x; - const int y = curCell->y; - if (y != old_y) - { - old_y = y; - widget_y = old_y + offsetY; - buf_ptr = buf + old_y * stride; - } - - int area = startCell->area; - cover += startCell->cover; - - // Accumulate all start cells - while (numCells-- > 0) - { - curCell++; - if (curCell->x != start_x || curCell->y != y) - { - break; - } - area += curCell->area; - cover += curCell->cover; - } - - if (area) - { - if (x >= 0 && x < width) - { - const int8_t alpha = LCD::div255(calculateAlpha((cover << (POLY_BASE_SHIFT + 1)) - area) * global_alpha); - if (alpha) - { - painter->paint(buf_ptr, x + xAdjust, x + offsetX, widget_y, 1, alpha); - } - } - x++; - } - - if (numCells == unsigned(-1)) - { - break; - } - - int count = curCell->x - x; - if (count > 0) - { - if (x < 0) - { - count += x; - x = 0; - } - if (count > 0) - { - if (x + count >= width) - { - count = width - x; - } - if (count > 0) - { - const int8_t alpha = LCD::div255(calculateAlpha(cover << (POLY_BASE_SHIFT + 1)) * global_alpha); - if (alpha) - { - painter->paint(buf_ptr, x + xAdjust, x + offsetX, widget_y, count, alpha); - } - } - } - } - } - return true; - } - - /** - * Sets maximum render y coordinate. This is passed to the Outline to avoid registering - * any Cell that has a y coordinate less than zero of higher than the given y. - * - * @param y The max y coordinate to render for the Outline. - */ - void setMaxRender(int16_t w, int16_t h) - { - width = w; - outline.setMaxRender(w, h); - } - - /** - * Determines if we the outline was too complex to draw completely. - * - * @return True if it was too complex, false if not. - */ - FORCE_INLINE_FUNCTION bool wasOutlineTooComplex() - { - return outline.wasOutlineTooComplex(); - } - -private: - /** - * Copy constructor. - * - * @param parameter1 The first parameter. - */ - Rasterizer(const Rasterizer&); - - /** - * Assignment operator. - * - * @param parameter1 The first parameter. - * - * @return A shallow copy of this object. - */ - const Rasterizer& operator=(const Rasterizer&); - - Outline outline; ///< The outline - FillingRule fillingRule; ///< The filling rule - - int16_t offsetX; - int16_t offsetY; - int16_t width; -}; - -} // namespace touchgfx - -/// @endcond - -#endif // TOUCHGFX_RASTERIZER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/license.txt b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/license.txt deleted file mode 100644 index 54dcfca..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/canvas_widget_renderer/license.txt +++ /dev/null @@ -1,51 +0,0 @@ -**************************************************************************** -** ** -** The code in this folder is based on "The Lightweight Rasterizer" ** -** which in turn is based on project "Anti-Grain Geometry". ** -** ** -** The Lightweight Rasterizer is available from ** -** http://www.antigrain.com/lite/agg2_lite.zip ** -** ** -** You can read more about Anti-Grain Geometry on ** -** http://www.antigrain.com ** -** ** -** The code has been heavily modified for TouchGFX to allow the ** -** rasterizer to be used in embedded devices. ** -** ** -** Below you find the original copyright notice. ** -** ** -**************************************************************************** - ----------------------------------------------------------------------------- -Anti-Grain Geometry - Version 2.1 Lite -Copyright (C) 2002-2003 Maxim Shemanarev (McSeem) - -Permission to copy, use, modify, sell and distribute this software -is granted provided this copyright notice appears in all copies. -This software is provided "as is" without express or implied -warranty, and with no claim as to its suitability for any purpose. - -The author gratefully acknowleges the support of David Turner, -Robert Wilhelm, and Werner Lemberg - the authors of the FreeType -libray - in producing this work. See http:www.freetype.org for details. - ----------------------------------------------------------------------------- -Contact: mcseem@antigrain.com - mcseemagg@yahoo.com - http:www.antigrain.com ----------------------------------------------------------------------------- - -Class Outline - implementation. - -Initially the rendering algorithm was designed by David Turner and the -other authors of the FreeType library - see the above notice. I nearly -created a similar renderer, but still I was far from David's work. -I completely redesigned the original code and adapted it for Anti-Grain -ideas. Two functions - renderLine and renderScanline are the core of -the algorithm - they calculate the exact coverage of each pixel cell -of the polygon. I left these functions almost as is, because there's -no way to improve the perfection - hats off to David and his group! - -All other code is very different from the original. - ----------------------------------------------------------------------------- diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp deleted file mode 100644 index e5e7cd7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/CacheableContainer.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/CacheableContainer.hpp - * - * Declares the touchgfx::CacheableContainer class. - */ -#ifndef TOUCHGFX_CACHEABLECONTAINER_HPP -#define TOUCHGFX_CACHEABLECONTAINER_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A CacheableContainer can be seen as a regular Container, i.e. a Drawable that can have child - * nodes. The z-order of children is determined by the order in which Drawables are - * added to the container - the Drawable added last will be front-most on the screen. - * - * The important difference is that a CacheableContainer can also render its content to - * a dynamic bitmap which can then be used as a texture in subsequent drawing operations, - * either as a simple Image or in a TextureMapper. If the bitmap format of the dynamic - * bitmap differs from the format of the current LCD, the LCD from drawing the bitmap - * must be setup using HAL::setAuxiliaryLCD(). - * - * @see Container, Bitmap, Image, TextureMapper - */ -class CacheableContainer : public Container -{ -public: - CacheableContainer(); - - /** - * Set the dynamic bitmap into which the container content will be rendered. The format - * of the bitmap must be the same as the current LCD or the same as the auxiliary LCD - * setup using HAL::setAuxiliaryLCD. - * - * @param bitmapId Id of the dynamic bitmap to serve as a render target. - * - * @see updateCache, getCacheBitmap, HAL::setAuxiliaryLCD - */ - void setCacheBitmap(BitmapId bitmapId); - - /** - * Get the dynamic bitmap used by the CacheableContainer. - * - * @return the id of the assigned bitmap or BITMAP_INVALID if no bitmap has been assigned. - * - * @see setCacheBitmap - */ - BitmapId getCacheBitmap() const; - - /** - * Render the container into the attached dynamic bitmap. - * - * @see setCacheBitmap - */ - void updateCache(); - - /** - * Render the container into the attached dynamic bitmap. Only the specified Rect region - * is updated. - * - * @param rect Region to update. - * - * @see setCacheBitmap - */ - void updateCache(const Rect& rect); - - /** - * Toggle cached mode on and off. The CacheableContainer behaves just like a regular - * Container when cached mode is turned off. - * - * @param enable Enable or disable cached mode. - */ - void enableCachedMode(bool enable); - - /** - * Request that a subregion of this drawable is redrawn. Will recursively traverse the - * children. When this function returns, the specified invalidated area has been redrawn - * for all appropriate Drawables covering the region. - * - * @param [in] invalidatedArea The area of this drawable to redraw expressed in coordinates - * relative to its parent (e.g. to request a complete - * redraw, invalidatedArea will be (0, 0, width, height). - */ - virtual void invalidateRect(Rect& invalidatedArea) const; - - /** - * Set the solid area on the dynamic bitmap assigned to the CacheableContainer. - * - * @param [in] solidRect The rectangle of th CacheableContainer that is solid. - * - * @return true if the operation succeeds, false otherwise. - */ - bool setSolidRect(const Rect& solidRect) const; - - /** - * Queries the CacheableContainer whether any child widget has been invalidated. - * - * @return True if a child widget has been invalidated and false otherwise. - */ - bool isChildInvalidated() const; - - /** - * @copydoc Image::setAlpha() - * - * @note The alpha is only applied when cached mode is enabled. - * - * @see enableCachedMode - */ - void setAlpha(uint8_t newAlpha) - { - cachedImage.setAlpha(newAlpha); - } - - /** @copydoc Image::getAlpha() */ - uint8_t getAlpha() const - { - return cachedImage.getAlpha(); - } - - virtual void invalidateContent() const - { - if (getAlpha() > 0) - { - Container::invalidateContent(); - } - } - -protected: - /// @cond - virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement); - - /** - * A CachedImage is a specialized Image object that exposes the setupDrawChain() method. - * - * @see CacheableContainer, Image - */ - class CachedImage : public Image - { - public: - virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement) - { - Drawable::setupDrawChain(invalidatedArea, nextPreviousElement); - } - }; - - /// @endcond - -private: - BitmapId cachedBitmapId; ///< The BitmapId of the dynamic bitmap attached to the CacheableContainer - CachedImage cachedImage; ///< The CachedImage object used as a wrapper widget around the attached dynamic bitmap - bool isCachedMode; ///< Cached mode whether enabled or disabled - bool childWasInvalidated; ///< A child widget has been invalidated. The flag is meaningful when isCachedMode is true. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CACHEABLECONTAINER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp deleted file mode 100644 index 62493c9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Container.hpp +++ /dev/null @@ -1,196 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/Container.hpp - * - * Declares the touchgfx::Container class. - */ -#ifndef TOUCHGFX_CONTAINER_HPP -#define TOUCHGFX_CONTAINER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A Container is a Drawable that can have child nodes. The z-order of children is determined by - * the order in which Drawables are added to the container - the Drawable added last - * will be front-most on the screen. - * - * This class overrides a few functions in Drawable in order to traverse child nodes. - * - * Note that containers act as view ports - that is, only the parts of children that - * intersect with the geometry of the container will be visible (e.g. setting a - * container's width to 0 will render all children invisible). - * - * @see Drawable - */ -class Container : public Drawable -{ -public: - Container() - : Drawable(), - firstChild(0) - { - } - - /** - * Adds a Drawable instance as child to this Container. The Drawable added will be - * placed as the element to be drawn last, and thus appear on top of all previously - * added drawables in the Container. - * - * @param [in] d The Drawable to add. - * - * @note Never add a drawable more than once! - */ - virtual void add(Drawable& d); - - /** - * Removes a Drawable from the container by removing it from the linked list of - * children. If the Drawable is not in the list of children, nothing happens. It is - * possible to remove an element from whichever Container it is a member of using: - * @code - * if (d.getParent()) d.getParent()->remove(d); - * @endcode - * The Drawable will have the parent and next sibling cleared, but is otherwise left - * unaltered. - * - * @param [in] d The Drawable to remove. - * - * @note This is safe to call even if d is not a child of this Container (in which case nothing happens). - */ - virtual void remove(Drawable& d); - - /** - * Removes all children in the Container by resetting their parent and sibling pointers. - * Please note that this is not done recursively, so any child which is itself a - * Container is not emptied. - */ - virtual void removeAll(); - - /** - * Removes all children by unlinking the first child. The parent and sibling pointers of - * the children are not reset. - * - * @see getFirstChild - */ - virtual void unlink(); - - /** - * Query if a given Drawable has been added directly to this Container. The search is - * not done recursively. - * - * @param d The Drawable to look for. - * - * @return True if the specified Drawable instance is direct child of this container, - * false otherwise. - */ - virtual bool contains(const Drawable& d); - - /** - * Inserts a Drawable after a specific child node. If previous child node is 0, the - * drawable will be inserted as the first element in the list. The first element in the - * list of children is the element drawn first, so this makes it possible to insert a - * Drawable \a behind all previously added children. - * - * @param [in] previous The Drawable to insert after. If null, insert as header. - * @param [in] d The Drawable to insert. - * - * @note As with add, do not add the same drawable twice. - */ - virtual void insert(Drawable* previous, Drawable& d); - - /** - * Gets the last child in the list of children in this Container. If this Container is - * touchable (isTouchable()), it will be passed back as the result. Otherwise all \a - * visible children are traversed recursively to find the Drawable that intersects with - * the given coordinate. - * - * @param x The x coordinate of the intersection. - * @param y The y coordinate of the intersection. - * @param [out] last out parameter in which the result is placed. - * - * @see isVisible, isTouchable, getLastChildNear - */ - virtual void getLastChild(int16_t x, int16_t y, Drawable** last); - - /** - * Works similar to getLastChild() but also considers the current set finger size in HAL. - * - * @param x The x coordinate of the intersection. - * @param y The y coordinate of the intersection. - * @param [out] last out parameter in which the result is placed. - * @param [out] fingerAdjustmentX out parameter in which the finger adjustment x is placed. - * @param [out] fingerAdjustmentY out parameter in which the finger adjustment y is placed. - * - * @see getLastChild, HAL::setFingerSize - */ - virtual void getLastChildNear(int16_t x, int16_t y, Drawable** last, int16_t* fingerAdjustmentX, int16_t* fingerAdjustmentY); - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - - /** - * Executes the specified callback function for each child in the Container. The - * callback to execute must have the following prototype: void T::func(Drawable&) - * - * @param [in] function The function to be executed for each child. - */ - virtual void forEachChild(GenericCallback* function); - - /** - * Obtain a pointer to the first child of this container. The first child is the - * Drawable drawn first, and therefore the Drawable \a behind all other children of this - * Container. Useful if you want to manually iterate the children added to this - * container. - * - * @return Pointer to the first drawable added to this container. If nothing has been - * added return zero. - * - * @see getNextSibling - */ - virtual Drawable* getFirstChild() - { - return firstChild; - } - -protected: - /** - * Gets a rectangle describing the total area covered by the children of this container. - * - * @return Rectangle covering all children. - */ - virtual Rect getContainedArea() const; - - /** - * Calls moveRelative on all children. - * - * @param deltaX Horizontal displacement. - * @param deltaY Vertical displacement. - */ - virtual void moveChildrenRelative(int16_t deltaX, int16_t deltaY); - - Drawable* firstChild; ///< Pointer to the first child of this container. Subsequent children can be found through firstChild's nextSibling. - - friend class Screen; - /// @cond - virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement); - /// @endcond -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CONTAINER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp deleted file mode 100644 index 983c38c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ListLayout.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/ListLayout.hpp - * - * Declares the touchgfx::ListLayout class. - */ -#ifndef TOUCHGFX_LISTLAYOUT_HPP -#define TOUCHGFX_LISTLAYOUT_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * This class provides a layout mechanism for arranging Drawable instances adjacent in the - * specified Direction. The first element in the ListLayout is positioned in the - * ListLayout origin (0,0). The dimensions of this class is automatically expanded to - * cover the area of the added Drawable instances, which may grow larger than the - * dimensions of the physical screen. Place the ListLayout inside e.g. a - * ScrollableContainer to allow all the children to be viewed. - * - * @see ScrollableContainer - */ -class ListLayout : public Container -{ -public: - /** - * Initializes a new instance of the ListLayout class. - * - * @param d (Optional) The direction to place the elements. ::SOUTH (Default) - * places the elements vertically, ::EAST places the elements horizontally. - * - * @see setDirection - */ - ListLayout(const Direction d = SOUTH) - : Container(), direction(d), offset(0) - { - assert((d == SOUTH || d == EAST) && "Chosen direction not supported"); - } - - /** - * Sets the direction of the ListLayout. If elements have already been added to the - * ListLayout, these elements will be repositioned to adhere to the new direction. - * - * @param d The new Direction to grow in when added children (either ::SOUTH or ::EAST). - * - * @see getDirection - */ - virtual void setDirection(const Direction d); - - /** - * Gets the direction of the ListLayout. - * - * @return The current direction to grow in when added children (either ::SOUTH or ::EAST). - * - * @see setDirection - */ - virtual Direction getDirection() const - { - return direction; - } - - /** - * Adds a Drawable instance to the end of the list. The Drawable dimensions shall be set - * prior to addition. The coordinates of the Drawable will be updated to reflect the - * position in the ListLayout. - * - * @param [in] d The Drawable to add. - */ - virtual void add(Drawable& d); - - /** - * Removes a Drawable. Safe to call even if drawable has not been added. Other Drawable - * elements in the ListLayout are repositioned and the size of the ListLayout is - * adjusted. - * - * @param [in] d The drawable to remove. - */ - virtual void remove(Drawable& d); - - virtual void insert(Drawable* previous, Drawable& d); - - virtual void removeAll(); - -private: - void internalAddElementAt(Drawable& d, int16_t coord); - void internalAddElement(Drawable& d); - void internalRemoveElement(Drawable& d, int16_t coord); - Direction direction; - int16_t offset; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LISTLAYOUT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp deleted file mode 100644 index 3764571..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ModalWindow.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/ModalWindow.hpp - * - * Declares the touchgfx::ModalWindow class. - */ -#ifndef TOUCHGFX_MODALWINDOW_HPP -#define TOUCHGFX_MODALWINDOW_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Container for displaying a modal window and hijacking touch event and prevent them from - * reaching the underlying view and widgets. - * - * The container has a background image and a surrounding box that acts as a shade on - * top of the rest of the screen. The background image must be set (using - * setBackground()) and the shade can be adjusted (using setShadeAlpha() and - * setShadeColor()). - * - * The ModalWindow can either be used directly by adding widgets/containers to the - * ModalWindow from your view or by sub-classing it if you need a specific ModalWindow - * with predefined behavior across your application. - * - * The ModalWindow should be instantiated in the view class and added as the last - * element (to always be on top, i.e. be modal). The ModalWindow will fill up the entire - * screen so it should always be placed at x=0, y=0 on the display. - * - * To control the visibility of the ModalWindow use the show and hide methods. - */ -class ModalWindow : public Container -{ -public: - ModalWindow(); - - /** - * Sets the background of the actual window. The remaining area of the screen will be - * covered by the shade. The background image is centered on the screen. - * - * @param bmpId Identifier for the background bitmap. - */ - virtual void setBackground(const BitmapId& bmpId); - - /** - * Sets the background of the actual window. The remaining area of the screen will be - * covered by the shade. The background image will be placed at the backgroundX and - * backgroundY coordinate. - * - * @param bmpId Identifier for the bitmap. - * @param backgroundX The background x coordinate. - * @param backgroundY The background y coordinate. - */ - virtual void setBackground(const BitmapId& bmpId, int16_t backgroundX, int16_t backgroundY); - - /** - * Gets the width of the actual window (the background images). Whereas the getWidth() - * method will return the width including the shade. - * - * @return The width of the actual window. - */ - virtual uint16_t getBackgroundWidth() const; - - /** - * Gets the height of the actual window (the background images). Whereas the getHeight() - * method will return the height including the shade. - * - * @return The height of the actual window. - */ - virtual uint16_t getBackgroundHeight() const; - - virtual void add(Drawable& d); - - virtual void remove(Drawable& d); - - /** - * Sets the alpha value of the background shade. Default, if not set, is 96. - * - * @param alpha The new alpha. - */ - virtual void setShadeAlpha(uint8_t alpha); - - /** - * Gets the alpha value of the background shade. - * - * @return The background shades alpha. - */ - virtual uint8_t getShadeAlpha() const; - - /** - * Sets the color of the background shade. Default is black. - * - * @param color The new color. - */ - virtual void setShadeColor(colortype color); - - /** - * Gets the color of the background shade. - * - * @return The color of the background shade. - */ - virtual colortype getShadeColor() const; - - /** Make the ModalWindow visible. */ - virtual void show(); - - /** Make the ModalWindow invisible. */ - virtual void hide(); - -protected: - Box backgroundShade; ///< The background shade - Container windowContainer; ///< The window container that defines the active container area where both the windowBackground and added drawables are placed. - Image windowBackground; ///< The window background -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_MODALWINDOW_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp deleted file mode 100644 index 0dd1f37..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ScrollableContainer.hpp +++ /dev/null @@ -1,405 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/ScrollableContainer.hpp - * - * Declares the touchgfx::ScrollableContainer class. - */ -#ifndef TOUCHGFX_SCROLLABLECONTAINER_HPP -#define TOUCHGFX_SCROLLABLECONTAINER_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A ScrollableContainer is a container that allows its contents to be scrolled. It will - * intercept drag operations and move child nodes accordingly. - * - * A standard Container will simply clip children that are either larger than the - * container itself, or children that extend beyond the borders of the container or - * children that are placed outside the borders of the container. A ScrollableContainer - * behaves much like a Container, except it enables the user to scroll the children and - * thereby act like a viewport. When the contents of the ScrollableContainer is - * scrollable, scrollbars can be seen near the edge of the ScrollableContainer. - * - * @see Container - * - * @note The ScrollableContainer will consume all DragEvents in the area covered by the - * container. - */ -class ScrollableContainer : public Container -{ -public: - ScrollableContainer(); - - /** - * Enables horizontal scrolling. By default, scrolling in either direction is enabled, - * provided that the content is larger than the size of the ScrollableContainer. This - * function can be used to explicitly (dis)allow horizontal scrolling, even if the - * content is larger than the container. - * - * @param enable If true (default), horizontal scrolling is enabled. If false, horizontal - * scrolling is disabled. - * - * @see enableVerticalScroll - */ - void enableHorizontalScroll(bool enable) - { - scrollableX = enable; - } - - /** - * Enables vertical scrolling. By default, scrolling in either direction is enabled, - * provided that the content is larger than the size of the ScrollableContainer. This - * function can be used to explicitly (dis)allow vertical scrolling, even if the content - * is larger than the container. - * - * @param enable If true (default), vertical scrolling is enabled. If false, vertical - * scrolling is disabled. - * - * @see enableHorizontalScroll - */ - void enableVerticalScroll(bool enable) - { - scrollableY = enable; - } - - /** - * Is the ClickableContainer scrollable in either direction? Takes the width of the - * contained elements into account and also checks to see if horizontal or vertical - * scrolling is allowed. - * - * @param [out] scrollX True if the container is able to scroll horizontally. - * @param [out] scrollY True if the container is able to scroll vertically. - * - * @see enableHorizontalScroll, enableVerticalScroll - */ - virtual void isScrollableXY(bool& scrollX, bool& scrollY) - { - Rect contained = getContainedArea(); - scrollX = (scrollableX && (rect.width < contained.width)); - scrollY = (scrollableY && (rect.height < contained.height)); - } - - /** - * Sets the visibility of the scrollbars, when the scrollable area is pressed. By - * default the scrollbars are hidden, but shown when the contents of the - * ScrollableContainer is being dragged around. Using setScrollbarsVisible, it is - * possible to hide the scrollbars when dragging the contents. - * - * @param newVisible If true (default), the scrollbars are visible when scrollable area is - * pressed. If false, scrollbars are always hidden. - * - * @see setScrollbarsPermanentlyVisible - */ - void setScrollbarsVisible(bool newVisible); - - /** - * Make scrollbars permanently visible regardless of the size and position of the - * children of the ScrollableContainer. Normally the scrollbars are hidden and only - * shown when dragging the contents of the ScrollableContainer (unless prohibited using - * setScrollbarsVisible()). - * - * @param permanentlyVisible (Optional) True to show the scrollbars permanently, false for default behavior. - * - * @see setScrollbarsVisible - */ - void setScrollbarsPermanentlyVisible(bool permanentlyVisible = true); - - virtual void add(Drawable& d); - - virtual void getLastChild(int16_t x, int16_t y, Drawable** last) - { - if (isVisible()) - { - if (isTouchable()) - { - *last = this; - } - else - { - Container::getLastChild(x, y, last); - } - } - } - - virtual void handleClickEvent(const ClickEvent& event); - - virtual void handleDragEvent(const DragEvent& event); - - virtual void handleGestureEvent(const GestureEvent& event); - - virtual void handleTickEvent(); - - /** - * Gets the area that contains all children added to the ScrollableContainer. The - * scrollbars are not considered in this operation. The area also includes the - * scrollableContainer itself. - * - * @return The contained area. - * - * @see getChildrenContainedArea - */ - virtual Rect getContainedArea() const; - - /** - * Gets the area that contains all children added to the ScrollableContainer. The - * container itself and scrollbars are not considered in this operation. - * - * @return The area containing only the children. - * - * @see getContainedArea - */ - virtual Rect getChildrenContainedArea() const; - - /** - * Used to signal that the size or position of one or more children have changed. This - * function can be called on parent nodes to signal that the size of one or more of its - * children have changed. - */ - virtual void childGeometryChanged(); - - /** - * Resets the ScrollableContainer to its original state, before the user started - * dragging the contents. This reset the x/y coordinates of children to the position - * they were in before the first drag event was received. - */ - void reset(); - - /** - * @copydoc Container::moveChildrenRelative - * - * @note Takes care not to move the scrollbars, which are also children. - * @note This function is scheduled to be deprecated. Use doScroll() instead. - */ - virtual void moveChildrenRelative(int16_t deltaX, int16_t deltaY); - - /** - * Sets the maximum velocity of a scroll due to a swipe. This can be used to force - * smooth scrolling by limiting the speed of any swipe gesture. - * - * @param max The maximum velocity of the scroll. - * - * @see GestureEvent::getVelocity - */ - void setMaxVelocity(uint16_t max) - { - maxVelocity = max; - } - - /** - * Change the threshold which the first drag event received must exceed before - * initiating a scroll. This can be used to avoid touching the screen and moving the - * finger only a few pixels resulting in the contents being scrolled. - * - * @param t The new threshold value. - * - * @note All subsequent scrolls will be processed regardless of threshold value until a - * ClickEvent::RELEASED is received. - */ - void setScrollThreshold(int16_t t) - { - scrollThreshold = t; - } - - /** - * Sets the color of the scrollbars. - * - * @param color The color of the box. - */ - void setScrollbarsColor(colortype color); - - /** - * Sets the alpha value (transparency) of the scrollbars. - * - * @param alpha The alpha value. 255 being completely solid, 0 being completely invisible. - */ - void setScrollbarsAlpha(uint8_t alpha); - - /** - * Sets the amount of space between the scrollbar and the edge of the ScrollableContainer. - * - * @param padding The padding. - */ - void setScrollbarPadding(uint8_t padding); - - /** - * Sets the width of the scrollbar measured in pixels. - * - * @param width The width of the scrollbar. - */ - void setScrollbarWidth(uint8_t width); - - /** - * Gets the distance scrolled for the x-axis. - * - * @return the distance scrolled for the x-axis. - */ - int16_t getScrolledX() const; - - /** - * Gets the distance scrolled for the y-axis. - * - * @return the distance scrolled for the y-axis. - */ - int16_t getScrolledY() const; - - /** - * Sets scroll duration speedup multiplier. Default value is 7 which gives a nice speedup on gestures. - * - * @param speedup The scroll duration speedup multiplier. - * - * @see getScrollDurationSpeedup, setScrollDurationSlowdown - */ - void setScrollDurationSpeedup(uint16_t speedup); - - /** - * Gets scroll duration speedup multiplier. - * - * @return The swipe acceleration. - * - * @see setScrollDurationSpeedup, getScrollDurationSlowdown - */ - uint16_t getScrollDurationSpeedup() const; - - /** - * Sets scroll duration speedup divisor. Default value is 1. - * - * @param slowdown The scroll duration speedup divisor. - * - * @see setScrollDurationSpeedup, getScrollDurationSlowdown - */ - void setScrollDurationSlowdown(uint16_t slowdown); - - /** - * Gets scroll duration speedup divisor. - * - * @return The scroll duration speedup divisor. - * - * @see setScrollDurationSlowdown - */ - uint16_t getScrollDurationSlowdown() const; - - /** - * Method to actually scroll the container. Passing negative values will scroll the - * items in the ScrollableContainer up / left, whereas positive values will scroll items - * down / right. - * - * If the distance is larger than allowed, the deltas are adjusted down to make sure the - * contained items stay inside view. - * - * @param deltaX The horizontal amount to scroll. - * @param deltaY The vertical amount to scroll. - * - * @return did the container actually scroll. The call doScroll(0,0) will always return - * false. - */ - virtual bool doScroll(int16_t deltaX, int16_t deltaY); - -protected: - uint8_t scrollbarPadding; ///< The amount of padding. The scrollbar will have a bit of space to the borders of the container. - uint8_t scrollbarWidth; ///< The width of the scrollbar. - uint8_t scrollbarAlpha; ///< The scrollbar is semitransparent - static const uint8_t SCROLLBAR_LINE = 0; ///< The scrollbar line. - colortype scrollbarColor; ///< The color of the scrollbar - static const uint16_t SCROLLBAR_MIN_VELOCITY = 5; ///< The minimum velocity of a scroll due to a swipe - static const uint16_t SCROLLBAR_MAX_VELOCITY = 17; ///< The (default) maximum velocity of a scroll due to a swipe - uint16_t maxVelocity; ///< The maximum velocity of a scroll (due to a swipe) - - /** - * Gets x coordinate of the scrollbar. - * - * @return The horizontal scrollbar area. - */ - Rect getXScrollbar() const; - - /** - * Gets y coordinate of the scrollbar. - * - * @return The vertical scrollbar area. - */ - Rect getYScrollbar() const; - - /** - * Gets the area where the horizontal scrollbar can move. - * - * @param xBar The current horizontal scrollbar, supplied for caching reasons. - * @param yBar The current vertical scrollbar, supplied for caching reasons. - * - * @return The area. - */ - Rect getXBorder(const Rect& xBar, const Rect& yBar) const; - - /** - * Gets the area where the vertical scrollbar can move. - * - * @param xBar The current horizontal scrollbar, supplied for caching reasons. - * @param yBar The current vertical scrollbar, supplied for caching reasons. - * - * @return The area. - */ - Rect getYBorder(const Rect& xBar, const Rect& yBar) const; - - /** Invalidate the scrollbars. */ - void invalidateScrollbars(); - - GestureEvent::GestureEventType accelDirection; ///< The current direction (horizontal or vertical) of scroll - - Box xSlider; ///< The horizontal scrollbar drawable - Box ySlider; ///< The vertical scrollbar drawable - - Drawable* pressedDrawable; ///< The drawable child of this container which received the last ClickEvent::PRESSED notification. When scrolling, send this drawable a CANCEL event if the new x/y coords no longer matches this drawable. - Drawable* lastDraggableChild; ///< The drawable child of this container which should receive drag events. Note that only drag events in directions which cannot be scrolled by this ScrollableContainer will be forwarded to children. - - int16_t scrolledXDistance; ///< The scrolled horizontal distance - int16_t scrolledYDistance; ///< The scrolled vertical distance - int16_t scrollThreshold; ///< The threshold which the first drag event received must exceed before scrolling. Default is 5. - - int16_t pressedX; ///< The x coordinate where the last ClickEvent::PRESSED was received. - int16_t pressedY; ///< The y coordinate where the last ClickEvent::PRESSED was received. - - bool isPressed; ///< Is the container currently pressed (maybe show scrollbars) - bool isScrolling; ///< Is the container scrolling (i.e. has overcome the initial larger drag that is required to initiate a scroll). - - bool scrollableX; ///< Is the container scrollable in the horizontal direction. - bool scrollableY; ///< Is the container scrollable in the vertical direction. - - bool scrollbarsVisible; ///< Are scrollbars visible. - bool scrollbarsPermanentlyVisible; ///< Are scrollbars always visible. - - uint16_t scrollDuration; ///< Number of ticks the scroll animation should use. - - int16_t beginningValue; ///< Initial X or Y for calculated values in scroll animation. - int16_t targetValue; ///< Target X or Y value for scroll animation - - uint16_t animationCounter; ///< Current step/tick in scroll animation. - bool animate; ///< Is scroll animation currently active - - int16_t fingerAdjustmentX; ///< How much should the finger be adjusted horizontally - int16_t fingerAdjustmentY; ///< and how much vertically - - bool hasIssuedCancelEvent; ///< true if the pressed drawable has received cancel event - - uint16_t scrollDurationSpeedup; ///< The scroll durations is multipled by this number - uint16_t scrollDurationSlowdown; ///< The scroll durations is divided by this number -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCROLLABLECONTAINER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp deleted file mode 100644 index 2b8df29..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SlideMenu.hpp +++ /dev/null @@ -1,380 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/SlideMenu.hpp - * - * Declares the touchgfx::SlideMenu class. - */ -#ifndef TOUCHGFX_SLIDEMENU_HPP -#define TOUCHGFX_SLIDEMENU_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * SlideMenu is a menu that can expand and collapse at the touch of a button. The SlideMenu can - * expand in any of the four directions. Menu items can be added, just like items are - * added to a normal container. - * - * The relative positions of the background and state change button is configurable as - * is the direction in which the SlideMenu expands and collapses. How much of the - * SlideMenu that is visible when collapsed can also be set with the. It is, of course, - * important that the state change button is accessible when collapsed. The SlideMenu - * will collapse after a given timeout is reached. The timer can be reset, for example - * when the user interacts with elements in the list. - * - * Menu elements are added normally using the add() method and are positioned relative - * to the SlideMenu. - */ -class SlideMenu : public Container -{ -public: - /** Values that represent the SlideMenu states. */ - enum State - { - COLLAPSED, ///< Menu is currently collapsed - EXPANDED ///< Menu is currently expanded - }; - - /** Values that represent the expand directions. */ - enum ExpandDirection - { - SOUTH, ///< Menu expands downwards (Towards the south) - NORTH, ///< Menu expands upwards (Towards the north) - EAST, ///< Menu expands to the right (Towards the east) - WEST ///< Menu expands to the left (Towards the west) - }; - - SlideMenu(); - - virtual ~SlideMenu(); - - /** - * Setup the SlideMenu by positioning the stateChangeButton next to background image - * relative to the expand direction, and center it in the other dimension. The width and - * height of the SlideMenu will be automatically set to span both elements. Default - * values are: expandedStateTimeout = 200, visiblePixelsWhenCollapsed = 0, - * hiddenPixelsWhenExpanded = 0, animationDuration = 10, animationEquation = - * cubicEaseInOut. - * - * @param newExpandDirection The new expand direction. - * @param backgroundBMP The background bitmap. - * @param stateChangeButtonBMP The state change button bitmap. - * @param stateChangeButtonPressedBMP The state change button pressed bitmap. - */ - virtual void setup(ExpandDirection newExpandDirection, const Bitmap& backgroundBMP, const Bitmap& stateChangeButtonBMP, const Bitmap& stateChangeButtonPressedBMP); - - /** - * Setup method for the SlideMenu. Positioning of the background is done by stating - * the X and Y coordinates for the element (relative to the SlideMenu). - * The width and height of the SlideMenu will be automatically set to the size of the background. - * Default values are: expandedStateTimeout = 200, visiblePixelsWhenCollapsed = 0, - * hiddenPixelsWhenExpanded = 0, animationDuration * = 10, animationEquation = cubicEaseInOut. - * - * @param newExpandDirection The new expand direction. - * @param backgroundBMP The background bitmap. - * @param backgroundX The background x coordinate. - * @param backgroundY The background y coordinate. - */ - virtual void setup(ExpandDirection newExpandDirection, const Bitmap& backgroundBMP, int16_t backgroundX, int16_t backgroundY); - - /** - * Setup method for the SlideMenu. Positioning of the background image and the - * stateChangeButton is done by stating the X and Y coordinates for the elements - * (relative to the SlideMenu). The width and height of the SlideMenu will be - * automatically set to span both elements. Default values are: expandedStateTimeout = - * 200, visiblePixelsWhenCollapsed = 0, hiddenPixelsWhenExpanded = 0, animationDuration - * = 10, animationEquation = cubicEaseInOut. - * - * @param newExpandDirection The new expand direction. - * @param backgroundBMP The background bitmap. - * @param stateChangeButtonBMP The state change button bitmap. - * @param stateChangeButtonPressedBMP The state change button pressed bitmap. - * @param backgroundX The background x coordinate. - * @param backgroundY The background y coordinate. - * @param stateChangeButtonX The state change button x coordinate. - * @param stateChangeButtonY The state change button y coordinate. - */ - virtual void setup(ExpandDirection newExpandDirection, const Bitmap& backgroundBMP, const Bitmap& stateChangeButtonBMP, const Bitmap& stateChangeButtonPressedBMP, int16_t backgroundX, int16_t backgroundY, int16_t stateChangeButtonX, int16_t stateChangeButtonY); - - /** - * Sets the expand direction. - * - * @param newExpandDirection The new expand direction. - */ - virtual void setExpandDirection(ExpandDirection newExpandDirection); - - /** - * Gets the expand direction. - * - * @return The expand direction. - */ - virtual ExpandDirection getExpandDirection() const; - - /** - * Sets the amount of visible pixels when collapsed. - * - * @param visiblePixels The visible pixels. - */ - virtual void setVisiblePixelsWhenCollapsed(int16_t visiblePixels); - - /** - * Gets the visible pixels when collapsed. - * - * @return The visible pixels when collapsed. - */ - virtual int16_t getVisiblePixelsWhenCollapsed() const; - - /** - * Sets the amount of hidden pixels when expanded. - * - * @param hiddenPixels The hidden pixels. - */ - virtual void setHiddenPixelsWhenExpanded(int16_t hiddenPixels); - - /** - * Gets the hidden pixels when expanded. - * - * @return The hidden pixels when expanded. - */ - virtual int16_t getHiddenPixelsWhenExpanded() const; - - /** - * Sets the expanded state timeout in ticks. The SlideMenu will animate to the COLLAPSED - * state when this number of ticks has been executed while the SlideMenu is in the - * EXPANDED state. The timer can be reset with the resetExpandedStateTimer method. - * - * @param timeout The timeout in ticks. - */ - virtual void setExpandedStateTimeout(uint16_t timeout); - - /** - * Gets expanded state timeout. - * - * @return The expanded state timeout. - */ - virtual uint16_t getExpandedStateTimeout() const; - - /** - * Sets the animation duration. - * - * @param duration The animation duration. - */ - virtual void setAnimationDuration(uint16_t duration); - - /** - * Gets the animation duration. - * - * @return The animation duration. - */ - virtual uint16_t getAnimationDuration() const; - - /** - * Sets the animation easing equation. - * - * @param animationEasingEquation The animation easing equation. - */ - virtual void setAnimationEasingEquation(EasingEquation animationEasingEquation); - - /** - * Gets the animation easing equation. - * - * @return The animation easing equation. - */ - virtual EasingEquation getAnimationEasingEquation() const; - - /** - * Sets the state of the SlideMenu. No animation is performed. - * - * @param newState The new state of the SlideMenu. - * - * @see animateToState, getState - */ - virtual void setState(State newState); - - /** - * Animate to the given expanded or collapsed state. - * - * @param newState The new state of the SlideMenu. - * - * @see setState, getState - */ - virtual void animateToState(State newState); - - /** - * Gets the current expanded or collapsed state. - * - * @return The current state. - * - * @see setState, animateToState - */ - virtual State getState(); - - /** - * Resets the expanded state timer. The SlideMenu will automatically animate to the - * COLLAPSED state after a number of ticks, as set with setExpandedStateTimeout(). This - * method resets this timer. - * - * @see getExpandedStateTimer - */ - virtual void resetExpandedStateTimer(); - - /** - * Gets the expanded state timer. - * - * @return The expanded state timer. - * - * @see resetExpandedStateTimer - */ - virtual uint16_t getExpandedStateTimer() const; - - /** - * Gets the background Image x coordinate. - * - * @return The background Image x coordinate. - */ - virtual int16_t getBackgroundX() const; - - /** - * Gets the background Image y coordinate. - * - * @return The background Image y coordinate. - */ - virtual int16_t getBackgroundY() const; - - /** - * Gets the state change button x coordinate. - * - * @return The state change button x coordinate. - */ - virtual int16_t getStateChangeButtonX() const; - - /** - * Gets the state change button y coordinate. - * - * @return The state change button y coordinate. - */ - virtual int16_t getStateChangeButtonY() const; - - /** - * Set the state changed callback. This callback is called when the state change button - * is clicked. - * - * @param callback The callback. - */ - virtual void setStateChangedCallback(GenericCallback& callback); - - /** - * Set the state change animation ended callback. This callback is called when a state - * change animation has ended. - * - * @param callback The callback. - */ - virtual void setStateChangedAnimationEndedCallback(GenericCallback& callback); - - /** - * Adds a drawable to the container. Make sure the x and y coordinates of the Drawable - * is correct relative to the SlideMenu. - * - * @param [in] d The drawable to add. - */ - virtual void add(Drawable& d); - - /** - * Removes the drawable from the container. - * - * @param [in] d The drawable to remove. - */ - virtual void remove(Drawable& d); - - virtual void handleTickEvent(); - -protected: - MoveAnimator menuContainer; ///< The container holding the actual menu items. This is the container that performs the state change animation - Button stateChangeButton; ///< The state change button that toggles the SlideMenu state - Image background; ///< The background of the SlideMenu - - Callback onStateChangeButtonClicked; ///< The local state changed button clicked callback - Callback&> animationEndedCallback; ///< The local state changed animation ended callback - - GenericCallback* stateChangedCallback; ///< The public state changed button clicked callback - GenericCallback* stateChangedAnimationEndedCallback; ///< The public state changed animation ended callback - - State currentState; ///< The current state of the SlideMenu - ExpandDirection expandDirection; ///< The expand direction of the SlideMenu - - EasingEquation animationEquation; ///< The easing equation used for the state change animation - - int16_t visiblePixelsWhenCollapsed; ///< The number of visible pixels when collapsed - int16_t hiddenPixelsWhenExpanded; ///< The number of hidden pixels when expanded - - uint16_t expandedStateTimeout; ///< The expanded state timeout. - uint16_t expandedStateTimer; ///< The timer that counts towards the expandedStateTimeout. If reached the SlideMenu will animate to COLLAPSED. - - uint16_t animationDuration; ///< The animation duration of the state change animation - - /** - * Handler for the state change button clicked event. - * - * @param button The state change button. - */ - void stateChangeButtonClickedHandler(const AbstractButton& button); - - /** - * Handler for the state change animation ended event. - * - * @param container The menuContainer. - */ - void animationEndedHandler(const MoveAnimator& container); - - /** - * Gets the x coordinate for the collapsed state. - * - * @return The collapsed x coordinate. - */ - virtual int16_t getCollapsedXCoordinate(); - - /** - * Gets the y coordinate for the collapsed state. - * - * @return The collapsed y coordinate. - */ - virtual int16_t getCollapsedYCoordinate(); - - /** - * Gets the x coordinate for the expanded state. - * - * @return The expanded x coordinate. - */ - virtual int16_t getExpandedXCoordinate(); - - /** - * Gets the y coordinate for the expanded state. - * - * @return The expanded y coordinate. - */ - virtual int16_t getExpandedYCoordinate(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SLIDEMENU_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp deleted file mode 100644 index 117f50f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/Slider.hpp +++ /dev/null @@ -1,363 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/Slider.hpp - * - * Declares the touchgfx::Slider class. - */ -#ifndef TOUCHGFX_SLIDER_HPP -#define TOUCHGFX_SLIDER_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A slider is a graphical element with which the user may set a value by moving an indicator on - * a slider, or simply by clicking the slider. The slider can operate in horizontal or - * vertical mode. The slider has two bitmaps. One bitmap is used on one side of the - * indicator. The other is used on the other side. They can be used in indicating the - * part of the slider value range that is currently selected. - * - * The slider operates on an integer value range that can be set by the user. - */ -class Slider : public Container -{ -public: - Slider(); - - /** - * Sets all the bitmaps for the Slider. The Slider shows the sliderBackgroundSelected - * bitmap in the region of the Slider that is selected, that is the area to the left of - * the indicator for a horizontal Slider and below the indicator for a vertical Slider. - * The sliderBackground is shown on the other side of the Slider. To ignore this effect - * simply use the same bitmap for both the sliderBackground and the - * sliderBackgroundSelected. - * - * @param sliderBackground The slider background with the slider range - * unselected. - * @param sliderBackgroundSelected The slider background with the slider range selected. - * @param indicator The indicator. - */ - void setBitmaps(const Bitmap& sliderBackground, const Bitmap& sliderBackgroundSelected, const Bitmap& indicator); - - /** - * Sets all the bitmaps for the Slider. The Slider shows the sliderBackgroundSelected - * bitmap in the region of the Slider that is selected, that is the area to the left of - * the indicator for a horizontal Slider and below the indicator for a vertical Slider. - * The sliderBackground is shown on the other side of the Slider. To ignore this effect - * simply use the same bitmap for both the sliderBackground and the - * sliderBackgroundSelected. - * - * @param sliderBackground The slider background with the slider range - * unselected. - * @param sliderBackgroundSelected The slider background with the slider range selected. - * @param indicator The indicator. - */ - void setBitmaps(const BitmapId sliderBackground, const BitmapId sliderBackgroundSelected, const BitmapId indicator); - - /** - * Associates an action to be performed when an interaction with the slider is initiated - * (click or drag). - * - * @param callback The callback to be executed. The callback will be given a reference - * to the Slider and the current value of the slider at interaction - * start. - * - * @see GenericCallback - */ - void setStartValueCallback(GenericCallback& callback) - { - startValueCallback = &callback; - } - - /** - * Associates an action to be performed when an interaction with the slider ends (click - * or drag). - * - * @param callback The callback to be executed. The callback will be given a reference - * to the Slider and the current value of the slider at interaction end. - * - * @see GenericCallback - */ - void setStopValueCallback(GenericCallback& callback) - { - stopValueCallback = &callback; - } - - /** - * Associates an action to be performed when the slider changes its value. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the Slider and the current value of the slider. - * - * @see GenericCallback - */ - void setNewValueCallback(GenericCallback& callback) - { - newValueCallback = &callback; - } - - /** - * Sets up the slider in horizontal mode with the range going from the left to right. - * - * Places the backgrounds and the indicator inside the Slider container. It is possible - * to place the end points of the indicator outside the background image if it needs to - * go beyond the boundaries of the background. The width and height of the Slider will - * be adjusted appropriately so that both the background and the indicator will be fully - * visible in both the minimum and maximum indicator positions. - * - * Calls setValue() with the current value (default 0) and triggers the newSliderValue - * callback. - * - * @param backgroundX The background x coordinate inside the slider. - * @param backgroundY The background y coordinate inside the slider. - * @param indicatorY The indicator y coordinate inside the slider. - * @param indicatorMinX The indicator minimum x coordinate inside the slider. This is the - * position used when the slider is at its minimum value. Must - * be less than indicatorMaxX. - * @param indicatorMaxX The indicator maximum x coordinate inside the slider. This is the - * position used when the slider is at its maximum value. Must - * be greater than indicatorMinX. - * - * @note The x and y position of the Slider will either be the left/top of the background or - * the left/top of the indicator in its minimum x coordinate. - */ - virtual void setupHorizontalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorY, uint16_t indicatorMinX, uint16_t indicatorMaxX); - - /** - * Sets up the slider in vertical mode with the range going from the bottom to top. - * - * Places the backgrounds and the indicator inside the Slider container. It is possible - * to place the end points of the indicator outside the background image if it needs to - * go beyond the boundaries of the background. The width and height of the Slider will - * be adjusted appropriately so that both the background and the indicator will be fully - * visible in both the minimum and maximum indicator positions. - * - * - * Calls setValue with the current value (default 0) and triggers the newSliderValue - * callback. - * - * @param backgroundX The background x coordinate inside the slider. - * @param backgroundY The background y coordinate inside the slider. - * @param indicatorX The indicator x coordinate inside the slider. - * @param indicatorMinY The indicator minimum y coordinate inside the slider. This is the - * position used when the slider is at its maximum value. Must - * be less than indicatorMaxX. - * @param indicatorMaxY The indicator maximum y coordinate inside the slider. This is the - * position used when the slider is at its minimum value. Must - * be greater than indicatorMinX. - * - * @note The x and y position of the Slider will either be the left/top of the background or - * the left/top of the indicator in its minimum y coordinate. - */ - virtual void setupVerticalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorX, uint16_t indicatorMinY, uint16_t indicatorMaxY); - - /** - * Gets indicator minimum previously set using setupHorizontalSlider() or - * setupVerticalSlider(). - * - * @return The indicator minimum. - * - * @see setupHorizontalSlider, setupVerticalSlider, getIndicatorMax - */ - virtual uint16_t getIndicatorMin() const - { - return indicatorMinPosition; - } - - /** - * Gets indicator maximum previous set using setupHorizontalSlider() or - * setupVerticalSlider(). - * - * @return The calculated indicator maximum. - * - * @see setupHorizontalSlider, setupVerticalSlider, getIndicatorMin - */ - virtual uint16_t getIndicatorMax() const - { - return indicatorMaxPosition; - } - - /** - * Sets the value range of the slider. Values accepted and returned by the slider will - * be in this range. - * - * The slider will set its value to the specified new value. - * - * @param minValue The minimum value. Must be less than maxValue. - * @param maxValue The maximum value. Must be greater than minValue. - * @param newValue The new value. - * - * @note If the range is larger than the number of pixels specified for the indicator min and - * max some values will not be represented by the slider. - */ - virtual void setValueRange(int minValue, int maxValue, int newValue); - - /** - * Gets the minimum value previously set using setValueRange(). - * - * @return The minimum value. - * - * @see setValueRange, getMaxValue - */ - virtual uint16_t getMinValue() const - { - return valueRangeMin; - } - - /** - * Gets the maximum value previously set using setValueRange(). - * - * @return The maximum value. - * - * @see setValueRange, getMinValue - */ - virtual uint16_t getMaxValue() const - { - return valueRangeMax; - } - - /** - * Sets the value range of the slider. Values accepted and returned by the slider will - * be in this range. - * - * The slider will set its value to the current value or round to minValue or maxValue - * if the current value is outside the new range. - * - * @param minValue The minimum value. Must be less than maxValue. - * @param maxValue The maximum value. Must be greater than minValue. - * - * @note If the range is larger than the number of pixels specified for the indicator min and - * indicator max, some values will not be represented by the slider. - */ - virtual void setValueRange(int minValue, int maxValue); - - /** - * Places the indicator at the specified value relative to the specified value range. - * Values beyond the value range will be rounded to the min/max value in the value range. - * - * @param value The value. - * - * @see setValueRange - * - * @note The value update triggers a newSliderValue callback just as a drag or click does. - * @note If the value range is larger than the number of pixels specified for the indicator - * min and indicator max, some values will not be represented by the slider and - * thus is not possible to set with this method. In this case the value will be - * rounded to the nearest value that is represented in the current setting. - */ - virtual void setValue(int value); - - /** - * Gets the current value represented by the indicator. - * - * @return The current value. - */ - int getValue() - { - return currentValue; - } - - virtual void handleClickEvent(const ClickEvent& event); - - virtual void handleDragEvent(const DragEvent& event); - -protected: - /** Values that represent slider orientations. */ - enum SliderOrientation - { - HORIZONTAL, ///< The Slider can be moved horizontally between left and right - VERTICAL ///< The Slider can be moved vertically between top and bottom - }; - - SliderOrientation sliderOrientation; ///< The selected slider orientation - - int currentValue; ///< The current value represented by the slider - - int valueRangeMin; ///< The value range min - int valueRangeMax; ///< The value range max - - Image background; ///< The background image - Image backgroundSelected; ///< The backgroundSelected image - Image indicator; ///< The indicator image - Container backgroundSelectedViewPort; ///< The backgroundSelected view port. Controls the visible part of the backgroundSelected image. - - int16_t indicatorMinPosition; ///< The minimum position of the indicator (either x coordinate in horizontal mode or y coordinate in vertical mode) - int16_t indicatorMaxPosition; ///< The maximum position of the indicator (either x coordinate in horizontal mode or y coordinate in vertical mode) - - GenericCallback* startValueCallback; ///< The start value callback (called when an interaction with the indicator is initiated) - GenericCallback* stopValueCallback; ///< The stop value callback (called when an interaction with the indicator ends) - GenericCallback* newValueCallback; ///< The new value callback (called when the indicator is moved) - - /** - * Updates the indicator position described by position. Calls the - * newSliderValueCallback with the new value. - * - * @param position The position (x coordinate in horizontal mode and y coordinate in - * vertical mode). - */ - virtual void updateIndicatorPosition(int16_t position); - - /** - * Translate a value in the value range to the corresponding position in the indicator - * position range (x coordinate in horizontal mode and y in vertical mode). - * - * @param value The value. - * - * @return The coordinate that corresponds to the value. - */ - virtual int16_t valueToPosition(int value) const; - - /** - * Translate a position (x coordinate in horizontal mode and y in vertical mode) in the - * indicator position range to the corresponding value in the value range. - * - * @param position The position. - * - * @return The value that corresponds to the coordinate. - */ - virtual int positionToValue(int16_t position) const; - - /** - * Gets the indicator radius, which is half the size of the indicator. - * - * @return The the indicator radius. - */ - virtual uint16_t getIndicatorRadius() const; - - /** - * Gets the indicator position range, i.e. the difference between max and min for the - * position of the indicator. - * - * @return The indicator position range. - */ - virtual int getIndicatorPositionRangeSize() const; - - /** - * Gets the value range, i.e. the difference between max and min for the value range. - * - * @return The value range. - */ - virtual int getValueRangeSize() const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SLIDER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp deleted file mode 100644 index 69f78f3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/SwipeContainer.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/SwipeContainer.hpp - * - * Declares the touchgfx::SwipeContainer class. - */ -#ifndef TOUCHGFX_SWIPECONTAINER_HPP -#define TOUCHGFX_SWIPECONTAINER_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A SwipeContainer is a Container with a horizontally laid out list of identically sized Drawables. The bottom of - * the SwipeContainer shows a page indicator to indicate the position in the horizontal - * list of items in the SwipeContainer. - * - * @see ListLayout - */ -class SwipeContainer : public Container -{ -public: - SwipeContainer(); - virtual ~SwipeContainer(); - - virtual void handleTickEvent(); - virtual void handleClickEvent(const ClickEvent& event); - virtual void handleDragEvent(const DragEvent& event); - virtual void handleGestureEvent(const GestureEvent& event); - - /** - * Adds a page to the container. - * - * @param [in] page The page to add. - * - * @note All pages must have the same width and height. - */ - virtual void add(Drawable& page); - - /** - * Removes the page from the container. - * - * @param [in] page The page to remove. - * - * @note This is safe to call even if page is not a page (in which case nothing happens). - */ - virtual void remove(Drawable& page); - - /** - * Set the swipe cutoff which indicates how far you should drag a page before it results in - * a page change. - * - * @param cutoff The cutoff in pixels. - */ - virtual void setSwipeCutoff(uint16_t cutoff); - - /** - * Sets the x and y position of the page indicator. - * - * @param x The x coordinate. - * @param y The y coordinate. - * - * @see setPageIndicatorXYWithCenteredX, setPageIndicatorCenteredX - */ - void setPageIndicatorXY(int16_t x, int16_t y); - - /** - * Sets the x and y position of the page indicator. The value specified as x will be the - * center coordinate of the page indicators. - * - * @param x The center x coordinate. - * @param y The y coordinate. - * - * @see setPageIndicatorCenteredX, setPageIndicatorXY - * - * @note This method should not be used until all pages have been added, the - * setPageIndicatorBitmaps() has been called and the page indicator therefore has the - * correct width. - */ - void setPageIndicatorXYWithCenteredX(int16_t x, int16_t y); - - /** - * Sets the page indicator centered inside the SwipeContainer without changing the y - * position. - * - * @see setPageIndicatorXYWithCenteredX, setPageIndicatorXY - * - * @note This method should not be used until all pages have been added, the - * setPageIndicatorBitmaps() has been called and the page indicator therefore has the - * correct width. - */ - void setPageIndicatorCenteredX(); - - /** - * Sets the x position of the page indicator without changing the y position. The value - * specified as x will be the center coordinate of the page indicators. - * - * @param x The center x coordinate. - * - * @see setPageIndicatorXYWithCenteredX, setPageIndicatorXY - * - * @note This method should not be used until all pages have been added, the - * setPageIndicatorBitmaps() has been called and the page indicator therefore has the - * correct width. - */ - void setPageIndicatorCenteredX(int16_t x); - - /** - * Sets the bitmaps that are used by the page indicator. The bitmap for the normal page is - * repeated side-by-side and the bitmap for a highlighted page is put in the proper position. - * - * @param normalPage The normal page. - * @param highlightedPage The highlighted page. - */ - void setPageIndicatorBitmaps(const Bitmap& normalPage, const Bitmap& highlightedPage); - - /** - * When dragging either one of the end pages a part of the background will become visible - * until the user stop dragging and the end page swipes back to its position. The width of - * this area is set by this method. - * - * @param width The width in pixels. - */ - void setEndSwipeElasticWidth(uint16_t width); - - /** - * Gets number of pages. - * - * @return The number of pages. - */ - uint8_t getNumberOfPages() - { - return pageIndicator.getNumberOfPages(); - } - - /** - * Sets the selected page. - * - * @param pageIndex Zero-based index of the page. Range from 0 to numberOfPages-1. - * - * @see getSelectedPage - */ - void setSelectedPage(uint8_t pageIndex); - - /** - * Gets the currently selected page. - * - * @return Zero-based index of the current page. Rage from 0 to numberOfPages-1. - * - * @see setSelectedPage - */ - uint8_t getSelectedPage() const; - -private: - static const int16_t DRAG_CANCEL_THRESHOLD = 3; - - enum States - { - ANIMATE_SWIPE_CANCELLED_LEFT, - ANIMATE_SWIPE_CANCELLED_RIGHT, - ANIMATE_LEFT, - ANIMATE_RIGHT, - NO_ANIMATION - } currentState; - - uint8_t animationCounter; - uint16_t swipeCutoff; - int16_t dragX; - int16_t animateDistance; - int16_t startX; - uint16_t endElasticWidth; - - ListLayout pages; - - void adjustPages(); - - void animateSwipeCancelledLeft(); - void animateSwipeCancelledRight(); - void animateLeft(); - void animateRight(); - - class PageIndicator : public Container - { - public: - PageIndicator(); - void setNumberOfPages(uint8_t size); - void setBitmaps(const Bitmap& normalPage, const Bitmap& highlightedPage); - void goRight(); - void goLeft(); - void setCurrentPage(uint8_t page); - uint8_t getNumberOfPages() const; - uint8_t getCurrentPage() const; - - private: - TiledImage unselectedPages; - Image selectedPage; - uint8_t numberOfPages; - uint8_t currentPage; - } pageIndicator; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SWIPECONTAINER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp deleted file mode 100644 index 2bfba07..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/ZoomAnimationImage.hpp +++ /dev/null @@ -1,345 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/ZoomAnimationImage.hpp - * - * Declares the touchgfx::ZoomAnimationImage class. - */ -#ifndef TOUCHGFX_ZOOMANIMATIONIMAGE_HPP -#define TOUCHGFX_ZOOMANIMATIONIMAGE_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Class for optimizing and wrapping move and zoom operations on a ScalableImage. The - * ZoomAnimationImage takes two bitmaps representing the same image but at a small and a - * large resolution. These bitmaps should be the sizes that are used when not animating - * the image. The ZoomAnimationImage will use an Image for displaying the Bitmap when - * its width and height matches either of them. When it does not match the size of one - * of the bitmaps, it will use a ScalableImage instead. The main idea is that the - * supplied bitmaps should be the end points of the zoom animation so that it ends up - * using an Image when not animating. This is, however, not a requirement. You can - * animate from and to sizes that are not equal the sizes of the bitmaps. The result is - * a container that has the high performance of an ordinary image when the size matches - * the pre-rendered bitmaps. Moreover it supplies easy to use animation functions that - * lets you zoom and move the image. - * - * @note Since this container uses the ScalableImage it has the same restrictions as a - * ScaleableImage, i.e. 1bpp is not supported. - */ -class ZoomAnimationImage : public Container -{ -public: - /** - * A ZoomMode describes in which direction the image will grow/shrink when do a zoom - * animation. A FIXED direction means that the image will not grow/shrink in that - * direction. - */ - enum ZoomMode - { - FIXED_CENTER, ///< The small image will grow from the center of the large image - FIXED_LEFT, ///< The small image will grow from the middle of the left side of the large image - FIXED_RIGHT, ///< The small image will grow from the middle of the right side of the large image - FIXED_TOP, ///< The small image will grow from the middle of the top of the large image - FIXED_BOTTOM, ///< The small image will grow from the middle of the bottom of the large image - FIXED_LEFT_AND_TOP, ///< The small image will grow from the top left corner of the large image - FIXED_RIGHT_AND_TOP, ///< The small image will grow from the top right corner of the large image - FIXED_LEFT_AND_BOTTOM, ///< The small image will grow from the bottom left corner of the large image - FIXED_RIGHT_AND_BOTTOM ///< The small image will grow from the bottom right corner of the large image - }; - - ZoomAnimationImage(); - - /** - * Setup and starts the zoom animation. At end of the animation the image will have been - * resized to the endWidth and endHeight. The development of the width and height during - * the animation is described by the supplied EasingEquations. The container is - * registered as a TimerWidget and automatically unregistered when the animation has - * finished. - * - * @param endWidth The width of the image at animation end. - * @param endHeight The height of the image at animation end. - * @param duration The duration of the animation measured in ticks. - * @param zoomMode (Optional) The zoom mode that will be used during the - * animation. Default is #FIXED_LEFT_AND_TOP. - * @param widthProgressionEquation (Optional) The equation that describes the - * development of the width during the animation. - * Default is EasingEquations::linearEaseNone. - * @param heightProgressionEquation (Optional) The equation that describes the - * development of the height during the animation. - * Default is EasingEquations::linearEaseNone. - * - * @note The animation follows the specified ZoomMode so the X and Y coordinates of the image - * might change during animation. - */ - void startZoomAnimation(int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoomMode = FIXED_LEFT_AND_TOP, EasingEquation widthProgressionEquation = &EasingEquations::linearEaseNone, EasingEquation heightProgressionEquation = &EasingEquations::linearEaseNone); - - /** - * Setup and starts the zoom and move animation. At end of the animation the image will - * have been resized to the endWidth and endHeight and have moved from its original - * position to the endX and endY. Please note that the ZoomMode might influence the - * actual end position since the zoom transformation might change the X and Y of the - * image. The ZoomMode #FIXED_LEFT_AND_TOP ensures that the endX and endY will be the - * actual end position. - * - * The development of the width, height, X and Y during the animation is described by - * the supplied EasingEquations. The container is registered as a TimerWidget and - * automatically unregistered when the animation has finished. - * - * @param endX The X position of the image at animation end. - * Relative to the container or view that holds the - * ZoomAnimationImage. - * @param endY The Y position of the image at animation end. - * Relative to the container or view that holds the - * ZoomAnimationImage. - * @param endWidth The width of the image at animation end. - * @param endHeight The height of the image at animation end. - * @param duration The duration of the animation measured in ticks. - * @param zoomMode (Optional) The zoom mode that will be used during the - * animation. Default is #FIXED_LEFT_AND_TOP. - * @param xProgressionEquation (Optional) The equation that describes the - * development of the X position during the animation. - * Default is EasingEquations::linearEaseNone. - * @param yProgressionEquation (Optional) The equation that describes the - * development of the Y position during the animation. - * Default is EasingEquations::linearEaseNone. - * @param widthProgressionEquation (Optional) The equation that describes the - * development of the width during the animation. - * Default is EasingEquations::linearEaseNone. - * @param heightProgressionEquation (Optional) The equation that describes the - * development of the height during the animation. - * Default is EasingEquations::linearEaseNone. - */ - void startZoomAndMoveAnimation(int16_t endX, int16_t endY, int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoomMode = FIXED_LEFT_AND_TOP, EasingEquation xProgressionEquation = &EasingEquations::linearEaseNone, EasingEquation yProgressionEquation = &EasingEquations::linearEaseNone, EasingEquation widthProgressionEquation = &EasingEquations::linearEaseNone, EasingEquation heightProgressionEquation = &EasingEquations::linearEaseNone); - - /** Cancel zoom animation. The image is left in the position and size it is currently at. */ - void cancelZoomAnimation(); - - virtual void handleTickEvent(); - - /** - * Initializes the bitmap of the image to be used. The bitmaps should represent the same - * image in the two needed static resolutions. - * - * @param smallBitmap The image in the smallest resolution. - * @param largeBitmap The image in the largest resolution. - * - * @see getSmallBitmap, getLargeBitmap - * - * @note The size of the bitmaps do not in any way limit the size of the ZoomAnimationImage - * and it is possible to scale the image beyond the sizes of these bitmaps. - */ - void setBitmaps(const Bitmap& smallBitmap, const Bitmap& largeBitmap); - - /** - * Gets the small bitmap. - * - * @return the small bitmap. - * - * @see setBitmaps - */ - Bitmap getSmallBitmap() const - { - return smallBmp; - } - - /** - * Gets the large bitmap. - * - * @return the large bitmap. - * - * @see setBitmaps - */ - Bitmap getLargeBitmap() const - { - return largeBmp; - } - - /** - * @copydoc Drawable::setWidth - * - * @note ZoomAnimationImage diverts from the normal behavior by automatically invalidating - * which causes a redraw. - */ - virtual void setWidth(int16_t width); - - /** - * @copydoc Drawable::setHeight - * - * @note ZoomAnimationImage diverts from the normal behavior by automatically invalidating - * which causes a redraw. - */ - virtual void setHeight(int16_t height); - - /** - * Sets the algorithm to be used. In short, there is currently a value for fast (nearest - * neighbor) and a value for slow (bilinear interpolation). Default is - * ScalableImage::NEAREST_NEIGHBOR since moving images do not need to be of the best - * quality, until they stop moving. If the image moves only a little bit, or - * moves/resizes slowly, consider using ScaleableImage::BILINEAR_INTERPOLATION. - * - * @param mode The algorithm to use when rendering. - * - * @see ScalableImage::ScalingAlgorithm, getScalingMode - */ - virtual void setScalingMode(ScalableImage::ScalingAlgorithm mode); - - /** - * Gets the scaling algorithm of the ScalableImage. - * - * @return the scaling algorithm used. - * - * @see setScalingMode - */ - virtual ScalableImage::ScalingAlgorithm getScalingMode(); - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha); - - /** - * @copydoc Image::getAlpha - */ - virtual uint8_t getAlpha() const; - - /** - * Sets a delay on animations done by the ZoomAnimationImage. Defaults to 0 which means - * that the animation starts immediately. - * - * @param delay The delay in ticks. - * - * @see getAnimationDelay - */ - virtual void setAnimationDelay(uint16_t delay); - - /** - * Gets the current animation delay. - * - * @return The current animation delay. Expressed in ticks. - * - * @see setAnimationDelay - */ - virtual uint16_t getAnimationDelay() const; - - /** - * Associates an action to be performed when the animation ends. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the ZoomAnimationImage. - * - * @see GenericCallback - */ - void setAnimationEndedCallback(GenericCallback& callback) - { - animationEndedAction = &callback; - } - - /** - * Is there currently an animation running. - * - * @return true if there is an animation running. - */ - bool isZoomAnimationRunning() const; - - virtual void invalidateContent() const - { - if (getAlpha() > 0) - { - Container::invalidateContent(); - } - } - -protected: - /** Animation states. */ - enum States - { - ANIMATE_ZOOM, ///< Zoom animation state - ANIMATE_ZOOM_AND_MOVE, ///< Zoom and move animation state - NO_ANIMATION ///< No animation state - }; - - States currentState; ///< The current animation state - uint16_t animationCounter; ///< The progress counter for the animation - uint16_t zoomAnimationDelay; ///< A delay that is applied before animation start. Expressed in ticks. - Bitmap smallBmp; ///< The bitmap representing the small image - Bitmap largeBmp; ///< The bitmap representing the large image - Image image; ///< The image for displaying the bitmap when the width/height is equal one of the bitmaps - ScalableImage scalableImage; ///< The scalable image for displaying the bitmap when the width/height is not equal one of the bitmaps - ZoomMode currentZoomMode; ///< The ZoomMode to use by the animation - int16_t zoomAnimationStartWidth; ///< Width of the zoom animation start - int16_t zoomAnimationStartHeight; ///< Height of the zoom animation start - int16_t zoomAnimationEndWidth; ///< Width of the zoom animation end - int16_t zoomAnimationEndHeight; ///< Height of the zoom animation end - int16_t zoomAnimationStartX; ///< The zoom animation start x coordinate - int16_t zoomAnimationStartY; ///< The zoom animation start y coordinate - int16_t zoomAnimationDeltaX; ///< The zoom animation delta x - int16_t zoomAnimationDeltaY; ///< The zoom animation delta y - int16_t moveAnimationEndX; ///< The move animation end x coordinate - int16_t moveAnimationEndY; ///< The move animation end y coordinate - uint16_t animationDuration; ///< Duration of the animation - EasingEquation zoomAnimationWidthEquation; ///< The zoom animation width equation - EasingEquation zoomAnimationHeightEquation; ///< The zoom animation height equation - EasingEquation moveAnimationXEquation; ///< The move animation x coordinate equation - EasingEquation moveAnimationYEquation; ///< The move animation y coordinate equation - - GenericCallback* animationEndedAction; ///< The animation ended action - - /** - * Chooses the optimal rendering of the image given the current width and height. If the - * dimensions match either the small or large bitmap, that will be used, otherwise the - * large image will be scaled using the defined scaling mode. - * - * @see setScalingMode, setBitmaps - */ - virtual void updateRenderingMethod(); - - /** - * Sets the current animation state and reset the animation counter. - * - * @param state The new state. - */ - virtual void setCurrentState(States state); - - /** - * Starts timer and set parameters. Contains code shared between startZoomAnimation() - * and startZoomAndMoveAnimation(). If both delay and duration is zero, the end position - * and size is applied and the animation is ended immediately. - * - * @param endWidth The end width. - * @param endHeight The end height. - * @param duration The duration. - * @param zoomMode The zoom mode. - * @param widthProgressionEquation The width progression equation. - * @param heightProgressionEquation The height progression equation. - */ - void startTimerAndSetParameters(int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoomMode, EasingEquation widthProgressionEquation, EasingEquation heightProgressionEquation); - - /** - * Calculates the change in X and Y caused by the zoom animation given the current - * #ZoomMode. - */ - virtual void updateZoomAnimationDeltaXY(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ZOOMANIMATIONIMAGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp deleted file mode 100644 index 56fc3cf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AbstractButtonContainer.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/AbstractButtonContainer.hpp - * - * Declares the touchgfx::AbstractButtonContainer class. - */ -#ifndef TOUCHGFX_ABSTRACTBUTTONCONTAINER_HPP -#define TOUCHGFX_ABSTRACTBUTTONCONTAINER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * An abstract button container. The AbstractButtonContainer defines pressed/not pressed state, - * the alpha value, and the action Callback of a button. AbstractButtonContainer is used - * as superclass for classes defining a specific button behavior. - * - * @see ClickButtonTrigger, RepeatButtonTrigger, ToggleButtonTrigger, TouchButtonTrigger - */ -class AbstractButtonContainer : public Container -{ -public: - AbstractButtonContainer() - : pressed(false), alpha(255), action(0) - { - setTouchable(true); - } - - /** - * Sets the pressed state to the given state. A subclass of AbstractButtonContainer - * should implement handlePressedUpdate() to handle the new pressed state. - * - * @param isPressed True if is pressed, false if not. - * - * @see getPressed, handlePressedUpdated - */ - void setPressed(bool isPressed) - { - pressed = isPressed; - handlePressedUpdated(); - } - - /** - * Gets the pressed state. - * - * @return True if it succeeds, false if it fails. - * - * @see setPressed - */ - bool getPressed() - { - return pressed; - } - - /** @copydoc Image::setAlpha() */ - void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - handleAlphaUpdated(); - } - - /** @copydoc Image::getAlpha() */ - uint8_t getAlpha() const - { - return alpha; - } - - /** - * Sets an action callback to be executed by the subclass of AbstractContainerButton. - * - * @param callback The callback. - * - * @see executeAction - */ - void setAction(GenericCallback& callback) - { - action = &callback; - } - - /** - * Executes the previously set action. - * - * @see setAction - */ - virtual void executeAction() - { - if (action && action->isValid()) - { - action->execute(*this); - } - } - -protected: - bool pressed; ///< True if pressed - uint8_t alpha; ///< The current alpha value. 255 denotes solid, 0 denotes completely invisible. - - GenericCallback* action; ///< The action to be executed - - /** Handles what should happen when the pressed state is updated. */ - virtual void handlePressedUpdated() - { - } - - /** Handles what should happen when the alpha is updated. */ - virtual void handleAlphaUpdated() - { - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTBUTTONCONTAINER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp deleted file mode 100644 index d13cde9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp - * - * Declares the touchgfx::AnimatedImageButtonStyle class. - */ -#ifndef TOUCHGFX_ANIMATEDIMAGEBUTTONSTYLE_HPP -#define TOUCHGFX_ANIMATEDIMAGEBUTTONSTYLE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * An animated image button style. An animated image button style. This class is supposed to be - * used with one of the ButtonTrigger classes to create a functional button. This class - * will show the first or last image of an animated image depending on the state of the - * button (pressed or released). When the state changes the button will show the - * sequence of images in forward or reversed order. - * - * The AnimatedImageButtonStyle will set the size of the enclosing container (normally - * AbstractButtonContainer) to the size of the first Bitmap. This can be overridden by - * calling setWidth/setHeight after setting the bitmaps. - * - * The position of the bitmap can be adjusted with setBitmapXY (default is upper left - * corner). - * - * @tparam T Generic type parameter. Typically a AbstractButtonContainer subclass. - * - * @see AbstractButtonContainer - */ -template -class AnimatedImageButtonStyle : public T -{ -public: - AnimatedImageButtonStyle() - : T(), buttonAnimatedImage() - { - buttonAnimatedImage.setXY(0, 0); - T::add(buttonAnimatedImage); - } - - /** - * Sets the bitmaps. - * - * @param bitmapStart The bitmap start. - * @param bitmapEnd The bitmap end. - */ - void setBitmaps(const Bitmap& bitmapStart, const Bitmap& bitmapEnd) - { - buttonAnimatedImage.setBitmaps(bitmapStart.getId(), bitmapEnd.getId()); - - AbstractButtonContainer::setWidthHeight(bitmapStart); - - handlePressedUpdated(); - } - - /** - * Sets bitmap x and y. - * - * @param x An uint16_t to process. - * @param y An uint16_t to process. - */ - void setBitmapXY(uint16_t x, uint16_t y) - { - buttonAnimatedImage.setXY(x, y); - } - - /** - * Sets update ticks interval. - * - * @param updateInterval The update interval. - */ - void setUpdateTicksInterval(uint8_t updateInterval) - { - buttonAnimatedImage.setUpdateTicksInterval(updateInterval); - } - -protected: - AnimatedImage buttonAnimatedImage; ///< The button animated image - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - buttonAnimatedImage.startAnimation(AbstractButtonContainer::pressed, true, false); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - buttonAnimatedImage.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ANIMATEDIMAGEBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp deleted file mode 100644 index a892f19..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/BoxWithBorderButtonStyle.hpp - * - * Declares the touchgfx::BoxWithBorderButtonStyle class. - */ -#ifndef TOUCHGFX_BOXWITHBORDERBUTTONSTYLE_HPP -#define TOUCHGFX_BOXWITHBORDERBUTTONSTYLE_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A box with border button style. This class is supposed to be used with one of the - * ButtonTrigger classes to create a functional button. This class will show a box with - * a border in different colors depending on the state of the button (pressed or - * released). - * - * An image button style. This class is supposed to be used with one of the - * ButtonTrigger classes to create a functional button. This class will show one of two - * images depending on the state of the button (pressed or released). - * - * @tparam T Generic type parameter. Typically a AbstractButtonContainer subclass. - * - * @see AbstractButtonContainer, BoxWithBorder - */ -template -class BoxWithBorderButtonStyle : public T -{ -public: - BoxWithBorderButtonStyle() - : T(), up(), down() - { - borderBox.setXY(0, 0); - T::add(borderBox); - } - - /** - * Sets the size and position of this BoxWithBorderButtonStyle, relative to its parent. - * - * @param x The x coordinate of this BoxWithBorderButtonStyle. - * @param y The y coordinate of this BoxWithBorderButtonStyle. - * @param width The width of this BoxWithBorderButtonStyle. - * @param height The height of this BoxWithBorderButtonStyle. - * - * @note Changing this does not automatically yield a redraw. - */ - void setBoxWithBorderPosition(int16_t x, int16_t y, int16_t width, int16_t height) - { - borderBox.setPosition(x, y, width, height); - } - - /** - * Sets the width. - * - * @param width The width. - */ - void setBoxWithBorderWidth(int16_t width) - { - borderBox.setWidth(width); - } - - /** - * Sets the height. - * - * @param height The height. - */ - void setBoxWithBorderHeight(int16_t height) - { - borderBox.setHeight(height); - } - - /** - * Sets the colors. - * - * @param colorReleased The color released. - * @param colorPressed The color pressed. - * @param borderColorReleased The border color released. - * @param borderColorPressed The border color pressed. - */ - void setBoxWithBorderColors(const colortype colorReleased, const colortype colorPressed, const colortype borderColorReleased, const colortype borderColorPressed) - { - up = colorReleased; - down = colorPressed; - - borderUp = borderColorReleased; - borderDown = borderColorPressed; - - handlePressedUpdated(); - } - - /** - * Sets border size. - * - * @param size The size. - */ - void setBorderSize(uint8_t size) - { - borderBox.setBorderSize(size); - } - -protected: - BoxWithBorder borderBox; ///< The border box - colortype up; ///< The up - colortype down; ///< The down - colortype borderUp; ///< The border up - colortype borderDown; ///< The border down - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - borderBox.setColor(T::getPressed() ? down : up); - borderBox.setBorderColor(T::getPressed() ? borderDown : borderUp); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - borderBox.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BOXWITHBORDERBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp deleted file mode 100644 index ca8abcf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/Buttons.hpp +++ /dev/null @@ -1,147 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/Buttons.hpp - * - * Declares the various FlexButton styles by combining often used template classes. - */ -#ifndef TOUCHGFX_BUTTONS_HPP -#define TOUCHGFX_BUTTONS_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** Defines an alias representing the box click button. */ -typedef BoxWithBorderButtonStyle BoxClickButton; - -/** Defines an alias representing the box repeat button. */ -typedef BoxWithBorderButtonStyle BoxRepeatButton; - -/** Defines an alias representing the box toggle button. */ -typedef BoxWithBorderButtonStyle BoxToggleButton; - -/** Defines an alias representing the box touch button. */ -typedef BoxWithBorderButtonStyle BoxTouchButton; - -/** Defines an alias representing the image click button. */ -typedef ImageButtonStyle ImageClickButton; - -/** Defines an alias representing the image repeat button. */ -typedef ImageButtonStyle ImageRepeatButton; - -/** Defines an alias representing the image touch button. */ -typedef ImageButtonStyle ImageTouchButton; - -/** Defines an alias representing the image toggle button. */ -typedef ImageButtonStyle ImageToggleButton; - -/** Defines an alias representing the icon click button. */ -typedef IconButtonStyle IconClickButton; - -/** Defines an alias representing the icon repeat button. */ -typedef IconButtonStyle IconRepeatButton; - -/** Defines an alias representing the icon touch button. */ -typedef IconButtonStyle IconTouchButton; - -/** Defines an alias representing the icon toggle button. */ -typedef IconButtonStyle IconToggleButton; - -/** Defines an alias representing the icon image click button. */ -typedef ImageButtonStyle > IconImageClickButton; - -/** Defines an alias representing the icon image repeat button. */ -typedef ImageButtonStyle > IconImageRepeatButton; - -/** Defines an alias representing the icon image touch button. */ -typedef ImageButtonStyle > IconImageTouchButton; - -/** Defines an alias representing the icon image toggle button. */ -typedef ImageButtonStyle > IconImageToggleButton; - -/** Defines an alias representing the text click button. */ -typedef TextButtonStyle TextClickButton; - -/** Defines an alias representing the text repeat button. */ -typedef TextButtonStyle TextRepeatButton; - -/** Defines an alias representing the text touch button. */ -typedef TextButtonStyle TextTouchButton; - -/** Defines an alias representing the text toggle button. */ -typedef TextButtonStyle TextToggleButton; - -/** Defines an alias representing the tiled image click button. */ -typedef TiledImageButtonStyle TiledImageClickButton; - -/** Defines an alias representing the tiled image repeat button. */ -typedef TiledImageButtonStyle TiledImageRepeatButton; - -/** Defines an alias representing the tiled image touch button. */ -typedef TiledImageButtonStyle TiledImageTouchButton; - -/** Defines an alias representing the tiled image toggle button. */ -typedef TiledImageButtonStyle TiledImageToggleButton; - -/** Defines an alias representing the wildcard text click button. */ -typedef WildcardTextButtonStyle WildcardTextClickButton; - -/** Defines an alias representing the wildcard text repeat button. */ -typedef WildcardTextButtonStyle WildcardTextRepeatButton; - -/** Defines an alias representing the wildcard text touch button. */ -typedef WildcardTextButtonStyle WildcardTextTouchButton; - -/** Defines an alias representing the wildcard text toggle button. */ -typedef WildcardTextButtonStyle WildcardTextToggleButton; - -/** Defines an alias representing the wildcard text click button. */ -typedef TwoWildcardTextButtonStyle TwoWildcardTextClickButton; - -/** Defines an alias representing the wildcard text repeat button. */ -typedef TwoWildcardTextButtonStyle TwoWildcardTextRepeatButton; - -/** Defines an alias representing the wildcard text touch button. */ -typedef TwoWildcardTextButtonStyle TwoWildcardTextTouchButton; - -/** Defines an alias representing the wildcard text toggle button. */ -typedef TwoWildcardTextButtonStyle TwoWildcardTextToggleButton; - -/** Defines an alias representing the animated image click button. */ -typedef AnimatedImageButtonStyle AnimatedImageClickButton; - -/** Defines an alias representing the animated image repeat button. */ -typedef AnimatedImageButtonStyle AnimatedImageRepeatButton; - -/** Defines an alias representing the animated image touch button. */ -typedef AnimatedImageButtonStyle AnimatedImageTouchButton; - -/** Defines an alias representing the animated image toggle button. */ -typedef AnimatedImageButtonStyle AnimatedImageToggleButton; - -} // namespace touchgfx - -#endif // TOUCHGFX_BUTTONS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp deleted file mode 100644 index 181fe77..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ClickButtonTrigger.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/ClickButtonTrigger.hpp - * - * Declares the touchgfx::ClickButtonTrigger class. - */ -#ifndef TOUCHGFX_CLICKBUTTONTRIGGER_HPP -#define TOUCHGFX_CLICKBUTTONTRIGGER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A click button trigger. This trigger will create a button that reacts on clicks. This means - * it will call the set action when it gets a touch released event. The - * ClickButtonTrigger can be combined with one or more of the ButtonStyle classes to - * create a fully functional button. - * - * @see TouchButtonTrigger - */ -class ClickButtonTrigger : public AbstractButtonContainer -{ -public: - /** - * Handles a ClickAvent. The action callback is called when the ClickButtonTrigger - * receives a ClickEvent::RELEASED event in PRESSED state. Function setPressed() will - * be called with the new button state. - * - * @param event The click event. - * - * @see setAction, setPressed, getPressed - */ - virtual void handleClickEvent(const ClickEvent& event) - { - bool wasPressed = getPressed(); - bool newPressedValue = (event.getType() == ClickEvent::PRESSED); - if ((newPressedValue && !wasPressed) || (!newPressedValue && wasPressed)) - { - setPressed(newPressedValue); - invalidate(); - } - if (wasPressed && (event.getType() == ClickEvent::RELEASED)) - { - executeAction(); - } - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CLICKBUTTONTRIGGER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp deleted file mode 100644 index eea1f8d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/IconButtonStyle.hpp +++ /dev/null @@ -1,153 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/IconButtonStyle.hpp - * - * Declares the touchgfx::IconButtonStyle class. - */ -#ifndef TOUCHGFX_ICONBUTTONSTYLE_HPP -#define TOUCHGFX_ICONBUTTONSTYLE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * An icon button style. This class is supposed to be used with one of the ButtonTrigger classes - * to create a functional button. This class will show one of two icons depending on the - * state of the button (pressed or released). - * - * To get a background behind the icon, use IconButtonStyle together with e.g. - * ImageButtonStyle: IconButtonStyle > - * myButton; - * - * The IconButtonStyle will center the icon on the enclosing container (normally - * AbstractButtonContainer). Set the size of the button before setting the icons. - * - * The position of the icon can be adjusted with setIconXY. - * - * @see AbstractButtonContainer - */ -template -class IconButtonStyle : public T -{ -public: - IconButtonStyle() - : T() - { - T::add(iconImage); - } - - /** - * Sets icon bitmaps. - * - * @param newIconReleased The new icon released. - * @param newIconPressed The new icon pressed. - */ - virtual void setIconBitmaps(const Bitmap& newIconReleased, const Bitmap& newIconPressed) - { - iconReleased = newIconReleased; - iconPressed = newIconPressed; - - iconImage.setXY((T::getWidth() / 2) - (newIconPressed.getWidth() / 2), (T::getHeight() / 2) - (newIconPressed.getHeight() / 2)); - - handlePressedUpdated(); - } - - /** - * Sets icon x coordinate. - * - * @param x The x coordinate. - */ - void setIconX(int16_t x) - { - iconImage.setX(x); - } - - /** - * Sets icon y coordinate. - * - * @param y The y coordinate. - */ - void setIconY(int16_t y) - { - iconImage.setY(y); - } - - /** - * Sets the position of the icon. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setIconXY(int16_t x, int16_t y) - { - setIconX(x); - setIconY(y); - } - - /** - * Gets currently displayed icon. - * - * @return The currently displayed icon. - */ - Bitmap getCurrentlyDisplayedIcon() const - { - return (T::getPressed() ? iconPressed : iconReleased); - } - - /** - * Gets icon x coordinate. - * - * @return The icon x coordinate. - */ - int16_t getIconX() const - { - return iconImage.getX(); - } - - /** - * Gets icon y coordinate. - * - * @return The icon y coordinate. - */ - int16_t getIconY() const - { - return iconImage.getY(); - } - -protected: - Bitmap iconReleased; ///< Icon to display when button is not pressed. - Bitmap iconPressed; ///< Icon to display when button is pressed. - Image iconImage; ///< The icon image - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - iconImage.setBitmap(T::getPressed() ? iconPressed : iconReleased); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - iconImage.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ICONBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp deleted file mode 100644 index 1f0c238..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ImageButtonStyle.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/ImageButtonStyle.hpp - * - * Declares the touchgfx::ImageButtonStyle class. - */ -#ifndef TOUCHGFX_IMAGEBUTTONSTYLE_HPP -#define TOUCHGFX_IMAGEBUTTONSTYLE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * An image button style. This class is supposed to be used with one of the ButtonTrigger - * classes to create a functional button. This class will show one of two images - * depending on the state of the button (pressed or released). - * - * The ImageButtonStyle will set the size of the enclosing container (normally - * AbstractButtonContainer) to the size of the pressed Bitmap. This can be overridden by - * calling setWidth/setHeight after setting the bitmaps. - * - * The position of the bitmap can be adjusted with setBitmapXY (default is upper left - * corner). - * - * @tparam T Generic type parameter. Typically a AbstractButtonContainer subclass. - * - * @see AbstractButtonContainer - */ -template -class ImageButtonStyle : public T -{ -public: - ImageButtonStyle() - : T(), up(), down() - { - buttonImage.setXY(0, 0); - T::add(buttonImage); - } - - /** - * Sets the bitmaps. - * - * @param bmpReleased The bitmap released. - * @param bmpPressed The bitmap pressed. - */ - virtual void setBitmaps(const Bitmap& bmpReleased, const Bitmap& bmpPressed) - { - up = bmpReleased; - down = bmpPressed; - ImageButtonStyle::setWidthHeight(down); - - handlePressedUpdated(); - } - - /** - * Sets bitmap x and y. - * - * @param x An uint16_t to process. - * @param y An uint16_t to process. - */ - void setBitmapXY(uint16_t x, uint16_t y) - { - buttonImage.setXY(x, y); - } - - /** - * Gets currently displayed bitmap. - * - * @return The currently displayed bitmap. - */ - Bitmap getCurrentlyDisplayedBitmap() const - { - return (AbstractButtonContainer::pressed ? down : up); - } - -protected: - Image buttonImage; ///< The button image - Bitmap up; ///< The image to display when button is released. - Bitmap down; ///< The image to display when button is pressed. - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - buttonImage.setBitmap(T::getPressed() ? down : up); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - buttonImage.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_IMAGEBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp deleted file mode 100644 index 7a7c312..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/RepeatButtonTrigger.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/RepeatButtonTrigger.hpp - * - * Declares the touchgfx::RepeatButtonTrigger class. - */ -#ifndef TOUCHGFX_REPEATBUTTONTRIGGER_HPP -#define TOUCHGFX_REPEATBUTTONTRIGGER_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A repeat button trigger. This trigger will create a button that reacts to a consistent touch. - * This means it will call the set action repeatedly as long as it is touched. The - * RepeatButtonTrigger can be combined with one or more of the ButtonStyle classes to - * create a fully functional button. - */ -class RepeatButtonTrigger : public AbstractButtonContainer -{ -public: - RepeatButtonTrigger() - : AbstractButtonContainer(), ticksDelay(30), ticksInterval(15), ticks(0), ticksBeforeContinuous(0) - { - } - - /** - * Sets the delay (in number of ticks) from the first button activation until the next - * time it will be automatically activated. - * - * @param delay The delay, measured in ticks, between first activation and second activation. - * - * @see setInterval, getDelay - */ - void setDelay(int delay) - { - ticksDelay = delay; - } - - /** - * Gets the delay in ticks from first button activation until next activation. - * - * @return The delay, measured in ticks, between first activation and second activation. - * - * @see setDelay - */ - int getDelay() - { - return ticksDelay; - } - - /** - * Sets the interval in number of ticks between each each activation of the pressed - * button after the second activation. - * - * @param interval The interval between repeated activations, measured in ticks. - * - * @see setDelay, getInterval - */ - void setInterval(int interval) - { - ticksInterval = interval; - } - - /** - * The interval between repeated activations, measured in ticks. This is the number of - * ticks between the an activation beyond the first and the following activation. - * - * @return The interval between repeated activations, measured in ticks. - * - * @see setInterval - */ - int getInterval() - { - return ticksInterval; - } - - virtual void handleClickEvent(const ClickEvent& event) - { - bool wasPressed = getPressed(); - bool newPressedValue = (event.getType() == ClickEvent::PRESSED); - if ((newPressedValue && !wasPressed) || (!newPressedValue && wasPressed)) - { - setPressed(newPressedValue); - invalidate(); - } - - if (event.getType() == ClickEvent::PRESSED) - { - executeAction(); - - ticks = 0; - ticksBeforeContinuous = ticksDelay; - Application::getInstance()->registerTimerWidget(this); - } - else - { - Application::getInstance()->unregisterTimerWidget(this); - } - } - - virtual void handleTickEvent() - { - AbstractButtonContainer::handleTickEvent(); - - if (!pressed) - { - return; - } - if (ticks == ticksBeforeContinuous) - { - executeAction(); - - ticks = 0; - ticksBeforeContinuous = ticksInterval; - } - else - { - ticks++; - } - } - -private: - int16_t ticksDelay; - int16_t ticksInterval; - - int16_t ticks; - int16_t ticksBeforeContinuous; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_REPEATBUTTONTRIGGER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp deleted file mode 100644 index 6bb1069..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TextButtonStyle.hpp +++ /dev/null @@ -1,154 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/TextButtonStyle.hpp - * - * Declares the touchgfx::TextButtonStyle class. - */ -#ifndef TOUCHGFX_TEXTBUTTONSTYLE_HPP -#define TOUCHGFX_TEXTBUTTONSTYLE_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A text button style. This class is supposed to be used with one of the ButtonTrigger classes - * to create a functional button. This class will show a text in one of two colors - * depending on the state of the button (pressed or released). - * - * The TextButtonStyle does not set the size of the enclosing container (normally - * AbstractButtonContainer). The size must be set manually. - * - * To get a background behind the text, use TextButtonStyle together with e.g. - * ImageButtonStyle: TextButtonStyle > - * myButton; - * - * The position of the text can be adjusted with setTextXY (default is centered). - * - * @see AbstractButtonContainer - */ -template -class TextButtonStyle : public T -{ -public: - TextButtonStyle() - : T() - { - T::add(text); - } - - /** - * Sets a text. - * - * @param t A TypedText to process. - */ - void setText(TypedText t) - { - text.setTypedText(t); - text.setWidthHeight(*this); - } - - /** - * Sets text x coordinate. - * - * @param x The x coordinate. - */ - void setTextX(int16_t x) - { - text.setX(x); - } - - /** - * Sets text y coordinate. - * - * @param y The y coordinate. - */ - void setTextY(int16_t y) - { - text.setY(y); - } - - /** - * Sets text x and y. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setTextXY(int16_t x, int16_t y) - { - setTextX(x); - setTextY(y); - } - - /** - * Sets text position. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param width The width of the text. - * @param height The height of the text. - */ - void setTextPosition(int16_t x, int16_t y, int16_t width, int16_t height) - { - text.setPosition(x, y, width, height); - } - - /** - * Sets text rotation. - * - * @param rotation The rotation. - */ - void setTextRotation(TextRotation rotation) - { - text.setRotation(rotation); - } - - /** - * Sets text colors. - * - * @param newColorReleased The new color released. - * @param newColorPressed The new color pressed. - */ - void setTextColors(colortype newColorReleased, colortype newColorPressed) - { - colorReleased = newColorReleased; - colorPressed = newColorPressed; - - handlePressedUpdated(); - } - -protected: - TextArea text; ///< The text - colortype colorReleased; ///< The color released - colortype colorPressed; ///< The color pressed - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - text.setColor(T::getPressed() ? colorPressed : colorReleased); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - text.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp deleted file mode 100644 index 08662a3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TiledImageButtonStyle.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/TiledImageButtonStyle.hpp - * - * Declares the touchgfx::TiledImageButtonStyle class. - */ -#ifndef TOUCHGFX_TILEDIMAGEBUTTONSTYLE_HPP -#define TOUCHGFX_TILEDIMAGEBUTTONSTYLE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A tiled image button style. - * - * An tiled image button style. This class is supposed to be used with one of the - * ButtonTrigger classes to create a functional button. This class will show one of two - * tiled images depending on the state of the button (pressed or released). - * - * The TiledImageButtonStyle does not set the size of the enclosing container (normally - * AbstractButtonContainer) to the size of the pressed Bitmap. This can be overridden by - * calling setWidth/setHeight after setting the bitmaps. - * - * @tparam T Generic type parameter. Typically a AbstractButtonContainer subclass. - * - * @see AbstractButtonContainer - */ -template -class TiledImageButtonStyle : public T -{ -public: - TiledImageButtonStyle() - : T() - { - tiledImage.setXY(0, 0); - T::add(tiledImage); - } - - /** - * Sets width. - * - * @param width The width. - */ - virtual void setWidth(int16_t width) - { - tiledImage.setWidth(width); - T::setWidth(width); - } - - /** - * Sets height. - * - * @param height The height. - */ - virtual void setHeight(int16_t height) - { - tiledImage.setHeight(height); - T::setHeight(height); - } - - /** - * Sets tile bitmaps. - * - * @param bmpReleased The bitmap released. - * @param bmpPressed The bitmap pressed. - */ - virtual void setTileBitmaps(const Bitmap& bmpReleased, const Bitmap& bmpPressed) - { - upTile = bmpReleased; - downTile = bmpPressed; - AbstractButtonContainer::setWidthHeight(downTile); - - handlePressedUpdated(); - } - - /** - * Sets an offset into the bitmap where the tile drawing should start. - * - * @param x The x coordinate offset. - * @param y The y coordinate offset. - * @see TiledImage::setOffset - */ - virtual void setTileOffset(int16_t x, int16_t y) - { - tiledImage.setOffset(x, y); - } - -protected: - TiledImage tiledImage; ///< The tiled image - Bitmap upTile; ///< The image to display when button is released. - Bitmap downTile; ///< The image to display when button is pressed. - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - int16_t buttonWidth = AbstractButtonContainer::getWidth(); - int16_t buttonHeight = AbstractButtonContainer::getHeight(); - - tiledImage.setBitmap(T::getPressed() ? downTile : upTile); - tiledImage.setWidthHeight(buttonWidth, buttonHeight); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - tiledImage.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TILEDIMAGEBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp deleted file mode 100644 index 1483393..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/ToggleButtonTrigger.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/ToggleButtonTrigger.hpp - * - * Declares the touchgfx::ToggleButtonTrigger class. - */ -#ifndef TOUCHGFX_TOGGLEBUTTONTRIGGER_HPP -#define TOUCHGFX_TOGGLEBUTTONTRIGGER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A toggle button trigger. This trigger will create a button that reacts on clicks. This means - * it will call the set action when it gets a touch released event, just like a - * ClickButtonTrigger. The difference being that a ToggleButtonTrigger will stay in - * pressed state until it is clicked again. - * - * The ToggleButtonTrigger can be combined with one or more of the ButtonStyle classes - * to create a fully functional button. - */ -class ToggleButtonTrigger : public AbstractButtonContainer -{ -public: - ToggleButtonTrigger() - : AbstractButtonContainer(), toggleCanceled(false) - { - } - - /** - * Allows the button to be forced into either the pressed state, or the normal state. In - * the pressed state, the button will always be shown as pressed down (and shown as - * released when the user presses it). In the normal state, the button will be show as - * released or pressed depending on its actual state. - * - * @param activeState If true, swap the images for released and pressed. If false display - * the button normally. - */ - void forceState(bool activeState) - { - AbstractButtonContainer::setPressed(activeState); - } - - /** - * Sets toggle canceled. - * - * @param isToggleCanceled True if is toggle canceled, false if not. - */ - void setToggleCanceled(bool isToggleCanceled) - { - toggleCanceled = isToggleCanceled; - } - - /** - * Gets toggle canceled. - * - * @return True if it succeeds, false if it fails. - */ - bool getToggleCanceled() - { - return toggleCanceled; - } - - virtual void handleClickEvent(const ClickEvent& event) - { - bool wasPressed = getPressed(); - bool newPressedValue = !getPressed(); - bool toggleCanceled = getToggleCanceled(); - setToggleCanceled(event.getType() == ClickEvent::CANCEL); - - if (((newPressedValue && !wasPressed) || (!newPressedValue && wasPressed)) && (event.getType() != ClickEvent::RELEASED) && !toggleCanceled) - { - setPressed(newPressedValue); - invalidate(); - } - - if (!toggleCanceled && (event.getType() == ClickEvent::RELEASED)) - { - executeAction(); - } - } - -protected: - bool toggleCanceled; ///< True if toggle canceled -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TOGGLEBUTTONTRIGGER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp deleted file mode 100644 index 05e9ae8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TouchButtonTrigger.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/TouchButtonTrigger.hpp - * - * Declares the touchgfx::TouchButtonTrigger class. - */ -#ifndef TOUCHGFX_TOUCHBUTTONTRIGGER_HPP -#define TOUCHGFX_TOUCHBUTTONTRIGGER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A touch button trigger. This trigger will create a button that reacts on touches. This means - * it will call the set action when it gets a touch pressed event. The - * TouchButtonTrigger can be combined with one or more of the ButtonStyle classes to - * create a fully functional button. - * - * @see ClickButtonTrigger - */ -class TouchButtonTrigger : public AbstractButtonContainer -{ -public: - /** - * Handles a ClickAvent. The action callback is called when the ClickButtonTrigger - * receives a ClickEvent::PRESSED event. Function setPressed() will be called with the - * new button state. - * - * @param event The click event. - * - * @see setAction, setPressed, getPressed - */ - virtual void handleClickEvent(const ClickEvent& event) - { - bool wasPressed = getPressed(); - bool newPressedValue = (event.getType() == ClickEvent::PRESSED); - if ((newPressedValue && !wasPressed) || (!newPressedValue && wasPressed)) - { - setPressed(newPressedValue); - invalidate(); - } - if (newPressedValue) - { - executeAction(); - } - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TOUCHBUTTONTRIGGER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp deleted file mode 100644 index 8e8ce24..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp +++ /dev/null @@ -1,183 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/TwoWildcardTextButtonStyle.hpp - * - * Declares the touchgfx::TwoWildcardTextButtonStyle class. - */ -#ifndef TOUCHGFX_TWOWILDCARDTEXTBUTTONSTYLE_HPP -#define TOUCHGFX_TWOWILDCARDTEXTBUTTONSTYLE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A wildcard text button style. - * - * An wildcard text button style. This class is supposed to be used with one of the - * ButtonTrigger classes to create a functional button. This class will show a text with - * a wildcard in one of two colors depending on the state of the button (pressed or - * released). - * - * The TwoWildcardTextButtonStyle does not set the size of the enclosing container - * (normally AbstractButtonContainer). The size must be set manually. - * - * To get a background behind the text, use TwoWildcardTextButtonStyle together with - * e.g. ImageButtonStyle: - * @code - * TwoWildcardTextButtonStyle > myButton; - * @endcode - * - * The position of the text can be adjusted with setTwoWildcardTextXY (default is - * centered). - * - * @tparam T Generic type parameter. Typically a AbstractButtonContainer subclass. - * - * @see AbstractButtonContainer - */ -template -class TwoWildcardTextButtonStyle : public T -{ -public: - TwoWildcardTextButtonStyle() - : T() - { - T::add(twoWildcardText); - } - - /** - * Sets wildcard text. - * - * @param t A TypedText to process. - */ - void setTwoWildcardText(TypedText t) - { - twoWildcardText.setTypedText(t); - twoWildcardText.setWidthHeight(T::getWidth(), T::getHeight()); - } - - /** - * Sets wildcard text x coordinate. - * - * @param x The x coordinate. - */ - void setTwoWildcardTextX(int16_t x) - { - twoWildcardText.setX(x); - } - - /** - * Sets wildcard text y coordinate. - * - * @param y The y coordinate. - */ - void setTwoWildcardTextY(int16_t y) - { - twoWildcardText.setY(y); - } - - /** - * Sets wildcard text position. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setTwoWildcardTextXY(int16_t x, int16_t y) - { - setTwoWildcardTextX(x); - setTwoWildcardTextY(y); - } - - /** - * Sets text position and dimensions. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param width The width of the text. - * @param height The height of the text. - */ - void setTwoWildcardTextPosition(int16_t x, int16_t y, int16_t width, int16_t height) - { - twoWildcardText.setPosition(x, y, width, height); - } - - /** - * Sets wildcard text rotation. - * - * @param rotation The rotation. - */ - void setTwoWildcardTextRotation(TextRotation rotation) - { - twoWildcardText.setRotation(rotation); - } - - /** - * Sets the first wildcard in the text. Must be a null-terminated UnicodeChar array. - * - * @param value A pointer to the UnicodeChar to set the wildcard to. - */ - void setWildcardTextBuffer1(const Unicode::UnicodeChar* value) - { - twoWildcardText.setWildcard1(value); - } - - /** - * Sets the second wildcard in the text. Must be a null-terminated UnicodeChar array. - * - * @param value A pointer to the UnicodeChar to set the wildcard to. - */ - void setWildcardTextBuffer2(const Unicode::UnicodeChar* value) - { - twoWildcardText.setWildcard2(value); - } - - /** - * Sets wild card text colors. - * - * @param newColorReleased The new color released. - * @param newColorPressed The new color pressed. - */ - void setTwoWildcardTextColors(colortype newColorReleased, colortype newColorPressed) - { - colorReleased = newColorReleased; - colorPressed = newColorPressed; - - handlePressedUpdated(); - } - -protected: - TextAreaWithTwoWildcards twoWildcardText; ///< The wildcard text - colortype colorReleased; ///< The color released - colortype colorPressed; ///< The color pressed - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - twoWildcardText.setColor(T::getPressed() ? colorPressed : colorReleased); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - twoWildcardText.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TWOWILDCARDTEXTBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp deleted file mode 100644 index 26bdcfb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/buttons/WildcardTextButtonStyle.hpp +++ /dev/null @@ -1,172 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/buttons/WildcardTextButtonStyle.hpp - * - * Declares the touchgfx::WildcardTextButtonStyle class. - */ -#ifndef TOUCHGFX_WILDCARDTEXTBUTTONSTYLE_HPP -#define TOUCHGFX_WILDCARDTEXTBUTTONSTYLE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A wildcard text button style. - * - * An wildcard text button style. This class is supposed to be used with one of the - * ButtonTrigger classes to create a functional button. This class will show a text with - * a wildcard in one of two colors depending on the state of the button (pressed or - * released). - * - * The WildcardTextButtonStyle does not set the size of the enclosing container - * (normally AbstractButtonContainer). The size must be set manually. - * - * To get a background behind the text, use WildcardTextButtonStyle together with e.g. - * ImageButtonStyle: - * @code - * WildcardTextButtonStyle > myButton; - * @endcode - * - * The position of the text can be adjusted with setTextXY (default is centered). - * - * @tparam T Generic type parameter. Typically a AbstractButtonContainer subclass. - * - * @see AbstractButtonContainer - */ -template -class WildcardTextButtonStyle : public T -{ -public: - WildcardTextButtonStyle() - : T() - { - T::add(wildcardText); - } - - /** - * Sets wildcard text. - * - * @param t A TypedText to process. - */ - void setWildcardText(TypedText t) - { - wildcardText.setTypedText(t); - wildcardText.setWidthHeight(T::getWidth(), T::getHeight()); - } - - /** - * Sets wildcard text x coordinate. - * - * @param x The x coordinate. - */ - void setWildcardTextX(int16_t x) - { - wildcardText.setX(x); - } - - /** - * Sets wildcard text y coordinate. - * - * @param y The y coordinate. - */ - void setWildcardTextY(int16_t y) - { - wildcardText.setY(y); - } - - /** - * Sets wildcard text position. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setWildcardTextXY(int16_t x, int16_t y) - { - setWildcardTextX(x); - setWildcardTextY(y); - } - - /** - * Sets text position and dimensions. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param width The width of the text. - * @param height The height of the text. - */ - void setWildcardTextPosition(int16_t x, int16_t y, int16_t width, int16_t height) - { - wildcardText.setPosition(x, y, width, height); - } - - /** - * Sets wildcard text rotation. - * - * @param rotation The rotation. - */ - void setWildcardTextRotation(TextRotation rotation) - { - wildcardText.setRotation(rotation); - } - - /** - * Sets wildcard text buffer. - * - * @param buffer If non-null, the buffer. - */ - void setWildcardTextBuffer(const Unicode::UnicodeChar* buffer) - { - wildcardText.setWildcard(buffer); - } - - /** - * Sets wild card text colors. - * - * @param newColorReleased The new color released. - * @param newColorPressed The new color pressed. - */ - void setWildcardTextColors(colortype newColorReleased, colortype newColorPressed) - { - colorReleased = newColorReleased; - colorPressed = newColorPressed; - - handlePressedUpdated(); - } - -protected: - TextAreaWithOneWildcard wildcardText; ///< The wildcard text - colortype colorReleased; ///< The color released - colortype colorPressed; ///< The color pressed - - /** @copydoc AbstractButtonContainer::handlePressedUpdated() */ - virtual void handlePressedUpdated() - { - wildcardText.setColor(T::getPressed() ? colorPressed : colorReleased); - T::handlePressedUpdated(); - } - - /** @copydoc AbstractButtonContainer::handleAlphaUpdated() */ - virtual void handleAlphaUpdated() - { - wildcardText.setAlpha(T::getAlpha()); - T::handleAlphaUpdated(); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_WILDCARDTEXTBUTTONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp deleted file mode 100644 index 9cccdee..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AbstractClock.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/clock/AbstractClock.hpp - * - * Declares the touchgfx::AbstractClock class. - */ -#ifndef TOUCHGFX_ABSTRACTCLOCK_HPP -#define TOUCHGFX_ABSTRACTCLOCK_HPP - -#include -#include - -namespace touchgfx -{ -/** - * Superclass of clock widgets. Allows the hour, minute and second of the clock to be set and - * read. - * - * @see AnalogClock, DigitalClock - */ -class AbstractClock : public Container -{ -public: - AbstractClock(); - - /** - * Sets the time with input format as 24H. Note that this does not affect any selected - * presentation formats. - * - * @param hour The hours, value should be between 0 and 23. - * @param minute The minutes, value should be between 0 and 59. - * @param second The seconds, value should be between 0 and 59. - * - * @note all values passed are saved modulo the values limit. For example minutes=62 is - * treated as minutes=2. - */ - virtual void setTime24Hour(uint8_t hour, uint8_t minute, uint8_t second); - - /** - * Sets the time with input format as 12H. Note that this does not affect any selected - * presentation formats. - * - * @param hour The hours, value should be between 1 and 12. - * @param minute The minutes, value should be between 0 and 59. - * @param second The seconds, value should be between 0 and 59. - * @param am AM/PM setting. True = AM, false = PM. - * - * @note all values passed are saved modulo the values limit. For example minutes=62 is - * treated as minutes=2. - */ - virtual void setTime12Hour(uint8_t hour, uint8_t minute, uint8_t second, bool am); - - /** - * Gets the current hour. - * - * @return The current hour in range 0-23. - * - * @see getCurrentHour24, getCurrentHour12 - */ - uint8_t getCurrentHour() const; - - /** - * Gets current hour 24, i.e. between 0 and 23. - * - * @return The current hour in range 0-23. - */ - uint8_t getCurrentHour24() const; - - /** - * Gets current hour 12, i.e. between 1 and 12. - * - * @return The current hour in range 1-12. - * - * @see getCurrentHour24, getCurrentAM - */ - uint8_t getCurrentHour12() const; - - /** - * Is the current time a.m. or p.m.? True for a.m. and false for p.m. - * - * @return True if a.m., false if p.m. - */ - bool getCurrentAM() const; - - /** - * Gets the current minute. - * - * @return The current minute in range 0-59. - */ - uint8_t getCurrentMinute() const; - - /** - * Gets the current second. - * - * @return The current second in range 0-59. - */ - uint8_t getCurrentSecond() const; - -protected: - uint8_t currentHour; ///< Local copy of the current hour - uint8_t currentMinute; ///< Local copy of the current minute - uint8_t currentSecond; ///< Local copy of the current second - - /** Update the visual representation of the clock on the display. */ - virtual void updateClock() = 0; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTCLOCK_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp deleted file mode 100644 index 8d42679..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/AnalogClock.hpp +++ /dev/null @@ -1,285 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/clock/AnalogClock.hpp - * - * Declares the touchgfx::AnalogClock class. - */ -#ifndef TOUCHGFX_ANALOGCLOCK_HPP -#define TOUCHGFX_ANALOGCLOCK_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * An analog clock. Should be supplied with images for the background, hour hand, minute hand - * and the optional second hand. You setup the AnalogClock by specifying the rotation - * point of each hand as well as the global rotation point of the clock. You can - * customize the behavior of the AnalogClock in respect to animations and relations - * between the hands e.g. if the hour hand should move gradually towards the next hour - * as the minute hand progresses (setHourHandMinuteCorrection()) - */ -class AnalogClock : public AbstractClock -{ -public: - AnalogClock(); - - /** - * Sets the background image of the clock. The clock rotation center is automatically - * set to the background image center. The clock rotation center is the point that the - * clock hands rotates around. The size of the AnalocClock widget is set to the size of - * the bitmap. - * - * @param backgroundBitmapId Identifier for the background bitmap. - */ - virtual void setBackground(const BitmapId backgroundBitmapId); - - /** - * Sets the background image of the clock and the rotation center of the clock. The - * clock rotation center is the point that the clock hands rotates around. The size of - * the AnalocClock widget is set to the size of the bitmap. - * - * @param backgroundBitmapId Identifier for the background bitmap. - * @param rotationCenterX The rotation center x coordinate. - * @param rotationCenterY The rotation center y coordinate. - * - * @see setBackground(BitmapId), setRotationCenter - */ - virtual void setBackground(const BitmapId backgroundBitmapId, int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Sets the rotation center of the clock. The clock rotation center is the point that - * the clock hands rotates around. - * - * @param rotationCenterX The rotation center x coordinate. - * @param rotationCenterY The rotation center y coordinate. - */ - virtual void setRotationCenter(int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Sets up the hour hand. The specified rotation center is the point of the hand that is - * to be placed on top of the clock rotation center. That is the point that the hand - * rotates around. The rotation point is relative to the supplied bitmap and can be - * placed outside of it. - * - * @param hourHandBitmapId Identifier for the hour hand bitmap. - * @param rotationCenterX The hand rotation center x coordinate. - * @param rotationCenterY The hand rotation center y coordinate. - * - * @note If no hour hand is setup it will just be omitted. - */ - virtual void setupHourHand(const BitmapId hourHandBitmapId, int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Sets up the minute hand. The specified rotation center is the point of the hand that - * is to be placed on top of the clock rotation center. That is the point that the hand - * rotates around. The rotation point is relative to the supplied bitmap but can be - * placed outside of it. - * - * @param minuteHandBitmapId Identifier for the minute hand bitmap. - * @param rotationCenterX The hand rotation center x coordinate. - * @param rotationCenterY The hand rotation center y coordinate. - * - * @note If no minute hand is setup it will just be omitted. - */ - virtual void setupMinuteHand(const BitmapId minuteHandBitmapId, int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Sets up the second hand. The specified rotation center is the point of the hand that - * is to be placed on top of the clock rotation center. That is the point that the hand - * rotates around. The rotation point is relative to the supplied bitmap but can be - * placed outside of it. - * - * @param secondHandBitmapId Identifier for the second hand bitmap. - * @param rotationCenterX The hand rotation center x coordinate. - * @param rotationCenterY The hand rotation center y coordinate. - * - * @note If no second hand is setup it will just be omitted. - */ - virtual void setupSecondHand(const BitmapId secondHandBitmapId, int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Sets whether hour hand minute correction should be active. If set to true the hour - * hand will be positioned between the current hour and the next depending on the minute - * hands position. - * - * @param active true to use hour hand correction. - * - * @see getHourHandMinuteCorrection - */ - virtual void setHourHandMinuteCorrection(bool active); - - /** - * Gets hour hand minute correction. - * - * @return true if hour hand minute correction is active. - * - * @see setHourHandMinuteCorrection - */ - virtual bool getHourHandMinuteCorrection() const; - - /** - * Sets whether minute hand second correction should be active. If set to true the - * minute hand will be positioned between the current minute and the next depending on - * the second hands position. - * - * @param active true to use. - * - * @see setMinuteHandSecondCorrection - */ - virtual void setMinuteHandSecondCorrection(bool active); - - /** - * Gets minute hand second correction. - * - * @return true if minute hand second correction is active. - * - * @see setHourHandMinuteCorrection - */ - virtual bool getMinuteHandSecondCorrection() const; - - /** - * Setup the clock to use animation for hand movements. - * - * @param duration (Optional) The animation duration, default is 10. - * @param animationProgressionEquation (Optional) The animation progression equation, - * default is EasingEquations::backEaseInOut. - */ - virtual void setAnimation(uint16_t duration = 10, EasingEquation animationProgressionEquation = EasingEquations::backEaseInOut); - - /** - * Gets the animation duration. - * - * @return The animation duration. - * - * @see setAnimation - */ - virtual uint16_t getAnimationDuration() - { - return animationDuration; - } - - /** - * Sets the time with input format as 24H. No animations are performed regardless of the - * animation settings. This is often useful when setting up the AnalogClock where you do - * not want an initial animation. - * - * @param hour The hours, value should be between 0 and 23. - * @param minute The minutes, value should be between 0 and 59. - * @param second The seconds, value should be between 0 and 59. - * - * @see setTime24Hour - * - * @note that this does not affect any selected presentation formats. - */ - virtual void initializeTime24Hour(uint8_t hour, uint8_t minute, uint8_t second); - - /** - * Sets the time with input format as 12H. No animations are performed regardless of the - * animation settings. This is often useful when setting up the AnalogClock where you do - * not want an initial animation. - * - * @param hour The hours, value should be between 1 and 12. - * @param minute The minutes, value should be between 0 and 59. - * @param second The seconds, value should be between 0 and 59. - * @param am AM/PM setting. True = AM, false = PM. - * - * @see setTime12Hour - * - * @note that this does not affect any selected presentation formats. - */ - virtual void initializeTime12Hour(uint8_t hour, uint8_t minute, uint8_t second, bool am); - - /** - * @copydoc Image::setAlpha - * @note The alpha value is reflected in the background image - */ - virtual void setAlpha(uint8_t newAlpha); - - /** @copydoc Image::getAlpha() */ - virtual uint8_t getAlpha() const; - - virtual void invalidateContent() const - { - if (getAlpha() > 0) - { - AbstractClock::invalidateContent(); - } - } - -protected: - Image background; ///< The background image of the AnalogClock - - AnimationTextureMapper hourHand; ///< TextureMapper used for drawing the hourHand - AnimationTextureMapper minuteHand; ///< TextureMapper used for drawing the minuteHand - AnimationTextureMapper secondHand; ///< TextureMapper used for drawing the secondHand - - EasingEquation animationEquation; ///< The easing equation used by hand animations - uint16_t animationDuration; ///< The duration of hand animations. If 0 animations are disabled - - int16_t clockRotationCenterX; ///< The x coordinate of the rotation point of the hands - int16_t clockRotationCenterY; ///< The y coordinate of the rotation point of the hands - - uint8_t lastHour; ///< The last know hour value - uint8_t lastMinute; ///< The last know minute value - uint8_t lastSecond; ///< The last know second value - - bool hourHandMinuteCorrectionActive; ///< Is hour hand minute correction active - bool minuteHandSecondCorrectionActive; ///< Is minute hand second correction active - - virtual void updateClock(); - - /** - * Sets up a given the hand. - * - * @param [in] hand Reference to the hand being setup. - * @param bitmapId The bitmap identifier for the given hand. - * @param rotationCenterX The hand rotation center x coordinate. - * @param rotationCenterY The hand rotation center y coordinate. - */ - virtual void setupHand(TextureMapper& hand, const BitmapId bitmapId, int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Convert hand value to angle. - * - * @param steps Number of steps the primary hand value is divided into, i.e. - * 60 for minutes/seconds and 12 for hour. - * @param handValue The actual value for the hand in question (in the range [0; - * steps]). - * @param secondHandValue (Optional) If the angle should be corrected for a secondary - * hand its value should be specified here (in the range [0; - * 60]). This is the case when setHourHandMinuteCorrection(true) - * or setMinuteHandSecondCorrection(true) is selected. - * - * @return The converted value to angle. - */ - virtual float convertHandValueToAngle(uint8_t steps, uint8_t handValue, uint8_t secondHandValue = 0) const; - - /** - * Is animation enabled for the hands? - * - * @return true if animation is enabled. - */ - virtual bool animationEnabled() const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ANALOGCLOCK_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp deleted file mode 100644 index 3d85f29..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/clock/DigitalClock.hpp +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/clock/DigitalClock.hpp - * - * Declares the touchgfx::DigitalClock class. - */ -#ifndef TOUCHGFX_DIGITALCLOCK_HPP -#define TOUCHGFX_DIGITALCLOCK_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A digital clock. Can be set in either 12 or 24 hour mode. Seconds are optional. Width and - * height must be set manually to match the typography and alignment specified in the - * text database. The Digital Clock requires a typedText with one wildcard and uses the - * following characters (not including quotes) - * "AMP :0123456789" These must be present in the text database with the same typography - * as the wildcard text. Leading zero for the hour indicator can be enabled/disable by - * the displayLeadingZeroForHourIndicator method. - */ -class DigitalClock : public AbstractClock -{ -public: - /** Values that represent different display modes. */ - enum DisplayMode - { - DISPLAY_12_HOUR_NO_SECONDS, ///< 12 Hour clock. Seconds are not displayed - DISPLAY_24_HOUR_NO_SECONDS, ///< 24 Hour clock. Seconds are not displayed - DISPLAY_12_HOUR, ///< 12 Hour clock. Seconds are displayed - DISPLAY_24_HOUR ///< 24 Hour clock. Seconds are displayed - }; - - DigitalClock(); - - virtual void setWidth(int16_t width); - - virtual void setHeight(int16_t height); - - /** - * Adjusts the DigitalClock y coordinate so the text will have its baseline at the - * specified value. The placements is relative to the specified TypedText so if the - * TypedText is changed, you have to set the baseline again. - * - * @param baselineY The y coordinate of the baseline of the text. - * - * @note that setTypedText must be called prior to setting the baseline. - */ - virtual void setBaselineY(int16_t baselineY); - - /** - * Sets the typed text of the DigitalClock. Expects a TypedText with one wildcard and - * that the following characters are defined for the typography of the TypedText: - * - 12 hour clock: "AMP :0123456789" - * - 24 hour clock: ":0123456789" - * - * @param typedText Describes the typed text to use. - * - * @note Automatically invalidates the DigitalClock. - */ - virtual void setTypedText(TypedText typedText); - - /** - * Sets the color of the text. - * - * @param color The new text color. - * - * @note Automatically invalidates the DigitalClock. - */ - virtual void setColor(colortype color); - - /** - * Gets the color of the text. - * - * @return The color. - */ - virtual colortype getColor() const; - - /** - * Sets the display mode to 12/24 hour clock with or without seconds. - * - * @param dm The new display mode. - * - * @see DisplayMode, getDisplayMode - */ - virtual void setDisplayMode(DisplayMode dm) - { - displayMode = dm; - } - - /** - * Gets the current display mode. - * - * @return The display mode. - * - * @see DisplayMode, setDisplayMode - */ - virtual DisplayMode getDisplayMode() const - { - return displayMode; - } - - /** - * Sets whether to display a leading zero for the hour indicator or not, when the hour - * value only has one digit. For example 8 can be displayed as "8:" - * (displayLeadingZero=false) or "08:" (displayLeadingZero=true). - * - * Default value for this setting is false. - * - * @param displayLeadingZero true = show leading zero. false = do not show leading zero. - * - * @note This does not affect the display of minutes or seconds. - */ - void displayLeadingZeroForHourIndicator(bool displayLeadingZero); - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha); - - /** - * @copydoc Image::getAlpha - */ - virtual uint8_t getAlpha() const; - - /** - * Gets text width of the currently displayed DigitalClock. - * - * @return The text width of the currently displayed DigitalClock. - */ - virtual uint16_t getTextWidth() const - { - return text.getTextWidth(); - } - - virtual void invalidateContent() const - { - if (getAlpha() > 0) - { - AbstractClock::invalidateContent(); - } - } - -protected: - static const int BUFFER_SIZE = 12; ///< Buffer size of the wild card, worst case is "12:59:59 AM" (12 chars) - - DisplayMode displayMode; ///< The current display mode - bool useLeadingZeroForHourIndicator; ///< Print a leading zero if the hour is less than 10 - - TextAreaWithOneWildcard text; ///< The clock text - Unicode::UnicodeChar buffer[BUFFER_SIZE]; ///< Wild card buffer for the clock text - - virtual void updateClock(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DIGITALCLOCK_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp deleted file mode 100644 index b1bc749..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/AbstractDirectionProgress.hpp - * - * Declares the touchgfx::AbstractDirectionProgress class. - */ -#ifndef TOUCHGFX_ABSTRACTDIRECTIONPROGRESS_HPP -#define TOUCHGFX_ABSTRACTDIRECTIONPROGRESS_HPP - -#include - -namespace touchgfx -{ -/** - * An abstract class for progress indicators that need a horizontal or vertical direction to be - * specified. - */ -class AbstractDirectionProgress : public AbstractProgressIndicator -{ -public: - /** Values that represent directions. */ - enum DirectionType - { - RIGHT, ///< Progress should be from left to right - LEFT, ///< Progress should be from right to left - DOWN, ///< Progress should be down (top to bottom) - UP ///< Progress should be up (bottom to top) - }; - - AbstractDirectionProgress(); - - /** - * Sets a direction for the progress indicator. This will re-calculate the current value - * according to the new direction. - * - * @param direction The direction. - * - * @see getDirection - */ - virtual void setDirection(DirectionType direction); - - /** - * Gets the current direction for the progress indicator. - * - * @return The direction. - * - * @see setDirection - */ - virtual DirectionType getDirection() const; - -protected: - DirectionType progressDirection; ///< The progress direction -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTDIRECTIONPROGRESS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp deleted file mode 100644 index b6fa1f8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp +++ /dev/null @@ -1,298 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/AbstractProgressIndicator.hpp - * - * Declares the touchgfx::AbstractProgressIndicator class. - */ -#ifndef TOUCHGFX_ABSTRACTPROGRESSINDICATOR_HPP -#define TOUCHGFX_ABSTRACTPROGRESSINDICATOR_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractProgressIndicator declares methods that provides the basic mechanisms and tools - * to implement a progress indicator. For more specific implementations see classes that - * inherit from AbstractProgressIndicator. - * - * @see BoxProgress, CircleProgress, ImageProgress, LineProgress, TextProgress - */ -class AbstractProgressIndicator : public Container -{ -public: - /** Initializes a new instance of the AbstractProgressIndicator class with a default range 0-100. */ - AbstractProgressIndicator(); - - /** - * Sets the background image. The width and height of the progress indicator widget is - * updated according to the dimensions of the bitmap. - * - * @param bitmapBackground The background bitmap. - */ - virtual void setBackground(const Bitmap& bitmapBackground); - - /** - * Sets the position and dimensions of the actual progress indicator relative to the - * background image. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param width The width of the box progress indicator. - * @param height The height of the box progress indicator. - * - * @see getProgressIndicatorX, getProgressIndicatorY, getProgressIndicatorWidth, - * getProgressIndicatorHeight - */ - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Gets progress indicator x coordinate. - * - * @return The progress indicator x coordinate. - * - * @see setProgressIndicatorPosition - */ - virtual int16_t getProgressIndicatorX() const; - - /** - * Gets progress indicator y coordinate. - * - * @return The progress indicator y coordinate. - * - * @see setProgressIndicatorPosition - */ - virtual int16_t getProgressIndicatorY() const; - - /** - * Gets progress indicator width. - * - * @return The progress indicator width. - * - * @see setProgressIndicatorPosition - */ - virtual int16_t getProgressIndicatorWidth() const; - - /** - * Gets progress indicator height. - * - * @return The progress indicator height. - * - * @see setProgressIndicatorPosition - */ - virtual int16_t getProgressIndicatorHeight() const; - - /** - * Sets the range for the progress indicator. The range is the values that are given to - * the progress indicator while progressing through the task at hand. If an app needs to - * work through 237 items to finish a task, the range should be set to (0, 237) assuming - * that 0 items is the minimum. Though the minimum is often 0, it is possible to - * customize this. - * - * The steps parameter is used to specify at what granularity you want the progress - * indicator to report a new progress value. If the 237 items to be reported as 0%, - * 10%, 20%, ... 100%, the steps should be set to 10 as there are ten steps from 0% - * to 100%. If you want to update a widget which is 150 pixels wide, you might want to - * set steps to 150 to get a new progress value for every pixel. If you are updating a - * clock and want this to resemble an analog clock, you might want to use - * 12 or perhaps 60 as number of steps. - * - * The minStep parameter is used when the minimum input value (min) should give a - * progress different from 0. For example, if progress is a clock face, you want to - * count from 0..1000 and you want progress per minute, but want to make sure that 0 is - * not a blank clock face, but instead you want 1 minute to show, use - * @code - * setRange(0, 1000, 60, 1) - * @endcode - * to make sure that as values progress from 0 to 1000, getProgress() start from 1 and - * goes up to 60. Another example could be a BoxProgress with a TextProgress on top and - * you want to make sure that "0%" will always show in the box, use something like - * @code - * setRange(0, 1000, 200, 40) - * @endcode - * if your box is 200 pixels wide and "0%" is 40 pixels wide. - * - * @param min The minimum input value. - * @param max The maximum input value. - * @param steps (Optional) The steps in which to report progress. - * @param minStep (Optional) The step which the minimum input value is mapped to. - * - * @see setValue, getProgress - */ - virtual void setRange(int min, int max, uint16_t steps = 0, uint16_t minStep = 0); - - /** - * Gets the range set by setRange(). - * - * @param [out] min The minimum input value. - * @param [out] max The maximum input value. - * @param [out] steps The steps in which to report progress. - * @param [out] minStep The step which the minimum input value is mapped to. - * - * @see setRange - */ - virtual void getRange(int& min, int& max, uint16_t& steps, uint16_t& minStep) const; - - /** - * Gets the range set by setRange(). - * - * @param [out] min The minimum input value. - * @param [out] max The maximum input value. - * @param [out] steps The steps in which to report progress. - * - * @see setRange - */ - virtual void getRange(int& min, int& max, uint16_t& steps) const; - - /** - * Gets the range set by setRange(). - * - * @param [out] min The minimum input value. - * @param [out] max The maximum input value. - * - * @see setRange - */ - virtual void getRange(int& min, int& max) const; - - /** - * Sets the current value in the range (min..max) set by setRange(). Values lower than min - * are mapped to min, values higher than max are mapped to max. If a callback function has - * been set using setValueSetAction, that callback will be called (unless the new value - * is the same as the current value). - * - * @param value The value. - * - * @see getValue, updateValue, setValueSetAction - * - * @note if value is equal to the current value, nothing happens, and the callback will not be - * called. - */ - virtual void setValue(int value); - - /** - * Sets easing equation to be used in updateValue. - * - * @param easingEquation The easing equation. - * - * @see updateValue - */ - virtual void setEasingEquation(EasingEquation easingEquation); - - /** - * Update the current value in the range (min..max) set by setRange(). Values lower than min - * are mapped to min, values higher than max are mapped to max. The value is changed - * gradually in the given number of ticks using the easing equation set in - * setEasingEquation. Function setValue() is called for every new value during the change of - * value, and if a callback function has been set using setValueSetAction, that callback - * will be called for every new value. The callback set using setValueUpdatedCallback is - * called when the animation has finished. - * - * @param value The value. - * @param duration The duration. - * - * @see setValue, setEasingEquation, setValueSetAction, setValueUpdatedAction - * - * @note If duration is 0, setValue will be called immediately and the valueUpdated action is - * called immediately. - */ - virtual void updateValue(int value, uint16_t duration); - - /** - * Gets the current value set by setValue(). - * - * @return The value. - * - * @see setValue - */ - virtual int getValue() const; - - /** - * Gets the current progress based on the range set by setRange() and the value set by - * setValue(). - * - * @param range (Optional) The range, default is 100. - * - * @return The progress. - * - * @see setRange, setValue, getValue - */ - virtual uint16_t getProgress(uint16_t range = 100) const; - - /** - * Sets callback that will be triggered every time a new value is assigned to the progress - * indicator. This can happen directly from setValue() or during a gradual change initiated - * using updateValue(). - * - * @param callback The callback. - * - * @see setValue, updateValue - */ - void setValueSetAction(GenericCallback& callback); - - /** - * Sets callback that will be triggered when updateValue has finished animating to the final - * value. - * - * @param callback The callback. - * - * @see updateValue, setValueSetAction - */ - void setValueUpdatedAction(GenericCallback& callback); - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha); - - /** - * @copydoc Image::getAlpha - */ - virtual uint8_t getAlpha() const; - - virtual void handleTickEvent(); - - virtual void invalidateContent() const - { - if (getAlpha() > 0) - { - Container::invalidateContent(); - } - } - -protected: - Image background; ///< The background image - Container progressIndicatorContainer; ///< The container that holds the actual progress indicator - int rangeMin; ///< The range minimum - int rangeMax; ///< The range maximum - int currentValue; ///< The current value - uint16_t rangeSteps; ///< The range steps - uint16_t rangeStepsMin; ///< The range steps minimum - EasingEquation equation; ///< The equation used in updateValue() - bool animationRunning; ///< Is the animation running - int animationStartValue; ///< The animation start value - int animationEndValue; ///< The animation end value - int animationDuration; ///< Duration of the animation - int animationStep; ///< The current animation step - GenericCallback* valueSetCallback; ///< New value assigned Callback. - GenericCallback* valueUpdatedCallback; ///< Animation ended Callback. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPROGRESSINDICATOR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp deleted file mode 100644 index 44d1566..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/BoxProgress.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/BoxProgress.hpp - * - * Declares the touchgfx::BoxProgress class. - */ -#ifndef TOUCHGFX_BOXPROGRESS_HPP -#define TOUCHGFX_BOXPROGRESS_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A BoxProgress which shows the current progress using a simple Box. It is possible to set the - * color and the alpha of the box. It is also possible to control in what direction the - * box will progress (up, down, to the left or to the right). - */ -class BoxProgress : public AbstractDirectionProgress -{ -public: - BoxProgress(); - - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Sets the color of the Box. - * - * @param color The color. - * @see getColor - */ - virtual void setColor(colortype color); - - /** - * Gets the color of the Box. - * - * @return The color. - * - * @see setColor - */ - virtual colortype getColor() const; - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha); - - virtual void setValue(int value); - -protected: - Box box; ///< The box -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BOXPROGRESS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp deleted file mode 100644 index 3ff737c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/CircleProgress.hpp +++ /dev/null @@ -1,177 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/CircleProgress.hpp - * - * Declares the touchgfx::CircleProgress class. - */ -#ifndef TOUCHGFX_CIRCLEPROGRESS_HPP -#define TOUCHGFX_CIRCLEPROGRESS_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A circle progress indicator uses CanvasWidgetRenderer for drawing the arc of a Circle to show - * progress. This means that the user must create a painter for painting the circle. The - * circle progress is defined by setting the minimum and maximum angle of the arc. - * - * @note As CircleProgress uses CanvasWidgetRenderer, it is important that a buffer is set up - * by calling CanvasWidgetRendere::setBuffer(). - */ -class CircleProgress : public AbstractProgressIndicator -{ -public: - CircleProgress(); - - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Sets the painter to use for drawing the circle progress. - * - * @param [in] painter The painter. - * - * @see Circle::setPainter, AbstractPainter - */ - virtual void setPainter(AbstractPainter& painter); - - /** - * Sets the center of the circle / arc. - * - * @param x The x coordinate of the center of the circle. - * @param y The y coordinate of the center of the circle. - */ - virtual void setCenter(int x, int y); - - /** - * Gets the circle center coordinates. - * - * @param [out] x The x coordinate of the center of the circle. - * @param [out] y The y coordinate of the center of the circle. - */ - virtual void getCenter(int& x, int& y) const; - - /** - * Sets the radius of the circle. - * - * @param r The radius. - * - * @see Circle::setRadius - */ - virtual void setRadius(int r); - - /** - * Gets the radius of the circle. - * - * @return The radius. - */ - virtual int getRadius() const; - - /** - * Sets line width of the circle. If a line width of zero is specified, it has a special - * meaning of drawing a filled circle (with the set radius) instead of just the circle arc. - * - * @param width The width of the line (0 produces a filled circle with the given radius). - * - * @see Circle::setLineWidth, setRadius - */ - virtual void setLineWidth(int width); - - /** - * Gets line width. - * - * @return The line width. - * - * @see setLineWidth - */ - virtual int getLineWidth() const; - - /** - * Sets the cap precision of end of the circle arc. This is not used if line width is - * zero. - * - * @param precision The cap precision. - * - * @see Circle::setCapPrecision, getCapPrecision - */ - virtual void setCapPrecision(int precision); - - /** - * Gets the cap precision. - * - * @return The cap precision. - * - * @see setCapPrecision - */ - virtual int getCapPrecision() const - { - return circle.getCapPrecision(); - } - - /** - * Sets start angle and end angle in degrees. By swapping end and start angles, circles can - * progress backwards. - * - * @param startAngle The start angle. - * @param endAngle The end angle. - * - * @note Angles are given in degrees, so a full circle is 360. - */ - virtual void setStartEndAngle(int startAngle, int endAngle); - - /** - * Gets start angle in degrees. - * - * @return The start angle. - * - * @see setStartEndAngle, getEndAngle - * - * @note Angles are given in degrees, so a full circle is 360. - */ - virtual int getStartAngle() const; - - /** - * Gets end angle in degrees. Beware that the value returned is not related to the current - * progress of the circle but rather the end point of the circle when it is at 100%. - * - * @return The end angle. - * - * @see setStartEndAngle - * - * @note Angles are given in degrees, so a full circle is 360. - */ - virtual int getEndAngle() const; - - /** - * @copydoc Image::setAlpha - * - * @note The alpha can also be set on the Painter, but this can be controlled directly from - * the user app, setting alpha for the CircleProgress will set the alpha of the - * actual circle. - */ - virtual void setAlpha(uint8_t newAlpha); - - virtual void setValue(int value); - -protected: - Circle circle; ///< The circle - int circleEndAngle; ///< The end angle -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CIRCLEPROGRESS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp deleted file mode 100644 index b93e144..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/ImageProgress.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/ImageProgress.hpp - * - * Declares the touchgfx::ImageProgress class. - */ -#ifndef TOUCHGFX_IMAGEPROGRESS_HPP -#define TOUCHGFX_IMAGEPROGRESS_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * An image progress will show parts of an image as a progress indicator. The image can progress - * from the left, the right, the bottom or the top of the given area, and can visually - * be fixed with a larger and larger portion of the image showing, or it can be moved - * into view. - */ -class ImageProgress : public AbstractDirectionProgress -{ -public: - ImageProgress(); - - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Sets anchor at zero. - * - * Setting anchor at zero will force the image will be placed so that it is not moved - * during progress, only more and more of the image will become visible. If the image is - * not anchored at zero, it will be anchored at the current progress and will appear to - * slide into view. - * - * @param anchorAtZero true to anchor at zero, false to anchor at current progress. - * - * @see getAnchorAtZero - */ - virtual void setAnchorAtZero(bool anchorAtZero); - - /** - * Gets the current anchor at zero setting. - * - * @return true if the image is anchored at zero, false if it is anchored at current - * progress. - * - * @see setAnchorAtZero - */ - virtual bool getAnchorAtZero() const; - - /** - * Sets the bitmap id to use for progress. Please note that the bitmap is tiled which - * will allow smaller bitmaps to repeat on the display and save memory. - * - * @param bitmapId The bitmap id. - * - * @see getBitmap, TiledImage - */ - virtual void setBitmap(BitmapId bitmapId); - - /** - * Gets the bitmap id of the current image. - * - * @return The image. - * - * @see setBitmap - */ - virtual BitmapId getBitmap() const; - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha); - - virtual void setValue(int value); - -protected: - Container container; ///< The container for the image to allow for anchored images - TiledImage image; ///< The image - bool fixedPosition; ///< true if the image should not move during progress -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_IMAGEPROGRESS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp deleted file mode 100644 index c858d7e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/LineProgress.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/LineProgress.hpp - * - * Declares the touchgfx::LineProgress class. - */ -#ifndef TOUCHGFX_LINEPROGRESS_HPP -#define TOUCHGFX_LINEPROGRESS_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Using Line from CanvasWidgetRenderer, progress will be rendered as a line. This means that - * the user must create a painter for painting the circle. The line does not need to - * horizontal or vertical, but can start at any coordinate and finish at any coordinate. - * - * @note As LineProgress uses CanvasWidgetRenderer, it is important that a buffer is set up by - * calling CanvasWidgetRendere::setBuffer(). - */ -class LineProgress : public AbstractProgressIndicator -{ -public: - LineProgress(); - - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Sets a painter to be used for drawing the line. This can be any Painter, a simple - * single color painter, a bitmap painter or a custom painter. - * - * @param [in] painter The painter. - */ - virtual void setPainter(AbstractPainter& painter); - - /** - * Sets a starting point for the line. - * - * @param x The x coordinate of the start point. - * @param y The y coordinate of the start point. - * - * @see setEnd - */ - virtual void setStart(int x, int y); - - /** - * Gets the coordinates of the starting point of the line. - * - * @param [out] x The x coordinate. - * @param [out] y The y coordinate. - */ - virtual void getStart(int& x, int& y) const; - - /** - * Sets the end point for the line. When progress is at 100%, the line will go from the - * coordinates set by setStart() to the coordinates set by setEnd() - * - * @param x The x coordinate of the end point. - * @param y The y coordinate of the end point. - * - * @see setStart - */ - virtual void setEnd(int x, int y); - - /** - * Gets the coordinates of the end point of the line. Beware that this is not the - * coordinates of the current progress of the line, but the coordinates when the line is - * at 100%. - * - * @param [out] x The x coordinate. - * @param [out] y The y coordinate. - */ - virtual void getEnd(int& x, int& y) const; - - /** - * Sets the line width. - * - * @param width The width. - * - * @see Line::setLineWidth - */ - virtual void setLineWidth(int width); - - /** - * Gets the line width. - * - * @return The line width. - */ - virtual int getLineWidth() const; - - /** - * Sets line ending style. - * - * @param lineEndingStyle The line ending style. - * - * @see Line::setLineEndingStyle - */ - virtual void setLineEndingStyle(Line::LINE_ENDING_STYLE lineEndingStyle); - - /** - * Gets line ending style. - * - * @return The line ending style. - */ - virtual Line::LINE_ENDING_STYLE getLineEndingStyle() const; - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha); - - virtual void setValue(int value); - -protected: - Line line; ///< The line - CWRUtil::Q5 startX; ///< The start x coordinate - CWRUtil::Q5 startY; ///< The start y coordinate - CWRUtil::Q5 endX; ///< The end x coordinate - CWRUtil::Q5 endY; ///< The end y coordinate -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LINEPROGRESS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp deleted file mode 100644 index dfef9f4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/progress_indicators/TextProgress.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/progress_indicators/TextProgress.hpp - * - * Declares the touchgfx::TextProgress class. - */ -#ifndef TOUCHGFX_TEXTPROGRESS_HPP -#define TOUCHGFX_TEXTPROGRESS_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A text progress will display progress as a number with a given number of decimals. - * - * @note The implementation does not use floating point variables to calculate the progress. - */ -class TextProgress : public AbstractProgressIndicator -{ -public: - TextProgress(); - - /** - * Sets the position and dimensions of the text progress indicator. - * - * Sets the position and dimensions of the text progress indicator relative to the - * background image. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param width The width of the text progress indicator. - * @param height The height of the text progress indicator. - */ - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Sets the typed text. The text should have exactly one wildcard and could for example - * look like this: "<progress>\%". - * - * @param t The TypedText to process. - * - * @see getTypedText - */ - virtual void setTypedText(const TypedText& t); - - /** - * Gets the typed text. - * - * @return The typed text. - * - * @see setTypedText - */ - virtual const TypedText& getTypedText() const; - - /** - * Sets the color of the text in the used text area. - * - * @param color The color. - * - * @see getColor, TextArea::setColor - */ - virtual void setColor(colortype color); - - /** - * Gets the color of the text in the used text area. - * - * @return The color. - */ - virtual colortype getColor() const; - - /** @copydoc Image::setAlpha */ - virtual void setAlpha(uint8_t newAlpha); - - /** - * Sets the new value for the progress indicator. - * - * @param value The value. - */ - virtual void setValue(int value); - - /** - * Sets number of decimals when displaying progress. - * - * @param numberOfDecimals Number of decimals. Only up to two decimals is supported. - * - * @see getNumberOfDecimals - */ - virtual void setNumberOfDecimals(uint16_t numberOfDecimals); - - /** - * Gets number of decimals. - * - * @return The number of decimals. - * - * @see setNumberOfDecimals - */ - virtual uint16_t getNumberOfDecimals() const; - -protected: - TextAreaWithOneWildcard textArea; ///< The text area - Unicode::UnicodeChar textBuffer[9]; ///< Room for 100.0000 - uint16_t decimals; ///< The number of decimals -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTPROGRESS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp deleted file mode 100644 index 85ffbc3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/DrawableList.hpp +++ /dev/null @@ -1,396 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/scrollers/DrawableList.hpp - * - * Declares the touchgfx::DrawableListItemsInterface (abstract), touchgfx::DrawableListItems - * and touchgfx::DrawableList classes. - */ -#ifndef TOUCHGFX_DRAWABLELIST_HPP -#define TOUCHGFX_DRAWABLELIST_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A drawable list items interface. Used to pass the allocated array of drawable elements to - * ScrollList::setDrawables(), ScrollWheel::setDrawables() or - * ScrollWheelWithSelectionStyle::setDrawables(). Provides easy access to each element - * in the array as well as the size of the array. - * - * @see ScrollList::setDrawables, ScrollWheel::setDrawables, - * ScrollWheelWithSelectionStyle::setDrawables - */ -class DrawableListItemsInterface -{ -public: - /** Finalizes an instance of the DrawableListItemsInterface class. */ - virtual ~DrawableListItemsInterface() - { - } - - /** - * Gets a drawable at a given index. - * - * @param index Zero-based index of the drawable. - * - * @return Null if it fails, else the drawable. - */ - virtual Drawable* getDrawable(int16_t index) = 0; - - /** - * Gets number of drawables. - * - * @return The number of drawables. - */ - virtual int16_t getNumberOfDrawables() = 0; -}; - -/** - * An array of drawables used by DrawableList. This class is used to ease the setup of - * a callback function to get access to a specific drawable in the array. - * - * Example usage: - * @code - * static const int NUMBER_OF_DRAWABLES = 5; - * DrawableListItems menuItems; - * @endcode - * - * @tparam TYPE Type of the drawables. Can be a simple drawable, such as Image or a more - * complex container. - * @tparam SIZE Size of the array. This is the number of drawables to allocate and should be - * all visible drawables on the screen at any given time. - */ -template -class DrawableListItems : public DrawableListItemsInterface -{ -public: - virtual Drawable* getDrawable(int16_t index) - { - assert(index >= 0 && index < SIZE); - return &element[index]; - } - - /** - * Array indexer operator. - * - * @param index Zero-based index of elements to access. - * - * @return The indexed value. - */ - TYPE& operator[](int index) - { - assert(index >= 0 && index < SIZE); - return element[index]; - } - - virtual int16_t getNumberOfDrawables() - { - return SIZE; - } - - TYPE element[SIZE]; ///< The array of drawables -}; - -/** - * A container able to display many items using only a few drawables. This is done by only - * having drawables for visible items, and populating these drawables with new content - * when each of these become visible. - * - * This means that all drawables must have an identical structure in some way, for - * example an Image or a Container with a button and a text. - */ -class DrawableList : public Container -{ -public: - DrawableList(); - - /** - * @copydoc Container::setWidth - * - * @note If the list is vertical, the width is also propagated to all drawables in the list. - */ - virtual void setWidth(int16_t width); - - /** - * @copydoc Container::setHeight - * - * @note If the list is horizontal, the height is also propagated to all drawables in the list. - */ - virtual void setHeight(int16_t height); - - /** - * Sets a horizontal or vertical layout. If parameter horizontal is set true, all - * drawables are arranged side by side. If horizontal is set false, the drawables are - * arranged above and below each other (vertically). - * - * @param horizontal True to align drawables horizontal, false to align drawables - * vertically. - * - * @see ScrollBase::setHorizontal, getHorizontal - * - * @note Default value is false, i.e. vertical layout. - */ - virtual void setHorizontal(bool horizontal); - - /** - * Gets the orientation of the drawables, previously set using setHorizontal(). - * - * @return True if it horizontal, false if it is vertical. - * - * @see ScrollBase::getHorizontal, setHorizontal - */ - virtual bool getHorizontal() const; - - /** - * Sets whether the list is circular (infinite) or not. A circular list is a list where - * the first drawable re-appears after the last item in the list - and the last item in - * the list appears before the first item in the list. - * - * @param circular True if the list should be circular, false if the list should not be - * circular. - * - * @see ScrollBase::setCircular, getCircular - */ - virtual void setCircular(bool circular); - - /** - * Gets the circular setting, previously set using setCircular(). - * - * @return True if the list is circular (infinite), false if the list is not circular - * (finite). - * - * @see ScrollBase::getCircular, setCircular - */ - virtual bool getCircular() const; - - /** - * Sets drawables size. The drawable is is the size of each drawable in the list in the - * set direction of the list (this is enforced by the DrawableList class). The specified - * margin is added above and below each item for spacing. The entire size of an item is - * thus size + 2 * spacing. - * - * For a horizontal list each element will be \a drawableSize high and have the same - * width as set using setWidth(). For a vertical list each element will be \a - * drawableSize wide and have the same height as set using setHeight(). - * - * @param drawableSize The size of the drawable. - * @param drawableMargin The margin around drawables (margin before and margin after). - * - * @see setWidth, setHeight, setHorizontal - */ - void setDrawableSize(int16_t drawableSize, int16_t drawableMargin); - - /** - * Gets size of each item. This equals the drawable size plus the drawable margin as set - * in setDrawables(). Equals getDrawableSize() + 2 * getDrawableMargin(). - * - * @return The item size. - * - * @see setDrawables, setDrawableSize, getDrawableMargin - * - * @note Not the same as getDrawableSize(). - */ - virtual int16_t getItemSize() const; - - /** - * Gets drawable size as set by setDrawables. - * - * @return The drawable size. - * - * @see setDrawables - */ - virtual int16_t getDrawableSize() const; - - /** - * Gets drawable margin. - * - * Gets drawable margin as set by setDrawables. - * - * @return The drawable margin. - */ - virtual int16_t getDrawableMargin() const; - - /** - * Sets the drawables parameters. These parameters are \li The access class to the array - * of drawables \li The offset in the drawableListItems array to start using drawable - * and \li Callback to update the contents of a drawable. - * - * @param [in] drawableListItems Number of drawables allocated. - * @param [in] drawableItemIndexOffset The offset of the drawable item. - * @param [in] updateDrawableCallback A callback to update the contents of a drawable. - * - * @see getRequiredNumberOfDrawables - */ - virtual void setDrawables(DrawableListItemsInterface& drawableListItems, - int16_t drawableItemIndexOffset, - GenericCallback& updateDrawableCallback); - - /** - * Gets number of drawables based on the size of each item and the size of the widget. - * - * @return The number of drawables. - * - * @see setDrawables - */ - int16_t getNumberOfDrawables() const; - - /** - * Sets number of items in the list. This forces all drawables to be updated to ensure - * that the content is correct. - * - * @param numberOfItems Number of items. - * - * @note The DrawableList is refreshed to reflect the change. - */ - void setNumberOfItems(int16_t numberOfItems); - - /** - * Gets number of items in the DrawableList, as previously set using setNumberOfItems(). - * - * @return The number of items. - * - * @see setNumberOfItems - */ - int16_t getNumberOfItems() const; - - /** - * Gets required number of drawables. After setting up the DrawableList it is possible - * to request how many drawables are needed to ensure that the list can always be drawn - * properly. If the DrawableList has been setup with fewer Drawables than the required - * number of drawables, part of the lower part of the DrawableList will look wrong. - * - * The number of required drawables depend on the size of the widget and the size of the - * drawables and the margin around drawables. If there are fewer drawables than required, - * the widget will not display correctly. If there are more drawables than required, - * some will be left unused. - * - * @return The required number of drawables. - * - * @see setDrawables - */ - int16_t getRequiredNumberOfDrawables() const; - - /** - * Sets virtual coordinate. Does not move to the given coordinate, but places the - * drawables and fill correct content into the drawables to give the impression that - * everything has been scrolled to the given coordinate. - * - * Setting a value of 0 means that item 0 is at the start of the DrawableList. Setting a - * value of "-getItemSize()" places item 0 outside the start of the DrawableList and - * item 1 at the start of it. - * - * Items that are completely outside of view, will be updated with new content using the - * provided callback from setDrawables(). Care is taken to not fill drawables more than - * strictly required. - * - * @param ofs The virtual coordinate. - * - * @see getOffset, setDrawables - */ - void setOffset(int32_t ofs); - - /** - * Gets offset, as previously set using setOffset(). - * - * @return The virtual offset. - * - * @see setOffset - */ - int32_t getOffset() const; - - /** - * Gets item stored in a given Drawable. - * - * @param drawableIndex Zero-based index of the drawable. - * - * @return The item index. - */ - int16_t getItemIndex(int16_t drawableIndex) const; - - /** - * Gets drawable indices. Useful when the number of items is smaller than the number of - * drawables as the same item might be in more than one drawable on the screen (if the - * DrawableList is circular). The passed array will be filled with the drawable indices - * and the number of indices found is returned. - * - * @param itemIndex Zero-based index of the item. - * @param [out] drawableIndexArray Array where the drawable indices are stored. - * @param arraySize Size of drawable array. - * - * @return The number of drawable indices found. - * - * @see getItemIndex, setCircular, getDrawableIndex - */ - int16_t getDrawableIndices(int16_t itemIndex, int16_t* drawableIndexArray, int16_t arraySize) const; - - /** - * Gets the drawable index of an item. If the number of items is smaller than the number - * of drawables and the DrawableList is circular, the same item can be in more than one - * drawable. In that case, calling this function again with the previously returned - * index as second parameter, the index of the next drawable containing the item will be - * returned. - * - * @param itemIndex Index of the item. - * @param prevDrawableIndex (Optional) Index of the previous drawable. If given, search - * starts after this index. - * - * @return The first drawable index with the given item. Returns -1 if the item is not - * in a drawable. - * - * @see getDrawableIndices - */ - int16_t getDrawableIndex(int16_t itemIndex, int16_t prevDrawableIndex = -1) const; - - /** - * Refresh drawables. Useful to call if the number or items, their size or other - * properties have changed. - */ - void refreshDrawables(); - - /** - * Item changed. - * - * Item changed and drawables containing this item must be updated. This function can be - * called when an item has changed and needs to be updated on screen. If the given item - * is displayed on screen, possible more than once for cyclic lists, each drawable is - * request to refresh its content to reflect the new value. - * - * @param itemIndex Zero-based index of the item. - */ - void itemChanged(int16_t itemIndex); - -private: - bool isHorizontal; ///< True if list is horizontal, false if not - bool isCircular; ///< True if list is circular, false if not - int32_t offset; ///< The offset of item 0 - int16_t itemSize; ///< Size of each item (including margin) - int16_t itemMargin; ///< The margin around each item (included in itemSize) - int16_t numItems; ///< Number of items - int16_t numDrawables; ///< Number of drawables - int16_t firstItem; ///< The first visible item - int16_t firstDrawable; ///< The first visible drawable - bool drawablesInitialized; ///< True if all drawables initialized - - int16_t firstDrawableIndex; ///< The offset when accessing DrawableListItems - DrawableListItemsInterface* drawableItems; ///< The drawable items - GenericCallback* updateDrawable; ///< The update drawable callback -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DRAWABLELIST_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp deleted file mode 100644 index 3df6123..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollBase.hpp +++ /dev/null @@ -1,490 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/scrollers/ScrollBase.hpp - * - * Declares the touchgfx::ScrollBase class. - */ -#ifndef TOUCHGFX_SCROLLBASE_HPP -#define TOUCHGFX_SCROLLBASE_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The ScrollBase class is an abstract class used for Widgets that needs to show (a lot of) - * elements in a DrawableList that can be scrolled. Due to memory limitations, this is - * implemented by re-using the Drawables in the DrawableList - once an element is moved - * off screen, it is filled with new content and moved to the other end and the of the - * scrolling list. - * - * Lists can be horizontal or vertical and the can be circular (infinite scrolling). - * - * @see ScrollList, ScrollWheel, ScrollWheelWithSelectionStyle - * @see ScrollWheelBase, DrawableList - */ -class ScrollBase : public Container -{ -public: - ScrollBase(); - - /** - * @copydoc Container::setWidth - * - * @note Also sets the width of the children. - */ - virtual void setWidth(int16_t width); - - /** - * @copydoc Container::setHeight - * - * @note Also sets the height of the children. - */ - virtual void setHeight(int16_t height); - - /** - * Sets a horizontal or vertical layout. If parameter horizontal is set true, all - * drawables are arranged side by side. If horizontal is set false, the drawables are - * arranged above and below each other (vertically). - * - * @param horizontal True to align drawables horizontal, false to align drawables - * vertically. - * - * @see DrawableList::setHorizontal, getHorizontal - * - * @note Default value is false, i.e. vertical layout. - */ - virtual void setHorizontal(bool horizontal); - - /** - * Gets the orientation of the drawables, previously set using setHorizontal(). - * - * @return True if it horizontal, false if it is vertical. - * - * @see DrawableList::getHorizontal, setHorizontal - */ - virtual bool getHorizontal() const; - - /** - * Sets whether the list is circular (infinite) or not. A circular list is a list where - * the first drawable re-appears after the last item in the list - and the last item in - * the list appears before the first item in the list. - * - * @param circular True if the list should be circular, false if the list should not be - * circular. - * - * @see DrawableList::setCircular, getCircular - */ - virtual void setCircular(bool circular); - - /** - * Gets the circular setting, previously set using setCircular(). - * - * @return True if the list is circular (infinite), false if the list is not circular - * (finite). - * - * @see DrawableList::getCircular, setCircular - */ - virtual bool getCircular() const; - - /** - * Sets drawables size. The drawable is is the size of each drawable in the list in the - * set direction of the list (this is enforced by the DrawableList class). The specified - * margin is added above and below each item for spacing. The entire size of an item is - * thus size + 2 * spacing. - * - * For a horizontal list each element will be \a drawableSize high and have the same - * width as set using setWidth(). For a vertical list each element will be \a - * drawableSize wide and have the same height as set using setHeight(). - * - * @param drawableSize The size of the drawable. - * @param drawableMargin The margin around drawables (margin before and margin after). - * - * @see setWidth, setHeight, setHorizontal - */ - virtual void setDrawableSize(int16_t drawableSize, int16_t drawableMargin); - - /** - * Gets drawable size as set through the first parameter in most recent call to - * setDrawableSize(). - * - * @return The drawable size. - * - * @see setDrawableSize - */ - virtual int16_t getDrawableSize() const; - - /** - * Gets drawable margin as set through the second parameter in most recent call to - * setDrawableSize(). - * - * @return The drawable margin. - * - * @see setDrawableSize - */ - virtual int16_t getDrawableMargin() const; - - /** - * Sets number of items in the DrawableList. This forces all drawables to be updated to - * ensure that the content is correct. For example a date selector might switch number - * of days between 28, 29, 30, and 31 depending on the month. A circular list might show - * 27-28-29-30-31 and might need to update this to show 27-28-1-2-3. - * - * @param numberOfItems Number of items. - * - * @note The DrawableList is refreshed to reflect the change. - */ - virtual void setNumberOfItems(int16_t numberOfItems); - - /** - * Gets number of items in the DrawableList, as previously set using setNumberOfItems(). - * - * @return The number of items. - * - * @see setNumberOfItems, DrawableList::getNumberOfItems - */ - virtual int16_t getNumberOfItems() const; - - /** - * Sets easing equation when changing the selected item, for example via swipe or - * AnimateTo. - * - * @param equation The equation. - * - * @see setAnimationSteps, getAnimationSteps - */ - void setEasingEquation(EasingEquation equation); - - /** - * Sets animation steps (in ticks) when moving to a new selected item. The default value is 30. - * - * @param steps The animation steps. - * - * @see setEasingEquation, getAnimationSteps - */ - void setAnimationSteps(int16_t steps); - - /** - * Gets animation steps as set in setAnimationSteps. - * - * @return The animation steps. - * - * @see setAnimationSteps, setEasingEquation - */ - uint16_t getAnimationSteps() const; - - /** - * Sets swipe acceleration (times 10). Default value, if not set, is 10, i.e. 1.0. - * - * @param acceleration The acceleration times 10, so "9" means "0.9" and "75" means "7.5". - * - * @see getSwipeAcceleration - * - * @note The reason for multiplying the acceleration by 10 is to avoid introducing floating - * point arithmetic. - */ - void setSwipeAcceleration(uint16_t acceleration); - - /** - * Gets swipe acceleration (times 10). - * - * @return The swipe acceleration. - * - * @see setSwipeAcceleration - * - * @note The reason for multiplying the acceleration by 10 is to avoid introducing floating - * point arithmetic. - */ - uint16_t getSwipeAcceleration() const; - - /** - * Sets maximum swipe items. Often useful when there are e.g. five visible items on the - * screen and a swipe action should at most swipe the next/previous five items into view - * to achieve sort of a paging effect. - * - * @param maxItems The maximum items, 0 means "no limit" (which is also the default). - * - * @see getMaxSwipeItems - */ - void setMaxSwipeItems(uint16_t maxItems); - - /** - * Gets maximum swipe items as set by setMaxSwipeItems. - * - * @return The maximum swipe items, 0 means "no limit". - * - * @see setMaxSwipeItems - */ - uint16_t getMaxSwipeItems() const; - - /** - * Sets drag acceleration times 10, so "10" means "1", "15" means "1.5". 10 makes the - * containers follow the finger, higher values makes the containers move faster. This - * can often be useful if the list is very long. - * - * @param acceleration The drag acceleration. - * - * @see getDragAcceleration - * - * @note The reason for multiplying the acceleration by 10 is to avoid introducing floating - * point arithmetic. - */ - void setDragAcceleration(uint16_t acceleration); - - /** - * Gets drag acceleration (times 10). - * - * @return The drag acceleration. - * - * @see setDragAcceleration - * - * @note The reason for multiplying the acceleration by 10 is to avoid introducing floating - * point arithmetic. - */ - uint16_t getDragAcceleration() const; - - /** - * Sets overshoot percentage when dragging a non-circular list. This is the size relative to an - * item that can be dragged further than the actual list. Setting this to 50, it is possible to - * drag the list to show an empty space half the size of an item. Setting this to 0 prevents - * dragging further than the actual elements in the list. - * - * @param percentage The overshoot percentage. - * - * @see getOvershootPercentage - */ - void setOvershootPercentage(uint8_t percentage) - { - overshootPercentage = percentage; - } - - /** - * Gets overshoot percentage, as previously set using setOvershootPercentage. - * - * @return The overshoot percentage. - * - * @see setOvershootPercentage - */ - uint8_t getOvershootPercentage() const - { - return overshootPercentage; - } - - /** - * Enables horizontal scrolling to be passed to the children in the list (in case a child - * widget is able to handle drag events). By default, scrolling in either direction is - * disabled. This function can be used to explicitly (dis)allow scrolling in the - * horizontal direction. - * - * @param enable If true, horizontal scrolling is enabled. If false (default), scrolling is - * disabled. - */ - void allowHorizontalDrag(bool enable); - - /** - * Enables the vertical scroll. - * - * Enables the vertical scroll to be passed to the children in the list (in case a child - * widget is able to handle drag events). By default, scrolling in either direction is - * disabled. This function can be used to explicitly (dis)allow scrolling in the - * vertical direction. - * - * @param enable If true, vertical scrolling is enabled. If false (default), scrolling is - * disabled. - */ - void allowVerticalDrag(bool enable); - - /** - * Go to a specific item, possibly with animation. The given item index is scrolled into view. If - * animationSteps is omitted, the default number of animation steps is used. If - * animationSteps is 0 no animation will be used, otherwise the number of animation - * steps specified is used. - * - * @param itemIndex Zero-based index of the item. - * @param animationSteps (Optional) The steps to use for the animation. 0 means no animation. - * If omitted, default animation steps are used. - * - * @see setAnimationSteps - */ - virtual void animateToItem(int16_t itemIndex, int16_t animationSteps = -1); - - /** - * Sets Callback which will be called when the selected item is clicked. - * - * @param [in] callback The callback. - */ - void setItemSelectedCallback(GenericCallback& callback); - - /** - * Callback, called when the set animation ended. - * - * @param [in] callback The ended callback. - */ - void setAnimationEndedCallback(GenericCallback<>& callback); - - /** - * Set Callback which will be called when a item is pressed. - * - * @param [in] callback The callback. - */ - void setItemPressedCallback(GenericCallback& callback); - - /** - * Query if an animation is ongoing. This can be good to know if getSelectedItem() - * is called, as the result might not be as expected if isAnimating() returns true, - * since the display is not showing the selected item in the right place yet. - * - * @return true if animating, false if not. - */ - bool isAnimating() const; - - /** - * Stops an animation if one is ongoing. Immediately moves to the item which is being - * animated to. - */ - void stopAnimation(); - - virtual void handleDragEvent(const DragEvent& event); - - virtual void handleGestureEvent(const GestureEvent& event); - - virtual void handleTickEvent(); - - /** - * Inform the scroll list that the contents of an item has changed and force all - * drawables with the given item index to be updated via the callback provided. This is - * important as a circular list with very few items might display the same item more - * than once and all these items should be updated. - * - * @param itemIndex Zero-based index of the changed item. - */ - virtual void itemChanged(int itemIndex); - - /** Removed all drawables and initializes the content of these items. */ - virtual void initialize() - { - list.refreshDrawables(); - } - -protected: - /** - * Sets display offset of first item. - * - * @param offset The offset. - */ - virtual void setOffset(int32_t offset); - - /** - * Gets display offset of first item. - * - * @return The offset. - */ - virtual int32_t getOffset() const; - - /** - * Get the position for an item. The position should ensure that the item is in view as - * defined by the semantics of the actual scroll class. If the item is already in view, - * the current offset is returned and not the offset of the given item. - * - * @param itemIndex Zero-based index of the item. - * - * @return The position for item. - */ - virtual int32_t getPositionForItem(int16_t itemIndex) = 0; - - /** - * Gets normalized offset from a given offset from 0 down to -numItems*itemSize. - * - * @param offset The offset. - * - * @return The normalized offset. - */ - int getNormalizedOffset(int offset) const; - - /** - * Keep offset inside limits. Return the new offset that is inside the limits of the - * scroll list, with the overShoot value added at both ends of the list. - * - * @param newOffset The new offset. - * @param overShoot The over shoot. - * - * @return The new offset inside the limits. - */ - virtual int32_t keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) const = 0; - - /** - * Gets nearest offset aligned to a multiple of itemSize. - * - * @param offset The offset. - * - * @return The nearest aligned offset. - */ - virtual int32_t getNearestAlignedOffset(int32_t offset) const; - - /** - * Animate to a new position/offset using the given number of steps. - * - * @param position The new position. - * @param steps (Optional) The steps. - */ - virtual void animateToPosition(int32_t position, int16_t steps = -1); - - /** Values that represent animation states. */ - enum AnimationState - { - NO_ANIMATION, ///< No animation - ANIMATING_GESTURE, ///< Animating a gesture - ANIMATING_DRAG ///< Animating a drag - }; - - DrawableList list; ///< The list - int16_t numberOfDrawables; ///< Number of drawables - int16_t distanceBeforeAlignedItem; ///< The distance before aligned item - - int16_t itemSize; ///< Size of the item (including margin) - uint16_t swipeAcceleration; ///< The swipe acceleration x10 - uint16_t dragAcceleration; ///< The drag acceleration x10 - uint16_t maxSwipeItems; ///< The maximum swipe items - EasingEquation easingEquation; ///< The easing equation used for animation - uint16_t defaultAnimationSteps; ///< The animation steps - uint8_t overshootPercentage; ///< The overshoot percentage when dragging - - GenericCallback* itemSelectedCallback; ///< The item selected callback - GenericCallback<>* itemLockedInCallback; ///< The item locked in callback - GenericCallback<>* animationEndedCallback; ///< The animation ended callback - GenericCallback* itemPressedCallback; ///< The item pressed callback - - AnimationState currentAnimationState; ///< The current animation state - int gestureStep; ///< The current gesture step - int gestureStepsTotal; ///< The total gesture steps - int gestureStart; ///< The gesture start - int gestureEnd; ///< The gesture end - - int16_t xClick; ///< The x coordinate of a click - int16_t yClick; ///< The y coordinate of a click - int32_t initialSwipeOffset; ///< The initial swipe offset - - bool draggableX; ///< Is the container draggable in the horizontal direction. - bool draggableY; ///< Is the container draggable in the vertical direction. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCROLLBASE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp deleted file mode 100644 index 30208ed..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollList.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/scrollers/ScrollList.hpp - * - * Declares the touchgfx::ScrollList class. - */ -#ifndef TOUCHGFX_SCROLLLIST_HPP -#define TOUCHGFX_SCROLLLIST_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A simple list of scrolling drawables. Since a long list of drawables only display a few of - * items at any one time, the drawables are re-used to preserve resources. - * - * @see DrawableList - */ -class ScrollList : public ScrollBase -{ -public: - ScrollList(); - - virtual void setWidth(int16_t width); - - virtual void setHeight(int16_t height); - - virtual void setDrawableSize(int16_t drawableSize, int16_t drawableMargin); - - /** - * Setup a list of drawables and provide a function to call to update a given Drawable - * with new contents. - * - * @param [in] drawableListItems The drawables allocated. - * @param [in] updateDrawableCallback A callback to update the contents of a specific - * drawable with a specific item. - * - * @see DrawableList::setDrawables - */ - virtual void setDrawables(DrawableListItemsInterface& drawableListItems, GenericCallback& updateDrawableCallback); - - /** - * Sets window size, i.e. the number of items that should always be visible. The default - * value is 1. If three items are visible on the display and window size is set to three, - * no part of the screen will be blank (unless the list contains less than three items - * and the list is not circular). - * - * @param items The number of items that should always be visible. - * - * @note This only applies to non-circular lists. - */ - void setWindowSize(int16_t items); - - /** - * Sets distance offset before and after the "visible" drawables in the ScrollList. This - * allows the actual area where widgets are placed to have a little extra area where - * parts of drawables can be seen. For example if the ScrollList is 200, each drawable - * is 50 and distance before and distance after are 25, then there is room for three - * visible drawables inside the ScrollList. When scrolling, part of the scrolled out - * drawables can be seen before and after the three drawables. In this case 25/50 = 50% - * of a drawable can be seen before and after the three drawables in the ScrollList. - * - * @param paddingBefore The distance before the first drawable in the ScrollList. - * @param paddingAfter The distance after the last drawable in the ScrollList. - * - * @see getPaddingBefore, getPaddingAfter - */ - void setPadding(int16_t paddingBefore, int16_t paddingAfter); - - /** - * Gets distance before first drawable in ScrollList. - * - * @return The distance before. - * - * @see setPadding, getPaddingAfter - */ - int16_t getPaddingBefore() const; - - /** - * Gets distance after last drawable in ScrollList. - * - * @return The distance after the last drawable in the ScrollList. - * - * @see setPadding, getPaddingBefore - */ - int16_t getPaddingAfter() const; - - /** - * Set snapping. If snapping is false, the items can flow freely. If snapping is true, - * the items will snap into place so an item is always in the "selected" spot. - * - * @param snap true to snap. - * - * @see getSnapping - */ - void setSnapping(bool snap); - - /** - * Gets the current snap stetting. - * - * @return true if snapping is set, false otherwise. - * - * @see setSnapping - */ - bool getSnapping() const; - - /** - * Gets an item. - * - * @param drawableIndex Zero-based index of the drawable. - * - * @return The item. - */ - int16_t getItem(int16_t drawableIndex) - { - return list.getItemIndex(drawableIndex); - } - - virtual void handleClickEvent(const ClickEvent& event); - -protected: - virtual int32_t getPositionForItem(int16_t itemIndex); - - virtual int32_t getNearestAlignedOffset(int32_t offset) const; - - virtual int32_t keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) const; - - int16_t paddingAfterLastItem; ///< The distance after last item - bool snapping; ///< Is snapping enabled? - int windowSize; ///< Number of items that should always be visible -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCROLLLIST_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp deleted file mode 100644 index 640d16c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheel.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/scrollers/ScrollWheel.hpp - * - * Declares the touchgfx::ScrollWheel class. - */ -#ifndef TOUCHGFX_SCROLLWHEEL_HPP -#define TOUCHGFX_SCROLLWHEEL_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A scroll wheel is very much like the digit selector on a padlock with numbers. The digits - * always snap into place and exactly one number is always the "selected" number. Thus, - * a scroll wheel is a list of identically styled drawables which can be scrolled - * through. One of the items in the list is the "selected" one, and scrolling through - * the list can be done in various ways. The ScrollWheel uses the DrawableList to make - * it possible to handle a huge number of items using only a limited number of drawables - * by reusing drawables that are no longer in view. - * - * @see ScrollWheelBase, DrawableList, ScrollWheelWithSelectionStyle - */ -class ScrollWheel : public ScrollWheelBase -{ -public: - /** - * Sets the drawables used by the scroll wheel. The drawables are updated through a - * callback will put the right data in the drawable. - * - * @param [in] drawableListItems Number of drawables. - * @param [in] updateDrawableCallback The update drawable callback. - */ - virtual void setDrawables(DrawableListItemsInterface& drawableListItems, GenericCallback& updateDrawableCallback); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCROLLWHEEL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp deleted file mode 100644 index 8998699..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelBase.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/scrollers/ScrollWheelBase.hpp - * - * Declares the touchgfx::ScrollWheelBase class. - */ -#ifndef TOUCHGFX_SCROLLWHEELBASE_HPP -#define TOUCHGFX_SCROLLWHEELBASE_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A base class for a scroll wheel. A scroll wheel is very much like the digit selector on a - * padlock with numbers. The digits always snap into place and exactly one number is - * always the "selected" number. Using ScrollWheel, all elements look the same, but an - * underlying bitmap can help emphasize the "selected" element. The - * ScrollWheelWithSelectionStyle can have a completely different style on the "selected" - * item - the font can be larger or bold and images can change color - this can help to - * give a kind of 3D effect using very few resources. - * - * @see ScrollWheel, ScrollWheelWithSelectionStyle - */ -class ScrollWheelBase : public ScrollBase -{ -public: - ScrollWheelBase(); - - /** - * Sets selected item offset, measured in pixels, from the edge of the widget. The - * offset is the relative x coordinate if the ScrollWheel is horizontal, otherwise it is - * the relative y coordinate. If this value is zero, the selected item is placed at the - * very start of the widget. - * - * @param offset The offset. - * - * @see getSelectedItemOffset - */ - virtual void setSelectedItemOffset(int16_t offset); - - /** - * Gets offset of selected item measured in pixels relative to the start of the widget. - * - * @return The selected item offset. - * - * @see setSelectedItemOffset - */ - virtual int16_t getSelectedItemOffset() const; - - /** - * Gets selected item. If an animation is in progress, the item that is being scrolled - * to is returned, not the item that happens to be flying by at the time. - * - * @return The selected item. - */ - int getSelectedItem() const; - - virtual int32_t keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) const; - - virtual void handleClickEvent(const ClickEvent& event); - - virtual void handleDragEvent(const DragEvent& event); - - virtual void handleGestureEvent(const GestureEvent& event); - - /** - * Sets Callback which will be called when the ScrollWheel animates to a new item. - * - * @param [in] callback The callback. - */ - void setAnimateToCallback(GenericCallback& callback); - -protected: - virtual int32_t getPositionForItem(int16_t itemIndex); - - virtual void animateToPosition(int32_t position, int16_t steps = -1); - - GenericCallback* animateToCallback; ///< The animate to callback -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCROLLWHEELBASE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp deleted file mode 100644 index d07ff75..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp +++ /dev/null @@ -1,187 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.hpp - * - * Declares the touchgfx::ScrollWheelWithSelectionStyle class. - */ -#ifndef TOUCHGFX_SCROLLWHEELWITHSELECTIONSTYLE_HPP -#define TOUCHGFX_SCROLLWHEELWITHSELECTIONSTYLE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A scroll wheel is very much like the digit selector on a padlock with numbers. The digits - * always snap into place and exactly one number is always the "selected" number. - * Similar to an ordinary ScrollWheel, but with a different style for the selected item - * which can thus be bold, have a different color or similar effect to highlight it and - * help create a 3D effect using very few resources. - * - * @see DrawableList, ScrollWheel - */ -class ScrollWheelWithSelectionStyle : public ScrollWheelBase -{ -public: - ScrollWheelWithSelectionStyle(); - - virtual void setWidth(int16_t width); - - virtual void setHeight(int16_t height); - - virtual void setHorizontal(bool horizontal); - - virtual void setCircular(bool circular); - - virtual void setNumberOfItems(int16_t numberOfItems); - - virtual void setSelectedItemOffset(int16_t offset); - - /** - * Sets selected item extra size to make the size of the area for the center drawables - * larger. - * - * @param extraSizeBefore The extra size before. - * @param extraSizeAfter The extra size after. - * - * @see setSelectedItemOffset - */ - virtual void setSelectedItemExtraSize(int16_t extraSizeBefore, int16_t extraSizeAfter); - - /** - * Gets selected item extra size before. - * - * @return The selected item extra size before. - * - * @see setSelectedItemExtraSize - */ - virtual int16_t getSelectedItemExtraSizeBefore() const; - - /** - * Gets selected item extra size after. - * - * @return The selected item extra size after. - * - * @see setSelectedItemExtraSize - */ - virtual int16_t getSelectedItemExtraSizeAfter() const; - - /** - * Sets margin around selected item. This like an invisible area added before and after - * the selected item (including extra size). - * - * @param marginBefore The margin before. - * @param marginAfter The margin after. - * - * @see setSelectedItemOffset, setSelectedItemExtraSize - */ - virtual void setSelectedItemMargin(int16_t marginBefore, int16_t marginAfter); - - /** - * Gets selected item margin before. - * - * @return The selected item margin before. - * - * @see setSelectedItemMargin - */ - virtual int16_t getSelectedItemMarginBefore() const; - - /** - * Gets selected item margin after. - * - * @return The selected item margin after. - * - * @see setSelectedItemMargin - */ - virtual int16_t getSelectedItemMarginAfter() const; - - /** - * Sets the selected item offset. This is the distance from the beginning of the - * ScrollWheel measured in pixels. The distance before and after that should also be - * drawn using the center drawables - for example to extend area of emphasized elements - - * can also be specified. Further, if a gap is needed between the "normal" drawables and - * the center drawables - for example to give the illusion that that items disappear - * under a graphical element, only to appear in the center. - * - * This is a combination of setSelectedItemOffset, setSelectedItemExtraSize and - * setSelectedItemMargin. - * - * @param offset The offset of the selected item. - * @param extraSizeBefore The extra size before the selected item. - * @param extraSizeAfter The extra size after the selected item. - * @param marginBefore The margin before the selected item. - * @param marginAfter The margin after the selected item. - * - * @see setSelectedItemOffset, setSelectedItemExtraSize, setSelectedItemMargin - */ - virtual void setSelectedItemPosition(int16_t offset, int16_t extraSizeBefore, int16_t extraSizeAfter, int16_t marginBefore, int16_t marginAfter); - - /** - * @copydoc ScrollWheelBase::setDrawableSize - */ - virtual void setDrawableSize(int16_t drawableSize, int16_t drawableMargin); - - /** - * Setups the widget. Numerous parameters control the position of the widget, the two - * scroll lists inside and the values in them. - * - * @param [in] drawableListItems Number of drawables in outer array. - * @param [in] updateDrawableCallback The callback to update a drawable. - * @param [in] centerDrawableListItems Number of drawables in center array. - * @param [in] updateCenterDrawableCallback The callback to update a center drawable. - */ - virtual void setDrawables(DrawableListItemsInterface& drawableListItems, GenericCallback& updateDrawableCallback, - DrawableListItemsInterface& centerDrawableListItems, GenericCallback& updateCenterDrawableCallback); - - virtual void itemChanged(int itemIndex); - - virtual void initialize() - { - ScrollWheelBase::initialize(); - list1.refreshDrawables(); - list2.refreshDrawables(); - } - -protected: - virtual void setOffset(int32_t offset); - - /** - * Refresh drawable lists layout. Ensure that the three DrawableLists are places - * correctly and setup properly. This is typically done after the - * ScrollWheelWithSelectionStyle has been resized or the size of the selected item is - * changed. - */ - void refreshDrawableListsLayout(); - - int16_t drawablesInFirstList; ///< List of drawables in firsts - DrawableList list1; ///< The center list - DrawableList list2; ///< The list for items not in the center - int16_t extraSizeBeforeSelectedItem; ///< The distance before selected item - int16_t extraSizeAfterSelectedItem; ///< The distance after selected item - int16_t marginBeforeSelectedItem; ///< The distance before selected item - int16_t marginAfterSelectedItem; ///< The distance after selected item - - DrawableListItemsInterface* drawables; ///< The drawables at the beginning and end of the scroll wheel - DrawableListItemsInterface* centerDrawables; ///< The drawables at the center of the scroll wheel - - GenericCallback* originalUpdateDrawableCallback; ///< The original update drawable callback - GenericCallback* originalUpdateCenterDrawableCallback; ///< The original update center drawable callback -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCROLLWHEELWITHSELECTIONSTYLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp deleted file mode 100644 index 93efb1c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/ClickEvent.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/events/ClickEvent.hpp - * - * Declares the touchgfx::ClickEvent class. - */ -#ifndef TOUCHGFX_CLICKEVENT_HPP -#define TOUCHGFX_CLICKEVENT_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A click event. The semantics of this event is slightly depending on hardware platform. - * ClickEvents are generated by the HAL layer. - * - * @see Event - */ -class ClickEvent : public Event -{ -public: - /** Values that represent click event types. */ - enum ClickEventType - { - PRESSED, ///< An enum constant representing the pressed option - RELEASED, ///< An enum constant representing the released option - CANCEL ///< An enum constant representing the cancel option - }; - - /** - * Initializes a new instance of the ClickEvent class. - * - * @param type The type of the click event. - * @param x The x coordinate of the click event. - * @param y The y coordinate of the click event. - * @param force (Optional) The force of the click. On touch displays this usually means how - * hard the user pressed on the display. On the windows platform, this - * will always be zero. - */ - ClickEvent(ClickEventType type, int16_t x, int16_t y, int16_t force = 0) - : clickEventType(type), clickX(x), clickY(y), clickForce(force) - { - } - - /** - * Copy constructor. - * - * @param clickEvent The click event. - */ - ClickEvent(const ClickEvent& clickEvent) - { - *this = clickEvent; - } - - /** - * Gets the x coordinate of this event. - * - * @return The x coordinate of this event. - */ - int16_t getX() const - { - return clickX; - } - - /** - * Gets the y coordinate of this event. - * - * @return The y coordinate of this event. - */ - int16_t getY() const - { - return clickY; - } - - /** - * Sets the x coordinate of this event. - * - * @param x The x coordinate of this event. - */ - void setX(int16_t x) - { - clickX = x; - } - - /** - * Sets the y coordinate of this event. - * - * @param y The y coordinate of this event. - */ - void setY(int16_t y) - { - clickY = y; - } - - /** - * Sets the click type of this event. - * - * @param type The type to set. - */ - void setType(ClickEventType type) - { - clickEventType = type; - } - - /** - * Gets the click type of this event. - * - * @return The click type of this event. - */ - ClickEventType getType() const - { - return clickEventType; - } - - /** - * Gets the force of the click. On touch displays this usually means how hard the user - * pressed on the display. On the windows platform, this will always be zero. - * - * @return The force of the click. - */ - int16_t getForce() const - { - return clickForce; - } - - /** - * Gets event type. - * - * @return The type of this event. - */ - virtual Event::EventType getEventType() const - { - return Event::EVENT_CLICK; - } - - /** - * Assignment operator. - * - * @param clickEvent The click event. - * - * @return A shallow copy of this object. - */ - const ClickEvent& operator=(const ClickEvent& clickEvent) - { - clickEventType = clickEvent.clickEventType; - clickX = clickEvent.clickX; - clickY = clickEvent.clickY; - clickForce = clickEvent.clickForce; - return *this; - } - -private: - ClickEventType clickEventType; - int16_t clickX; - int16_t clickY; - int16_t clickForce; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CLICKEVENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp deleted file mode 100644 index 9165914..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/DragEvent.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/events/DragEvent.hpp - * - * Declares the touchgfx::DragEvent class. - */ -#ifndef TOUCHGFX_DRAGEVENT_HPP -#define TOUCHGFX_DRAGEVENT_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A drag event. The only drag event currently supported is DRAGGED, - * which will be issued every time the input system detects a drag. - * - * @see Event - */ -class DragEvent : public Event -{ -public: - /** Values that represent drag event types. */ - enum DragEventType - { - DRAGGED ///< An enum constant representing the dragged option - }; - - /** - * Initializes a new instance of the DragEvent class. - * - * @param type The type of the drag event. - * @param oldX The x coordinate of the drag start position (dragged from) - * @param oldY The y coordinate of the drag start position (dragged from) - * @param newX The x coordinate of the new position (dragged to) - * @param newY The y coordinate of the new position (dragged to) - */ - DragEvent(DragEventType type, int16_t oldX, int16_t oldY, int16_t newX, int16_t newY) - : dragEventType(type), dragOldX(oldX), dragOldY(oldY), dragNewX(newX), dragNewY(newY) - { - } - - /** - * Copy constructor. - * - * @param dragEvent The drag event. - */ - DragEvent(const DragEvent& dragEvent) - { - *this = dragEvent; - } - - /** - * Gets the old x coordinate, i.e. where the drag operation was - * started (dragged from). - * - * @return The old x coordinate, i.e. where the drag operation was started (dragged from). - */ - int16_t getOldX() const - { - return dragOldX; - } - - /** - * Gets the old y coordinate, i.e. where the drag operation was - * started (dragged from). - * - * @return The old y coordinate, i.e. where the drag operation was started (dragged from). - */ - int16_t getOldY() const - { - return dragOldY; - } - - /** - * Gets the new x coordinate (dragged to). - * - * @return The new x coordinate (dragged to). - */ - int16_t getNewX() const - { - return dragNewX; - } - - /** - * Gets the new x coordinate (dragged to). - * - * @return The new y coordinate (dragged to). - */ - int16_t getNewY() const - { - return dragNewY; - } - - /** - * Gets the type of this drag event. - * - * @return The type of this drag event. - */ - DragEventType getType() const - { - return dragEventType; - } - - /** - * Gets the distance in x coordinates (how long was the drag). - * - * @return The distance of this drag event. - */ - int16_t getDeltaX() const - { - return dragNewX - dragOldX; - } - - /** - * Gets the distance in y coordinates (how long was the drag). - * - * @return The distance of this drag event. - */ - int16_t getDeltaY() const - { - return dragNewY - dragOldY; - } - - /** - * Gets event type. - * - * @return The type of this event. - */ - virtual Event::EventType getEventType() const - { - return Event::EVENT_DRAG; - } - - /** - * Assignment operator. - * - * @param dragEvent The drag event. - * - * @return A shallow copy of this object. - */ - const DragEvent& operator=(const DragEvent& dragEvent) - { - dragEventType = dragEvent.dragEventType; - dragOldX = dragEvent.dragOldX; - dragOldY = dragEvent.dragOldY; - dragNewX = dragEvent.dragNewX; - dragNewY = dragEvent.dragNewY; - return *this; - } - -private: - DragEventType dragEventType; - int16_t dragOldX; - int16_t dragOldY; - int16_t dragNewX; - int16_t dragNewY; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DRAGEVENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp deleted file mode 100644 index 4188002..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/events/GestureEvent.hpp +++ /dev/null @@ -1,150 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/events/GestureEvent.hpp - * - * Declares the touchgfx::GestureEvent class. - */ -#ifndef TOUCHGFX_GESTUREEVENT_HPP -#define TOUCHGFX_GESTUREEVENT_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A gesture event. The only gesture events currently supported is #SWIPE_HORIZONTAL and - * #SWIPE_VERTICAL, which will be issued every time the input system detects a swipe. - * - * @see Event - */ -class GestureEvent : public Event -{ -public: - /** Values that represent gesture types. */ - enum GestureEventType - { - SWIPE_HORIZONTAL, ///< An enum constant representing a horizontal swipe - SWIPE_VERTICAL ///< An enum constant representing a vertical swipe - }; - - /** - * Constructor. Create a gesture event of the specified type with the specified - * coordinates. - * - * @param type The type of the gesture event. - * @param velocity The velocity of this gesture (swipe) - * @param x The x coordinate of the gesture. - * @param y The y coordinate of the gesture. - */ - GestureEvent(GestureEventType type, int16_t velocity, int16_t x, int16_t y) - : gestureEventType(type), - gestureVelocity(velocity), - gestureX(x), - gestureY(y) - { - } - - /** - * Copy constructor. - * - * @param gestureEvent The gesture event. - */ - GestureEvent(const GestureEvent& gestureEvent) - { - *this = gestureEvent; - } - - /** - * Gets the velocity of this gesture event. - * - * @return The velocity of this gesture event. - */ - int16_t getVelocity() const - { - return gestureVelocity; - } - - /** - * Gets the type of this gesture event. - * - * @return The type of this gesture event. - */ - GestureEventType getType() const - { - return gestureEventType; - } - - /** - * Gets the x coordinate of this gesture event. - * - * @return The x coordinate of this gesture event. - */ - int16_t getX() const - { - return gestureX; - } - - /** - * Gets the y coordinate of this gesture event. - * - * @return The y coordinate of this gesture event. - */ - int16_t getY() const - { - return gestureY; - } - - /** - * Gets event type. - * - * @return The type of this event. - */ - virtual Event::EventType getEventType() const - { - return Event::EVENT_GESTURE; - } - - /** - * Assignment operator. - * - * @param gestureEvent The gesture event. - * - * @return A shallow copy of this object. - */ - const GestureEvent& operator=(const GestureEvent& gestureEvent) - { - gestureEventType = gestureEvent.gestureEventType; - gestureVelocity = gestureEvent.gestureVelocity; - gestureX = gestureEvent.gestureX; - gestureY = gestureEvent.gestureY; - return *this; - } - -private: - /** Initializes a new instance of the GestureEvent class. */ - GestureEvent() - : gestureEventType(SWIPE_HORIZONTAL), gestureVelocity(0), gestureX(0), gestureY(0) - { - } - - GestureEventType gestureEventType; - int16_t gestureVelocity; - int16_t gestureX; - int16_t gestureY; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GESTUREEVENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp deleted file mode 100644 index a16b701..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Atomic.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/Atomic.hpp - * - * Declares functions for performing atomic operations. - */ -#ifndef TOUCHGFX_ATOMIC_HPP -#define TOUCHGFX_ATOMIC_HPP - -/** - * Defines a atomic write on supported platforms - */ - -#if defined(WIN32) || defined(_WIN32) - -#include -/** Defines the atomic type. */ -typedef LONG atomic_t; - -/** - * Makes a atomic write of value to target. - * - * @param [out] target The value to write to. - * @param value The value to write. - */ -inline void atomic_set(atomic_t& target, atomic_t value) -{ - InterlockedExchange(&target, value); -} - -#elif defined(__GNUC__) && !defined(__ARMCC_VERSION) - -#include -/** Defines the atomic type. */ -typedef sig_atomic_t atomic_t; - -/** - * Makes a atomic write of value to target. - * - * @param [out] target The value to write to. - * @param value The value to write. - */ -inline void atomic_set(atomic_t& target, atomic_t value) -{ - __sync_synchronize(); - target = value; -} - -#elif defined(__IAR_SYSTEMS_ICC__) - -/** Defines the atomic type. */ -typedef unsigned long atomic_t; - -/** - * Makes a atomic write of value to target. - * - * @param [out] target The value to write to. - * @param value The value to write. - * - * @note Assume that 32 bit writes are atomic. - */ -inline void atomic_set(atomic_t& target, atomic_t value) -{ - target = value; -} -#elif defined(__ARMCC_VERSION) -/** Defines the atomic type. */ -typedef unsigned long atomic_t; - -/** - * Makes a atomic write of value to target. - * - * @param [out] target The value to write to. - * @param value The value to write. - */ -inline void atomic_set(atomic_t& target, atomic_t value) -{ - target = value; -} -#else - -#error "Compiler/platform not supported" - -#endif - -#endif // TOUCHGFX_ATOMIC_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp deleted file mode 100644 index 945c4ea..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BlitOp.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/BlitOp.hpp - * - * Declares constants for specifying blit operation capabilities. - */ -#ifndef TOUCHGFX_BLITOP_HPP -#define TOUCHGFX_BLITOP_HPP - -#include - -namespace touchgfx -{ -/** The Blit Operations. */ -enum BlitOperations -{ - BLIT_OP_COPY = 1 << 0, ///< Copy the source to the destination - BLIT_OP_FILL = 1 << 1, ///< Fill the destination with color - BLIT_OP_COPY_WITH_ALPHA = 1 << 2, ///< Copy the source to the destination using the given alpha - BLIT_OP_FILL_WITH_ALPHA = 1 << 3, ///< Fill the destination with color using the given alpha - BLIT_OP_COPY_WITH_TRANSPARENT_PIXELS = 1 << 4, ///< Deprecated, ignored. (Copy the source to the destination, but not the transparent pixels) - BLIT_OP_COPY_ARGB8888 = 1 << 5, ///< Copy the source to the destination, performing per-pixel alpha blending - BLIT_OP_COPY_ARGB8888_WITH_ALPHA = 1 << 6, ///< Copy the source to the destination, performing per-pixel alpha blending and blending the result with an image-wide alpha - BLIT_OP_COPY_L8 = 1 << 7, ///< Copy the L8 source to the destination using the given alpha - BLIT_OP_COPY_A4 = 1 << 8, ///< Copy 4-bit source text to destination, performing per-pixel alpha blending - BLIT_OP_COPY_A8 = 1 << 9, ///< Copy 8-bit source text to destination, performing per-pixel alpha blending - BLIT_OP_COPY_16BIT = 1 << 10, ///< Copy 16-bit regardless of frame buffer format - BLIT_OP_FILL_16BIT = 1 << 11 ///< Fill 16-bit regardless of frame buffer format -}; - -/** - * BlitOp instances carry the required information for performing operations on the LCD - * (framebuffer) using DMA. - */ -struct BlitOp -{ - uint32_t operation; ///< The operation to perform @see BlitOperations - const uint16_t* pSrc; ///< Pointer to the source (pixels or indexes) - const uint8_t* pClut; ///< Pointer to the source CLUT entires - colortype color; ///< Color to fill - uint16_t* pDst; ///< Pointer to the destination - uint16_t nSteps; ///< The number of pixels in a line - uint16_t nLoops; ///< The number of lines - uint16_t srcLoopStride; ///< The number of bytes to stride the source after every loop - uint16_t dstLoopStride; ///< The number of bytes to stride the destination after every loop - uint8_t alpha; ///< The alpha to use - uint8_t srcFormat; ///< The source format @see Bitmap::BitmapFormat - uint8_t dstFormat; ///< The destination format @see Bitmap::BitmapFormat - bool replaceBgAlpha; ///< Replace the background per pixel alpha value with 255 = solid - bool replaceFgAlpha; ///< Replace the fourground per pixel alpha value with 255 = solid -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BLITOP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp deleted file mode 100644 index 88f8ce2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/BoardConfiguration.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/BoardConfiguration.hpp - * - * Declares initialization functions for the hardware as well as for TouchGFX. - */ -#ifndef TOUCHGFX_BOARDCONFIGURATION_HPP -#define TOUCHGFX_BOARDCONFIGURATION_HPP - -namespace touchgfx -{ -/** - * Function to perform generic hardware initialization of the board. This function prototype is - * only provided as a convention. - */ -void hw_init(); - -/** - * Function to perform touchgfx initialization. This function prototype is only provided as a - * convention. - */ -void touchgfx_init(); - -} // namespace touchgfx - -#endif // TOUCHGFX_BOARDCONFIGURATION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp deleted file mode 100644 index 83c88b8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Buttons.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/Buttons.hpp - * - * Declares the touchgfx::Buttons class. - */ -#ifndef TOUCHGFX_BUTTONS_HPP -#define TOUCHGFX_BUTTONS_HPP - -namespace touchgfx -{ -/** A class for accessing a physical button. */ -class Buttons -{ -public: - /** Perform configuration of IO pins. */ - static void init(); - - /** - * Sample button states. - * - * @return the sampled state of the buttons. - */ - static unsigned int sample(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BUTTONS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp deleted file mode 100644 index be7e5e4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Config.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/Config.hpp - * - * Declares various macros defining which section to use during linking. - */ -#ifndef TOUCHGFX_CONFIG_HPP -#define TOUCHGFX_CONFIG_HPP - -/** A macro to generate the passed argument in double quotes */ -#define STR(X) STR_I(X) -/** A macro to generate the passed argument in double quotes */ -#define STR_I(X) #X - -/** - * Compiler specific macros. - * LOCATION_PRAGMA is a macro for placing elements in the proper memory section - * LOCATION_ATTRIBUTE is a macro for placing attributes in the proper memory section - * FORCE_INLINE_FUNCTION is used to force inline of time critical functions. - * TOUCHGFX_DEPRECATED is used to mark a function deprecated. - */ -#ifdef SIMULATOR - -#define LOCATION_PRAGMA(name) -#define LOCATION_PRAGMA_NOLOAD(name) -#define LOCATION_ATTRIBUTE(name) -#define LOCATION_ATTRIBUTE_NOLOAD(name) -#define FORCE_INLINE_FUNCTION inline -#if defined(__GNUC__) -#define TOUCHGFX_DEPRECATED(message, decl) decl __attribute__((deprecated(message))) -#elif _MSC_VER >= 1900 -// Visual Studio 2015 or newer -#define TOUCHGFX_DEPRECATED(message, decl) [[deprecated("Deprecated: " message)]] decl -#else -#define TOUCHGFX_DEPRECATED(message, decl) decl -#endif - -#elif defined(__GNUC__) && !defined(__ARMCC_VERSION) - -// xgcc -#define LOCATION_PRAGMA(name) -#define LOCATION_PRAGMA_NOLOAD(name) -#define LOCATION_ATTRIBUTE(name) __attribute__((section(STR(name)))) __attribute__((aligned(4))) -#define LOCATION_ATTRIBUTE_NOLOAD(name) __attribute__((section(STR(name)))) __attribute__((aligned(4))) -#define FORCE_INLINE_FUNCTION __attribute__((always_inline)) inline -#define TOUCHGFX_DEPRECATED(message, decl) [[deprecated(message)]] decl - -#elif defined __ICCARM__ - -// IAR -#define LOCATION_PRAGMA(name) _Pragma(STR(location = name)) -#define LOCATION_PRAGMA_NOLOAD(name) _Pragma(STR(location = name)) -#define LOCATION_ATTRIBUTE(name) -#define LOCATION_ATTRIBUTE_NOLOAD(name) -#define FORCE_INLINE_FUNCTION _Pragma("inline=forced") -#if __IAR_SYSTEMS_ICC__ >= 9 -#define TOUCHGFX_DEPRECATED(message, decl) [[deprecated(message)]] decl -#else -#define TOUCHGFX_DEPRECATED(message, decl) decl -#endif -#pragma diag_suppress = Pe236 - -#elif defined(__ARMCC_VERSION) - -// Keil -#define LOCATION_PRAGMA(name) -#define LOCATION_PRAGMA_NOLOAD(name) -#define LOCATION_ATTRIBUTE(name) __attribute__((section(name))) __attribute__((aligned(4))) -#define LOCATION_ATTRIBUTE_NOLOAD(name) __attribute__((section(name), zero_init)) __attribute__((aligned(4))) -#define FORCE_INLINE_FUNCTION inline -#if __ARMCC_VERSION >= 6000000 -// Only newer Keil support message to be given -#define TOUCHGFX_DEPRECATED(message, decl) decl __attribute__((deprecated(message))) -#else -#define TOUCHGFX_DEPRECATED(message, decl) decl __attribute__((deprecated)) -#endif - -#else - -// Other/Unknown -#define LOCATION_PRAGMA(name) -#define LOCATION_PRAGMA_NOLOAD(name) -#define LOCATION_ATTRIBUTE(name) -#define LOCATION_ATTRIBUTE_NOLOAD(name) -#define FORCE_INLINE_FUNCTION -#define TOUCHGFX_DEPRECATED(message, decl) decl - -#endif - -/** A macro for placing Font Glyph in memory. */ -#define FONT_GLYPH_LOCATION_FLASH_PRAGMA LOCATION_PRAGMA("FontFlashSection") -/** A macro for placing Font Glyph attribute in memory. */ -#define FONT_GLYPH_LOCATION_FLASH_ATTRIBUTE LOCATION_ATTRIBUTE("FontFlashSection") - -/** A macro for placing Font table in memory. */ -#define FONT_TABLE_LOCATION_FLASH_PRAGMA LOCATION_PRAGMA("FontFlashSection") -/** A macro for placing Font table attribute in memory. */ -#define FONT_TABLE_LOCATION_FLASH_ATTRIBUTE LOCATION_ATTRIBUTE("FontFlashSection") - -/** A macro for placing Font lookup table in memory. */ -#define FONT_SEARCHTABLE_LOCATION_FLASH_PRAGMA LOCATION_PRAGMA("FontSearchFlashSection") -/** A macro for placing Font table attribute in memory. */ -#define FONT_SEARCHTABLE_LOCATION_FLASH_ATTRIBUTE LOCATION_ATTRIBUTE("FontSearchFlashSection") - -/** A macro for placing Font kerning in memory. */ -#define FONT_KERNING_LOCATION_FLASH_PRAGMA LOCATION_PRAGMA("FontSearchFlashSection") -/** A macro for placing Font kerning attribute in memory. */ -#define FONT_KERNING_LOCATION_FLASH_ATTRIBUTE LOCATION_ATTRIBUTE("FontSearchFlashSection") - -/** A macro for placing Text kerning in memory. */ -#define TEXT_LOCATION_FLASH_PRAGMA LOCATION_PRAGMA("TextFlashSection") -/** A macro for placing Text attribute in memory. */ -#define TEXT_LOCATION_FLASH_ATTRIBUTE LOCATION_ATTRIBUTE("TextFlashSection") - -/** A generic macro for placing an element in memory. */ -#define LOCATION_EXTFLASH_PRAGMA LOCATION_PRAGMA("ExtFlashSection") -/** A generic macro for placing an element attribute in memory. */ -#define LOCATION_EXTFLASH_ATTRIBUTE LOCATION_ATTRIBUTE("ExtFlashSection") - -/** - * To be able to use __restrict__ on the supported platform. The IAR compiler does not support - * this. - */ -#ifdef __GNUC__ -#define RESTRICT __restrict__ -#else -#define RESTRICT -#endif // __GNUC__ - -/** Use KEEP to make sure the compiler does not remove this. */ -#ifdef __ICCARM__ -#define KEEP __root -#else -#define KEEP -#endif - -#endif // TOUCHGFX_CONFIG_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp deleted file mode 100644 index d897ad8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/DMA.hpp +++ /dev/null @@ -1,292 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/DMA.hpp - * - * Declares the touchgfx::DMA_Queue (abstract), touchgfx::LockFreeDMA_Queue and - * touchgfx::DMA_Interface (abstract) classes. - */ -#ifndef TOUCHGFX_DMA_HPP -#define TOUCHGFX_DMA_HPP - -#include -#include -#include - -namespace touchgfx -{ -class DMA_Interface; - -/** - * This class provides an interface for a FIFO (circular) list used by DMA_Interface and - * descendants for storing BlitOp's. - */ -class DMA_Queue -{ - friend class DMA_Interface; - -public: - /** - * Query if this object is empty. - * - * @return true if the queue is empty. - */ - virtual bool isEmpty() = 0; - - /** - * Query if this object is full. - * - * @return true if the queue is full. - */ - virtual bool isFull() = 0; - - /** - * Adds the specified blitop to the queue. - * - * @param op The blitop to add. - */ - virtual void pushCopyOf(const BlitOp& op) = 0; - - /** Finalizes an instance of the DMA_Queue class. */ - virtual ~DMA_Queue() - { - } - -protected: - /** Initializes a new instance of the DMA_Queue class. */ - DMA_Queue() - { - } - - /** Pops an element from the queue. */ - virtual void pop() = 0; - - /** - * Gets the first element in the queue. - * - * @return The first element in the queue. - */ - virtual const BlitOp* first() = 0; -}; - -/** - * This implements a simple lock-free FIFO queue (single producer, single consumer) - * - * @see DMA_Queue - */ -class LockFreeDMA_Queue : public DMA_Queue -{ -public: - /** - * Constructs a lock-free queue. - * - * @param [out] mem Pointer to the memory used by the queue to store elements. - * @param n Number of elements the memory provided can contain. - */ - LockFreeDMA_Queue(BlitOp* mem, atomic_t n); - - virtual bool isEmpty(); - - virtual bool isFull(); - - virtual void pushCopyOf(const BlitOp& op); - -protected: - virtual void pop(); - - virtual const BlitOp* first(); - - BlitOp* q; ///< Pointer to the queue memory. - atomic_t capacity; ///< The number of elements the queue can contain. - atomic_t head; ///< Index to the head element. - atomic_t tail; ///< Index to the tail element. -}; - -/** - * DMA_Interface provides basic functionality and structure for processing "blit" operations - * using DMA. - */ -class DMA_Interface -{ -public: - /** - * Gets the blit capabilities of this DMA. - * - * @return The blit operations supported by this DMA implementation. - */ - virtual BlitOperations getBlitCaps() = 0; - - /** - * Inserts a BlitOp for processing. This also potentially starts the DMA controller, if - * not already running. - * - * @param op The operation to add. - */ - virtual void addToQueue(const BlitOp& op); - - /** This function blocks until all DMA transfers in the queue have been completed. */ - virtual void flush() - { - waitForFrameBufferSemaphore(); - } - - /** Perform initialization. Does nothing in this base class. */ - virtual void initialize() - { - } - - /** - * Query if the DMA is running. - * - * @return true if a DMA operation is currently in progress. - */ - bool isDMARunning() - { - return isRunning; - } - - /** - * Sets whether or not a DMA operation is allowed to begin. Used in single-buffering to - * avoid changing the framebuffer while display is being updated. - * - * @param allowed true if DMA transfers are allowed. - */ - void setAllowed(bool allowed) - { - isAllowed = allowed; - } - - /** - * Gets whether a DMA operation is allowed to begin. Used in single-buffering to avoid - * changing the framebuffer while display is being updated. - * - * @return true if DMA is allowed to start, false if not. - */ - bool getAllowed() const - { - return isAllowed; - } - - /** Signals that DMA transfers can start. If any elements are in the queue, start it. */ - virtual void start(); - - /** - * This function is called automatically by the framework when a DMA interrupt has been - * received. - * - * This function is called automatically by the framework when a DMA interrupt has been - * received. - */ - virtual void signalDMAInterrupt() = 0; - - /** - * Query if the DMA queue is empty. - * - * @return 1 if DMA queue is empty, else 0. - */ - uint8_t isDmaQueueEmpty(); - - /** - * Query if the DMA queue is full. - * - * @return 1 if DMA queue is full, else 0. - */ - uint8_t isDmaQueueFull(); - - /** - * Function for obtaining the DMA type of the concrete DMA_Interface implementation. As - * default, will return DMA_TYPE_GENERIC type value. - * - * @return a DMAType value of the concrete DMA_Interface implementation. - */ - virtual DMAType getDMAType() - { - return DMA_TYPE_GENERIC; - } - - /** Finalizes an instance of the DMA_Interface class. */ - virtual ~DMA_Interface() - { - } - -protected: - /** - * Constructs a DMA Interface object. - * - * @param [in] dmaQueue Reference to the queue of DMA operations. - */ - DMA_Interface(DMA_Queue& dmaQueue) - : queue(dmaQueue), isRunning(false), isAllowed(false) - { - } - - /** Performs a queued blit-op. */ - virtual void execute(); - - /** To be called when blit-op has been performed. */ - virtual void executeCompleted(); - - /** - * Called when elements are added to the DMA-queue. - * - * @note The framebuffer must be locked before this method returns if the DMA-queue is non- - * empty. - */ - virtual void seedExecution(); - - /** - * Configures blit-op hardware for a 2D copy as specified by blitOp. - * - * @param blitOp The operation to execute. - */ - virtual void setupDataCopy(const BlitOp& blitOp) = 0; - - /** - * Configures blit-op hardware for a 2D fill as specified by blitOp. - * - * @param blitOp The operation to execute. - */ - virtual void setupDataFill(const BlitOp& blitOp) = 0; - - /** - * Configures blit-op hardware for alpha-blending. - * - * @param alpha The alpha-blending value to apply. - */ - virtual void enableAlpha(uint8_t alpha); - - /** Configures blit-op hardware for solid operation (no alpha-blending) */ - virtual void disableAlpha(); - - /** - * Configures blit-op hardware for alpha-blending while simultaneously skipping - * transparent pixels. - * - * @param alpha The alpha-blending value to apply. - */ - virtual void enableCopyWithTransparentPixels(uint8_t alpha); - - /** - * Waits until framebuffer semaphore is available (i.e. neither DMA or application is - * accessing the framebuffer). - */ - virtual void waitForFrameBufferSemaphore(); - - DMA_Queue& queue; ///< Reference to the DMA queue - bool isRunning; ///< true if a DMA transfer is currently ongoing. - volatile bool isAllowed; ///< true if DMA transfers are currently allowed. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DMA_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp deleted file mode 100644 index 329f001..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FlashDataReader.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/FlashDataReader.hpp - * - * Declares the touchgfx::FlashDataReader class. - */ -#ifndef TOUCHGFX_FLASHDATAREADER_HPP -#define TOUCHGFX_FLASHDATAREADER_HPP - -#include - -namespace touchgfx -{ -/** - * This class is an abstract interface for a class reading data from a flash. The flash can be - * any type, but is mostly used for flashes that are not memory mapped. Applications - * must implement access to the flash through this interface. - */ -class FlashDataReader -{ -public: - /** Finalizes an instance of the FlashDataReader class. */ - virtual ~FlashDataReader() - { - } - - /** - * Compute if an address is directly addressable by the MCU. - * - * Compute if an address is directly addressable by the MCU. The data is addressable it - * should be read direct through a pointer and not through this interface. - * - * @param address The address in the flash. - * - * @return True if the address is addressable by the MCU. - */ - virtual bool addressIsAddressable(const void* address) = 0; - - /** - * Copy data from flash to a buffer. This must be a synchrony method that does not - * return until the copy is done. - * - * @param src Address of source data in the flash. - * @param [in,out] dst Address of destination buffer in RAM. - * @param bytes Number of bytes to copy. - */ - virtual void copyData(const void* src, void* dst, uint32_t bytes) = 0; - - /** - * Initiate a read operation from flash to a buffer. This can be an asynchrony operation - * that is still running after this function returns. Buffers must be handled by the - * subclass. LCD16bppSerialFlash will at most copy 4 bytes times the width of the - * display. - * - * @param src Address of source data in the flash. - * @param bytes Number of bytes to copy. - */ - virtual void startFlashLineRead(const void* src, uint32_t bytes) = 0; - - /** - * Waits until the previous startFlashLineRead operation is complete. - * - * Waits until the previous startFlashLineRead operation is complete. If the - * startFlashLineRead method is asynchrony, this method must wait until the previous - * operation has completed. - * - * @return The address of a buffer containing the read data. - */ - virtual const uint8_t* waitFlashReadComplete() = 0; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_FLASHDATAREADER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp deleted file mode 100644 index 1e932ab..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp +++ /dev/null @@ -1,269 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/FrameBufferAllocator.hpp - * - * Declares the touchgfx::FrameBufferAllocator, touchgfx::SingleBlockAllocator - * and touchgfx::ManyBlockAllocator classes. - */ -#ifndef TOUCHGFX_FRAMEBUFFERALLOCATOR_HPP -#define TOUCHGFX_FRAMEBUFFERALLOCATOR_HPP - -#include - -namespace touchgfx -{ -/** - * Called by FrameBufferAllocator to wait for a LCD Transfer, when the allocator has no free - * blocks. The LCD driver can use this function to synchronize the UI thread with the - * transfer logic. - */ -void FrameBufferAllocatorWaitOnTransfer(); - -/** - * Called by FrameBufferAllocator when a block is drawn and therefore ready for transfer. The - * LCD driver should use this method to start a transfer. - */ -void FrameBufferAllocatorSignalBlockDrawn(); - -/** - * This class is an abstract interface for a class allocating partial framebuffer blocks. The - * interface must be implemented by a subclass. - * - * @see ManyBlockAllocator - */ -class FrameBufferAllocator -{ -public: - /** - * Allocates a framebuffer block. The block will have at least the width requested. The - * height of the allocated block can be lower than requested if not enough memory is - * available. - * - * @param x The absolute x coordinate of the block on the screen. - * @param y The absolute y coordinate of the block on the screen. - * @param width The width of the block. - * @param height The height of the block. - * @param [in,out] block Pointer to pointer to return the block address in. - * - * @return The height of the allocated block. - */ - virtual uint16_t allocateBlock(const uint16_t x, const uint16_t y, const uint16_t width, const uint16_t height, uint8_t** block) = 0; - - /** - * Marks a previously allocated block as ready to be transferred to the LCD. - * - */ - virtual void markBlockReadyForTransfer() = 0; - - /** - * Check if a block is ready for transfer to the LCD. - * - * @return True if a block is ready for transfer. - */ - virtual bool hasBlockReadyForTransfer() = 0; - - /** - * Get the block ready for transfer. - * - * @param [out] rect Reference to rect to write block x, y, width, and height. - * - * @return Returns the address of the block ready for transfer. - */ - virtual const uint8_t* getBlockForTransfer(Rect& rect) = 0; - - /** - * Get the Rect of the next block to transfer. - * - * @return Rect ready for transfer. - * - * @see hasBlockReadyForTransfer - * - * @note This function should only be called when the allocator has a block ready for transfer. - */ - virtual const Rect& peekBlockForTransfer() = 0; - - /** - * Check if a block is ready for drawing (the block is empty). - * - * @return True if a block is empty. - */ - virtual bool hasEmptyBlock() = 0; - - /** - * Free a block after transfer to the LCD. Marks a previously allocated block as - * transferred and ready to reuse. - */ - virtual void freeBlockAfterTransfer() = 0; - - /** Finalizes an instance of the FrameBufferAllocator class. */ - virtual ~FrameBufferAllocator() - { - } - -protected: - /** BlockState is used for internal state of each block. */ - enum BlockState - { - EMPTY, ///< Block is empty, can be allocated - ALLOCATED, ///< Block is allocated for drawing - DRAWN, ///< Block has been drawn to, can be send - SENDING ///< Block is being transmitted to the display - }; -}; - -/** - * This class is partial framebuffer allocator using multiple blocks. New buffers can be - * allocated until no free blocks are available. After transfer to LCD, a block is - * queued for allocation again. - * - * @see FrameBufferAllocator - */ -template -class ManyBlockAllocator : public FrameBufferAllocator -{ -public: - ManyBlockAllocator() - { - sendingBlock = -1; - drawingBlock = -1; - for (uint32_t i = 0; i < blocks; i++) - { - state[i] = EMPTY; - } - } - - /** - * Allocates a framebuffer block. The block will have at least the width requested. The - * height of the allocated block can be lower than requested if not enough memory is - * available. - * - * @param x The absolute x coordinate of the block on the screen. - * @param y The absolute y coordinate of the block on the screen. - * @param width The width of the block. - * @param height The height of the block. - * @param [in,out] block Pointer to pointer to return the block address in. - * - * @return The height of the allocated block. - */ - virtual uint16_t allocateBlock(const uint16_t x, const uint16_t y, const uint16_t width, const uint16_t height, uint8_t** block) - { - drawingBlock++; - if (drawingBlock == blocks) - { - drawingBlock = 0; - } - while (state[drawingBlock] != EMPTY) - { - FrameBufferAllocatorWaitOnTransfer(); - } - assert(state[drawingBlock] == EMPTY); - state[drawingBlock] = ALLOCATED; - const int32_t stride = width * bytes_pr_pixel; - const int32_t lines = block_size / stride; - *block = (uint8_t*)&memory[drawingBlock][0]; - blockRect[drawingBlock].x = x; - blockRect[drawingBlock].y = y; - blockRect[drawingBlock].width = width; - blockRect[drawingBlock].height = MIN(height, lines); - return blockRect[drawingBlock].height; - } - - /** Marks a previously allocated block as ready to be transferred to the LCD. */ - virtual void markBlockReadyForTransfer() - { - assert(state[drawingBlock] == ALLOCATED); - state[drawingBlock] = DRAWN; - FrameBufferAllocatorSignalBlockDrawn(); - } - - /** - * Check if a block is ready for transfer to the LCD. - * - * @return True if a block is ready for transfer. - */ - virtual bool hasBlockReadyForTransfer() - { - for (uint32_t i = 0; i < blocks; i++) - { - if (state[i] == DRAWN) - { - return true; - } - } - return false; - } - - /** - * Get the block ready for transfer. - * - * @param [in,out] rect Reference to rect to write block x, y, width, and height. - * - * @return Returns the address of the block ready for transfer. - */ - virtual const uint8_t* getBlockForTransfer(Rect& rect) - { - sendingBlock++; - if (sendingBlock == blocks) - { - sendingBlock = 0; - } - assert(state[sendingBlock] == DRAWN); - rect = blockRect[sendingBlock]; - state[sendingBlock] = SENDING; - return (const uint8_t*)&memory[sendingBlock][0]; - } - - virtual const Rect& peekBlockForTransfer() - { - int nextSendingBlock = sendingBlock + 1; - if (nextSendingBlock == blocks) - { - nextSendingBlock = 0; - } - assert(state[nextSendingBlock] == DRAWN); - return blockRect[nextSendingBlock]; - } - - virtual bool hasEmptyBlock() - { - int nextDrawingBlock = drawingBlock + 1; - if (nextDrawingBlock == blocks) - { - nextDrawingBlock = 0; - } - return (state[nextDrawingBlock] == EMPTY); - } - - /** - * Free a block after transfer to the LCD. - * - * Marks a previously allocated block as transferred and ready to reuse. - */ - virtual void freeBlockAfterTransfer() - { - assert(state[sendingBlock] == SENDING); - state[sendingBlock] = EMPTY; - } - -private: - volatile BlockState state[blocks]; - uint32_t memory[blocks][block_size / 4]; - Rect blockRect[blocks]; - int sendingBlock; - int drawingBlock; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_FRAMEBUFFERALLOCATOR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp deleted file mode 100644 index 1c0cb5f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/GPIO.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/GPIO.hpp - * - * Declares the touchgfx::GPIO class. - */ -#ifndef TOUCHGFX_GPIO_HPP -#define TOUCHGFX_GPIO_HPP - -namespace touchgfx -{ -/** - * Interface class for manipulating GPIOs in order to do performance measurements on target. Not - * used on the PC simulator. - */ -class GPIO -{ -public: - /** Enum for the GPIOs used. */ - enum GPIO_ID - { - VSYNC_FREQ, /// Pin is toggled at each VSYNC - RENDER_TIME, /// Pin is high when frame rendering begins, low when finished - FRAME_RATE, /// Pin is toggled when the framebuffers are swapped. - MCU_ACTIVE /// Pin is high when the MCU is doing work (i.e. not in idle task). - }; - - /** Perform configuration of IO pins. */ - static void init(); - - /** - * Sets a pin high. - * - * @param id the pin to set. - */ - static void set(GPIO_ID id); - - /** - * Sets a pin low. - * - * @param id the pin to set. - */ - static void clear(GPIO_ID id); - - /** - * Toggles a pin. - * - * @param id the pin to toggle. - */ - static void toggle(GPIO_ID id); - - /** - * Gets the state of a pin. - * - * @param id the pin to get. - * - * @return true if the pin is high, false otherwise. - */ - static bool get(GPIO_ID id); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GPIO_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp deleted file mode 100644 index d5bf4cc..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Gestures.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/Gestures.hpp - * - * Declares the touchgfx::Gestures class. - */ -#ifndef TOUCHGFX_GESTURES_HPP -#define TOUCHGFX_GESTURES_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** This class implements the detection of gestures. */ -class Gestures -{ - static const uint8_t MAX_TICKS_BETWEEN_MOVES_FOR_SWIPE = 7; - static const uint8_t MIN_VELOCITY_AT_RELEASE_BEFORE_SWIPE = 3; - - /** Defines the state of a drag. */ - struct DragState - { - DragState() - : startX(0), - startY(0), - downX(0), - downY(0), - tickCount(0), - velocityX(0), - velocityY(0), - inProgress(false) - { - } - - uint16_t startX; ///< Starting x coordinate - uint16_t startY; ///< Starting y coordinate - uint16_t downX; ///< Starting x coordinate of the drag - uint16_t downY; ///< Starting x coordinate of the drag - uint16_t tickCount; ///< Measures the timing of the drag - int16_t velocityX; ///< The velocity (X orientation) of the drag - int16_t velocityY; ///< The velocity (Y orientation) of the drag - bool inProgress; ///< Whether a drag is in progress or not - }; - -public: - /** Default constructor. Does nothing. */ - Gestures() - : drag(), listener(0), dragThresholdValue(0) - { - } - - /** - * Register the event listener. - * - * @param [in] l The EventListener to register. - */ - void registerEventListener(UIEventListener& l); - - /** Has to be called during the timer tick. */ - void tick(); - - /** - * Register a drag event. - * - * @param oldX The x coordinate of the drag start position (dragged from) - * @param oldY The y coordinate of the drag start position (dragged from) - * @param newX The x coordinate of the new position (dragged to) - * @param newY The y coordinate of the new position (dragged to) - * - * @return True if the drag exceeds threshold value (and therefore was reported as a - * drag), or false if the drag did not exceed threshold (and therefore was - * discarded). - */ - bool registerDragEvent(uint16_t oldX, uint16_t oldY, uint16_t newX, uint16_t newY); - - /** - * Register a click event and figure out if this is a drag event, too. - * - * @param event The type of the click event. - * @param x The x coordinate of the click event. - * @param y The y coordinate of the click event. - */ - void registerClickEvent(ClickEvent::ClickEventType event, uint16_t x, uint16_t y); - - /** - * Configure the threshold for reporting drag events. A touch input movement must exceed - * this value in either axis in order to report a drag. Default value is 0. - * - * @param val New threshold value. - */ - void setDragThreshold(uint16_t val) - { - dragThresholdValue = val; - } - -private: - DragState drag; - UIEventListener* listener; - uint16_t dragThresholdValue; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GESTURES_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp deleted file mode 100644 index d8d2989..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/HAL.hpp +++ /dev/null @@ -1,1251 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/HAL.hpp - * - * Declares the touchgfx::HAL class. - */ -#ifndef TOUCHGFX_HAL_HPP -#define TOUCHGFX_HAL_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -class FlashDataReader; -class UIEventListener; - -/** - * Hardware Abstraction Layer. - * - * Contains functions that are specific to the hardware platform the code is running on. - */ -class HAL -{ -public: - /** - * Initializes a new instance of the HAL class. - * - * @param [in] dmaInterface Reference to the DMA interface. - * @param [in] display Reference to the LCD. - * @param [in] touchCtrl Reference to the touch controller. - * @param width The width of the LCD display, in pixels. - * @param height The height of the LCD display, in pixels. - */ - HAL(DMA_Interface& dmaInterface, LCD& display, TouchController& touchCtrl, uint16_t width, uint16_t height) - : dma(dmaInterface), - lcdRef(display), - touchController(touchCtrl), - mcuInstrumentation(0), - buttonController(0), - frameBufferAllocator(0), - gestures(), - nativeDisplayOrientation(ORIENTATION_LANDSCAPE), - taskDelayFunc(0), - frameBuffer0(0), - frameBuffer1(0), - frameBuffer2(0), - refreshStrategy(REFRESH_STRATEGY_DEFAULT), - fingerSize(1), - lockDMAToPorch(false), - frameBufferUpdatedThisFrame(false), - auxiliaryLCD(0), - partialFrameBufferRect(), - listener(0), - lastX(0), - lastY(0), - touchSampleRate(1), - mcuLoadPct(0), - vSyncCnt(0), - vSyncForFrame(1), - vSyncCompensationEnabled(false), - clientDirty(false), - swapRequested(false), - lastTouched(false), - updateMCULoad(0), - cc_begin(0), - requestedOrientation(ORIENTATION_LANDSCAPE), - displayOrientationChangeRequested(false), - useAuxiliaryLCD(false), - useDMAAcceleration(true), - lastRenderMethod(HARDWARE) - { - instance = this; - FRAME_BUFFER_WIDTH = DISPLAY_WIDTH = width; - FRAME_BUFFER_HEIGHT = DISPLAY_HEIGHT = height; - DISPLAY_ROTATION = rotate0; - nativeDisplayOrientation = ((width >= height) ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT); - } - - /** Finalizes an instance of the HAL class. */ - virtual ~HAL() - { - } - - /** - * Gets the HAL instance. - * - * @return The HAL instance. - */ - static HAL* getInstance() - { - return instance; - } - - /** - * Sets the desired display orientation (landscape or portrait). If desired orientation - * is different from the native orientation of the display, a rotation is automatically - * applied. The rotation does not incur any performance cost. - * - * @param orientation The desired display orientation. - * - * @note A screen transition must occur before this takes effect! - */ - virtual void setDisplayOrientation(DisplayOrientation orientation) - { - requestedOrientation = orientation; - displayOrientationChangeRequested = true; - } - - /** - * Gets the current display orientation. Will be equal to the native orientation of the - * display unless setDisplayOrientation has been explicitly called earlier. - * - * @return The current display orientation. - */ - DisplayOrientation getDisplayOrientation() const - { - if (DISPLAY_ROTATION == rotate0) - { - return nativeDisplayOrientation; - } - return (nativeDisplayOrientation == ORIENTATION_LANDSCAPE ? ORIENTATION_PORTRAIT : ORIENTATION_LANDSCAPE); - } - - /** - * Sets framebuffer size. By default the display size and the framebuffer size are the same, but - * in some hardware configurations, the hardware may have a width of e.g. 832 pixels even though - * the display is only 800 pixels wide. First set the display width and height using - * touchgfx_generic_init() and the update the framebuffer size using setFrameBufferSize(). - * - * @param width The width of the framebuffer. - * @param height The height of the framebuffer. - * - * @see touchgfx_generic_init - */ - virtual void setFrameBufferSize(uint16_t width, uint16_t height) - { - assert(width >= DISPLAY_WIDTH && height >= DISPLAY_HEIGHT && "Framebuffer cannot be smaller than display"); - FRAME_BUFFER_WIDTH = width; - FRAME_BUFFER_HEIGHT = height; - } - - /** Notify the framework that a DMA interrupt has occurred. */ - void signalDMAInterrupt() - { - dma.signalDMAInterrupt(); - } - - /** - * This function initializes the HAL, DMA, TouchController, and interrupts. - * - * @see configureInterrupts - */ - virtual void initialize(); - - /** - * Main event loop. Will wait for VSYNC signal, and then process next frame. Call this - * function from your GUI task. - * - * @note This function never returns! - */ - virtual void taskEntry(); - - /** - * This function is called whenever the framework has performed a complete draw. - * - * On some platforms, a local framebuffer needs to be pushed to the display through a - * SPI channel or similar. Implement that functionality here. This function is called - * whenever the framework has performed a complete draw. - */ - virtual void flushFrameBuffer(); - - /** - * This function is called whenever the framework has performed a partial draw. - * - * @param rect The area of the screen that has been drawn, expressed in absolute coordinates. - * - * @see flushFrameBuffer - */ - virtual void flushFrameBuffer(const Rect& rect); - - /** Allow the DMA to start transfers. Front Porch Entry is a good place to call this. */ - virtual void allowDMATransfers(); - - /** - * Has to be called from within the LCD IRQ routine when the Front Porch Entry is - * reached. - */ - void frontPorchEntered() - { - allowDMATransfers(); - } - - /** This function blocks until the DMA queue (containing BlitOps) is empty. */ - virtual void flushDMA(); - - /** - * Waits for the framebuffer to become available for use (i.e. not - * used by DMA transfers). Calls the InvalidateCache virtual if - * previous operation was hardware based. - * - * @return A pointer to the beginning of the currently used framebuffer. - * - * @note Function blocks until framebuffer is available. Client code MUST call - * unlockFrameBuffer() when framebuffer operation has completed. - */ - virtual uint16_t* lockFrameBuffer(); - - /** - * A list of rendering methods. - * - * @see setRenderingMethod - */ - enum RenderingMethod - { - SOFTWARE, ///< Transition to this method will invalidate the D-Cache, if enabled - HARDWARE ///< Transition to this method will flush the D-Cache, if enabled - }; - - /** - * Locks the framebuffer and sets rendering method for correct - * cache management. - * - * @param method The rendering method to be used. - * - * @return A pointer to the beginning of the currently used framebuffer. - */ - uint16_t* lockFrameBufferForRenderingMethod(RenderingMethod method); - - /** - * Unlocks the framebuffer (MUST be called exactly once for each call to - * lockFrameBuffer()). - */ - virtual void unlockFrameBuffer(); - - /** - * Gets the framebuffer address used by the TFT controller. - * - * @return The address of the framebuffer currently being displayed on the TFT. - */ - virtual uint16_t* getTFTFrameBuffer() const = 0; - - /** - * Gets a reference to the LCD. - * - * @return A reference to the LCD. - */ - static LCD& lcd() - { - if (instance->useAuxiliaryLCD && instance->auxiliaryLCD) - { - return *instance->auxiliaryLCD; - } - return instance->lcdRef; - } - - /** - * Function to set whether the DMA transfers are locked to the TFT update cycle. If - * locked, DMA transfer will not begin until the TFT controller has finished updating - * the display. If not locked, DMA transfers will begin as soon as possible. Default is - * true (DMA is locked with TFT). - * - * Disabling the lock will in most cases significantly increase rendering performance. - * It is therefore strongly recommended to disable it. Depending on platform this may in - * rare cases cause rendering problems (visible tearing on display). Please see the - * chapter "Optimizing DMA During TFT Controller Access" for details on this setting. - * - * @param enableLock True to lock DMA transfers to the front porch signal. Conservative, - * default setting. False to disable, which will normally yield - * substantial performance improvement. - * - * @note This setting only has effect when using double buffering. - */ - void lockDMAToFrontPorch(bool enableLock) - { - lockDMAToPorch = enableLock; - } - - /** - * This function performs a platform-specific memcpy, if supported by the hardware. - * - * @param [out] dest Pointer to destination memory. - * @param [in] src Pointer to source memory. - * @param numBytes Number of bytes to copy. - * - * @return true if the copy succeeded, false if copy was not performed. - */ - virtual bool blockCopy(void* RESTRICT dest, const void* RESTRICT src, uint32_t numBytes); - - /** - * Function for obtaining the blit capabilities of the concrete HAL implementation. As - * default, will return whatever blitcaps are reported by the associated DMA object. - * - * DMA operations can be disabled by calling enableDMAAcceleration(bool). - * - * @return a bitmask of the supported blitcaps. - * - * @see enableDMAAcceleration - */ - virtual BlitOperations getBlitCaps() - { - if (useDMAAcceleration) - { - return dma.getBlitCaps(); - } - return static_cast(0); - } - - /** - * Sets a flag to allow use of DMA operations to speed up drawing operations. - * - * @param enable True to enable, false to disable. - * - * @see getBlitCaps - */ - void enableDMAAcceleration(const bool enable) - { - useDMAAcceleration = enable; - } - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending as specified. - * - * @param pSrc The source-array pointer (points to first value to copy) - * @param pClut The CLUT pointer (points to CLUT header data which include - * the type and size of this CLUT followed by colors data) - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param srcWidth The distance (in elements) from first value of first line, to - * first value of second line (the source 2D array width) - * @param alpha The alpha value to use for blending (255 = solid, no blending) - * @param hasTransparentPixels If true, this data copy contains transparent pixels and - * require hardware support for that to be enabled. - * @param dstWidth The distance (in elements) from first value of first line, to - * first value of second line (the destination 2D array width) - * @param srcFormat The source buffer color format (default is the framebuffer - * format) - * @param dstFormat The destination buffer color format (default is the - * framebuffer format) - * @param replaceBgAlpha Replace the background buffer per pixel alpha value - * with 255 = solid. - * - * @note Alpha=255 is assumed "solid" and shall be used if HAL does not support - * BLIT_OP_COPY_WITH_ALPHA. - */ - virtual void blitCopy(const uint16_t* pSrc, const uint8_t* pClut, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t srcWidth, uint8_t alpha, bool hasTransparentPixels, uint16_t dstWidth, Bitmap::BitmapFormat srcFormat, Bitmap::BitmapFormat dstFormat, bool replaceBgAlpha); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending as specified. - * - * @param pSrc The source-array pointer (points to first value to copy) - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param srcWidth The distance (in elements) from first value of first line, to - * first value of second line (the source 2D array width) - * @param alpha The alpha value to use for blending (255 = solid, no blending) - * @param hasTransparentPixels If true, this data copy contains transparent pixels and - * require hardware support for that to be enabled. - * @param dstWidth The distance (in elements) from first value of first line, to - * first value of second line (the destination 2D array width) - * @param srcFormat The source buffer color format (default is the framebuffer - * format) - * @param dstFormat The destination buffer color format (default is the - * framebuffer format) - * @param replaceBgAlpha Replace the background buffer per pixel alpha value - * with 255 = solid. - * - * @note Alpha=255 is assumed "solid" and shall be used if HAL does not support - * BLIT_OP_COPY_WITH_ALPHA. - */ - virtual void blitCopy(const uint16_t* pSrc, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t srcWidth, uint8_t alpha, bool hasTransparentPixels, uint16_t dstWidth, Bitmap::BitmapFormat srcFormat, Bitmap::BitmapFormat dstFormat, bool replaceBgAlpha); - - /** - * Blits a 2D source-array to the framebuffer performing alpha-blending as specified using - * the default lcd format. - * - * @param pSrc The source-array pointer (points to first value to copy) - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param srcWidth The distance (in elements) from first value of first line, to - * first value of second line (the source 2D array width) - * @param alpha The alpha value to use for blending (255 = solid, no blending) - * @param hasTransparentPixels If true, this data copy contains transparent pixels and - * require hardware support for that to be enabled. - * @param replaceBgAlpha Replace the background buffer per pixel alpha value - * with 255 = solid. - * - * @note Alpha=255 is assumed "solid" and shall be used if HAL does not support - * BLIT_OP_COPY_WITH_ALPHA. - */ - virtual void blitCopy(const uint16_t* pSrc, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t srcWidth, uint8_t alpha, bool hasTransparentPixels, bool replaceBgAlpha); - - /** - * Blits a 2D source-array to the framebuffer using 16-bit copy - * without conversion. This operation can be used to perform - * hardware accelerated copies to the framebuffer even when the - * image (and framebuffer) format is not 16-bit. - * - * All parameters (e.g. x) must correspond to their 16-bit - * values. I.e. the 10th bytes corresponds to x=5. - * - * @param pSrc Pointer to the source data (points to first value to copy) - * @param x The destination x coordinate in the framebuffer with 16-bit pixels. - * @param y The destination y coordinate in the framebuffer with 16-bit pixels. - * @param width The width of the area to copy in 16-bit pixels. - * @param height The height of the area to copy - * @param srcWidth The width of the source bitmap (stride) in 16-bit pixels. - * @param dstWidth The width of the framebuffer in 16-bit pixels. - */ - virtual void blitCopyWord(const uint16_t* pSrc, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t srcWidth, uint16_t dstWidth); - - /** - * Fills a part of the framebuffer using 16-bit fill without - * conversion. This operation can be used to perform hardware - * accelerated fills in the framebuffer even when the framebuffer - * format is not 16-bit. - * - * All parameters (e.g. x) must correspond to their 16-bit - * values. I.e. the 10th bytes corresponds to x=5. - * - * @param colorValue The 16-bit value to fill in the framebuffer. - * @param x The destination x coordinate in the framebuffer with 16-bit pixels. - * @param y The destination y coordinate in the framebuffer with 16-bit pixels. - * @param width The width of the area to copy in 16-bit pixels. - * @param height The height of the area to copy - * @param dstWidth The width of the framebuffer in 16-bit pixels. - */ - virtual void blitFillWord(uint16_t colorValue, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t dstWidth); - - /** - * Blits a 2D source-array to the framebuffer performing per-pixel alpha blending. - * - * @param pSrc The source-array pointer (points to first value to copy) - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param srcWidth The distance (in elements) from first value of first line, to first - * value of second line (the source 2D array width) - * @param alpha The alpha value to use for blending. This is applied on every pixel, - * in addition to the per-pixel alpha value (255 = solid, no blending) - * @param replaceBgAlpha Replace the background buffer per pixel alpha value with 255 = solid. - * - */ - virtual void blitCopyARGB8888(const uint16_t* pSrc, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t srcWidth, uint8_t alpha, bool replaceBgAlpha); - - /** - * Blits a 4bpp or 8bpp glyph - maybe use the same method and supply additional color - * mode arg. - * - * @param pSrc The source-array pointer (points to first value to copy) - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param srcWidth The distance (in elements) from first value of first line, to first - * value of second line (the source 2D array width) - * @param color Color of the text. - * @param alpha The alpha value to use for blending (255 = solid, no blending) - * @param operation The operation type to use for blit copy. - * @param replaceBgAlpha Replace the background buffer per pixel alpha value - * with 255 = solid. - */ - virtual void blitCopyGlyph(const uint8_t* pSrc, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t srcWidth, colortype color, uint8_t alpha, BlitOperations operation, bool replaceBgAlpha); - - /** - * Blits a color value to the framebuffer performing alpha-blending as specified. - * - * @param color The desired fill-color. - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param alpha The alpha value to use for blending (255 = solid, no blending) - * @param dstWidth The distance (in elements) from first value of first line, to first value - * of second line (the destination 2D array width) - * @param dstFormat The destination buffer color format (default is the framebuffer format) - * @param replaceBgAlpha Replace the background buffer per pixel alpha value - * with 255 = solid. - * - * @note Alpha=255 is assumed "solid" and shall be used if HAL does not support - * BLIT_OP_FILL_WITH_ALPHA. - */ - virtual void blitFill(colortype color, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t alpha, uint16_t dstWidth, Bitmap::BitmapFormat dstFormat, bool replaceBgAlpha); - - /** - * Copies a region of the currently displayed framebuffer to memory. Used for e.g. - * BlockTransition and for displaying pre-rendered drawables - * e.g. in animations where redrawing the drawable is not necessary. - * - * @param region The displayed framebuffer region to copy. - * - * @return A pointer to the memory address containing the copy of the framebuffer. - * - * @note Requires double framebuffer to be enabled. - */ - virtual uint16_t* copyFromTFTToClientBuffer(Rect region); - - /** - * Blits a color value to the framebuffer performing alpha-blending as specified. - * - * @param color The desired fill-color. - * @param x The destination x coordinate on the framebuffer. - * @param y The destination y coordinate on the framebuffer. - * @param width The width desired area of the source 2D array. - * @param height The height of desired area of the source 2D array. - * @param alpha The alpha value to use for blending (255 = solid, no blending) - * @param replaceBgAlpha Replace the background buffer per pixel alpha value - * with 255 = solid. - * - * @note Alpha=255 is assumed "solid" and shall be used if HAL does not support - * BLIT_OP_FILL_WITH_ALPHA. - */ - virtual void blitFill(colortype color, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t alpha, bool replaceBgAlpha); - - /** - * Registers an event handler implementation with the underlying event system. The - * actual HAL implementation decides whether or not multiple UIEventListener instances - * are allowed (including execution order). - * - * @param [in] listener The listener to register. - */ - virtual void registerEventListener(UIEventListener& listener); - - /** - * Copies a region of the currently displayed framebuffer to memory. Used for e.g. - * SlideTransition and for displaying pre-rendered drawables - * e.g. in animations where redrawing the drawable is not necessary. - * - * @param meAbs The framebuffer region to copy. - * - * @return A pointer to the memory address containing the copy of the framebuffer. - * - * @note Requires animation storage to be present. - */ - virtual uint16_t* copyFBRegionToMemory(Rect meAbs); - - /** - * Copies a region of the currently displayed framebuffer to a buffer. Used for e.g. - * SlideTransition and for displaying pre-rendered drawables e.g. in animations where - * redrawing the drawable is not necessary. The buffer can e.g. be a dynamic bitmap. - * - * @param meAbs The framebuffer region to copy. - * @param [in,out] dst Address of the buffer to store the copy in. - * @param stride The width of the target buffer (row length). - * - * @return A pointer to the memory address containing the copy of the framebuffer. - * - * @note Requires animation storage to be present. - */ - virtual uint16_t* copyFBRegionToMemory(Rect meAbs, uint16_t* dst, uint32_t stride); - - /** - * Gets display width. - * - * @return The display width. - */ - uint16_t getDisplayWidth() const - { - return DISPLAY_WIDTH; - } - - /** - * Gets display height. - * - * @return The display height. - */ - uint16_t getDisplayHeight() const - { - return DISPLAY_HEIGHT; - } - - /** Swaps the two framebuffers. */ - void swapFrameBuffers(); - - /** - * Returns the number of VSync interrupts between the current drawing operation and the - * last drawing operation, i.e. the number of lost frames. - * - * @return Number of VSync since previous draw. - */ - uint32_t getLCDRefreshCount() - { - return vSyncForFrame; - } - - /** - * Enables or disables compensation for lost frames. See knowledge base article. - * - * @param enabled true to enable, false to disable. - */ - void setFrameRateCompensation(bool enabled) - { - vSyncCompensationEnabled = enabled; - } - - /** - * Called by the VSync interrupt. - * - * Called by the VSync interrupt for counting of LCD refreshes. - */ - void vSync() - { - vSyncCnt++; - } - - /** - * Has to be called from within the LCD IRQ rutine when the Back Porch Exit is reached. - * - * Has to be called from within the LCD IRQ rutine when the Back Porch Exit is reached. - */ - virtual void backPorchExited() - { - swapFrameBuffers(); - tick(); - } - - /** - * Configures the interrupts relevant for TouchGFX. This primarily entails setting the - * interrupt priorities for the DMA and LCD interrupts. - */ - virtual void configureInterrupts() = 0; - - /** Enables the DMA and LCD interrupts. */ - virtual void enableInterrupts() = 0; - - /** Disables the DMA and LCD interrupts. */ - virtual void disableInterrupts() = 0; - - /** - * Configure the LCD controller to fire interrupts at VSYNC. Called automatically once - * TouchGFX initialization has completed. - */ - virtual void enableLCDControllerInterrupt() = 0; - - /** - * Sample external key event. - * - * @param [out] key Output parameter that will be set to the key value if a keypress was - * detected. - * - * @return True if a keypress was detected and the "key" parameter is set to a value. - */ - virtual bool sampleKey(uint8_t& key) - { - (void)key; // Unused variable - return false; - } - - /** - * Configure the threshold for reporting drag events. A touch input movement must exceed - * this value in either axis in order to report a drag. Default value is 0. - * - * @param value New threshold value. - * - * @note Use if touch controller is not completely accurate to avoid "false" drags. - */ - void setDragThreshold(uint8_t value) - { - gestures.setDragThreshold(value); - } - - /** - * Get the Gesture class attached to the HAL instance. - * - * @return A pointer to the Gestures object. - */ - Gestures* getGestures() - { - return &gestures; - } - - static uint16_t DISPLAY_WIDTH; ///< The width of the LCD display in pixels. - static uint16_t DISPLAY_HEIGHT; ///< The height of the LCD display in pixels. - static DisplayRotation DISPLAY_ROTATION; ///< The rotation from display to framebuffer. - static uint16_t FRAME_BUFFER_WIDTH; ///< The width of the framebuffer in pixels. - static uint16_t FRAME_BUFFER_HEIGHT; ///< The height of the framebuffer in pixels. - static bool USE_DOUBLE_BUFFERING; ///< Is double buffering enabled? - static bool USE_ANIMATION_STORAGE; ///< Is animation storage enabled? - - /** - * Sets framebuffer start addresses. - * - * Sets individual framebuffer start addresses. - * - * @param [in] frameBuffer Buffer for framebuffer data, must be non-null. - * @param [in] doubleBuffer If non-null, buffer for double buffer data. If null double - * buffering is disabled. - * @param [in] animationStorage If non-null, the animation storage. If null animation storage - * is disabled. - * - * @see setAnimationStorage - */ - virtual void setFrameBufferStartAddresses(void* frameBuffer, void* doubleBuffer, void* animationStorage) - { - assert(frameBuffer != 0 && "A framebuffer address must be set"); - frameBuffer0 = reinterpret_cast(frameBuffer); - frameBuffer1 = reinterpret_cast(doubleBuffer); - USE_DOUBLE_BUFFERING = doubleBuffer != 0; - setAnimationStorage(animationStorage); - } - - /** - * Sets animation storage address. - * - * @param [in] animationStorage If non-null, the animation storage. If null animation storage - * is disabled. - * - * @see setFrameBufferStartAddresses - */ - virtual void setAnimationStorage(void* animationStorage) - { - frameBuffer2 = reinterpret_cast(animationStorage); - USE_ANIMATION_STORAGE = animationStorage != 0; - } - - /** - * Configures a partial framebuffer as current framebuffer. This method uses the - * assigned FrameBufferAllocator to allocate block of compatible dimensions. The height - * of the allocated block is returned. - * - * @param x The absolute x coordinate of the block on the screen. - * @param y The absolute y coordinate of the block on the screen. - * @param width The width of the block. - * @param height The height of the block requested. - * - * @return The height of the block allocated. - */ - virtual uint16_t configurePartialFrameBuffer(const uint16_t x, const uint16_t y, const uint16_t width, const uint16_t height); - - /** - * Sets the number of ticks between each touch screen sample. - * - * @param sampleRateInTicks Sample rate. Default is 1 (every tick). - */ - void setTouchSampleRate(int8_t sampleRateInTicks) - { - if (sampleRateInTicks > 0) - { - touchSampleRate = sampleRateInTicks; - } - } - - /** - * Gets the number of ticks between each touch screen sample. - * - * @return Number of ticks between each touch screen sample. - */ - int8_t getTouchSampleRate() const - { - return touchSampleRate; - } - - /** - * Register if MCU is active by measuring cpu cycles. If user wishes to track MCU load, - * this method should be called whenever the OS Idle task is scheduled in or out. This - * method makes calls to a concrete implementation of GPIO functionality and a concrete - * implementation of cpu cycles. - * - * @param active If true, MCU is registered as being active, inactive otherwise. - */ - void setMCUActive(bool active); - - /** - * Gets the current cycle counter. - * - * @return the cycle counter. - */ - uint32_t getCPUCycles(); - - /** - * Stores a pointer to an instance of an MCU specific instrumentation class. - * - * @param [in] mcuInstr pointer to MCU instrumentation. - */ - void setMCUInstrumentation(MCUInstrumentation* mcuInstr) - { - mcuInstrumentation = mcuInstr; - } - - /** - * This method sets a flag that determines if generic HAL should calculate MCU load - * based on concrete MCU instrumentation. - * - * @param enabled If true, set flag to update MCU load. - */ - void enableMCULoadCalculation(bool enabled) - { - updateMCULoad = enabled; - } - - /** - * Gets the current MCU load. - * - * @return mcuLoadPct the MCU Load in %. - */ - uint8_t getMCULoadPct() const - { - return mcuLoadPct; - } - - /** - * Stores a pointer to an instance of a specific implementation of a ButtonController. - * - * @param [in] btnCtrl pointer to button controller. - */ - void setButtonController(ButtonController* btnCtrl) - { - buttonController = btnCtrl; - } - - /** - * Gets the associated ButtonController. - * - * @return A pointer to the ButtonController, or zero if no ButtonController has been - * set. - */ - ButtonController* getButtonController() const - { - return buttonController; - } - - /** - * Sets a framebuffer allocator. The framebuffer allocator is only used in partial - * framebuffer mode. - * - * @param [in] allocator pointer to a framebuffer allocator object. - */ - void setFrameBufferAllocator(FrameBufferAllocator* allocator) - { - frameBufferAllocator = allocator; - } - - /** - * Gets the framebuffer allocator. - * - * @return The framebuffer allocator. - */ - FrameBufferAllocator* getFrameBufferAllocator() - { - return frameBufferAllocator; - } - - /** - * Gets the flash data reader. This method must be implemented in - * subclasses that uses a FlashDataReader object. - * - * @return the FlashDataReader. - */ - virtual FlashDataReader* getFlashDataReader() const - { - return 0; - } - - /** - * Sets the finger size in pixels. Setting the finger size to a size of more than 1 - * pixel will emulate a finger of width and height of 2*(fingersize-1)+1. This can be - * especially useful when trying to interact with small elements on a high ppi display. - * The finger size will influence which element is chosen as the point of interaction, - * when clicking, dragging, ... the display. A number of samples will be drawn from - * within the finger area and a best matching drawable will be chosen. The best matching - * algorithm will consider the size of the drawable and the distance from the touch - * point. - * - * @param [in] size the size of the finger. - */ - void setFingerSize(uint8_t size) - { - fingerSize = size; - } - - /** - * Gets the finger size in pixels. - * - * @return The size of the finger in pixels, 1 is the default value. - */ - uint8_t getFingerSize() const - { - return fingerSize; - } - - /** - * Gets the optional framebuffer used for animation storage. - * - * @return The address or 0 if unused. - */ - uint16_t* getAnimationStorage() const - { - return frameBuffer2; - } - - /** - * A list of available frame refresh strategies. - * - * @see setFrameRefreshStrategy - */ - enum FrameRefreshStrategy - { - REFRESH_STRATEGY_DEFAULT, ///< If not explicitly set, this strategy is used. - REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL, ///< Strategy optimized for single framebuffer on systems with TFT controller. - REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER ///< Strategy using less than a full framebuffer. - }; - - /** - * Set a specific strategy for handling timing and mechanism of framebuffer drawing. - * - * By setting a different frame refresh strategy, the internals of how TouchGFX - * interacts with the framebuffer can be modified. - * - * Currently there are two strategies available. This will increase over time. - * - REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL: this strategy is available - * on targets that use single buffering on a TFT controller based system. It requires an - * implementation of the getTFTCurrentLine() function as well as a task delay function - * being registered. The implementation of this strategy is that TouchGFX will carefully - * track the progress of the TFT controller, and draw parts of the framebuffer whenever - * possible. The effect is that the risk of tearing is much reduced compared to the - * default single buffer strategy of only drawing in porch areas. It does have a - * drawback of slightly increased MCU load. But in many cases employing this strategy - * will make it possible to avoid external RAM, by using just a single framebuffer in - * internal RAM and still avoid tearing. - * - REFRESH_STRATEGY_DEFAULT: This is a general strategy that works for all target - * configurations. - * - * Recommendation: Try using REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL if you're on - * a TFT controller based system (ie. non-8080) and you have a desire to avoid external - * RAM. Otherwise stick to REFRESH_STRATEGY_DEFAULT. - * - * @param s The desired strategy to use. - * - * @return true if the desired strategy will be used, false otherwise. - */ - bool setFrameRefreshStrategy(FrameRefreshStrategy s) - { - if (s == REFRESH_STRATEGY_DEFAULT || s == REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER) - { - refreshStrategy = s; - return true; - } - if (s == REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL) - { - // Perform sanity checks. This strategy requires - // - task delay function - // - a TFT controller (+ an impl of getTFTCurrentLine()) - // - single buffering - if (taskDelayFunc != 0 && getTFTCurrentLine() != 0xFFFF && !USE_DOUBLE_BUFFERING) - { - refreshStrategy = s; - return true; - } - return false; - } - // Unknown strategy - return false; - } - - /** - * Used internally by TouchGFX core to manage the timing and process of drawing into the - * framebuffer. - * - * @return Current frame refresh strategy. - * - * @see setFrameRefreshStrategy - */ - FrameRefreshStrategy getFrameRefreshStrategy() const - { - return refreshStrategy; - } - - /** - * Registers a function capable of delaying GUI task execution - * - * In order to make use of the HAL::taskDelay function, a delay function must be - * registered by calling this function. Usually the delay function would be - * OSWrappers::taskDelay. - * - * @param [in] delayF A pointer to a function returning void with an uint16_t parameter - * specifying number of milliseconds to delay. - * - * @note The task delay capability is only used when the frame refresh strategy - * REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL is selected. Otherwise it is - * not necessary to register a delay function. - */ - void registerTaskDelayFunction(void (*delayF)(uint16_t)) - { - taskDelayFunc = delayF; - } - - /** - * Delay GUI task execution by number of milliseconds - * - * This function requires the presence of a task delay function. If a task delay - * function has not been registered, it returns immediately. Otherwise it returns when - * number of milliseconds has passed. - * - * @param ms Number of milliseconds to wait. - * - * @see registerTaskDelayFunction - */ - virtual void taskDelay(uint16_t ms) - { - if (taskDelayFunc) - { - taskDelayFunc(ms); - } - } - - /** - * Get the current line (Y) of the TFT controller - * - * This function is used to obtain the progress of the TFT controller. More specifically, - * the line (or Y-value) currently being transferred. - * - * Note: The value must be adjusted to account for vertical back porch before returning, - * such that the value is always within the range of [0; - * actual display height in pixels[ - * - * It is used for the REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL frame refresh - * strategy in order to synchronize framebuffer drawing with TFT controller progress. If - * this strategy is used, the concrete HAL subclass must provide an override of this - * function that returns correct line value. If this strategy is not used, then the - * getTFTCurrentLine function is never called and can be disregarded. - * - * @return In this default implementation, 0xFFFF is returned to signify "not - * implemented". - */ - virtual uint16_t getTFTCurrentLine() - { - return 0xFFFFu; - } - - /** - * Function for obtaining the DMA type of the concrete DMA implementation. As default, - * will return DMA_TYPE_GENERIC type value. - * - * @return a DMAType value of the concrete DMA implementation. - */ - virtual DMAType getDMAType() - { - return dma.getDMAType(); - } - - /** - * Render a Drawable and its widgets into a dynamic bitmap. - * - * @param [in,out] drawable A reference on the Drawable object to render. - * @param bitmapId Dynamic bitmap to be used as a rendertarget. - */ - virtual void drawDrawableInDynamicBitmap(Drawable& drawable, BitmapId bitmapId); - - /** - * Render a Drawable and its widgets into a dynamic bitmap. Only the specified Rect - * region is updated. - * - * @param [in,out] drawable A reference on the Drawable object to render. - * @param bitmapId Dynamic bitmap to be used as a rendertarget. - * @param rect Region to update. - */ - virtual void drawDrawableInDynamicBitmap(Drawable& drawable, BitmapId bitmapId, const Rect& rect); - - /** - * Set an auxiliary LCD class to be used for offscreen rendering. - * - * @param [in,out] auxLCD A pointer on the axiliary LCD class to use for offscreen rendering. - */ - void setAuxiliaryLCD(LCD* auxLCD) - { - auxiliaryLCD = auxLCD; - } - - /** - * Get the auxiliary LCD class attached to the HAL instance if any. - * - * @return A pointer on the axiliary LCD class attached to the HAL instance. - */ - LCD* getAuxiliaryLCD() - { - return auxiliaryLCD; - } - - /** - * Set current rendering method for cache maintenance. - * - * This function is used to keep track of previous rendering method and will determine if cache should be flush or invalidated depending on transition state. - * - * @param method The rendering method used. - */ - void setRenderingMethod(RenderingMethod method); - -protected: - /** This function is called at each timer tick, depending on platform implementation. */ - virtual void tick(); - - /** - * Called when beginning to rendering a frame. - * - * @return true if rendering can begin, false otherwise. - */ - virtual bool beginFrame(); - - /** Called when a rendering pass is completed. */ - virtual void endFrame(); - - /** - * Sets the framebuffer address used by the TFT controller. - * - * @param [in] address New framebuffer address. - */ - virtual void setTFTFrameBuffer(uint16_t* address) = 0; - - /** - * Gets client framebuffer. - * - * @return The address of the framebuffer currently used by the framework to draw in. - */ - uint16_t* getClientFrameBuffer() - { - if (USE_DOUBLE_BUFFERING && getTFTFrameBuffer() == frameBuffer0) - { - return frameBuffer1; - } - return frameBuffer0; - } - - /** - * Called by the touch driver to indicate a touch. - * - * @param x The x coordinate of the touch. - * @param y The y coordinate of the touch. - */ - virtual void touch(int32_t x, int32_t y); - - /** Called by the touch driver to indicate that no touch is currently detected. */ - virtual void noTouch(); - - /** Perform the actual display orientation change. */ - virtual void performDisplayOrientationChange() - { - if (requestedOrientation != nativeDisplayOrientation) - { - if (DISPLAY_ROTATION == rotate0) - { - const uint16_t tmp = DISPLAY_HEIGHT; - DISPLAY_HEIGHT = DISPLAY_WIDTH; - DISPLAY_WIDTH = tmp; - DISPLAY_ROTATION = rotate90; - } - } - else if (DISPLAY_ROTATION != rotate0) - { - const uint16_t tmp = DISPLAY_HEIGHT; - DISPLAY_HEIGHT = DISPLAY_WIDTH; - DISPLAY_WIDTH = tmp; - DISPLAY_ROTATION = rotate0; - } - } - - /** - * Invalidate D-Cache. - * - * Called by setRenderingMethod when changing rendering method - * from Hardware to Software indicating the cache should be invalidated. - */ - virtual void InvalidateCache() - { - } - - /** - * Flush D-Cache. - * - * Called by setRenderingMethod when changing rendering method - * from Software to Hardware indicating the cache should be invalidated. - */ - virtual void FlushCache() - { - } - - DMA_Interface& dma; ///< A reference to the DMA interface. - LCD& lcdRef; ///< A reference to the LCD. - TouchController& touchController; ///< A reference to the touch controller. - MCUInstrumentation* mcuInstrumentation; ///< A reference to an optional MCU instrumentation. - ButtonController* buttonController; ///< A reference to an optional ButtonController. - FrameBufferAllocator* frameBufferAllocator; ///< A reference to an optional FrameBufferAllocator. - static bool isDrawing; ///< True if currently in the process of rendering a screen. - Gestures gestures; ///< Class for low-level interpretation of touch events. - DisplayOrientation nativeDisplayOrientation; ///< Contains the native display orientation. If desired orientation is different, apply rotation. - void (*taskDelayFunc)(uint16_t); ///< Pointer to a function that can delay GUI task for a number of milliseconds. - uint16_t* frameBuffer0; ///< Pointer to the first framebuffer. - uint16_t* frameBuffer1; ///< Pointer to the second framebuffer. - uint16_t* frameBuffer2; ///< Pointer to the optional third framebuffer used for animation storage. - FrameRefreshStrategy refreshStrategy; ///< The selected display refresh strategy. - uint8_t fingerSize; ///< The radius of the finger in pixels - bool lockDMAToPorch; ///< Whether or not to lock DMA transfers with TFT porch signal. - bool frameBufferUpdatedThisFrame; ///< True if something was drawn in the current frame. - LCD* auxiliaryLCD; ///< Auxiliary LCD class used to render Drawables into dynamic bitmaps. - Rect partialFrameBufferRect; ///< The region of the screen covered by the partial framebuffer. - -private: - UIEventListener* listener; - static HAL* instance; - int32_t lastX; - int32_t lastY; - int8_t touchSampleRate; - uint8_t mcuLoadPct; - uint8_t vSyncCnt; - uint8_t vSyncForFrame; - bool vSyncCompensationEnabled; - bool clientDirty; - bool swapRequested; - bool lastTouched; - bool updateMCULoad; - uint32_t cc_begin; - DisplayOrientation requestedOrientation; - bool displayOrientationChangeRequested; - bool useAuxiliaryLCD; - bool useDMAAcceleration; - RenderingMethod lastRenderMethod; - - uint16_t* getDstAddress(uint16_t x, uint16_t y, uint16_t* startAddress, uint16_t dstWidth, Bitmap::BitmapFormat dstFormat) const; - uint16_t* getDstAddress(uint16_t x, uint16_t y, uint16_t* startAddress) const; - uint8_t getBitDepth(Bitmap::BitmapFormat format) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_HAL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp deleted file mode 100644 index 56e92a4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/NoDMA.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/NoDMA.hpp - * - * Declares the touchgfx::NoDMA class. - */ -#ifndef TOUCHGFX_NODMA_HPP -#define TOUCHGFX_NODMA_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * This is an "empty" DMA subclass that does nothing except assert if accidentally used. An - * instance of this object can be used if DMA support is not desired. - * - * @see DMA_Interface - */ -class NoDMA : public DMA_Interface -{ -public: - NoDMA() - : DMA_Interface(q), q(&b, 1) - { - } - - /** - * No blit operations supported by this DMA implementation. - * - * @return Zero (no blit ops supported). - */ - virtual BlitOperations getBlitCaps() - { - return static_cast(0); - } - - /** - * Asserts if used. - * - * @param blitOp The blit operation to be performed by this DMA instance. - */ - virtual void setupDataCopy(const BlitOp& blitOp) - { - assert(false && "DMA operation not supported"); - } - - /** - * Asserts if used. - * - * @param blitOp The blit operation to be performed by this DMA instance. - */ - virtual void setupDataFill(const BlitOp& blitOp) - { - assert(false && "DMA operation not supported"); - } - - /** Does nothing. */ - virtual void signalDMAInterrupt() - { - } - - /** - * Block until all DMA transfers are complete. Since this particular DMA does not do - * anything, return immediately. - */ - virtual void flush() - { - } - -private: - LockFreeDMA_Queue q; - BlitOp b; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_NODMA_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp deleted file mode 100644 index dbdf6c0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/OSWrappers.hpp - * - * Declares the touchgfx::OSWrappers class. - */ -#ifndef TOUCHGFX_OSWRAPPERS_HPP -#define TOUCHGFX_OSWRAPPERS_HPP - -#include - -namespace touchgfx -{ -/** - * This class specifies OS wrappers for dealing with the framebuffer semaphore and the VSYNC - * signal. - */ -class OSWrappers -{ -public: - /** Initialize framebuffer semaphore and queue/mutex for VSYNC signal. */ - static void initialize(); - - /** Initialize framebuffer semaphore and queue/mutex for VSYNC signal. */ - static void deinitialize(); - - /** - * Signal that a VSYNC has occurred. Should make the vsync queue/mutex available. - * - * @note This function is called from an ISR, and should (depending on OS) trigger a - * scheduling. - */ - static void signalVSync(); - - /** - * Signal that the rendering of the frame has completed. Used by - * some systems to avoid using any previous vsync. - */ - static void signalRenderingDone(); - - /** - * This function blocks until a VSYNC occurs. - * - * @note This function must first clear the mutex/queue and then wait for the next one to - * occur. - */ - static void waitForVSync(); - - /** - * This function checks if a VSync occurred after last - * rendering. The function is used in systems that cannot wait in - * waitForVSync (because they are also checking other event - * sources. - * - * @note signalRenderingDone is typically used together with this function. - * - * @return True if VSync occurred. - */ - static bool isVSyncAvailable(); - - /** Take the framebuffer semaphore. Blocks until semaphore is available. */ - static void takeFrameBufferSemaphore(); - - /** - * Attempt to obtain the framebuffer semaphore. If semaphore is not available, do - * nothing. - * - * @note must return immediately! This function does not care who has the taken the semaphore, - * it only serves to make sure that the semaphore is taken by someone. - */ - static void tryTakeFrameBufferSemaphore(); - - /** Release the framebuffer semaphore. */ - static void giveFrameBufferSemaphore(); - - /** - * Release the framebuffer semaphore in a way that is safe in interrupt context. Called - * from ISR. - */ - static void giveFrameBufferSemaphoreFromISR(); - - /** - * A function that causes executing task to sleep for a number of milliseconds. This - * function is OPTIONAL. It is only used by the TouchGFX in the case of a specific frame - * refresh strategy (REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL). Due to backwards - * compatibility, in order for this function to be usable by the HAL the function must - * be explicitly registered: - * hal.registerTaskDelayFunction(&OSWrappers::taskDelay) - * - * @param ms The number of milliseconds to sleep. - * - * @see HAL::setFrameRefreshStrategy, HAL::registerTaskDelayFunction - */ - static void taskDelay(uint16_t ms); - - /** - * A function that causes the executing task to yield control to - * another thread. This function is used by the framework when it - * is necessary to wait a little before continuing (e.g. drawing). - * - * The implementation should typically request the operating - * system to change to another task of similar priority. When - * running without an operating system, the implementation can run - * a very short task and return. - */ - static void taskYield(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_OSWRAPPERS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp deleted file mode 100644 index 1f42ad1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Paint.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/Paint.hpp - * - * Declares paint functions for widgets - */ -#ifndef TOUCHGFX_PAINT_HPP -#define TOUCHGFX_PAINT_HPP - -#include - -namespace touchgfx -{ -namespace paint -{ -void setL8Pallette(const uint8_t* const data); -void tearDown(void); - -namespace rgb565 -{ -void lineFromColor(uint16_t* const ptr, const unsigned count, const uint32_t color, const uint8_t alpha, const uint32_t color565); -void lineFromRGB565(uint16_t* const ptr, const uint16_t* const data, const unsigned count, const uint8_t alpha); -void lineFromARGB8888(uint16_t* const ptr, const uint32_t* const data, const unsigned count, const uint8_t alpha); -void lineFromL8RGB888(uint16_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); -void lineFromL8ARGB8888(uint16_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); -} // namespace rgb565 - -namespace rgb888 -{ -void lineFromColor(uint8_t* const ptr, const unsigned count, const uint32_t color, const uint8_t alpha); -void lineFromRGB888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); -void lineFromARGB8888(uint8_t* const ptr, const uint32_t* const data, const unsigned count, const uint8_t alpha); -void lineFromL8RGB888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); -void lineFromL8ARGB8888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha); - -} // namespace rgb888 -} // namespace paint -} // namespace touchgfx - -#endif // TOUCHGFX_PAINT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp deleted file mode 100644 index 5377e49..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintImpl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/PaintImpl.hpp - * - * Declares paint functions for widgets - */ -#ifndef TOUCHGFX_PAINTIMPL_HPP -#define TOUCHGFX_PAINTIMPL_HPP - -#include - -namespace touchgfx -{ -namespace paint -{ -namespace -{ -const uint8_t* blendL8CLUT = 0; -} //namespace - -void setL8Pallette(const uint8_t* const data) -{ - blendL8CLUT = data; -} - -void tearDown() -{ -} - -} // namespace paint -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTIMPL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp deleted file mode 100644 index 2ac3a2f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB565Impl.hpp +++ /dev/null @@ -1,208 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/PaintRGB565Impl.hpp - * - * Implements RGB565 software painter functions for widgets - */ -#ifndef TOUCHGFX_PAINTRGB565IMPL_HPP -#define TOUCHGFX_PAINTRGB565IMPL_HPP - -#include - -namespace touchgfx -{ -namespace paint -{ -namespace rgb565 -{ -namespace -{ -const uint16_t RMASK = 0xF800; // Mask for red (1111100000000000) -const uint16_t GMASK = 0x07E0; // Mask for green (0000011111100000) -const uint16_t BMASK = 0x001F; // Mask for blue (0000000000011111) -} //namespace - -/** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param R The red color (0-31 shifted into RMASK). - * @param G The green color (0-63 shifted into GMASK). - * @param B The blue color (0-31 shifted into BMASK). - * @param bufpix The buffer pixel value. - * @param alpha The alpha of the R,G,B. - * - * @return The result of blending the two colors into a new color. - */ -FORCE_INLINE_FUNCTION uint16_t alphaBlend(uint16_t R, uint16_t G, uint16_t B, uint16_t bufpix, uint8_t alpha) -{ - const uint8_t ialpha = 0xFF - alpha; - return (((R * alpha + (bufpix & RMASK) * ialpha) / 255) & RMASK) | - (((G * alpha + (bufpix & GMASK) * ialpha) / 255) & GMASK) | - (((B * alpha + (bufpix & BMASK) * ialpha) / 255) & BMASK); -} - -/** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param newpix The new pixel value. - * @param bufpix The buffer pixel value. - * @param alpha The alpha to apply to the new pixel. - * - * @return The result of blending the two colors into a new color. - */ -FORCE_INLINE_FUNCTION uint16_t alphaBlend(uint16_t newpix, uint16_t bufpix, uint8_t alpha) -{ - return alphaBlend(newpix & RMASK, newpix & GMASK, newpix & BMASK, bufpix, alpha); -} - -/** - * Generates a color representation to be used on the LCD, based on 24 bit RGB values. - * - * @param color The color. - * - * @return The color representation depending on LCD color format. - */ -FORCE_INLINE_FUNCTION uint16_t getNativeColor(colortype color) -{ - return ((color >> 8) & 0xF800) | ((color >> 5) & 0x07E0) | ((color >> 3) & 0x001F); -} - -void lineFromColor(uint16_t* const ptr, const unsigned count, const uint32_t color, const uint8_t alpha, const uint32_t color565) -{ - uint16_t* framebuffer = ptr; - const uint16_t* const lineEnd = framebuffer + count; - if (alpha == 0xFF) - { - do - { - *framebuffer = color565; - } while (++framebuffer < lineEnd); - } - else - { - do - { - *framebuffer = alphaBlend(color565, *framebuffer, alpha); - } while (++framebuffer < lineEnd); - } -} - -void lineFromRGB565(uint16_t* const ptr, const uint16_t* const data, const unsigned count, const uint8_t alpha) -{ - uint16_t* framebuffer = ptr; - const uint16_t* bitmapPointer = data; - const uint16_t* const chunkend = framebuffer + count; - - if (alpha == 0xFF) - { - do - { - *framebuffer = *bitmapPointer++; - } while (++framebuffer < chunkend); - } - else - { - do - { - *framebuffer = alphaBlend(*bitmapPointer++, *framebuffer, alpha); - } while (++framebuffer < chunkend); - } -} - -void lineFromARGB8888(uint16_t* const ptr, const uint32_t* const data, const unsigned count, const uint8_t alpha) -{ - uint16_t* framebuffer = ptr; - const uint32_t* bitmapPointer = data; - const uint16_t* const chunkend = framebuffer + count; - do - { - const uint8_t srcAlpha = (*bitmapPointer) >> 24; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = getNativeColor(*bitmapPointer); - } - else if (a) - { - const uint32_t newpix = *bitmapPointer; - *framebuffer = alphaBlend((newpix >> 8) & RMASK, (newpix >> 5) & GMASK, (newpix >> 3) & BMASK, *framebuffer, a); - } - bitmapPointer++; - } while (++framebuffer < chunkend); -} - -void lineFromL8RGB888(uint16_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha) -{ - uint16_t* framebuffer = ptr; - const uint8_t* bitmapPointer = data; - const uint16_t* const chunkend = framebuffer + count; - if (alpha == 0xFF) - { - do - { - const uint8_t* src = &blendL8CLUT[*bitmapPointer++ * 3]; - // Use alpha from covers directly - const uint8_t blue = *src++; - const uint8_t green = *src++; - const uint8_t red = *src; - *framebuffer = ((red << 8) & RMASK) | ((green << 3) & GMASK) | ((blue >> 3) & BMASK); - } while (++framebuffer < chunkend); - } - else - { - do - { - const uint8_t* src = &blendL8CLUT[*bitmapPointer++ * 3]; - // Use alpha from covers directly - const uint8_t blue = *src++; - const uint8_t green = *src++; - const uint8_t red = *src; - const uint8_t ialpha = 0xFF - alpha; - const uint16_t bufpix = *framebuffer; - uint8_t fbr = Color::getRedFromRGB565(bufpix); - uint8_t fbg = Color::getGreenFromRGB565(bufpix); - uint8_t fbb = Color::getBlueFromRGB565(bufpix); - *framebuffer = ((LCD::div255(red * alpha + fbr * ialpha) << 8) & RMASK) | ((LCD::div255(green * alpha + fbg * ialpha) << 3) & GMASK) | ((LCD::div255(blue * alpha + fbb * ialpha) >> 3) & BMASK); - } while (++framebuffer < chunkend); - } -} - -void lineFromL8ARGB8888(uint16_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha) -{ - uint16_t* framebuffer = ptr; - const uint8_t* bitmapPointer = data; - const uint16_t* const chunkend = framebuffer + count; - do - { - const uint32_t newpix = reinterpret_cast(blendL8CLUT)[*bitmapPointer++]; - const uint8_t srcAlpha = newpix >> 24; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = getNativeColor(newpix); - } - else if (a) - { - *framebuffer = alphaBlend((newpix >> 8) & RMASK, (newpix >> 5) & GMASK, (newpix >> 3) & BMASK, *framebuffer, a); - } - } while (++framebuffer < chunkend); -} - -} // namespace rgb565 -} // namespace paint -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTRGB565IMPL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp deleted file mode 100644 index 2b46006..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PaintRGB888Impl.hpp +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/PaintRGB888Impl.hpp - * - * Implements RGB888 software painter functions for widgets - */ -#ifndef TOUCHGFX_PAINTRGB888IMPL_HPP -#define TOUCHGFX_PAINTRGB888IMPL_HPP - -#include - -namespace touchgfx -{ -namespace paint -{ -namespace rgb888 -{ -void lineFromColor(uint8_t* const ptr, const unsigned count, const uint32_t color, const uint8_t alpha) -{ - uint8_t* framebuffer = ptr; - const uint8_t* const lineEnd = framebuffer + count * 3; - const uint8_t painterRed = Color::getRed(color); - const uint8_t painterGreen = Color::getGreen(color); - const uint8_t painterBlue = Color::getBlue(color); - - if (alpha == 0xFF) - { - do - { - *framebuffer++ = painterBlue; - *framebuffer++ = painterGreen; - *framebuffer++ = painterRed; - } while (framebuffer < lineEnd); - } - else - { - do - { - const uint8_t ialpha = 0xFF - alpha; - uint8_t pByte = *framebuffer; - *framebuffer++ = LCD::div255(painterBlue * alpha + pByte * ialpha); - pByte = *framebuffer; - *framebuffer++ = LCD::div255(painterGreen * alpha + pByte * ialpha); - pByte = *framebuffer; - *framebuffer++ = LCD::div255(painterRed * alpha + pByte * ialpha); - } while (framebuffer < lineEnd); - } -} - -void lineFromRGB888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha) -{ - uint8_t* framebuffer = ptr; - const uint8_t* bitmapPointer = data; - const uint8_t* const chunkend = framebuffer + count * 3; - if (alpha == 0xFF) - { - do - { - *framebuffer++ = *bitmapPointer++; - *framebuffer++ = *bitmapPointer++; - *framebuffer++ = *bitmapPointer++; - } while (framebuffer < chunkend); - } - else - { - do - { - const uint8_t ialpha = 0xFF - alpha; - *framebuffer = LCD::div255(*bitmapPointer++ * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(*bitmapPointer++ * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(*bitmapPointer++ * alpha + *framebuffer * ialpha); - framebuffer++; - } while (framebuffer < chunkend); - } -} - -void lineFromARGB8888(uint8_t* const ptr, const uint32_t* const data, const unsigned count, const uint8_t alpha) -{ - uint8_t* framebuffer = ptr; - const uint32_t* bitmapPointer = data; - const uint8_t* const chunkend = framebuffer + count * 3; - do - { - const uint32_t argb = *bitmapPointer++; - const uint8_t a = LCD::div255(alpha * (argb >> 24)); - if (a == 0xFF) - { - *framebuffer++ = argb; // Blue - *framebuffer++ = argb >> 8; // Green - *framebuffer++ = argb >> 16; // Red - } - else - { - const uint8_t ialpha = 0xFF - a; - uint8_t cByte = argb; - *framebuffer = LCD::div255(cByte * a + *framebuffer * ialpha); - framebuffer++; - cByte = argb >> 8; - *framebuffer = LCD::div255(cByte * a + *framebuffer * ialpha); - framebuffer++; - cByte = argb >> 16; - *framebuffer = LCD::div255(cByte * a + *framebuffer * ialpha); - framebuffer++; - } - } while (framebuffer < chunkend); -} - -void lineFromL8RGB888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha) -{ - uint8_t* framebuffer = ptr; - const uint8_t* bitmapPointer = data; - const uint8_t* const chunkend = framebuffer + count * 3; - if (alpha == 0xFF) - { - do - { - const uint8_t* src = &blendL8CLUT[*bitmapPointer++ * 3]; - *framebuffer++ = *src++; - *framebuffer++ = *src++; - *framebuffer++ = *src; - } while (framebuffer < chunkend); - } - else - { - do - { - const uint8_t* src = &blendL8CLUT[*bitmapPointer++ * 3]; - const uint8_t ialpha = 0xFF - alpha; - *framebuffer = LCD::div255(*src++ * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(*src++ * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(*src * alpha + *framebuffer * ialpha); - framebuffer++; - } while (framebuffer < chunkend); - } -} - -void lineFromL8ARGB8888(uint8_t* const ptr, const uint8_t* const data, const unsigned count, const uint8_t alpha) -{ - uint8_t* framebuffer = ptr; - const uint8_t* bitmapPointer = data; - const uint8_t* const chunkend = framebuffer + count * 3; - do - { - uint32_t src = reinterpret_cast(blendL8CLUT)[*bitmapPointer++]; - const uint8_t srcAlpha = src >> 24; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer++ = src; // Blue - *framebuffer++ = src >> 8; // Green - *framebuffer++ = src >> 16; // Red - } - else - { - const uint8_t ialpha = 0xFF - a; - *framebuffer = LCD::div255((src & 0xFF) * a + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(((src >> 8) & 0xFF) * a + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(((src >> 16) & 0xFF) * a + *framebuffer * ialpha); - framebuffer++; - } - } while (framebuffer < chunkend); -} - -} // namespace rgb888 -} // namespace paint -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTRGB888IMPL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp deleted file mode 100644 index 0c817f5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/PartialFrameBufferManager.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/PartialFrameBufferManager.hpp - * - * Declares the touchgfx::PartialFrameBufferManager class. - */ -#ifndef TOUCHGFX_PARTIALFRAMEBUFFERMANAGER_HPP -#define TOUCHGFX_PARTIALFRAMEBUFFERMANAGER_HPP - -#include - -namespace touchgfx -{ -/** - * Check if a Frame Buffer Block is being transmitted. - * - * @return Non zero if possible. - */ -int transmitActive(); - -/** - * Check if a Frame Buffer Block ending at bottom may be sent. - * - * @param bottom The bottom coordinate of the block to transfer. - * - * @return Non zero if possible. - */ -int shouldTransferBlock(uint16_t bottom); - -/** - * Transmit a Frame Buffer Block. - * - * @param pixels Pointer to the pixel data. - * @param x X coordinate of the block. - * @param y Y coordinate of the block. - * @param w Width of the block. - * @param h Height of the block. - */ -void transmitBlock(const uint8_t* pixels, uint16_t x, uint16_t y, uint16_t w, uint16_t h); - -/** - * This class specifies strategies for transmitting block to the display using Partial Frame Buffer. - */ -class PartialFrameBufferManager -{ -public: - /** - * Transmit all remaining drawn Framebuffer blocks. - * - * @note This function does not return before all blocks have been transmitted. - */ - static void transmitRemainingBlocks(); - - /** - * Tries to transmit a drawn block. - * - * @note Will return immediately if already transmitting. - */ - static void tryTransmitBlock(); - - /** - * Tries to transmit a drawn block in interrupt context. - * - * @note Will transmit next block immediately if drawn. - */ - static void tryTransmitBlockFromIRQ(); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PARTIALFRAMEBUFFERMANAGER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp deleted file mode 100644 index 5651c1f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/Types.hpp +++ /dev/null @@ -1,783 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/Types.hpp - * - * Declares the touchgfx::colortype, touchgfx::Rect, touchgfx::Vector, touchgfx::Point, - * touchgfx::Pair classes as well as some less used classes and structs. - */ -#ifndef TOUCHGFX_TYPES_HPP -#define TOUCHGFX_TYPES_HPP - -#include -#include -#include - -/** - * A macro that returns the smallest of two items. - * - * @param a The first item. - * @param b The second item. - */ -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -/** - * A macro that returns the largest of two items. - * - * @param a The first item. - * @param b The second item. - */ -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -/** - * A macro that rounds a number up to the next multiple. Works for negative numbers, too. - * - * @param num The number to round up. - * @param multiple The multiple. - */ -#ifndef ROUNDUP -#define ROUNDUP(num, multiple) ((multiple) == 0 ? (num) : ((num) + (abs(multiple) - ((num) % abs(multiple))) % abs(multiple))) -#endif - -/** - * A macro that rounds a number down to the next multiple. Works for negative numbers, too. - * - * @param num The number to round down. - * @param multiple The multiple. - */ -#ifndef ROUNDDOWN -#define ROUNDDOWN(num, multiple) (-(ROUNDUP(-(num), multiple))) -#endif - -namespace touchgfx -{ -static const float PI = 3.14159265358979323846f; ///< PI - -/** - * This type can contain a color value. Note that in order to maintain backwards - * compatibility, casting this type to an integral value will yield a 16-bit value. To - * extract a 24/32-bit color from this type, use the getColor32 function. - */ -struct colortype -{ - /** Default constructor. Creates a black (0) color. */ - colortype() - : color(0) - { - } - - /** - * Constructor which creates a colortype with the given color. Use - * Color::getColorFromRGB() to create a color that will work on your selected LCD type. - * - * @param col The color. - * - * @see Color::getColorFromRGB - */ - colortype(uint32_t col) - : color(col) - { - } - - /** - * Gets color as a 32bit value suitable for passing to Color::getRed(), - * Color::getGreen() and Color::getBlue() which will handle all bitdeptchs. - * - * @return The color 32. - * - * @see Color::getRed, Color::getGreen, Color::getBlue - */ - FORCE_INLINE_FUNCTION uint32_t getColor32() const - { - return color; - } - - /** - * Cast that converts the given colortype to an uint32_t. - * - * @return The result of the operation. - */ - operator uint32_t() const - { - return color; - } - - uint32_t color; ///< The color -}; - -/** Class representing a Rectangle with a few convenient methods. */ -class Rect -{ -public: - /** Default constructor. Resulting in an empty Rect with coordinates 0,0. */ - Rect() - : x(0), y(0), width(0), height(0) - { - } - - /** - * Initializes a new instance of the Rect class. - * - * @param rectX The x coordinate. - * @param rectY The y coordinate. - * @param rectWidth The width. - * @param rectHeight The height. - */ - Rect(int16_t rectX, int16_t rectY, int16_t rectWidth, int16_t rectHeight) - : x(rectX), y(rectY), width(rectWidth), height(rectHeight) - { - } - - int16_t x; ///< The x coordinate - int16_t y; ///< The y coordinate - int16_t width; ///< The width - int16_t height; ///< The height - - /** - * Gets the x coordinate of the right edge of the Rect, i.e. the number - * of the first column just to the right of the Rect. - * - * @return x coordinate of the right edge (calculated as "x + width"). - */ - FORCE_INLINE_FUNCTION int16_t right() const - { - return x + width; - } - - /** - * Gets the y coordinate of the bottom edge of the Rect, i.e. the number - * of the first row just below the Rect. - * - * @return y coordinate of the bottom edge (calculated as "y + height"). - */ - FORCE_INLINE_FUNCTION int16_t bottom() const - { - return y + height; - } - - /** - * Determines whether specified point lies inside this rectangle. - * - * @param otherX The x coordinate of the point. - * @param otherY The y coordinate of the point. - * - * @return true if point lies inside rectangle. - */ - bool intersect(int16_t otherX, int16_t otherY) const - { - return otherX >= x && otherX < right() && otherY >= y && otherY < bottom(); - } - - /** - * Determines whether specified rectangle intersects with this rectangle. - * - * @param other The other rectangle. - * - * @return true if the two rectangles intersect. - */ - bool intersect(const Rect& other) const - { - return !(x >= other.right() || right() <= other.x || y >= other.bottom() || bottom() <= other.y); - } - - /** - * Determines whether the specified rectangle is completely included in this rectangle. - * - * @param other The other rectangle. - * - * @return true if the specified rectangle is completely included. - */ - bool includes(const Rect& other) const - { - return other.isEmpty() || (other.x >= x && other.y >= y && other.right() <= right() && other.bottom() <= bottom()); - } - - /** - * Gets a rectangle describing the intersecting area between this rectangle and the - * supplied rectangle. - * - * @param other The other rectangle. - * - * @return Intersecting rectangle or empty Rect in case of no intersection. - */ - Rect operator&(const Rect& other) const - { - Rect r = *this; - r &= other; - return r; - } - - /** - * Assigns this Rect to the intersection of the current Rect and the assigned Rect. The - * assignment will result in a empty Rect if they do not intersect. - * - * @param other The rect to intersect with. - */ - void operator&=(const Rect& other) - { - if (intersect(other)) - { - int16_t newX = MAX(x, other.x); - int16_t newY = MAX(y, other.y); - - width = MIN(right(), other.right()) - newX; - height = MIN(bottom(), other.bottom()) - newY; - x = newX; - y = newY; - } - else - { - x = 0; - y = 0; - width = 0; - height = 0; - } - } - - /** - * Increases the area covered by this rectangle to encompass the area covered by - * supplied rectangle. - * - * @param other The other rectangle. - */ - void expandToFit(const Rect& other) - { - if (!other.isEmpty()) - { - if (isEmpty()) - { - x = other.x; - y = other.y; - width = other.width; - height = other.height; - } - else - { - int16_t newX = MIN(x, other.x); - int16_t newY = MIN(y, other.y); - - int16_t endPointX = MAX(right(), other.right()); - int16_t endPointY = MAX(bottom(), other.bottom()); - - x = newX; - y = newY; - width = endPointX - newX; - height = endPointY - newY; - } - } - } - - /** - * Restrict the area to not exceed the given max width and max height. As a result, width or - * height can be negative if the rect is completely outside Rect(0, 0, max_width, max_height), - * but this is nicely handled by the isEmpty() function. - * - * @param max_width The maximum width. - * @param max_height The maximum height. - * - * @see intersect, isEmpty - */ - void restrictTo(int16_t max_width, int16_t max_height) - { - // Limit area to the screen (0,0,HAL::WIDTH,HAL::HEIGT) - if (x < 0) - { - width += x; - x = 0; // Negative width is ok (isEmpty => true) - } - if (width > max_width - x) // right() > max_width - { - width = max_width - x; - } - if (y < 0) - { - height += y; - y = 0; // Negative height is ok (isEmpty => true) - } - if (height > max_height - y) // bottom() > max_height - { - height = max_height - y; - } - } - - /** - * Compares equality of two Rect by the dimensions and position of these. - * - * @param other The Rect to compare with. - * - * @return true if the compared Rect have the same dimensions and coordinates. - */ - bool operator==(const Rect& other) const - { - return isEqual(other); - } - - /** - * Opposite of the == operator. - * - * @param other The Rect to compare with. - * - * @return true if the compared Rect differ in dimensions or coordinates. - */ - bool operator!=(const Rect& other) const - { - return !isEqual(other); - } - - /** - * Query if this object is empty. - * - * @return true if any of the dimensions are 0. - */ - bool isEmpty() const - { - return width <= 0 || height <= 0; - } - - /** - * Calculate the area of the rectangle. - * - * @return area of the rectangle. - */ - int32_t area() const - { - return isEmpty() ? 0 : width * height; - } - -private: - bool isEqual(const Rect& other) const - { - return x == other.x && y == other.y && width == other.width && height == other.height; - } -}; - -/** - * A very simple container class using pre-allocated memory. - * - * @tparam T The type of objects this container works on. - * @tparam capacity The maximum number of objects this container can store. - */ -template -class Vector -{ -public: - /** Default constructor. Constructs an empty vector. */ - Vector() - : _size(0) - { - } - - /** - * Index operator. - * - * @param idx The index of the element to obtain. - * - * @return A reference to the element placed at index idx. - */ - T& operator[](uint16_t idx) - { - return _elem[idx]; - } - - /** - * Const version of the index operator. - * - * @param idx The index of the element to obtain. - * - * @return A const reference to the element placed at index idx. - */ - const T& operator[](uint16_t idx) const - { - return _elem[idx]; - } - - /** - * Adds an element to the Vector if the Vector is not full. - * - * - * Adds an element to the Vector if the Vector is not full. Does nothing if the Vector - * is full. - * - * @param e The element to add to the Vector. - */ - void add(T e) - { - assert(_size < capacity && "Vector capacity exceeded"); - if (_size < capacity) - { - _elem[_size++] = e; - } - } - - /** - * Removes an element from the Vector if found in the Vector. Does nothing if the - * element is not found in the Vector. The == operator of the element is used when - * comparing it with the elements in the Vector. - * - * @param e The element to remove from the Vector. - */ - void remove(T e) - { - for (int i = 0; i < _size; i++) - { - if (_elem[i] == e) - { - for (int j = i; j < _size && j < capacity - 1; j++) - { - _elem[j] = _elem[j + 1]; - } - _size--; - } - } - } - - /** - * Removes an element at the specified index of the Vector. Will "bubble-down" any - * remaining elements after the specified index. - * - * @param index The index to remove. - * - * @return The value of the removed element. - */ - T removeAt(uint16_t index) - { - assert(index < _size); - - _size--; - T tmp = _elem[index]; - for (int i = index; i < _size; i++) - { - _elem[i] = _elem[i + 1]; - } - return tmp; - } - - /** - * Removes an element at the specified index of the Vector. The last element in the list - * is moved to the position where the element is removed. - * - * @param index The index to remove. - */ - void quickRemoveAt(uint16_t index) - { - assert(index < _size); - - _size--; - // No need to copy element when removing the last element in the vector - if (index < _size) - { - _elem[index] = _elem[_size]; - } - } - - /** Reverses the ordering of the elements in the Vector. */ - void reverse() - { - uint16_t a = 0; - uint16_t b = _size; - for (; a < --b; a++) - { - T tmp = _elem[a]; - _elem[a] = _elem[b]; - _elem[b] = tmp; - } - } - - /** - * Checks if the Vector contains an element. The == operator of the element is used when - * comparing it with the elements in the Vector. - * - * @param elem The element. - * - * @return true if the Vector contains the element, false otherwise. - */ - bool contains(T elem) - { - for (uint16_t i = 0; i < _size; i++) - { - if (elem == _elem[i]) - { - return true; - } - } - return false; - } - - /** - * Gets the current size of the Vector which is the number of elements contained in the - * Vector. - * - * Gets the current size of the Vector which is the number of elements contained in the - * Vector. - * - * @return The size of the Vector. - */ - uint16_t size() const - { - return _size; - } - - /** - * Query if this object is empty. - * - * @return true if the Vector contains no elements. - */ - bool isEmpty() const - { - return _size == 0; - } - - /** - * Query the maximum capacity of the vector. - * - * @return The capacity the Vector was initialized with. - */ - uint16_t maxCapacity() const - { - return capacity; - } - - /** - * Clears the contents of the container. It does not destruct any of the elements in the - * Vector. - */ - void clear() - { - _size = 0; - } - -private: - T _elem[capacity]; - uint16_t _size; -}; - -/** A simple struct containing coordinates. */ -struct Point -{ - int32_t x; ///< The x coordinate - int32_t y; ///< The y coordinate - - /** - * The squared distance from this Point to another Point. - * - * @param [in] o The point to get the squared distance to. - * - * @return The squared distance. - */ - int32_t dist_sqr(struct Point& o) - { - return (x - o.x) * (x - o.x) + (y - o.y) * (y - o.y); - } -}; - -/** Values that represent directions. */ -enum Direction -{ - NORTH, ///< An enum constant representing the north option - SOUTH, ///< An enum constant representing the south option - EAST, ///< An enum constant representing the east option - WEST ///< An enum constant representing the west option -}; - -/** Defines an alignment type. */ -typedef uint8_t Alignment; -static const Alignment LEFT = 0; ///< Text is left aligned -static const Alignment CENTER = 1; ///< Text is centered horizontally -static const Alignment RIGHT = 2; ///< Text is right aligned - -/** Defines a the direction to write text. */ -typedef uint8_t TextDirection; -static const TextDirection TEXT_DIRECTION_LTR = 0; ///< Text is written Left-To-Right, e.g. English -static const TextDirection TEXT_DIRECTION_RTL = 1; ///< Text is written Right-To-Left, e.g. Hebrew - -/** Values that represent frame buffers. */ -enum FrameBuffer -{ - FB_PRIMARY, ///< First framebuffer - FB_SECONDARY, ///< Second framebuffer - FB_TERTIARY ///< Third framebuffer -}; - -/** Values that represent gradients. */ -enum Gradient -{ - GRADIENT_HORIZONTAL, ///< Horizontal gradient. - GRADIENT_VERTICAL ///< Vertical gradient -}; - -/** Values that represent display rotations. */ -enum DisplayRotation -{ - rotate0, ///< The display is oriented like the framebuffer - rotate90 ///< The display is rotated 90 degrees compared to the framebuffer layout -}; - -/** Values that represent display orientations. */ -enum DisplayOrientation -{ - ORIENTATION_LANDSCAPE, ///< The display has more pixels from left to right than from top to bottom - ORIENTATION_PORTRAIT ///< The display has more pixels from top to bottom than from right to left -}; - -/** Values that represent text rotations. */ -enum TextRotation -{ - TEXT_ROTATE_0, ///< Text is written from left to right - TEXT_ROTATE_90, ///< Text is written from top to bottom - TEXT_ROTATE_180, ///< Text is written from right to left (upside down) - TEXT_ROTATE_270 ///< Text is written bottom to top -}; - -/** Values that represent wide text actions. */ -enum WideTextAction -{ - WIDE_TEXT_NONE, ///< Do nothing, simply cut the text in the middle of any character that extends beyond the width of the TextArea - WIDE_TEXT_WORDWRAP, ///< Wrap between words, no ellipsis, keep wrapping lines - WIDE_TEXT_WORDWRAP_ELLIPSIS, ///< Wrap between words, ellipsis anywhere "Very long t..." - WIDE_TEXT_WORDWRAP_ELLIPSIS_AFTER_SPACE, ///< Wrap between words, ellipsis only after space "Very long ..." - WIDE_TEXT_CHARWRAP, ///< Wrap between any two characters, no ellipsis, keep wrapping lines - WIDE_TEXT_CHARWRAP_ELLIPSIS, ///< Wrap between any two characters, ellipsis anywhere, as used in Chinese - WIDE_TEXT_CHARWRAP_DOUBLE_ELLIPSIS ///< Wrap between any two characters, double ellipsis anywhere, as used in Chinese -}; - -/** - * A simple struct for holding pairs of data. - * - * @tparam T1 The type of the first element. - * @tparam T2 The type of the second element. - */ -template -struct Pair -{ -public: - T1 first; ///< The first element - T2 second; ///< The second element - - /** - * Constructor initializing the elements it holds, using their default constructors. - */ - Pair() - : first(T1()), second(T2()) - { - } - - /** - * Constructor initializing the elements it holds, using their copy constructor. - * - * @param x Reference to the first element. - * @param y Reference to the second element. - */ - Pair(const T1& x, const T2& y) - : first(x), second(y) - { - } - - /** - * Copy constructor. - * - * @tparam U Generic type parameter. - * @tparam V Generic type parameter. - * @param p The pair to copy from. - */ - template - Pair(const Pair& p) - : first(p.first), second(p.second) - { - } -}; - -/** - * Describes a combination of rendering algorithm, image format, and alpha information. The - * lowest bit is 0 for "Nearest neighbor", 1 for "Bilinear". The next bit is "0" for "no - * alpha", "2" for "alpha". The rest is the Bitmap::Format shifted up by 2. - */ -typedef uint16_t RenderingVariant; -static const uint16_t RenderingVariant_NearestNeighbor = 0; ///< The rendering variant nearest neighbor bit value -static const uint16_t RenderingVariant_Bilinear = 1; ///< The rendering variant bilinear bit value -static const uint16_t RenderingVariant_NoAlpha = 0; ///< The rendering variant no alpha bit value -static const uint16_t RenderingVariant_Alpha = 2; ///< The rendering variant alpha bit value -static const uint16_t RenderingVariant_FormatShift = 2; ///< The rendering variant format shift - -/** A fixed point value using 4 bits for the decimal part and 28 bits for the integral part. */ -typedef int32_t fixed28_4; - -/** A fixed point value using 16 bits for the decimal part and 16 bits for the integral part. */ -typedef int32_t fixed16_16; - -/** A 3D point. */ -struct Point3D -{ - fixed28_4 X; ///< The X coordinate - fixed28_4 Y; ///< The Y coordinate - float Z; ///< The Z coordinate - float U; ///< The U coordinate - float V; ///< The V coordinate -}; - -/** - * A texture source. Contains a pointer to the data and the width and height of the texture. The - * alpha channel is used in 565 rendering with alpha. The stride is the width used when - * moving to the next line of the texture. - */ -struct TextureSurface -{ - const uint16_t* data; ///< The pixel bits or indexes for color in CLUT entries - const uint8_t* extraData; ///< The alpha channel or clut data - int32_t width; ///< The width - int32_t height; ///< The height - int32_t stride; ///< The stride -}; - -/** - * The destination of a draw operation. Contains a pointer to where to draw and the stride of - * the drawing surface. - */ -struct DrawingSurface -{ - uint16_t* address; ///< The bits - int32_t stride; ///< The stride -}; - -/** Text IDs as generated by the text converter are simple uint16_t typedefs. */ -typedef uint16_t TypedTextId; - -/** Values that represent dma types. */ -enum DMAType -{ - DMA_TYPE_GENERIC, ///< Generic DMA Implementation - DMA_TYPE_CHROMART ///< ChromART hardware DMA Implementation -}; - -/** - * A list of the vector graphics primitives. - * - * @see VectorRenderer::drawPath - */ -enum VectorPrimitives -{ - VECTOR_PRIM_CLOSE = 0, ///< Close the path - VECTOR_PRIM_MOVE = 1, ///< Move to a point - VECTOR_PRIM_LINE = 2, ///< Line to a point from current position - VECTOR_PRIM_HLINE = 3, ///< Horizontal line to a point from current position - VECTOR_PRIM_VLINE = 4, ///< Vertical line to a point from current position - VECTOR_PRIM_BEZIER_QUAD = 5, ///< Quadratic Bezier (1 control point) curve to a point from the current position - VECTOR_PRIM_BEZIER_CUBIC = 6 ///< Cubic Bezier (2 control points) curve to a point from the current position -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TYPES_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp deleted file mode 100644 index 627e117..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VGData.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/VectorRenderer.hpp - * - * Defines the touchgfx::VGShape, and the touchgfx::VGObject structs. - * - */ -#ifndef TOUCHGFX_VGDATA_HPP -#define TOUCHGFX_VGDATA_HPP - -#include - -namespace touchgfx -{ - -/** - * A list of vector graphics polygon filling modes. - */ -enum VGFillMode -{ - VG_FILL_EVEN_ODD, ///< Fill the paths using the even-odd filling rule - VG_FILL_NON_ZERO ///< Fill the paths using the non-zero filling rule -}; - -/** - * A list of coloring modes. Each shape can have 2 coloring modes. One - * for filling and one for stroking. - */ -enum VGColorMode -{ - VG_NONE, ///< No coloring - VG_FIXED_COLOR, ///< Color with a fixed color in the whole shape - VG_LINEAR_GRADIENT ///< Color using a linear gradient -}; - -/** - * Values that represent the different ways strokes lines can be joined. Bevel is a simple cut off, - * Miter extends into a spike (possibly falling back to Bevel if the miter limit for the stroke - * is exceeded) and Round is a circle arc. - */ -enum VGStrokeLineJoin -{ - VG_STROKE_LINEJOIN_BEVEL, - VG_STROKE_LINEJOIN_MITER, - VG_STROKE_LINEJOIN_ROUND -}; - -/** - * Values that represent the different ways stroke lines can end. Butt is a simpe cut off, Round - * is a half circle and Square extends the line by half stroke width. - */ -enum VGStrokeLineCap -{ - VG_STROKE_LINECAP_BUTT, - VG_STROKE_LINECAP_ROUND, - VG_STROKE_LINECAP_SQUARE -}; - -/** - * Fixed color paint definition. - */ -struct VGFixedColor -{ - uint32_t argb; ///< The color in ARGB8888 format -}; - -/** - * Linear gradient paint definition. - */ -struct VGLinearGradient -{ - const uint32_t* palette; ///< 1024 colors in ARGB888 - uint32_t stops; ///< Number of stops (colors) - const float* stopPositions; ///< Stop positions on the vector - const uint32_t* colors; ///< Stop colors - float x0; ///< The gradient line start x - float y0; ///< The gradient line start y - float x1; ///< The gradient line end x - float y1; ///< The gradient line end y - bool isSolid; ///< True if all colors are solid -}; - -/** - * Data structure for a vector shape (polygon, circle, path, etc.). - * - * Shapes can be linked in a list using the next member. Shapes are linked to by a VGObject. - * Which thereby consists of a number of Shapes. Each shape has attributes, e.g. strokeWidth, - * that is used when drawing the paths in the Shape. - * - * All coordinates and sizes (e.g. strokeWidth) are not translated by any transform given in the - * svg. This has to be done when drawing. - */ -struct VGShape -{ - uint16_t numCommands; ///< Number of commands in the paths - uint16_t numPoints; ///< Number of coordinate floats in the paths - const uint8_t* commands; ///< The paths commands - const float* points; ///< The paths coordinates - VGFillMode drawingMode; ///< Polygon fill mode for this shape - VGColorMode fillMode; ///< Fill coloring mode for this shape - VGColorMode strokeMode; ///< Stroke coloring mode for this shape - const void* fillPaint; ///< Filling painter object or null if not filled - const void* strokePaint; ///< Stroking painter object or null if not stroked - float strokeWidth; ///< Stroke width to use when drawing this shape - VGStrokeLineJoin strokeLineJoin; ///< The stroke line join - VGStrokeLineCap strokeLineCap; ///< The stroke line cap visual - float strokeMiterLimit; ///< The stroke miter limit - uint8_t fillAlpha; ///< Alpha of this shape's fill in the range [0;255] - uint8_t strokeAlpha; ///< Alpha of this shape's stroke in the range [0;255] - float boundingbox[4]; ///< Un-transformed bounding box for this Shape [xmin, ymin, xmax, ymax] excluding strokeWidth - float transformation[6]; ///< The transformation matrix to apply before drawing - const VGShape* next; ///< Pointer to the next Shape -}; - -/** - * Data structure for a vector drawing. - * - * VGObject drawings consists of a linked list of VGShapes. - */ -struct VGObject -{ - float x; ///< The x coordinate - float y; ///< The y coordinate - float width; ///< The width including strokeWidth - float height; ///< The height including strokeWidth - float imageWidth; ///< Width of the image (either calculated or from SVG width attribute) - float imageHeight; ///< Height of the image (either calculated or from SVG height attribute) - const VGShape* shape; ///< First shape in this drawing -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_VGDATA_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp deleted file mode 100644 index 277b843..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VectorRenderer.hpp +++ /dev/null @@ -1,193 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/hal/VectorRenderer.hpp - * - * Defines the touchgfx::VectorRenderer class. - */ -#ifndef TOUCHGFX_VECTORRENDERER_HPP -#define TOUCHGFX_VECTORRENDERER_HPP - -#include -#include -#include - -namespace touchgfx -{ - -/** - * Abstract interface for classes implementing general 2D vector - * drawing. - * - * Users of this interface are Widgets drawing vector graphics like - * SVG images. - * - * Implementations draw the path given (in drawPath) using the last - * color or gradient supplied with setColor, setLinearGradient, or - * setRadialGradient. - */ -class VectorRenderer -{ -public: - /** Virtual destructor. */ - virtual ~VectorRenderer() - { - } - - /** - * Gets the VectorRenderer instance. - * - * @return The VectorRenderer instance. - */ - static VectorRenderer* getInstance(); - - /** - * Start a new drawing in the given area. The area typically - * corresponds to an invalidated area of a Widget. - * Implementations may lock the framebuffer here. - * - * @param renderer The Widget that does the rendering. - * @param drawingArea The area of the screen to draw in. - */ - virtual void setup(const Widget& renderer, const Rect& drawingArea) = 0; - - /** - * A list of vector graphics drawing modes. - * - */ - enum DrawMode - { - STROKE, ///< Draw the outline of the paths - FILL_EVEN_ODD, ///< Fill the paths using the even-odd filling rule - FILL_NON_ZERO ///< Fill the paths using the non-zero filling rule - }; - - /** - * Set the drawing mode for the VectorRenderer. The mode will be - * used for all subsequent drawings until setMode is called again. - * - * The default mode is non-zero filling. - * - * @param mode The filling mode. - */ - virtual void setMode(DrawMode mode) = 0; - - /** - * Sets stroke miter limit. This the max distance from the Miter point on the stroke to the - * stroke point that will be used. If the miter limit is exceeded for a stroke join, it will not - * be drawn as a Miter but as a Bevel. - * - * @param miterLimit The miter limit. - */ - virtual void setStrokeMiterLimit(float miterLimit) = 0; - - /** - * Sets stroke line join type. - * - * @param lineJoin The line join type. - */ - virtual void setStrokeLineJoin(VGStrokeLineJoin lineJoin) = 0; - - /** - * Sets stroke line cap type. - * - * @param lineCap The line cap type. - */ - virtual void setStrokeLineCap(VGStrokeLineCap lineCap) = 0; - - /** - * Finalizes the current drawing. The implementation may block - * here until the drawing is done. - * - * The implementation is required to unlock the framebuffer when - * tearDown is called. - */ - virtual void tearDown() = 0; - - /** - * Draw a Path defined by the given array of primitives - * (commands) and an array of the corresponding floating point - * coordinates. - * - * @param cmds An uint8_t array of VectorPrimitives values - * @param nCmds The number of commands in cmds - * @param points An array of coordinates for the commands - * @param nPoints The number of values in the points arrays - * @param bbox Array describing the bounding box of the path [minx,miny,maxx,maxy] or 0 if unknown - */ - virtual void drawPath(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const float* bbox = 0) = 0; - - /** - * Set the width used for future drawings using the VECTOR_STROKE - * drawing mode. - * - * @param w The width used for stroke drawing. - */ - virtual void setStrokeWidth(float w) = 0; - - /** - * Set a constant color used for future drawings. - * - * @param c An ARGB color value - */ - virtual void setColor(colortype c) = 0; - - /** - * Set the alpha value (opacity) used for future drawings. - * The alpha is specified in the interval [0;1]. - * - * @param a The alpha value. - */ - virtual void setAlpha(uint8_t a) = 0; - - /** - * Set a linear gradient used for future drawings. - * The linear gradient is transformed using the current - * transformation matrix. - * Multiple colors (stops) can be specified for the gradient. The - * stop positions are given in the range [0;1]. - * - * @param x0 X-coordinate for gradient starting point - * @param y0 Y-coordinate for gradient starting point - * @param x1 X-coordinate for gradient end point - * @param y1 Y-coordinate for gradient end point - * @param stops Number of stops - * @param stopPositions Positions of the stops on the line - * @param stopColors Colors of the stops - * @param width Width of the box to fill - * @param height Height of the box to fill - * @param solid True if all colors in the gradient are solid - * @param palette The gradient palette - */ - virtual void setLinearGradient(float x0, float y0, float x1, float y1, - uint32_t stops, - const float* stopPositions, - const uint32_t* stopColors, - float width, - float height, - bool solid, - const uint32_t* palette) = 0; - - /** - * Sets the transformation matrix used for future drawings. - * The transformation is reset when setup is called. - * - * @param m The transformation matrix - * - */ - virtual void setTransformationMatrix(const Matrix3x3& m) = 0; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_VECTORRENDERER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp deleted file mode 100644 index bd7864d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/hal/VideoController.hpp +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/Drawable.hpp - * - * Declares the touchgfx::Drawable class. - */ -#ifndef TOUCHGFX_VIDEOCONTROLLER_HPP -#define TOUCHGFX_VIDEOCONTROLLER_HPP - -#include - -namespace touchgfx -{ -/** - * This type contains various information read from a video file. - */ -struct VideoInformation -{ - uint32_t ms_between_frames; ///< The number of milliseconds between frames - uint32_t number_of_frames; ///< The number of frames in the movie - uint32_t frame_width; ///< The frame width in pixels - uint32_t frame_height; ///< The frame height in pixels -}; - -/** Interface for classes reading video data from non-memory-mapped flash storage. */ -class VideoDataReader -{ -public: - /** Virtual destructor. */ - virtual ~VideoDataReader() - { - } - - /** - * Get the length of the data (file). - * - * @return The length of the data. - */ - virtual uint32_t getDataLength() = 0; - - /** - * Seek to a specific position in the data (file). - * - * @param position Byte position in the data that is needed next. - */ - virtual void seek(uint32_t position) = 0; - - /** - * Read data from flash to a buffer. This must be a synchrony method that does not return until - * the copy is done. - * - * @param [in,out] dst Address of destination buffer in RAM. - * @param bytes Number of bytes to copy. - * - * @return Returns true if read was successful. - */ - virtual bool readData(void* dst, uint32_t bytes) = 0; -}; - -class VideoWidget; - -/** - * The VideoController is an abstract interface for the video decoder. A - * concrete implementation will be generated by the TouchGFX - * Generator. - * - * The VideoController can control multiple video streams in multiple - * VideoWidgets. These are recognized by their Handle. - * - * Application code should only interact with the VideoWidget class. - * - * @see VideoWidget - */ -class VideoController -{ -public: - /** The commands send to the Controller. */ - enum Command - { - PLAY, ///< Play the video - PAUSE, ///< Pause the playing - SEEK, ///< Seek to frame - SHOW, ///< Show a frame - STOP, ///< Stop the video - SET_REPEAT ///< Set repeat mode - }; - - /** Virtual destructor. */ - virtual ~VideoController() - { - } - - /** Type to identify a video stream. */ - typedef uint32_t Handle; - - /** - * Gets the VideoController instance. - * - * @return The VideoController instance. - */ - static VideoController& getInstance(); - - /** - * Register a VideoWidget to get a Handle. - * - * @param [in,out] widget The VideoWidget. - * - * @return A video stream handle. - */ - virtual Handle registerVideoWidget(VideoWidget& widget) = 0; - - /** - * Unregister a VideoWidget to release the handle. - * - * @param handle The stream handle. - */ - virtual void unregisterVideoWidget(const Handle handle) = 0; - - /** - * Set the framerate for video using a qoutient of screen frames /video frames. - * - * To get 20 video frames pr second on a 60 fps display use video_frames = 20 and ui_frames = 60. - * - * @param handle The stream handle. - * @param ui_frames Number of UI frames (divider) - * @param video_frames Number of video_frames (dividend) - */ - virtual void setFrameRate(const Handle handle, uint32_t ui_frames, uint32_t video_frames) = 0; - - /** - * Signal that the widget can be invalidated (tickEvent). - * - * @param handle The stream handle. - * @param [in,out] widget The Widget. - * - * @return Returns true if video has more frames (i.e. false on the last frame). - */ - virtual bool updateFrame(const Handle handle, VideoWidget& widget) = 0; - - /** - * Draw the video content. - * - * @param handle The stream handle. - * @param invalidatedArea The area of the widget that must be redrawn. - * @param widget Reference to the widget. - */ - virtual void draw(const Handle handle, const Rect& invalidatedArea, const VideoWidget& widget) = 0; - - /** - * Set the video data for the stream. - * - * @param handle The stream handle. - * @param movie Pointer to the video data. - * @param length Length of the video data. - */ - virtual void setVideoData(const Handle handle, const uint8_t* movie, const uint32_t length) = 0; - - /** - * Set the video data for the stream. - * - * @param handle The stream handle. - * @param [in,out] reader Reference to a VideoDataReader object. - */ - virtual void setVideoData(const Handle handle, VideoDataReader& reader) = 0; - - /** - * Pass a command from the Widget to the Controller. - * - * @param handle The stream handle. - * @param cmd The Command. - * @param param A parameter. - */ - virtual void setCommand(const Handle handle, Command cmd, uint32_t param) = 0; - - /** - * Get the current frame number. - * - * @param handle The stream handle. - * - * @return Return the current frame number. - */ - virtual uint32_t getCurrentFrameNumber(const Handle handle) = 0; - - /** - * Get Video information. - * - * Get information from the video data. - * - * @param handle The stream handle. - * @param [in,out] data Pointer to VideoInformation where information should be stored. - */ - virtual void getVideoInformation(const Handle handle, VideoInformation* data) = 0; - - /** - * Check if the video stream is playing (not paused or stopped). - * - * @param handle The stream handle. - * - * @return Returns true if the video is playing. - */ - virtual bool getIsPlaying(const Handle handle) = 0; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_VIDEOCONTROLLER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp deleted file mode 100644 index 76ede80..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/DebugPrinter.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/DebugPrinter.hpp - * - * Declares the touchgfx::DebugPrinter class. - */ -#ifndef TOUCHGFX_DEBUGPRINTER_HPP -#define TOUCHGFX_DEBUGPRINTER_HPP - -#include - -namespace touchgfx -{ -/** - * The class DebugPrinter defines the interface for printing debug messages on top of the - * framebuffer. - */ -class DebugPrinter -{ -public: - /** Initializes a new instance of the DebugPrinter class. */ - DebugPrinter() - : debugString(0), debugRegion(), debugForegroundColor(0xffffffff), debugScale(1) - { - } - - /** Finalizes an instance of the DebugPrinter class. */ - virtual ~DebugPrinter() - { - } - - /** - * Sets the debug string to be displayed on top of the framebuffer. - * - * @param [in] string The string to be displayed. - */ - void setString(const char* string) - { - debugString = string; - } - - /** - * Sets the position onscreen where the debug string will be displayed. - * - * @param x The coordinate of the region where the debug string is displayed. - * @param y The coordinate of the region where the debug string is displayed. - * @param w The width of the region where the debug string is displayed. - * @param h The height of the region where the debug string is displayed. - */ - void setPosition(int16_t x, int16_t y, int16_t w, int16_t h) - { - debugRegion = Rect(x, y, w, h); - } - - /** - * Sets the font scale of the debug string. - * - * @param [in] scale The font scale of the debug string. - */ - void setScale(uint8_t scale) - { - if (!scale) - { - scale = 1; - } - - debugScale = scale; - } - - /** - * Sets the foreground color of the debug string. - * - * @param [in] fg The foreground color of the debug string. - */ - void setColor(colortype fg) - { - debugForegroundColor = fg; - } - - /** - * Draws the debug string on top of the framebuffer content. - * - * @param [in] rect The rect to draw inside. - */ - virtual void draw(const Rect& rect) const = 0; - - /** - * Returns the region where the debug string is displayed. - * - * @return Rect The debug string region. - */ - const Rect& getRegion() const - { - return debugRegion; - } - -protected: - /** - * Gets a glyph (15 bits) arranged with 3 bits wide, 5 bits high in a single uint16_t value. - * - * @param c The character to get a glyph for. - * - * @return The glyph. - */ - uint16_t getGlyph(uint8_t c) const - { - static const uint16_t builtin_debug_font[] = { - 000000, 022202, 055000, 057575, 026532, 051245, 025253, 022000, - 012221, 042224, 005250, 002720, 000024, 000700, 000002, 011244, - 025752, 026222, 061247, 061216, 045571, 074616, 034652, 071222, - 025252, 025312, 002020, 002024, 012421, 007070, 042124, 061202, - 025543, 025755, 065656, 034443, 065556, 074647, 074644, 034553, - 055755, 072227, 011152, 055655, 044447, 057555, 015754, 025552, - 065644, 025573, 065655, 034216, 072222, 055557, 055522, 055575, - 055255, 055222, 071247, 032223, 044211, 062226, 025000, 000007, - 042000, 003553, 046556, 003443, 013553, 002743, 012722, 002716, - 046555, 020627, 010316, 045655, 062227, 006777, 006555, 002552, - 006564, 003531, 006544, 003636, 022721, 005553, 005522, 005575, - 005255, 005316, 007247, 032623, 022222, 062326, 063000, 077777 - }; - - if (c < ' ' || c > '~') - { - c = 0x7F; - } - return builtin_debug_font[c - ' ']; - } - - const char* debugString; ///< Debug string to be displayed on screen. - Rect debugRegion; ///< Region on screen where the debug message is displayed. - colortype debugForegroundColor; ///< Font color to use when displaying the debug string. - uint8_t debugScale; ///< Font scaling factor to use when displaying the debug string. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp deleted file mode 100644 index 8a07bd3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD.hpp +++ /dev/null @@ -1,972 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD.hpp - * - * This file contains two super classes, namely LCD and DebugPrinter. The LCD class specifies - * various functions that allow drawing images, texts and boxes on the display. In general, - * these functions are available through various widgets which encapsulates these drawing - * operations and keep track of the state of image/text/etc. Please consult the documentation - * for the widgets for more information. - * - * @see touchgfx::LCD, touchgfx::DebugPrinter - */ -#ifndef TOUCHGFX_LCD_HPP -#define TOUCHGFX_LCD_HPP - -// LCD is defined in some CubeFW C header file. We have to undef to be able to create the LCD class -#ifdef LCD -#undef LCD -#endif - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This class contains the various low-level drawing routines for drawing bitmaps, texts and - * rectangles/boxes. Normally, these draw operations are called from widgets, which also - * keep track of logical states such as visibility etc. - * - * The LCD class cannot be instantiated, instead use one of the subclasses which - * implements the LCD drawing operations for a specific display configuration. - * - * @note All coordinates sent to functions in the LCD class are expected to be in absolute - * coordinates, i.e. (0, 0) is upper left corner of the display. - */ -class LCD -{ -public: - /** Initializes a new instance of the LCD class. */ - LCD() - : textureMapperClass(0) - { - } - - /** Finalizes an instance of the LCD class. */ - virtual ~LCD() - { - } - - /** - * Draws all (or a part) of a \a bitmap. The coordinates of the corner of the bitmap is - * given in (\a x, \a y) and \a rect describes which part of the \a bitmap should be - * drawn. The bitmap can be drawn as it is or more or less transparent depending on the - * value of \a alpha. The value of \a alpha is independent of the transparency of the - * individual pixels of the given \a bitmap. - * - * @param bitmap The bitmap to draw. - * @param x The absolute x coordinate to place (0, 0) of the bitmap on the screen. - * @param y The absolute y coordinate to place (0, 0) of the bitmap on the screen. - * @param rect A rectangle describing what region of the bitmap is to be drawn. - * @param alpha (Optional) Optional alpha value ranging from 0=invisible to - * 255=solid. Default is 255 (solid). - * @param useOptimized (Optional) if false, do not attempt to substitute (parts of) this - * bitmap with faster fillrects. - */ - virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true) = 0; - - /** - * Blits (directly copies) a block of data to the framebuffer, performing alpha blending - * (and tranparency keying) as specified. Performs a software blend if HAL does not - * support BLIT_COPY_WITH_ALPHA and alpha != 255 (solid). - * - * @param sourceData The source array pointer (points to the beginning of the - * data). The sourceData must be stored in a format - * suitable for the selected display. - * @param source The position and dimensions of the source. The x and y of this - * rect should both be 0. - * @param blitRect A rectangle describing what region of the \a sourceData is to - * be copied to the framebuffer. - * @param alpha The alpha value to use for blending ranging from 0=invisible - * to 255=solid=no blending. - * @param hasTransparentPixels If true, this data copy contains transparent pixels and - * require hardware support for that to be enabled. - */ - virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels) = 0; - - /** - * Blits (directly copies) a block of data to the framebuffer, performing alpha blending - * (and tranparency keying) as specified. Performs a software blend if HAL does not - * support BLIT_COPY_WITH_ALPHA and alpha < 255 (solid). - * - * If the display does not support the specified \a sourceFormat, an \a assert will be - * raised. - * - * @param sourceData The source array pointer (points to the beginning of the - * data). The sourceData must be stored in a format - * suitable for the selected display. - * @param sourceFormat The bitmap format used in the source data. - * @param source The position and dimensions of the source. The x and y of this - * rect should both be 0. - * @param blitRect A rectangle describing what region of the \a sourceData is to - * be copied to the framebuffer. - * @param alpha The alpha value to use for blending ranging from 0=invisible - * to 255=solid=no blending. - * @param hasTransparentPixels If true, this data copy contains transparent pixels and - * require hardware support for that to be enabled. - */ - virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels) = 0; - - /** - * Copies part of the framebuffer to the data section of a bitmap. The bitmap must be a - * dynamic bitmap or animation storage (BITMAP_ANIMATION_STORAGE). Only the part - * specified with by parameter \a region is copied. - * - * If \a region has negative x/y coordinates of if width/height exceeds those of the - * given bitmap, only the visible and legal part of the framebuffer is copied. The rest - * of the bitmap image is left untouched. - * - * @param region The part of the framebuffer to copy. - * @param bitmapId (Optional) The bitmap to store the data in. Default is to use - * Animation Storage. - * - * @return A pointer to the copy. - * - * @see blitCopy - * - * @note There is only one instance of animation storage. The content of the bitmap data (or - * animation storage) outside the given region is left untouched. - */ - uint16_t* copyFrameBufferRegionToMemory(const Rect& region, const BitmapId bitmapId = BITMAP_ANIMATION_STORAGE) - { - return copyFrameBufferRegionToMemory(region, region, bitmapId); - } - - /** - * Copies part of the framebuffer to the data section of a bitmap. The bitmap must be a - * dynamic bitmap or animation storage (BITMAP_ANIMATION_STORAGE). The two regions given - * are the visible region and the absolute region on screen. This is used to copy only a - * part of the framebuffer. This might be the case if a SnapshotWidget is placed inside - * a Container where parts of the SnapshowWidget is outside the area defined by the - * Container. The visible region must be completely inside the absolute region. - * - * @param visRegion The visible region. - * @param absRegion The absolute region. - * @param bitmapId Identifier for the bitmap. - * - * @return Null if it fails, else a pointer to the data in the given bitmap. - * - * @see blitCopy, copyFrameBufferRegionToMemory(const Rect&, const Rect&, uint8_t*, int16_t, int16_t) - * - * @note There is only one instance of animation storage. The content of the bitmap data - * /animation storage outside the given region is left untouched. - */ - virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, const BitmapId bitmapId) = 0; - - /** - * Copies part of the framebuffer to memory. The memory is assumed to have the same format as - * the framebuffer. The two regions given are the visible region and the absolute region on - * screen. This is used to copy only a part of the framebuffer. This might be the case if a - * SnapshotWidget is placed inside a Container where parts of the SnapshowWidget is outside the - * area defined by the Container. The visible region must be completely inside the absolute - * region. - * - * @param visRegion The visible region. - * @param absRegion The absolute region. - * @param [in,out] dst Destination memory in same format as the framebuffer. - * @param dstWidth Width of the destination. - * @param dstHeight Height of the destination. - * - * @return The rect that was actually copied to the destination buffer. - * - * @see blitCopy, copyFrameBufferRegionToMemory(const Rect&, const Rect&, const BitmapId) - * - * @note There is only one instance of animation storage. The content of the bitmap data - * /animation storage outside the given region is left untouched. - */ - virtual Rect copyFrameBufferRegionToMemory(const Rect& visRegion, const Rect& absRegion, uint8_t* dst, int16_t dstWidth, int16_t dstHeight) = 0; - - /** - * Copies part of the displayed framebuffer to current framebuffer. - * The region given is the absolute region on screen. - * - * @param region A rectangle describing what region of the displayed framebuffer - * is to be copied to the framebuffer. - * - * @note The copy is performed only when double buffering is enabled. Otherwise the given - * region in current framebuffer is left untouched. - */ - virtual void copyAreaFromTFTToClientBuffer(const Rect& region) = 0; - - /** - * Draws a filled rectangle in the framebuffer in the specified color and opacity. By - * default the rectangle will be drawn as a solid box. The rectangle can be drawn with - * transparency by specifying alpha from 0=invisible to 255=solid. - * - * @param rect The rectangle to draw in absolute display coordinates. - * @param color The rectangle color. - * @param alpha (Optional) The rectangle opacity, from 0=invisible to 255=solid. - * - * @see fillBuffer - */ - virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255) = 0; - - /** - * Draws a filled rectangle in destination memory using the specified color and opacity. The - * destination memory must have the same format as the display framebuffer. By default the - * rectangle will be drawn as a solid box. The rectangle can be drawn with transparency by - * specifying alpha from 0=invisible to 255=solid. - * - * @param [in] destination The start of the memory area to fill. - * @param pixelStride The pixel stride, i.e. number of pixels in a row. - * @param rect The rectangle to fill absolute coordinates. - * @param color The rectangle color. - * @param alpha The rectangle opacity, from 0=invisible to 255=solid. - * - * @note The pixelStride is rounded up to nearest whole bytes for displays with more than one - * pixel per byte (LCD1bpp, LCD2bpp and LCD4bpp) - */ - virtual void fillBuffer(uint8_t* const destination, uint16_t pixelStride, const Rect& rect, const colortype color, const uint8_t alpha) = 0; - - /** The visual elements when writing a string. */ - struct StringVisuals - { - const Font* font; ///< The font to use. - Alignment alignment; ///< The alignment to use. Default is LEFT. - TextDirection textDirection; ///< The direction to use. Default is LTR - TextRotation rotation; ///< Orientation (rotation) of the text. Default is TEXT_ROTATE_0. - colortype color; ///< RGB color value. Default is 0 (black). - int16_t linespace; ///< Line space in pixels for multiline strings. Default is 0. - uint8_t alpha; ///< 8-bit alpha value. Default is 255 (solid). - uint8_t indentation; ///< Indentation of text inside rectangle. Text will start this far from the left/right edge - WideTextAction wideTextAction; ///< What to do with wide text lines - - /** Initializes a new instance of the LCD class. */ - StringVisuals() - : font(0), alignment(LEFT), textDirection(TEXT_DIRECTION_LTR), rotation(TEXT_ROTATE_0), color(0), linespace(0), alpha(255), indentation(0), wideTextAction(WIDE_TEXT_NONE) - { - } - - /** - * Construct a StringVisual object for rendering text. - * - * @param svFont The Font with which to draw the text. - * @param svColor The color with which to draw the text. - * @param svAlpha Alpha blending. Default value is 255 (solid) - * @param svAlignment How to align the text. - * @param svLinespace Line space in pixels between each line, in case the text contains - * newline characters. - * @param svRotation How to rotate the text. - * @param svTextDirection The text direction. - * @param svIndentation The indentation of the text from the left and right of the text area - * rectangle. - * @param svWideTextAction (Optional) What to do with lines longer than the width of the - * TextArea. - */ - StringVisuals(const Font* svFont, colortype svColor, uint8_t svAlpha, Alignment svAlignment, int16_t svLinespace, TextRotation svRotation, TextDirection svTextDirection, uint8_t svIndentation, WideTextAction svWideTextAction = WIDE_TEXT_NONE) - : font(svFont), alignment(svAlignment), textDirection(svTextDirection), rotation(svRotation), color(svColor), linespace(svLinespace), alpha(svAlpha), indentation(svIndentation), wideTextAction(svWideTextAction) - { - } - }; - - /** - * Draws the specified Unicode string. Breaks line on newline. - * - * @param widgetArea The area covered by the drawing widget in absolute - * coordinates. - * @param invalidatedArea The (sub)region of the widget area to draw, expressed - * relative to the widget area. If the widgetArea is x=10, y=10, - * width=20, height=20 and invalidatedArea is x=5, y=5, width=6, - * height=6 the widgetArea drawn on the LCD is x=15, y=15, - * width=6, height=6. - * @param stringVisuals The string visuals (font, alignment, line space, color) - * with which to draw this string. - * @param format A pointer to a null-terminated text string with optional - * additional wildcard arguments. - * @param ... Variable arguments providing additional information. - */ - void drawString(Rect widgetArea, - const Rect& invalidatedArea, - const StringVisuals& stringVisuals, - const Unicode::UnicodeChar* format, - ...); - - /** - * Number of bits per pixel used by the display. - * - * @return The number of bits per pixel. - */ - virtual uint8_t bitDepth() const = 0; - - /** - * Framebuffer format used by the display. - * - * @return A Bitmap::BitmapFormat. - */ - virtual Bitmap::BitmapFormat framebufferFormat() const = 0; - - /** - * Framebuffer stride in bytes. The distance (in bytes) from the start of one - * framebuffer row, to the next. - * - * @return The number of bytes in one framebuffer row. - */ - virtual uint16_t framebufferStride() const = 0; - - /** - * Check if LCD support dynamic bitmap drawing. - * - * @param format The dynamic bitmap format. - * - * @return true if dynamic bitmap drawing is supported, false otherwise. - */ - virtual bool supportDynamicBitmapDrawing(const Bitmap::BitmapFormat format) - { - // return true if bitmap format matches framebuffer format - return (format == framebufferFormat()); - } - - /** - * Sets default color as used by alpha level only bitmap formats, e.g. A4. The default - * color, if no color is set, is black. - * - * @param color The color. - * - * @see getDefaultColor - */ - virtual void setDefaultColor(colortype color) - { - defaultColor = color; - } - - /** - * Gets default color previously set using setDefaultColor. - * - * @return The default color. - * - * @see setDefaultColor - */ - colortype getDefaultColor() const - { - return defaultColor; - } - - /** - * Texture map triangle. Draw a perspective correct texture mapped triangle. The - * vertices describes the surface, the x,y,z coordinates and the u,v coordinates of the - * texture. The texture contains the image data to be drawn The triangle line will be - * placed and clipped using the absolute and dirty rectangles The alpha will determine - * how the triangle should be alpha blended. The subDivisionSize will determine the size - * of the piecewise affine texture mapped portions of the triangle. - * - * @param dest The description of where the texture is drawn - can be used - * to issue a draw off screen. - * @param vertices The vertices of the triangle. - * @param texture The texture. - * @param absoluteRect The containing rectangle in absolute coordinates. - * @param dirtyAreaAbsolute The dirty area in absolute coordinates. - * @param renderVariant The render variant - includes the algorithm and the pixel - * format. - * @param alpha (Optional) the alpha. Default is 255 (solid). - * @param subDivisionSize (Optional) the size of the subdivisions of the scan line. - * Default is 12. - */ - virtual void drawTextureMapTriangle(const DrawingSurface& dest, - const Point3D* vertices, - const TextureSurface& texture, - const Rect& absoluteRect, - const Rect& dirtyAreaAbsolute, - RenderingVariant renderVariant, - uint8_t alpha = 255, - uint16_t subDivisionSize = 12); - - /** - * Texture map quad. Draw a perspective correct texture mapped quad. The - * vertices describes the surface, the x,y,z coordinates and the u,v coordinates of the - * texture. The texture contains the image data to be drawn The quad line will be - * placed and clipped using the absolute and dirty rectangles The alpha will determine - * how the quad should be alpha blended. The subDivisionSize will determine the size - * of the piecewise affine texture mapped portions of the quad. - * - * @param dest The description of where the texture is drawn - can be used - * to issue a draw off screen. - * @param vertices The vertices of the quad. - * @param texture The texture. - * @param absoluteRect The containing rectangle in absolute coordinates. - * @param dirtyAreaAbsolute The dirty area in absolute coordinates. - * @param renderVariant The render variant - includes the algorithm and the pixel - * format. - * @param alpha (Optional) the alpha. Default is 255 (solid). - * @param subDivisionSize (Optional) the size of the subdivisions of the scan line. - * Default is 12. - */ - virtual void drawTextureMapQuad(const DrawingSurface& dest, - const Point3D* vertices, - const TextureSurface& texture, - const Rect& absoluteRect, - const Rect& dirtyAreaAbsolute, - RenderingVariant renderVariant, - uint8_t alpha = 255, - uint16_t subDivisionSize = 12); - - /** - * Approximates an integer division of a 16bit value by 255. Divides numerator num (e.g. - * the sum resulting from an alpha-blending operation) by 255. - * - * @param [in] num The numerator to divide by 255. - * - * @return The result of a division by 255. - */ - FORCE_INLINE_FUNCTION static uint8_t div255(uint16_t num) - { - return (num + 1 + (num >> 8)) >> 8; - } - - /** - * Divides the red and blue components of pixelxAlpha by 255. - * - * @param [in] pixelxAlpha The red and blue components of a 32bit ARGB pixel multiplied - * by an alpha factor. - * - * @return pixelxAlpha with its red and blue components divided by 255. - */ - FORCE_INLINE_FUNCTION static uint32_t div255rb(uint32_t pixelxAlpha) - { - return ((pixelxAlpha + 0x10001 + ((pixelxAlpha >> 8) & 0xFF00FF)) >> 8) & 0xFF00FF; - } - - /** - * Divides the green component of pixelxAlpha by 255. - * - * @param [in] pixelxAlpha The green component of a 32bit ARGB pixel multiplied by an - * alpha factor. - * - * @return pixelxAlpha with its green component divided by 255. - */ - FORCE_INLINE_FUNCTION static uint32_t div255g(uint32_t pixelxAlpha) - { - return ((pixelxAlpha + 0x100 + (pixelxAlpha >> 8)) >> 8) & 0x00FF00; - } - -protected: - static const uint16_t newLine = 10; ///< NewLine value. - - static colortype defaultColor; ///< Default Color to use when displaying transparency-only elements, e.g. A4 bitmaps - - /** Base class for drawing scanline by the texture mapper. */ - class DrawTextureMapScanLineBase - { - public: - /** Finalizes an instance of the DrawTextureMapScanLineBase class. */ - virtual ~DrawTextureMapScanLineBase() - { - } - - /** - * Draw texture map scan line subdivisions. - * - * @param subdivisions The number of subdivisions. - * @param widthModLength Remainder of length (after subdivisions). - * @param pixelsToDraw The pixels to draw. - * @param affineLength Length of one subdivision. - * @param oneOverZRight 1/Z right. - * @param UOverZRight U/Z right. - * @param VOverZRight V/Z right. - * @param U U Coordinate in fixed16_16 notation. - * @param V V Coordinate in fixed16_16 notation. - * @param deltaU U delta to get to next pixel coordinate. - * @param deltaV V delta to get to next pixel coordinate. - * @param ULeft The left U. - * @param VLeft The left V. - * @param URight The right U. - * @param VRight The right V. - * @param ZRight The right Z. - * @param dest Destination drawing surface. - * @param destX Destination x coordinate. - * @param destY Destination y coordinate. - * @param texture The texture. - * @param alpha The global alpha. - * @param dOneOverZdXAff 1/ZdX affine. - * @param dUOverZdXAff U/ZdX affine. - * @param dVOverZdXAff V/ZdX affine. - */ - virtual void drawTextureMapScanLineSubdivisions(int subdivisions, const int widthModLength, int pixelsToDraw, const int affineLength, float oneOverZRight, float UOverZRight, float VOverZRight, fixed16_16 U, fixed16_16 V, fixed16_16 deltaU, fixed16_16 deltaV, float ULeft, float VLeft, float URight, float VRight, float ZRight, const DrawingSurface& dest, const int destX, const int destY, const TextureSurface& texture, uint8_t alpha, const float dOneOverZdXAff, const float dUOverZdXAff, const float dVOverZdXAff) = 0; - - protected: - static const fixed16_16 half = 0x8000; ///< 1/2 in fixed16_16 format - - /** - * Draw texture map next subdivision. - * - * @param [out] ULeft U left. - * @param [out] VLeft V left. - * @param [out] ZRight Z right. - * @param [out] URight U right. - * @param [out] VRight V right. - * @param [in,out] oneOverZRight 1/Z right. - * @param dOneOverZdXAff d1/ZdX affine. - * @param [in,out] UOverZRight U/Z right. - * @param dUOverZdXAff dU/ZdX affine. - * @param [in,out] VOverZRight V/Z right. - * @param dVOverZdXAff dV/ZdX affine. - * @param affineLength Length of the affine. - * @param [out] U Bitmap X in fixed16_16. - * @param [out] V Bitmap Y in fixed16_16. - * @param [out] deltaU U delta. - * @param [out] deltaV V delta. - */ - FORCE_INLINE_FUNCTION void drawTextureMapNextSubdivision(float& ULeft, float& VLeft, float& ZRight, float& URight, float& VRight, float& oneOverZRight, const float dOneOverZdXAff, float& UOverZRight, const float dUOverZdXAff, float& VOverZRight, const float dVOverZdXAff, const int affineLength, fixed16_16& U, fixed16_16& V, fixed16_16& deltaU, fixed16_16& deltaV) - { - ULeft = URight; - VLeft = VRight; - - oneOverZRight += dOneOverZdXAff; - UOverZRight += dUOverZdXAff; - VOverZRight += dVOverZdXAff; - - ZRight = 1 / oneOverZRight; - URight = ZRight * UOverZRight; - VRight = ZRight * VOverZRight; - - U = floatToFixed16_16(ULeft); - V = floatToFixed16_16(VLeft); - deltaU = floatToFixed16_16(URight - ULeft) / affineLength; - deltaV = floatToFixed16_16(VRight - VLeft) / affineLength; - } - - /** - * Check if value is inside [0..limit[. - * - * @param [in] value Value to check. - * @param [in] limit Upper limit. - * - * @return true if value is inside given limit. - */ - FORCE_INLINE_FUNCTION bool is1Inside(int value, int limit) const - { - return (value >= 0 && value < limit); - } - - /** - * Check if (x,y) is inside ([0..width[, [0..height[) - * - * @param [in] x X coordinate. - * @param [in] y Y coordinate. - * @param [in] width X limit. - * @param [in] height Y limit. - * - * @return true if (x,y) is inside given limits. - */ - FORCE_INLINE_FUNCTION bool is1x1Inside(int x, int y, int width, int height) const - { - return is1Inside(x, width) && is1Inside(y, height); - } - - /** - * Check if both value and value+1 are inside [0..limit[. - * - * @param [in] value Value to check. - * @param [in] limit Upper limit. - * - * @return true if value and value+1 are inside given limit. - */ - FORCE_INLINE_FUNCTION bool is2Inside(int value, int limit) const - { - return is1Inside(value, limit - 1); - } - - /** - * Check if both (x,y) and (x+1,y+1) are inside ([0..width[,[0..height[) - * - * @param [in] x X coordinate. - * @param [in] y Y coordinate. - * @param [in] width X limit. - * @param [in] height Y limit. - * - * @return true if (x,y) and (x+1,y+1) are inside given limits. - */ - FORCE_INLINE_FUNCTION bool is2x2Inside(int x, int y, int width, int height) const - { - return is2Inside(x, width) && is2Inside(y, height); - } - - /** - * Check if either value or value+1 is inside [0..limit[. - * - * @param [in] value Value to check. - * @param [in] limit Upper limit. - * - * @return true if either value or value+1 is inside given limit. - */ - FORCE_INLINE_FUNCTION bool is2PartiallyInside(int value, int limit) const - { - return is1Inside(value + 1, limit + 1); - } - - /** - * Check if either (x,y) or (x+1,y+1) is inside ([0..width[,[0..height[) - * - * @param [in] x X coordinate. - * @param [in] y Y coordinate. - * @param [in] width X limit. - * @param [in] height Y limit. - * - * @return true if either (x,y) or (x+1,y+1) is inside given limits. - */ - FORCE_INLINE_FUNCTION bool is2x2PartiallyInside(int x, int y, int width, int height) const - { - return is2PartiallyInside(x, width) && is2PartiallyInside(y, height); - } - }; - - /** - * Gets pointer to object that can draw a scan line which allows for highly specialized - * and optimized implementation. - * - * @param texture The texture Surface. - * @param renderVariant The render variant. - * @param alpha The global alpha. - * - * @return Null if it fails, else the pointer to the texture mapper draw scan line - * object. - */ - virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha); - - /** - * Draw scan line. Draw one horizontal line of the texture map on screen. The scan line - * will be drawn using perspective correct texture mapping. The appearance of the line - * is determined by the left and right edge and the gradients structure. The edges - * contain the information about the x,y,z coordinates of the left and right side - * respectively and also information about the u,v coordinates of the texture map used. - * The gradients structure contains information about how to interpolate all the values - * across the scan line. The data drawn should be present in the texture argument. - * - * The scan line will be drawn using the additional arguments. The scan line will be - * placed and clipped using the absolute and dirty rectangles The alpha will determine - * how the scan line should be alpha blended. The subDivisionSize will determine the - * size of the piecewise affine texture mapped lines. - * - * @param dest The description of where the texture is drawn - can be used - * to issue a draw off screen. - * @param gradients The gradients using in interpolation across the scan line. - * @param leftEdge The left edge of the scan line. - * @param rightEdge The right edge of the scan line. - * @param texture The texture. - * @param absoluteRect The containing rectangle in absolute coordinates. - * @param dirtyAreaAbsolute The dirty area in absolute coordinates. - * @param renderVariant The render variant - includes the algorithm and the pixel - * format. - * @param alpha The alpha. - * @param subDivisionSize The size of the subdivisions of the scan line. A value of 1 - * will give a completely perspective correct texture mapped - * scan line. A large value will give an affine texture mapped - * scan line. - */ - virtual void drawTextureMapScanLine(const DrawingSurface& dest, const Gradients& gradients, const Edge* leftEdge, const Edge* rightEdge, const TextureSurface& texture, const Rect& absoluteRect, const Rect& dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize); - - /** - * Private version of draw-glyph with explicit destination buffer pointer argument. For - * all parameters (except the buffer pointer) see the public function drawString(). - * - * @param [out] wbuf16 The destination (frame) buffer to draw to. - * @param widgetArea The canvas to draw the glyph inside. - * @param x Horizontal offset to start drawing the glyph. - * @param y Vertical offset to start drawing the glyph. - * @param offsetX Horizontal offset in the glyph to start drawing from. - * @param offsetY Vertical offset in the glyph to start drawing from. - * @param invalidatedArea The area to draw inside. - * @param glyph Specifications of the glyph to draw. - * @param glyphData Data containing the actual glyph (dense format) - * @param byteAlignRow Each row of glyph data starts in a new byte. - * @param color The color of the glyph. - * @param bitsPerPixel Bit depth of the glyph. - * @param alpha The transparency of the glyph. - * @param rotation Rotation to do before drawing the glyph. - */ - virtual void drawGlyph(uint16_t* wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation) = 0; - - /** - * Rotate a rectangle inside another rectangle. - * - * @param [in,out] rect The rectangle to rotate. - * @param canvas The rectangle containing the rect to rotate. - * @param rotation Rotation to perform on rect. - */ - static void rotateRect(Rect& rect, const Rect& canvas, const TextRotation rotation); - - /** - * Find the real, absolute x coordinate of a point inside a widget with regards to - * rotation. - * - * @param [in] widgetArea The widget containing the point. - * @param x The x coordinate. - * @param y The y coordinate. - * @param rotation Rotation to perform. - * - * @return The absolute x coordinate after applying appropriate rotation. - */ - static int realX(const Rect& widgetArea, int16_t x, int16_t y, TextRotation rotation); - - /** - * Find the real, absolute y coordinate of a point inside a widget with regards to - * rotation. - * - * @param [in] widgetArea The widget containing the point. - * @param x The x coordinate. - * @param y The y coordinate. - * @param rotation Rotation to perform. - * - * @return The absolute y coordinate after applying appropriate rotation. - */ - static int realY(const Rect& widgetArea, int16_t x, int16_t y, TextRotation rotation); - - /** - * Draws the specified Unicode string. Breaks line on newline. The string is assumed to - * contain only Latin characters written left-to-right. - * - * @param widgetArea The area covered by the drawing widget in absolute - * coordinates. - * @param invalidatedArea The (sub)region of the widget area to draw, expressed - * relative to the widget area. If the widgetArea is - * x=10, y=10, width=20, height=20 and invalidatedArea - * is x=5, y=5, width=6, height=6 the widgetArea drawn - * on the LCD is x=15, y=15, width=6, height=6. - * @param [in] visuals The string visuals (font, alignment, line space, color) - * with which to draw this string. - * @param format A pointer to a null-terminated text string with optional - * additional wildcard arguments. - * @param pArg Variable arguments providing additional information. - * - * @see drawString - */ - void drawStringLTR(const Rect& widgetArea, - const Rect& invalidatedArea, - const StringVisuals& visuals, - const Unicode::UnicodeChar* format, - va_list pArg); - - /** - * Draws the specified Unicode string. Breaks line on newline. The string can be either - * right-to-left or left-to-right and may contain sequences of Arabic / Hebrew and Latin - * characters. - * - * @param widgetArea The area covered by the drawing widget in absolute - * coordinates. - * @param invalidatedArea The (sub)region of the widget area to draw, expressed - * relative to the widget area. If the widgetArea is - * x=10, y=10, width=20, height=20 and invalidatedArea - * is x=5, y=5, width=6, height=6 the widgetArea drawn - * on the LCD is x=15, y=15, width=6, height=6. - * @param [in] visuals The string visuals (font, alignment, line space, color) - * with which to draw this string. - * @param format A pointer to a null-terminated text string with optional - * additional wildcard arguments. - * @param pArg Variable arguments providing additional information. - * - * @see drawString - */ - void drawStringRTL(const Rect& widgetArea, - const Rect& invalidatedArea, - const StringVisuals& visuals, - const Unicode::UnicodeChar* format, - va_list pArg); - - /** - * Find string width of the given number of ligatures read from the given TextProvider. - * After the introduction of Arabic, Thai, Hindi and other languages, ligatures are - * counted instead of characters. For Latin languages, number of characters equal number - * of ligatures. - * - * @param [in] textProvider The text provider. - * @param font The font. - * @param numChars Number of characters (ligatures). - * @param textDirection The text direction. - * - * @return An int16_t. - */ - static uint16_t stringWidth(TextProvider& textProvider, const Font& font, const int numChars, TextDirection textDirection); - - /** - * Gets number of lines for a given text taking word wrap into consideration. The font - * and width are required to find the number of lines in case word wrap is true. - * - * @param [in] textProvider The text provider. - * @param wideTextAction The wide text action in case lines are longer than the width - * of the text area. - * @param textDirection The text direction (LTR or RTL). - * @param font The font. - * @param width The width. - * - * @return The number lines. - */ - static uint16_t getNumLines(TextProvider& textProvider, WideTextAction wideTextAction, TextDirection textDirection, const Font* font, int16_t width); - - friend class Font; - friend class TextArea; - friend class TextAreaWithWildcardBase; - - /** - * Gets alpha from A4 image at given offset. The value is scaled up from range 0-15 to 0- - * 255. - * - * @param data A pointer to the start of the A4 data. - * @param offset The offset into the A4 image. - * - * @return The alpha from A4 (0-255). - */ - FORCE_INLINE_FUNCTION static uint8_t getAlphaFromA4(const uint16_t* data, uint32_t offset) - { - uint8_t byte = reinterpret_cast(data)[offset / 2]; - return ((offset & 1) == 0 ? byte & 0xF : byte >> 4) * 0x11; - } - -private: - DrawTextureMapScanLineBase* textureMapperClass; ///< Used during faster TextureMapper rendering - - /** A draw string internal structure. */ - class DrawStringInternalStruct - { - public: - uint16_t* frameBuffer; - const Rect* widgetArea; - int16_t widgetRectY; - const Rect* toDraw; - const StringVisuals* stringVisuals; - - /** Initializes a new instance of the DrawStringInternalStruct class. */ - DrawStringInternalStruct() - : frameBuffer(0), widgetArea(0), widgetRectY(0), toDraw(0), stringVisuals(0) - { - } - }; - - void drawStringRTLLine(int16_t& offset, const Font* font, TextDirection textDirection, TextProvider& textProvider, const int numChars, const bool useEllipsis, const DrawStringInternalStruct* data); - void drawStringRTLInternal(int16_t& offset, const Font* font, const TextDirection textDirection, TextProvider& drawTextProvider, const int numChars, const uint16_t widthOfNumChars, const DrawStringInternalStruct* data); - bool drawStringInternal(uint16_t* frameBuffer, const Rect* widgetArea, int16_t widgetRectY, int16_t offset, const Rect& invalidatedArea, const StringVisuals* stringVisuals, const TextDirection textDirection, TextProvider& textProvider, const int numChars, bool useEllipsis); - - /** A wide text internal structure. */ - class WideTextInternalStruct - { - public: - /** - * Initializes a new instance of the WideTextInternalStruct class. - * - * @param [in] textProvider The text provider. - * @param width The maximum width. - * @param height The height. - * @param direction The text direction. - * @param _font The font. - * @param _linespace The linespace. - * @param action The action. - */ - WideTextInternalStruct(TextProvider& textProvider, uint16_t width, uint16_t height, TextDirection direction, const Font* _font, int16_t _linespace, WideTextAction action) - : currChar(0), tp(textProvider), textDirection(direction), wideTextAction(action), font(_font), areaWidth(width), areaHeight(height), linespace(_linespace), charsRead(0), widthUsed(0), charsReadAhead(0), widthAhead(0), widthWithoutWhiteSpaceAtEnd(0), ellipsisGlyphWidth(0), useEllipsis(false) - { - if (wideTextAction != WIDE_TEXT_NONE) - { - Unicode::UnicodeChar ellipsisChar = font->getEllipsisChar(); - if (ellipsisChar != 0) - { - const GlyphNode* ellipsisGlyph = font->getGlyph(ellipsisChar); - if (ellipsisGlyph != 0) - { - ellipsisGlyphWidth = ellipsisGlyph->advance(); - if (wideTextAction == WIDE_TEXT_CHARWRAP_DOUBLE_ELLIPSIS) - { - ellipsisGlyphWidth += font->getKerning(ellipsisChar, ellipsisGlyph) + ellipsisGlyph->advance(); - } - } - } - } - } - - /** - * Gets string length for line. - * - * @param useWideTextEllipsisFlag True to use wide text ellipsis flag. - */ - void scanStringLengthForLine(); - - /** - * Query if 'ch' is space. - * - * @param ch The ch. - * - * @return True if space, false if not. - */ - bool isSpace(Unicode::UnicodeChar ch) - { - return ch == ' ' || ch == 0x200B; - } - - /** - * Gets current character. - * - * @return The current character. - */ - Unicode::UnicodeChar getCurrChar() const - { - return currChar; - } - - /** - * Gets line width. - * - * @return The line width. - */ - uint16_t getLineWidth() const - { - return widthWithoutWhiteSpaceAtEnd; - } - - /** - * Gets characters read. - * - * @return The characters read. - */ - uint16_t getCharsRead() const - { - return charsRead; - } - - /** - * Determines if we ellipsis was added at end of line. - * - * @return True if it succeeds (not more text), false otherwise. - */ - bool ellipsisAtEndOfLine() const - { - return useEllipsis; - } - - private: - Unicode::UnicodeChar currChar; - TextProvider& tp; - TextDirection textDirection; - WideTextAction wideTextAction; - const Font* font; - uint16_t areaWidth; - uint16_t areaHeight; - int16_t linespace; - uint16_t charsRead; - uint16_t widthUsed; - uint16_t charsReadAhead; - uint16_t widthAhead; - uint16_t widthWithoutWhiteSpaceAtEnd; - uint16_t ellipsisGlyphWidth; - bool useEllipsis; - - void addWord(uint16_t widthBeforeCurrChar, uint16_t widthBeforeWhiteSpaceAtEnd, uint16_t charsReadTooMany); - }; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp deleted file mode 100644 index b0bc8e3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD16DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD16DebugPrinter.hpp - * - * Declares the touchgfx::LCD16DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD16DEBUGPRINTER_HPP -#define TOUCHGFX_LCD16DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD16DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 16bit framebuffer. - * - * @see DebugPrinter - */ -class LCD16DebugPrinter : public DebugPrinter -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD16DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp deleted file mode 100644 index c2f5740..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD1DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD1DebugPrinter.hpp - * - * Declares the touchgfx::LCD1DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD1DEBUGPRINTER_HPP -#define TOUCHGFX_LCD1DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD1DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 1bit framebuffer. - * - * @see DebugPrinter - */ -class LCD1DebugPrinter : public DebugPrinter -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD1DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp deleted file mode 100644 index 9616fff..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD24DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD24DebugPrinter.hpp - * - * Declares the touchgfx::LCD24DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD24DEBUGPRINTER_HPP -#define TOUCHGFX_LCD24DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD24DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 24bit framebuffer. - * - * @see DebugPrinter - */ -class LCD24DebugPrinter : public DebugPrinter -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD24DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp deleted file mode 100644 index 705fc67..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD2DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD2DebugPrinter.hpp - * - * Declares the touchgfx::LCD2DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD2DEBUGPRINTER_HPP -#define TOUCHGFX_LCD2DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD2DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 2bit framebuffer. - * - * @see DebugPrinter - */ -class LCD2DebugPrinter : public DebugPrinter -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD2DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp deleted file mode 100644 index ff35a92..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD32DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD32DebugPrinter.hpp - * - * Declares the touchgfx::LCD32DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD32DEBUGPRINTER_HPP -#define TOUCHGFX_LCD32DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD32DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 32bit framebuffer. - * - * @see DebugPrinter - */ -class LCD32DebugPrinter : public DebugPrinter -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD32DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp deleted file mode 100644 index f46dbb0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD4DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD4DebugPrinter.hpp - * - * Declares the touchgfx::LCD4DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD4DEBUGPRINTER_HPP -#define TOUCHGFX_LCD4DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD4DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 4bit framebuffer. - * - * @see DebugPrinter - */ -class LCD4DebugPrinter : public DebugPrinter -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD4DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp deleted file mode 100644 index a429f61..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD8ABGR2222DebugPrinter.hpp - * - * Declares the touchgfx::LCD8ABGR2222DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD8ABGR2222DEBUGPRINTER_HPP -#define TOUCHGFX_LCD8ABGR2222DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD8ABGR2222DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 8bit framebuffer. - * - * @see DebugPrinter - */ -class LCD8ABGR2222DebugPrinter : public LCD8DebugPrinterBase -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8ABGR2222DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp deleted file mode 100644 index 7f8d803..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD8ARGB2222DebugPrinter.hpp - * - * Declares the touchgfx::LCD8ARGB2222DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD8ARGB2222DEBUGPRINTER_HPP -#define TOUCHGFX_LCD8ARGB2222DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD8ARGB2222DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 8bit framebuffer. - * - * @see DebugPrinter - */ -class LCD8ARGB2222DebugPrinter : public LCD8DebugPrinterBase -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8ARGB2222DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp deleted file mode 100644 index 319a543..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD8BGRA2222DebugPrinter.hpp - * - * Declares the touchgfx::LCD8BGRA2222DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD8BGRA2222DEBUGPRINTER_HPP -#define TOUCHGFX_LCD8BGRA2222DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD8BGRA2222DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 8bit framebuffer. - * - * @see DebugPrinter - */ -class LCD8BGRA2222DebugPrinter : public LCD8DebugPrinterBase -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8BGRA2222DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp deleted file mode 100644 index aadba58..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8DebugPrinterBase.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD8DebugPrinterBase.hpp - * - * Declares the touchgfx::LCD8DebugPrinterBase class. - */ -#ifndef TOUCHGFX_LCD8DEBUGPRINTERBASE_HPP -#define TOUCHGFX_LCD8DEBUGPRINTERBASE_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD8DebugPrinterBase defines the abstract base class used for printing debug messages - * on top of a specific 8bit framebuffer, with a specifc color type. - * - * @note The DebugPrinter interface is implemented in each specific LCD8 debug printer. - * @see LCD8ABGR2222DebugPrinter, LCD8ARGB2222DebugPrinter, LCD8BGRA2222DebugPrinter, LCD8RGBA2222DebugPrinter - * - */ -class LCD8DebugPrinterBase : public DebugPrinter -{ -protected: - /** - * Draws the DebugPrinter::debugString on top of the framebuffer content. - * - * @param [in] rect The rect to draw inside. - * @param [in] debugColorType The specific 8bit color type to use. - */ - void drawColorType(const Rect& rect, const uint8_t debugColorType) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8DEBUGPRINTERBASE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp deleted file mode 100644 index cf36b7c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/lcd/LCD8RGBA2222DebugPrinter.hpp - * - * Declares the touchgfx::LCD8RGBA2222DebugPrinter class. - */ -#ifndef TOUCHGFX_LCD8RGBA2222DEBUGPRINTER_HPP -#define TOUCHGFX_LCD8RGBA2222DEBUGPRINTER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The class LCD8RGBA2222DebugPrinter implements the DebugPrinter interface for printing debug messages - * on top of 8bit framebuffer. - * - * @see DebugPrinter - */ -class LCD8RGBA2222DebugPrinter : public LCD8DebugPrinterBase -{ -public: - virtual void draw(const Rect& rect) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LCD8RGBA2222DEBUGPRINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp deleted file mode 100644 index 6b43700..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/ClickListener.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/mixins/ClickListener.hpp - * - * Declares the touchgfx::ClickListener class. - */ -#ifndef TOUCHGFX_CLICKLISTENER_HPP -#define TOUCHGFX_CLICKLISTENER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * Mix-in class that extends a class with a click action event that is called when the class - * receives a click event. - * - * @tparam T specifies the type to extend with the ClickListener behavior. - */ -template -class ClickListener : public T -{ -public: - /** Initializes a new instance of the ClickListener class. Make the object touchable. */ - ClickListener() - : T(), clickAction(0) - { - T::setTouchable(true); - } - - /** - * Ensures that the clickEvent is propagated to the super class T and to the clickAction - * listener. - * - * @param event Information about the click. - */ - virtual void handleClickEvent(const ClickEvent& event) - { - T::handleClickEvent(event); - if (clickAction && clickAction->isValid()) - { - clickAction->execute(*this, event); - } - } - - /** - * Associates an action to be performed when the class T is clicked. - * - * @param callback The callback to be executed. The callback will be given a reference - * to T. - */ - void setClickAction(GenericCallback& callback) - { - clickAction = &callback; - } - -protected: - GenericCallback* clickAction; ///< The callback to be executed when T is clicked -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CLICKLISTENER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp deleted file mode 100644 index 05495f5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Draggable.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/mixins/Draggable.hpp - * - * Declares the touchgfx::Draggable class. - */ -#ifndef TOUCHGFX_DRAGGABLE_HPP -#define TOUCHGFX_DRAGGABLE_HPP - -#include - -namespace touchgfx -{ -/** - * Mix-in class that extends a class to become Draggable, which means that the object on screen - * can be freely moved around using the touch screen. - * - * @tparam T specifies the type to extend with the Draggable behavior. - */ -template -class Draggable : public T -{ -public: - /** Initializes a new instance of the Draggable class. Make the object touchable. */ - Draggable() - : T() - { - T::setTouchable(true); - } - - /** - * Called when dragging the Draggable object. The object is moved according to the drag - * event. - * - * @param event The drag event. - */ - virtual void handleDragEvent(const DragEvent& event) - { - T::handleDragEvent(event); - T::moveRelative(event.getDeltaX(), event.getDeltaY()); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DRAGGABLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp deleted file mode 100644 index b76563c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/FadeAnimator.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/mixins/FadeAnimator.hpp - * - * Declares the touchgfx::FadeAnimator class. - */ -#ifndef TOUCHGFX_FADEANIMATOR_HPP -#define TOUCHGFX_FADEANIMATOR_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A FadeAnimator makes the template class T able to animate the alpha value from its current - * value to a specified end value. It is possible to use a fade in effect as well as - * fade out effect using FadeAnimator. The alpha progression can be described by - * supplying an EasingEquation. The FadeAnimator performs a callback when the animation - * has finished. - * - * This mixin can be used on any Drawable that has a 'void setAlpha(uint8_t)' and a - * 'uint8_t getAlpha()' method. - * - * @tparam T specifies the type to extend with the FadeAnimator behavior. - */ -template -class FadeAnimator : public T -{ -public: - FadeAnimator() - : T(), - fadeAnimationRunning(false), - fadeAnimationCounter(0), - fadeAnimationDelay(0), - fadeAnimationEndedCallback(0) - { - } - - /** - * Associates an action to be performed when the animation ends. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the FadeAnimator. - */ - void setFadeAnimationEndedAction(GenericCallback&>& callback) - { - fadeAnimationEndedCallback = &callback; - } - - /** - * Clears the fade animation ended action previously set by setFadeAnimationEndedAction. - * - * Clears the fade animation ended action previously set by setFadeAnimationEndedAction. - * - * @see setFadeAnimationEndedAction - */ - void clearFadeAnimationEndedAction() - { - fadeAnimationEndedCallback = 0; - } - - /** - * Sets a delay before the actual animation starts for the animation done by the - * FadeAnimator. - * - * @param delay The delay in ticks. - * - * @see getFadeAnimationDelay - */ - virtual void setFadeAnimationDelay(uint16_t delay) - { - fadeAnimationDelay = delay; - } - - /** - * Gets the current animation delay. - * - * @return The current animation delay. - * - * @see setFadeAnimationDelay - */ - virtual uint16_t getFadeAnimationDelay() const - { - return fadeAnimationDelay; - } - - /** - * Gets whether or not the fade animation is running. - * - * @return true if the fade animation is running. - */ - bool isFadeAnimationRunning() const - { - return fadeAnimationRunning; - } - - /** - * Starts the fade animation from the current alpha value to the specified end alpha - * value. The progression of the alpha value during the animation is described by the - * supplied EasingEquation. - * - * @param endAlpha The alpha value of T at animation end. - * @param duration The duration of the animation measured in ticks. - * @param alphaProgressionEquation (Optional) The equation that describes the - * development of the alpha value during the animation. - * Default is EasingEquations::linearEaseNone. - */ - void startFadeAnimation(uint8_t endAlpha, uint16_t duration, EasingEquation alphaProgressionEquation = &EasingEquations::linearEaseNone) - { - if (!fadeAnimationRunning) - { - Application::getInstance()->registerTimerWidget(this); - } - - fadeAnimationCounter = 0; - fadeAnimationStartAlpha = T::getAlpha(); - fadeAnimationEndAlpha = endAlpha; - fadeAnimationDuration = duration; - fadeAnimationAlphaEquation = alphaProgressionEquation; - - fadeAnimationRunning = true; - - if (fadeAnimationDelay == 0 && fadeAnimationDuration == 0) - { - nextFadeAnimationStep(); // Set end alpha and shut down - } - } - - /** - * Cancel fade animation. The animation is stopped and the alpha value is left where it - * currently is. - */ - void cancelFadeAnimation() - { - if (fadeAnimationRunning) - { - Application::getInstance()->unregisterTimerWidget(this); - fadeAnimationRunning = false; - } - } - - /** @copydoc Drawable::handleTickEvent */ - virtual void handleTickEvent() - { - T::handleTickEvent(); - nextFadeAnimationStep(); - } - -protected: - /** Execute next step in fade animation and stop the timer if necessary. */ - void nextFadeAnimationStep() - { - if (fadeAnimationRunning) - { - fadeAnimationCounter++; - if (fadeAnimationCounter >= fadeAnimationDelay) - { - // Adjust the used animationCounter for the startup delay - uint32_t actualAnimationCounter = fadeAnimationCounter - fadeAnimationDelay; - - int16_t newAlpha = fadeAnimationStartAlpha + (int16_t)fadeAnimationAlphaEquation(actualAnimationCounter, 0, fadeAnimationEndAlpha - fadeAnimationStartAlpha, fadeAnimationDuration); - - if (T::getAlpha() != newAlpha) - { - if (newAlpha == 0) - { - // InvalidateContent before it becomes invisible - T::invalidateContent(); - T::setAlpha((uint8_t)newAlpha); - } - else - { - // InvalidateContent after we are sure that it is visible - T::setAlpha((uint8_t)newAlpha); - T::invalidateContent(); - } - } - - if (fadeAnimationCounter >= (uint32_t)(fadeAnimationDelay + fadeAnimationDuration)) - { - // End of animation - fadeAnimationRunning = false; - fadeAnimationDuration = 0; - Application::getInstance()->unregisterTimerWidget(this); - - if (fadeAnimationEndedCallback && fadeAnimationEndedCallback->isValid()) - { - fadeAnimationEndedCallback->execute(*this); - } - } - } - } - } - - bool fadeAnimationRunning; ///< True if the animation is running. - uint16_t fadeAnimationCounter; ///< To the current step in the animation - uint16_t fadeAnimationDelay; ///< A delay that is applied before animation start. Expressed in ticks. - uint16_t fadeAnimationDuration; ///< The complete duration of the animation. Expressed in ticks. - int16_t fadeAnimationStartAlpha; ///< The alpha value at the beginning of the animation. - int16_t fadeAnimationEndAlpha; ///< The alpha value at the end of the animation. - EasingEquation fadeAnimationAlphaEquation; ///< EasingEquation expressing the progression of the alpha value during the animation. - - GenericCallback&>* fadeAnimationEndedCallback; ///< Animation ended Callback. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_FADEANIMATOR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp deleted file mode 100644 index 77c75ef..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/MoveAnimator.hpp +++ /dev/null @@ -1,224 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/mixins/MoveAnimator.hpp - * - * Declares the touchgfx::MoveAnimator class. - */ -#ifndef TOUCHGFX_MOVEANIMATOR_HPP -#define TOUCHGFX_MOVEANIMATOR_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A MoveAnimator makes the template class T able to animate a movement from its current - * position to a specified end position. The speed of the movement in both the X and Y - * direction can be controlled by supplying EasingEquations. The MoveAnimator performs a - * callback when the animation has finished. - * - * This mixin can be used on any Drawable. - */ -template -class MoveAnimator : public T -{ -public: - MoveAnimator() - : T(), - moveAnimationRunning(false), - moveAnimationCounter(0), - moveAnimationDelay(0), - moveAnimationDuration(0), - moveAnimationStartX(0), - moveAnimationStartY(0), - moveAnimationEndX(0), - moveAnimationEndY(0), - moveAnimationXEquation(), - moveAnimationYEquation(), - moveAnimationEndedCallback(0) - { - } - - /** - * Associates an action to be performed when the animation ends. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the MoveAnimator. - * - * @see clearMoveAnimationEndedAction - */ - void setMoveAnimationEndedAction(GenericCallback&>& callback) - { - moveAnimationEndedCallback = &callback; - } - - /** - * Clears the move animation ended action previously set by setMoveAnimationEndedAction. - * The effect is that any action set using setMoveAnimationEndedAction() will not be - * executed. - * - * @see setMoveAnimationEndedAction - */ - void clearMoveAnimationEndedAction() - { - moveAnimationEndedCallback = 0; - } - - /** - * Sets a delay on animations done by the MoveAnimator. - * - * @param delay The delay in ticks. - * - * @see getMoveAnimationDelay - */ - virtual void setMoveAnimationDelay(uint16_t delay) - { - moveAnimationDelay = delay; - } - - /** - * Gets the current animation delay. - * - * @return The current animation delay. - * - * @see setMoveAnimationDelay - */ - virtual uint16_t getMoveAnimationDelay() const - { - return moveAnimationDelay; - } - - /** - * Gets whether or not the move animation is running. - * - * @return true if the move animation is running. - */ - bool isMoveAnimationRunning() const - { - return moveAnimationRunning; - } - - /** - * Starts the move animation from the current position to the specified end position. - * The development of the position (X, Y) during the animation is described by the - * supplied EasingEquations. If no easing equation is given, the movement is performed - * linear. - * - * @param endX The X position at animation end. - * @param endY The Y position at animation end. - * @param duration The duration of the animation measured in ticks. - * @param xProgressionEquation (Optional) The equation that describes the development of the - * X position during the animation. Default is - * EasingEquations::linearEaseNone. - * @param yProgressionEquation (Optional) The equation that describes the development of the - * Y position during the animation. Default is - * EasingEquations::linearEaseNone. - */ - void startMoveAnimation(int16_t endX, int16_t endY, uint16_t duration, EasingEquation xProgressionEquation = &EasingEquations::linearEaseNone, EasingEquation yProgressionEquation = &EasingEquations::linearEaseNone) - { - if (!moveAnimationRunning) - { - Application::getInstance()->registerTimerWidget(this); - } - - moveAnimationCounter = 0; - moveAnimationStartX = T::getX(); - moveAnimationStartY = T::getY(); - moveAnimationEndX = endX; - moveAnimationEndY = endY; - moveAnimationDuration = duration; - moveAnimationXEquation = xProgressionEquation; - moveAnimationYEquation = yProgressionEquation; - - moveAnimationRunning = true; - - if (moveAnimationDelay == 0 && moveAnimationDuration == 0) - { - nextMoveAnimationStep(); // Set end position and shut down - } - } - - /** - * Cancel move animation and leave the Drawable in its current position. If the - * animation is not running, nothing is done. - */ - void cancelMoveAnimation() - { - if (moveAnimationRunning) - { - Application::getInstance()->unregisterTimerWidget(this); - moveAnimationRunning = false; - } - } - - /** The tick handler that handles the actual animation steps. */ - virtual void handleTickEvent() - { - T::handleTickEvent(); - nextMoveAnimationStep(); - } - -protected: - /** Execute next step in move animation and stop the timer if the animation has finished. */ - void nextMoveAnimationStep() - { - if (moveAnimationRunning) - { - moveAnimationCounter++; - if (moveAnimationCounter >= moveAnimationDelay) - { - // Adjust the used animationCounter for the startup delay - uint32_t actualAnimationCounter = moveAnimationCounter - moveAnimationDelay; - - int16_t deltaX = moveAnimationXEquation(actualAnimationCounter, 0, moveAnimationEndX - moveAnimationStartX, moveAnimationDuration); - int16_t deltaY = moveAnimationYEquation(actualAnimationCounter, 0, moveAnimationEndY - moveAnimationStartY, moveAnimationDuration); - - T::moveTo(moveAnimationStartX + deltaX, moveAnimationStartY + deltaY); - - if (moveAnimationCounter >= (uint32_t)(moveAnimationDelay + moveAnimationDuration)) - { - // End of animation - moveAnimationRunning = false; - moveAnimationCounter = 0; - Application::getInstance()->unregisterTimerWidget(this); - - if (moveAnimationEndedCallback && moveAnimationEndedCallback->isValid()) - { - moveAnimationEndedCallback->execute(*this); - } - } - } - } - } - - bool moveAnimationRunning; ///< True if the animation is running - uint16_t moveAnimationCounter; ///< Counter that is equal to the current step in the animation - uint16_t moveAnimationDelay; ///< The delay applied before animation start. Expressed in ticks. - uint16_t moveAnimationDuration; ///< The complete duration of the actual animation. Expressed in ticks. - int16_t moveAnimationStartX; ///< The X value at the beginning of the animation. - int16_t moveAnimationStartY; ///< The Y value at the beginning of the animation. - int16_t moveAnimationEndX; ///< The X value at the end of the animation. - int16_t moveAnimationEndY; ///< The Y value at the end of the animation. - EasingEquation moveAnimationXEquation; ///< EasingEquation expressing the development of the X value during the animation. - EasingEquation moveAnimationYEquation; ///< EasingEquation expressing the development of the Y value during the animation. - - GenericCallback&>* moveAnimationEndedCallback; ///< Animation ended Callback. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_MOVEANIMATOR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp deleted file mode 100644 index 26a7ae0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/mixins/Snapper.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/mixins/Snapper.hpp - * - * Declares the touchgfx::Snapper class. - */ -#ifndef TOUCHGFX_SNAPPER_HPP -#define TOUCHGFX_SNAPPER_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A mix-in that will make class T draggable and able to snap to a position when a drag - * operation has ended. The mix-in is able to perform callbacks when the snapper gets - * dragged and when the Snapper snaps to its snap position. - * - * @see Draggable - * - * @tparam T specifies the type to enable the Snap behavior to. - */ -template -class Snapper : public Draggable -{ -public: - Snapper() - : Draggable(), snapPositionX(0), snapPositionY(0), dragAction(0), snappedAction(0) - { - } - - virtual void handleDragEvent(const DragEvent& event) - { - Draggable::handleDragEvent(event); - - if (dragAction && dragAction->isValid()) - { - dragAction->execute(event); - } - } - - /** - * Handles the click events when the Snapper is clicked. It saves its current position - * as the snap position if the Snapper is pressed. This happens when the drag operation - * starts. - * - * The snapper will then move to the snap position when the click is released. This - * happens when the drag operation ends. - * - * @param event The click event. - */ - virtual void handleClickEvent(const ClickEvent& event) - { - T::handleClickEvent(event); - - if (event.getType() == ClickEvent::RELEASED) - { - if (snappedAction && snappedAction->isValid()) - { - snappedAction->execute(); - } - - T::moveTo(snapPositionX, snapPositionY); - } - else if (event.getType() == ClickEvent::PRESSED) - { - snapPositionX = T::getX(); - snapPositionY = T::getY(); - } - } - - /** - * Sets the position the Snapper should snap to. This position will be overridden with - * the Snappers current position when the Snapper is pressed. - * - * @param x The x coordinate. - * @param y The y coordinate. - */ - void setSnapPosition(int16_t x, int16_t y) - { - snapPositionX = x; - snapPositionY = y; - } - - /** - * Associates an action to be performed when the Snapper is dragged. - * - * @param callback The callback will be executed with the DragEvent. - * - * @see GenericCallback - */ - void setDragAction(GenericCallback& callback) - { - dragAction = &callback; - } - - /** - * Associates an action to be performed when the Snapper is snapped. - * - * @param [in] callback The callback to be executed on snap. - * - * @see GenericCallback - */ - void setSnappedAction(GenericCallback<>& callback) - { - snappedAction = &callback; - } - -private: - int16_t snapPositionX; - int16_t snapPositionY; - GenericCallback* dragAction; - GenericCallback<>* snappedAction; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SNAPPER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp deleted file mode 100644 index aff3633..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/DisplayTransformation.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transforms/DisplayTransformation.hpp - * - * Declares the touchgfx::DisplayTransformation class. - */ -#ifndef TOUCHGFX_DISPLAYTRANSFORMATION_HPP -#define TOUCHGFX_DISPLAYTRANSFORMATION_HPP - -#include - -namespace touchgfx -{ -/** - * Defines transformations from display space to framebuffer space. The display might be - * (considered) in portrait mode from 0,0 to 272,480, while the actual framebuffer is - * from 0,0 to 480,272. This class handles the transformations. - */ -class DisplayTransformation -{ -public: - /** - * Transform x,y from display to framebuffer coordinates. - * - * @param [in,out] x the x part to translate. - * @param [in,out] y the y part to translate. - */ - static void transformDisplayToFrameBuffer(int16_t& x, int16_t& y); - - /** - * Transform x,y from display to framebuffer coordinates. - * - * @param [in,out] x the x part to translate. - * @param [in,out] y the y part to translate. - */ - static void transformDisplayToFrameBuffer(float& x, float& y); - - /** - * Transform x,y from framebuffer to display coordinates. - * - * @param [in,out] x the x part to translate. - * @param [in,out] y the y part to translate. - */ - static void transformFrameBufferToDisplay(int16_t& x, int16_t& y); - - /** - * Transform x,y from coordinates relative to the in rect to framebuffer coordinates. - * - * Transform x,y from coordinates relative to the in rect to framebuffer coordinates. - * - * @param [in,out] x the x part to translate. - * @param [in,out] y the y part to translate. - * @param in the rectangle defining the coordinate space. - */ - static void transformDisplayToFrameBuffer(int16_t& x, int16_t& y, const Rect& in); - - /** - * Transform x,y from coordinates relative to the in rect to framebuffer coordinates. - * - * Transform x,y from coordinates relative to the in rect to framebuffer coordinates. - * - * @param [in,out] x the x part to translate. - * @param [in,out] y the y part to translate. - * @param in the rectangle defining the coordinate space. - */ - static void transformDisplayToFrameBuffer(float& x, float& y, const Rect& in); - - /** - * Transform rectangle from display to framebuffer coordinates. - * - * @param [in,out] r the rectangle to translate. - */ - static void transformDisplayToFrameBuffer(Rect& r); - - /** - * Transform rectangle from framebuffer to display coordinates. - * - * @param [in,out] r the rectangle to translate. - */ - static void transformFrameBufferToDisplay(Rect& r); - - /** - * Transform rectangle r from coordinates relative to the in rect to framebuffer - * coordinates. - * - * Transform rectangle r from coordinates relative to the in rect to framebuffer - * coordinates. - * - * @param [in,out] r the rectangle to translate. - * @param in the rectangle defining the coordinate space. - */ - static void transformDisplayToFrameBuffer(Rect& r, const Rect& in); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_DISPLAYTRANSFORMATION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp deleted file mode 100644 index 47e7d54..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transforms/TouchCalibration.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transforms/TouchCalibration.hpp - * - * Declares the touchgfx::TouchCalibration class. - */ -#ifndef TOUCHGFX_TOUCHCALIBRATION_HPP -#define TOUCHGFX_TOUCHCALIBRATION_HPP - -#include - -namespace touchgfx -{ -/** - * Calibrates a touch coordinate. - * - * Class TouchCalibraiton is responsible for translating coordinates (Point) based on - * matrix of calibration values. - */ -class TouchCalibration -{ -public: - TouchCalibration() - { - matrix.Divider = 0; - } - - /** - * Initializes the calibration matrix based on reference and measured values. - * - * @param ref Pointer to array of three reference points. - * @param scr Pointer to array of three measured points. - */ - static void setCalibrationMatrix(const Point* ref, const Point* scr); - - /** - * Translates the specified point using the matrix. If matrix has not been initialized, - * p is not modified. - * - * @param [in,out] p The point to translate. - */ - static void translatePoint(Point& p); - -private: - static int32_t muldiv(int32_t factor1, int32_t clzu1, int32_t factor2, int32_t divisor, int32_t& remainder); - static uint32_t muldivu(const uint32_t factor1, const uint32_t clzu1, const uint32_t factor2, const uint32_t clzu2, const uint32_t divisor, uint32_t& remainder); - - static int32_t clzu(uint32_t x); - - /** - * A matrix. See http://www.embedded.com/design/system-integration/4023968/How-To-Calibrate-Touch-Screens - * for calibration technique by Carlos E. Vidales. - */ - struct Matrix - { - int32_t An, Bn, Cn, Dn, En, Fn, Divider; - int32_t clzuAn, clzuBn, clzuDn, clzuEn; - }; - - static Matrix matrix; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TOUCHCALIBRATION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp deleted file mode 100644 index 7ac5103..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/BlockTransition.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transitions/BlockTransition.hpp - * - * Declares the touchgfx::BlockTransition class. - */ -#ifndef TOUCHGFX_BLOCKTRANSITION_HPP -#define TOUCHGFX_BLOCKTRANSITION_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A Transition that draws two small blocks in every frame. It is - * therefore very useful on MCUs with limited performance. - */ -class BlockTransition : public Transition -{ -public: - /** - * Initializes a new instance of the BlockTransition class. - * - * @param transitionSteps (Optional) Number of steps in the transition animation. - */ - BlockTransition() - : Transition(), - animationCounter(0) - { - // 8x6 blocks, with 8 blocks on the longest edge - if (HAL::DISPLAY_WIDTH > HAL::DISPLAY_HEIGHT) - { - blockWidth = (HAL::DISPLAY_WIDTH + 7) / 8; - blockHeight = (HAL::DISPLAY_HEIGHT + 5) / 6; - blocksHorizontal = 8; - } - else - { - blockWidth = (HAL::DISPLAY_WIDTH + 5) / 6; - blockHeight = (HAL::DISPLAY_HEIGHT + 7) / 8; - blocksHorizontal = 6; - } - } - - /** - * Handles the tick event when transitioning. It uncovers and - * invalidates two blocks in every frame, for a total of 24 - * frames. - */ - virtual void handleTickEvent() - { - const int animationSteps = 48; - // "Random" sequence of blocks to invalidate - const int indeces[animationSteps] = { 20, 11, 47, 14, 10, 0, 18, 28, 13, 6, 2, 41, - 44, 5, 3, 17, 36, 46, 26, 15, 29, 39, 25, 12, - 19, 24, 7, 38, 37, 30, 9, 43, 4, 31, 22, 23, - 35, 16, 32, 42, 8, 1, 40, 33, 21, 27, 34, 45 }; - - Transition::handleTickEvent(); - - if (animationCounter >= animationSteps) - { - // Final step: stop the animation - done = true; - return; - } - - if (animationCounter == 0 && HAL::USE_DOUBLE_BUFFERING) - { - // Synchronize framebuffers - Application::getInstance()->copyInvalidatedAreasFromTFTToClientBuffer(); - } - - int blocks_per_tick = 2; - while (blocks_per_tick-- > 0 && animationCounter <= animationSteps) - { - // Invalidate next block in sequence - const int index = indeces[animationCounter]; - - const int16_t x = (index % blocksHorizontal) * blockWidth; - const int16_t y = (index / blocksHorizontal) * blockHeight; - - Rect invRect(x, y, blockWidth, blockHeight); - screenContainer->invalidateRect(invRect); - animationCounter++; - } - } - - virtual void tearDown() - { - } - - virtual void init() - { - Transition::init(); - } - - /** - * Block transition does not require an invalidation. Invalidation - * is handled by the class. Do no invalidation initially. - */ - virtual void invalidate() - { - } - -private: - uint16_t blockWidth; - uint16_t blockHeight; - uint16_t blocksHorizontal; - uint8_t animationCounter; ///< Current step in the transition animation. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BLOCKTRANSITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp deleted file mode 100644 index 08f6b30..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/CoverTransition.hpp +++ /dev/null @@ -1,208 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transitions/CoverTransition.hpp - * - * Declares the touchgfx::CoverTransition class. - */ -#ifndef TOUCHGFX_COVERTRANSITION_HPP -#define TOUCHGFX_COVERTRANSITION_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A Transition that slides the new screen over the previous \e from the given direction. - */ -template -class CoverTransition : public Transition -{ -public: - /** - * Initializes a new instance of the CoverTransition class. - * - * @param transitionSteps (Optional) Number of steps in the transition animation. - */ - CoverTransition(const uint8_t transitionSteps = 20) - : Transition(), - animationSteps(transitionSteps), - animationCounter(0), - calculatedValue(0), - solid() - { - switch (templateDirection) - { - case EAST: - targetValue = -HAL::DISPLAY_WIDTH; - break; - case WEST: - targetValue = HAL::DISPLAY_WIDTH; - break; - case NORTH: - targetValue = HAL::DISPLAY_HEIGHT; - break; - case SOUTH: - targetValue = -HAL::DISPLAY_HEIGHT; - break; - default: - done = true; - // Nothing to do here - break; - } - - // Ensure that the solid area covers the entire screen - solid.setPosition(0, 0, HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT); - } - - /** - * Handles the tick event when transitioning. It moves the contents of the Screen's - * container. The direction of the transition determines the direction the contents of - * the container moves. - */ - virtual void handleTickEvent() - { - Transition::handleTickEvent(); - - // Calculate new position or stop animation - animationCounter++; - if (animationCounter > animationSteps) - { - // Final step: stop the animation - done = true; - animationCounter = 0; - return; - } - - const int16_t oldValue = calculatedValue; - - // Calculate value in [0;targetValue] - calculatedValue = EasingEquations::cubicEaseOut(animationCounter, 0, targetValue, animationSteps); - - // Note: Result of "calculatedValue & 1" is compiler dependent for negative values of calculatedValue - if ((calculatedValue % 2) != 0) - { - // Optimization: calculatedValue is odd, add 1/-1 to move drawables modulo 32 bits in framebuffer - calculatedValue += (calculatedValue > 0 ? 1 : -1); - } - - // Convert the calculated value to delta value relative to current moved-to position - const int16_t relativeValue = calculatedValue - oldValue; - - // The Cover Transition only draws to parts of the non-TFT framebuffer. To avoid glitches - // In Double buffering mode both framebuffers must be identical. - if (animationCounter == 1 && HAL::USE_DOUBLE_BUFFERING) - { - // Synchronize framebuffers - Application::getInstance()->copyInvalidatedAreasFromTFTToClientBuffer(); - } - - Rect rect; - switch (templateDirection) - { - case EAST: - rect.x = HAL::DISPLAY_WIDTH + calculatedValue; - rect.y = 0; - rect.width = -calculatedValue; - rect.height = HAL::DISPLAY_HEIGHT; - break; - case WEST: - rect.x = 0; - rect.y = 0; - rect.width = calculatedValue; - rect.height = HAL::DISPLAY_HEIGHT; - break; - case NORTH: - rect.x = 0; - rect.y = 0; - rect.width = HAL::DISPLAY_WIDTH; - rect.height = calculatedValue; - break; - case SOUTH: - rect.x = 0; - rect.y = HAL::DISPLAY_HEIGHT + calculatedValue; - rect.width = HAL::DISPLAY_WIDTH; - rect.height = -calculatedValue; - break; - } - Application::getInstance()->invalidateArea(rect); - - // Move children with delta value for X or Y - Drawable* d = screenContainer->getFirstChild(); - while (d) - { - switch (templateDirection) - { - case EAST: - case WEST: - d->setX(d->getX() + relativeValue); - break; - case NORTH: - case SOUTH: - d->setY(d->getY() + relativeValue); - break; - } - - d = d->getNextSibling(); - } - } - - virtual void tearDown() - { - screenContainer->remove(solid); - } - - virtual void init() - { - Transition::init(); - - // Move snapshot and its children with delta value for X or Y - Drawable* d = screenContainer->getFirstChild(); - while (d) - { - switch (templateDirection) - { - case EAST: - case WEST: - d->setX(d->getX() - targetValue); - break; - case NORTH: - case SOUTH: - d->setY(d->getY() - targetValue); - break; - } - - d = d->getNextSibling(); - } - - screenContainer->add(solid); - } - -private: - const uint8_t animationSteps; ///< Number of steps the transition should move per complete animation. - uint8_t animationCounter; ///< Current step in the transition animation. - int16_t targetValue; ///< The target value for the transition animation. - int16_t calculatedValue; ///< The current X or Y value - FullSolidRect solid; ///< A solid rect that covers the entire screen to avoid copying elements outside -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_COVERTRANSITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp deleted file mode 100644 index 27243bc..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/NoTransition.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transitions/NoTransition.hpp - * - * Declares the touchgfx::NoTransition class. - */ -#ifndef TOUCHGFX_NOTRANSITION_HPP -#define TOUCHGFX_NOTRANSITION_HPP - -#include - -namespace touchgfx -{ -/** - * The most simple Transition without any visual effects. THe screen transition is done by - * immediately replace the current Screen with a new Screen. - * - * @see Transition - */ -class NoTransition : public Transition -{ -public: - /** Indicates that the transition is done after the first tick. */ - virtual void handleTickEvent() - { - done = true; - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_NOTRANSITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp deleted file mode 100644 index 598fa49..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/SlideTransition.hpp +++ /dev/null @@ -1,197 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transitions/SlideTransition.hpp - * - * Declares the touchgfx::SlideTransition class. - */ -#ifndef TOUCHGFX_SLIDETRANSITION_HPP -#define TOUCHGFX_SLIDETRANSITION_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A Transition that slides from one screen to the next. It does so by moving a SnapShotWidget - * with a snapshot of the Screen transitioning away from, and by moving the contents of - * Screen transitioning to. - * - * @see Transition - */ -template -class SlideTransition : public Transition -{ -public: - /** - * Initializes a new instance of the SlideTransition class. - * - * @param transitionSteps (Optional) Number of steps (ticks) in the transition animation, default is 20. - */ - SlideTransition(const uint8_t transitionSteps = 20) - : Transition(), - snapshot(), - animationSteps(transitionSteps), - animationCounter(0), - relativeValue(0) - { - if (!HAL::USE_ANIMATION_STORAGE) - { - // No animation storage, don't slide - done = true; - return; - } - - snapshot.setPosition(0, 0, HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT); - snapshot.makeSnapshot(); - - switch (templateDirection) - { - case EAST: - targetValue = -HAL::DISPLAY_WIDTH; - break; - case WEST: - targetValue = HAL::DISPLAY_WIDTH; - break; - case NORTH: - targetValue = HAL::DISPLAY_HEIGHT; - break; - case SOUTH: - targetValue = -HAL::DISPLAY_HEIGHT; - break; - } - } - - /** - * Handles the tick event when transitioning. It moves the contents of the Screen's - * container and a SnapshotWidget with a snapshot of the previous Screen. The direction - * of the transition determines the direction the contents of the container and the - * SnapshotWidget moves. - */ - virtual void handleTickEvent() - { - Transition::handleTickEvent(); - - // Calculate new position or stop animation - animationCounter++; - if (animationCounter > animationSteps) - { - // Final step: stop the animation - done = true; - animationCounter = 0; - return; - } - - // Calculate value in [0;targetValue] - int16_t calculatedValue = EasingEquations::cubicEaseOut(animationCounter, 0, targetValue, animationSteps); - - // Note: Result of "calculatedValue & 1" is compiler dependent for negative values of calculatedValue - if ((calculatedValue % 2) != 0) - { - // Optimization: calculatedValue is odd, add 1/-1 to move drawables modulo 32 bits in framebuffer - calculatedValue += (calculatedValue > 0 ? 1 : -1); - } - - // Move snapshot - switch (templateDirection) - { - case EAST: - case WEST: - relativeValue = calculatedValue - snapshot.getX(); - break; - case NORTH: - case SOUTH: - relativeValue = calculatedValue - snapshot.getY(); - break; - } - - // Move snapshot and its children with delta value for X or Y - Drawable* d = screenContainer->getFirstChild(); - while (d) - { - switch (templateDirection) - { - case EAST: - case WEST: - d->setX(d->getX() + relativeValue); - break; - case NORTH: - case SOUTH: - d->setY(d->getY() + relativeValue); - break; - } - d = d->getNextSibling(); - } - - // Entire screen has changed, redraw - screenContainer->invalidate(); - } - - virtual void tearDown() - { - if (HAL::USE_ANIMATION_STORAGE && screenContainer) - { - screenContainer->remove(snapshot); - } - } - - virtual void init() - { - Transition::init(); - - if (done) - { - return; - } - - // Move snapshot and its children with delta value for X or Y - Drawable* d = screenContainer->getFirstChild(); - while (d) - { - switch (templateDirection) - { - case EAST: - case WEST: - d->setX(d->getX() - targetValue); - break; - case NORTH: - case SOUTH: - d->setY(d->getY() - targetValue); - break; - } - - d = d->getNextSibling(); - } - - screenContainer->add(snapshot); - } - -protected: - SnapshotWidget snapshot; ///< The SnapshotWidget that is moved when transitioning. - -private: - const uint8_t animationSteps; ///< Number of steps the transition should move per complete animation. - uint8_t animationCounter; ///< Current step in the transition animation. - int16_t targetValue; ///< The target value for the transition animation. - int16_t relativeValue; ///< The relative X or Y value for the snapshot and the children. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SLIDETRANSITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp deleted file mode 100644 index f221225..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/Transition.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transitions/Transition.hpp - * - * Declares the touchgfx::Transition class. - */ -#ifndef TOUCHGFX_TRANSITION_HPP -#define TOUCHGFX_TRANSITION_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The Transition class is the base class for Transitions. Implementations of Transition defines - * what happens when transitioning between Screens, which typically involves visual - * effects. An example of a transition implementation can be seen in example - * custom_transition_example. The most basic transition is the NoTransition class that - * does a transition without any visual effects. - * - * @see NoTransition, SlideTransition - */ -class Transition -{ -public: - /** Initializes a new instance of the Transition class. */ - Transition() - : screenContainer(0), done(false) - { - } - - /** Finalizes an instance of the Transition class. */ - virtual ~Transition() - { - } - - /** Called for every tick when transitioning. */ - virtual void handleTickEvent() - { - } - - /** - * Query if the transition is done transitioning. It is the responsibility of the - * inheriting class to set the underlying done flag once the transition has been - * completed. - * - * @return True if the transition is done, false otherwise. - */ - bool isDone() const - { - return done; - } - - /** - * Tears down the Animation. Called before the destructor is called, when the - * application changes the transition. - */ - virtual void tearDown() - { - } - - /** - * Initializes the transition. Called after the constructor is called, when the - * application changes the transition. - */ - virtual void init() - { - } - - /** - * Invalidates the screen when starting the Transition. Default is - * to invalidate the whole screen. Subclasses can do partial - * invalidation. - */ - virtual void invalidate() - { - Application::getInstance()->invalidate(); - } - - /** - * Sets the Screen Container. Is used by Screen to enable the transition to access the - * Container. - * - * @param [in] cont The Container the transition should have access to. - */ - virtual void setScreenContainer(Container& cont) - { - screenContainer = &cont; - } - -protected: - /** - * A Widget that reports solid and but does not draw anything. - */ - class FullSolidRect : public Widget - { - public: - virtual Rect getSolidRect() const - { - return Rect(0, 0, rect.width, rect.height); - } - - virtual void draw(const Rect& area) const - { - } - }; - - Container* screenContainer; ///< The screen Container of the Screen transitioning to. - bool done; ///< Flag that indicates when the transition is done. This should be set by implementing classes. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TRANSITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp deleted file mode 100644 index 9b44b1d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/transitions/WipeTransition.hpp +++ /dev/null @@ -1,192 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/transitions/WipeTransition.hpp - * - * Declares the touchgfx::WipeTransition class. - */ -#ifndef TOUCHGFX_WIPETRANSITION_HPP -#define TOUCHGFX_WIPETRANSITION_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A Transition that expands the new screen over the previous from - * the given direction. This transition only draws the pixels in the - * framebuffer once, and never moves any pixels. It is therefore very - * useful on MCUs with limited performance. - */ -template -class WipeTransition : public Transition -{ -public: - /** - * Initializes a new instance of the WipeTransition class. - * - * @param transitionSteps (Optional) Number of steps in the transition animation. - */ - WipeTransition(const uint8_t transitionSteps = 20) - : Transition(), - animationSteps(transitionSteps), - animationCounter(0), - calculatedValue(0), - solid() - { - switch (templateDirection) - { - case EAST: - case WEST: - targetValue = HAL::DISPLAY_WIDTH; - break; - case NORTH: - case SOUTH: - targetValue = HAL::DISPLAY_HEIGHT; - break; - } - - // Ensure that the solid area covers the entire screen - solid.setPosition(0, 0, HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT); - } - - /** - * Handles the tick event when transitioning. It uncovers and - * invalidates increasing parts of the new screen elements. - */ - virtual void handleTickEvent() - { - Transition::handleTickEvent(); - animationCounter++; - - // Calculate new position or stop animation - if (animationCounter > animationSteps) - { - // Final step: stop the animation - done = true; - animationCounter = 0; - return; - } - - // Calculate value in [0;targetValue] - calculatedValue = EasingEquations::cubicEaseOut(animationCounter, 0, targetValue, animationSteps); - - // Note: Result of "calculatedValue & 1" is compiler dependent for negative values of calculatedValue - if ((calculatedValue % 2) != 0) - { - // Optimization: calculatedValue is odd, add 1/-1 to move drawables modulo 32 bits in framebuffer - calculatedValue += (calculatedValue > 0 ? 1 : -1); - } - - // calculatedValue is the width/height of the visible area - - switch (templateDirection) - { - case EAST: - { - // Cover must have width of remaining part - const uint16_t prevSolidWidth = solid.getWidth(); - solid.setWidth(HAL::DISPLAY_WIDTH - calculatedValue); - - // Invalidate the uncovered part - const uint16_t delta = prevSolidWidth - solid.getWidth(); - Rect r(solid.getWidth(), 0, delta, HAL::DISPLAY_HEIGHT); - screenContainer->invalidateRect(r); - break; - } - case WEST: - { - // Cover must have width of remaining part and start after uncovered - const uint16_t prevSolidPos = solid.getX(); - solid.setWidth(HAL::DISPLAY_WIDTH - calculatedValue); - solid.setX(calculatedValue); - - // Invalidate the uncovered part - const uint16_t delta = calculatedValue - prevSolidPos; - Rect r(prevSolidPos, 0, delta, HAL::DISPLAY_HEIGHT); - screenContainer->invalidateRect(r); - break; - } - case NORTH: - { - // Cover must have height of remaining part and start after uncovered - const uint16_t prevSolidPos = solid.getY(); - solid.setHeight(HAL::DISPLAY_HEIGHT - calculatedValue); - solid.setY(calculatedValue); - - // Invalidate the uncovered part - const uint16_t delta = calculatedValue - prevSolidPos; - Rect r(0, prevSolidPos, HAL::DISPLAY_WIDTH, delta); - screenContainer->invalidateRect(r); - break; - } - case SOUTH: - { - // Cover must have height of remaining part - const uint16_t prevSolidHeight = solid.getHeight(); - solid.setHeight(HAL::DISPLAY_HEIGHT - calculatedValue); - - // Invalidate the uncovered part - const uint16_t delta = prevSolidHeight - solid.getHeight(); - Rect r(0, solid.getHeight(), HAL::DISPLAY_WIDTH, delta); - screenContainer->invalidateRect(r); - break; - } - } - - // The WipeTransition only draws to parts of the non-TFT - // framebuffer. To avoid glitches in Double buffering mode - // both framebuffers must be made identical. - if (animationCounter == 1 && HAL::USE_DOUBLE_BUFFERING) - { - // Synchronize framebuffers - Application::getInstance()->copyInvalidatedAreasFromTFTToClientBuffer(); - } - } - - virtual void tearDown() - { - screenContainer->remove(solid); - } - - virtual void init() - { - Transition::init(); - // Add the solid (and not-drawing-anything) widget on top to cover the other widgets - screenContainer->add(solid); - } - - /** - * Wipe transition does not require an invalidation. Invalidation - * is handled by the class. Do no invalidation initially. - */ - virtual void invalidate() - { - } - -private: - const uint8_t animationSteps; ///< Number of steps the transition should move per complete animation. - uint8_t animationCounter; ///< Current step in the transition animation. - int16_t targetValue; ///< The target value for the transition animation. - int16_t calculatedValue; ///< The calculated X or Y value to move the snapshot and the children. - FullSolidRect solid; ///< A solid rect that covers the entire screen to avoid copying elements outside -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_WIPETRANSITION_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp deleted file mode 100644 index 9661555..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AbstractButton.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/AbstractButton.hpp - * - * Declares the touchgfx::AbstractButton class - */ -#ifndef TOUCHGFX_ABSTRACTBUTTON_HPP -#define TOUCHGFX_ABSTRACTBUTTON_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * This class defines an abstract interface for button-like elements. A button is a clickable - * element that has two states: pressed and released. A button also has an action that - * is executed when the button goes from state pressed to state released. - */ -class AbstractButton : public Widget -{ -public: - /** Sets this Widget touchable so the user can interact with buttons. */ - AbstractButton() - : Widget(), action(), pressed(false) - { - setTouchable(true); - } - - /** - * Updates the current state of the button. The state can be either pressed or released, - * and if the new state is different from the current state, the button is also - * invalidated to force a redraw. - * - * If the button state is changed from ClickEvent::PRESSED to ClickEvent::RELEASED, the - * associated action (if any) is also executed. - * - * @param event Information about the click. - */ - virtual void handleClickEvent(const ClickEvent& event); - - /** - * Associates an action with the button. The action is performed when the AbstractButton - * is in the pressed state, goes to the released. - * - * @param callback The callback to be executed. The callback will be executed with a - * reference to the AbstractButton. - * - * @see GenericCallback, handleClickEvent, ClickEvent - */ - void setAction(GenericCallback& callback) - { - action = &callback; - } - - /** - * Executes the previously set action. - * - * @see setAction - */ - virtual void executeAction() - { - if (action && action->isValid()) - { - action->execute(*this); - } - } - - /** - * Function to determine if the AbstractButton is currently pressed. - * - * @return true if button is pressed, false otherwise. - */ - virtual bool getPressedState() const - { - return pressed; - } - -protected: - GenericCallback* action; ///< The callback to be executed when this AbstractButton is clicked - - bool pressed; ///< Is the button pressed or released? True if pressed. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTBUTTON_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp deleted file mode 100644 index a0d2e9b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimatedImage.hpp +++ /dev/null @@ -1,200 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/AnimatedImage.hpp - * - * Declares the touchgfx::AnimatedImage class. - */ -#ifndef TOUCHGFX_ANIMATEDIMAGE_HPP -#define TOUCHGFX_ANIMATEDIMAGE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A widget capable of basic animation using a range of bitmaps. The AnimatedImage is capable of - * running the animation from start to end or, in reverse order, end to start. It is - * capable of doing a single animation or looping the animation until stopped or paused. - */ -class AnimatedImage : public Image -{ -public: - /** - * Constructs an AnimatedImage. The start and the end specifies the range of bitmaps to - * be used for animation. The update interval defines how often the animation should be - * updated. The animation will iterate over the bitmaps that lies between the IDs of - * start and end, both included. - * - * @param start Defines the start of the range of images in the animation. - * @param end Defines the end of the range of images in the animation. - * @param updateInterval (Optional) Defines the number of ticks between each animation step. - * Higher value results in a slower animation. Default is to - * update the image on every tick. - */ - AnimatedImage(const BitmapId& start, const BitmapId& end, const uint8_t& updateInterval = 1) - : Image(Bitmap(start)), - animationDoneAction(0), - startId(start), - endId(end), - updateTicksInterval(updateInterval), - ticksSinceUpdate(0), - reverse(false), - loopAnimation(false), - running(false) - { - } - - /** - * Constructs an AnimatedImage without initializing bitmaps. - * - * @param updateInterval (Optional) Defines the number of ticks between each animation step. - * Higher value results in a slower animation. - * - * @note The bitmaps to display must be configured through set setBitmaps function before this - * widget displays anything. - */ - AnimatedImage(const uint8_t& updateInterval = 1) - : animationDoneAction(0), - startId(BITMAP_INVALID), - endId(BITMAP_INVALID), - updateTicksInterval(updateInterval), - ticksSinceUpdate(0), - reverse(false), - loopAnimation(false), - running(false) - { - } - - /** - * Starts the animation with the given parameters for animation direction, normal or - * reverse, whether to restart the animation and finally if the animation should loop - * automatically upon completion. - * - * @param rev Defines if the animation should be performed in reverse order. - * @param reset (Optional) Defines if the animation should reset and start from the first (or - * last if reverse order) bitmap. - * @param loop (Optional) Defines if the animation should loop or do a single animation. - */ - virtual void startAnimation(const bool rev, const bool reset = false, const bool loop = false); - - /** - * Stops and resets the animation. If the animation should not reset to the first image - * in the animation sequence, use pauseAnimation(). - * - * @see startAnimation, pauseAnimation - */ - virtual void stopAnimation(); - - /** - * Toggles the running state of an animation. Pauses the animation if the animation is - * running. Continues the animation if previously paused. - * - * @see stopAnimation - */ - virtual void pauseAnimation(); - - virtual void handleTickEvent(); - - /** - * Associates an action to be performed when the animation of the AnimatedImage is done. - * If the animation is set to loop at the end, the action is also triggered when the - * animation starts over. - * - * @param callback The callback is executed when done. The callback is given the - * animated image. - */ - void setDoneAction(GenericCallback& callback) - { - animationDoneAction = &callback; - } - - /** - * Gets the running state of the AnimatedImage. - * - * @return true if the animation is currently running, false otherwise. - */ - bool isAnimatedImageRunning() const - { - return running; - } - - /** - * Query if this object is running in reverse. - * - * @return true if the animation is performed in reverse order. - */ - bool isReverse() - { - return reverse; - } - - /** - * @copydoc Image::setBitmap(const Bitmap&) - * - * @see setBitmaps, setBitmapEnd - * - * @note This only sets the start image. - */ - virtual void setBitmap(const Bitmap& bmp); - - /** - * Sets the end bitmap for this AnimatedImage sequence. - * - * @param bmp The bitmap. - * - * @see setBitmaps, setBitmap - */ - virtual void setBitmapEnd(const Bitmap& bmp); - - /** - * Sets the bitmaps that are used by the animation. - * - * The animation will iterate over the bitmaps that lies between the IDs of start and - * end, both inclusive. - * - * @param start Defines the start of the range of images in the animation. - * @param end Defines the end of the range of images in the animation. - * - * @see setBitmap, setBitmapEnd - */ - void setBitmaps(BitmapId start, BitmapId end); - - /** - * Sets the update interval. The value specifies the number of ticks between each step - * of the animation. The default update interval for animated images is 1, which means - * results in the fastest possible animation. - * - * @param updateInterval Defines the number of ticks between each animation step. Higher value - * results in a slower animation. - */ - void setUpdateTicksInterval(uint8_t updateInterval); - -protected: - GenericCallback* animationDoneAction; ///< Pointer to the callback to be executed when animation is done. - - BitmapId startId; ///< Id of first bitmap in animation. - BitmapId endId; ///< Id of last bitmap in animation. - uint8_t updateTicksInterval; ///< Number of ticks between each animation update (image change). - uint8_t ticksSinceUpdate; ///< Number of ticks since last animation update. - bool reverse; ///< If true, run in reverse direction (last to first). - bool loopAnimation; ///< If true, continuously loop animation. - bool running; ///< If true, animation is running. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ANIMATEDIMAGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp deleted file mode 100644 index dbd89f3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/AnimationTextureMapper.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/AnimationTextureMapper.hpp - * - * Declares the touchgfx::AnimationTextureMapper class. - */ -#ifndef TOUCHGFX_ANIMATIONTEXTUREMAPPER_HPP -#define TOUCHGFX_ANIMATIONTEXTUREMAPPER_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A TextureMapper with animation capabilities. Note that the angles of the TextureMapper is - * normalized to lie in the range [0; 2PI[ at the beginning at the animation. The end - * angles should be relative to this and are limited to values in the range [-32.7; - * 32.7]. - */ -class AnimationTextureMapper : public TextureMapper -{ -public: - /** Values that represent different animation parameter. */ - enum AnimationParameter - { - X_ROTATION, ///< Rotation around the X axis - Y_ROTATION, ///< Rotation around the Y axis - Z_ROTATION, ///< Rotation around the Z axis - SCALE ///< Scaling of the image - }; - - static const int NUMBER_OF_ANIMATION_PARAMETERS = SCALE + 1; ///< Number of animation parameters - - AnimationTextureMapper(); - - /** - * Associates an action to be performed for every step in the animation. Will not be called - * during the delay period. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the AnimationTextureMapper. - * - * @see GenericCallback - */ - void setTextureMapperAnimationStepAction(GenericCallback& callback); - - /** - * Associates an action to be performed when the animation ends. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the AnimationTextureMapper. - * - * @see GenericCallback - */ - void setTextureMapperAnimationEndedAction(GenericCallback& callback); - - /** - * Gets whether or not the animation is running. - * - * @return true if the animation is running. - */ - virtual bool isTextureMapperAnimationRunning() const; - - /** - * Sets up the animation for a specific parameter (angle/scale) for the next animation. - * The specific parameter is chosen using the AnimationType enum. AnimationTypes that - * are not setup using this method will keep their value during the animation. - * - * @param parameter The parameter of the TextureMapper that should be animated. - * @param endValue The end value for the parameter. - * @param duration The duration for the animation of the parameter. Specified in - * ticks. - * @param delay The delay before the animation of the parameter starts. - * Specified in ticks. - * @param progressionEquation (Optional) the progression equation for the animation of this - * parameter. Default is EasingEquations::linearEaseNone. - */ - virtual void setupAnimation(AnimationParameter parameter, float endValue, uint16_t duration, uint16_t delay, EasingEquation progressionEquation = &EasingEquations::linearEaseNone); - - /** - * Starts the animation from the current position to the specified end angles/scale, as - * specified by one or more calls to setupAnimation(). - */ - virtual void startAnimation(); - - /** - * Cancel move animation. Stops any running animation at the current position regardless - * of the progress made so far. Disables all animation parameters set using - * setupAnimation and mark the animation as stopped. - */ - virtual void cancelAnimationTextureMapperAnimation(); - - /** - * Gets the current animation step measured in ticks since the call to startAnimation(). - * The steps during the initial delay are also counted. - * - * @return The current animation step. - */ - virtual uint16_t getAnimationStep(); - - virtual void handleTickEvent(); - -protected: - /** Information about how a specific animation parameter should be animated. */ - struct AnimationSetting - { - bool animationActive; ///< Should this animation be performed? - float animationStart; ///< The animation start value - float animationEnd; ///< The animation end value - uint16_t animationDelay; ///< A delay before the actual animation start. Expressed in ticks. - uint16_t animationDuration; ///< The complete duration of the animation. Expressed in ticks. - EasingEquation animationProgressionEquation; ///< EasingEquation expressing the development of the value during the animation. - }; - - AnimationSetting animations[NUMBER_OF_ANIMATION_PARAMETERS]; ///< Descriptions of the animation of specific animation parameters - - GenericCallback* textureMapperAnimationStepCallback; ///< Callback that is executed after every step of the animation. - GenericCallback* textureMapperAnimationEndedCallback; ///< Callback that is executed after the animation ends. - - uint16_t animationCounter; ///< Counter that is equal to the current step in the animation - bool animationRunning; ///< Boolean that is true if the animation is running -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ANIMATIONTEXTUREMAPPER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp deleted file mode 100644 index af547bf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Box.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/Box.hpp - * - * Declares the touchgfx::Box class. - */ -#ifndef TOUCHGFX_BOX_HPP -#define TOUCHGFX_BOX_HPP - -#include -#include - -namespace touchgfx -{ -/** - * Simple widget capable of showing a rectangle of a specific color and an optional alpha. - */ -class Box : public Widget -{ -public: - /** Construct a new Box with a default alpha value of 255 (solid) */ - Box() - : Widget(), alpha(255), color(0) - { - } - - /** - * Construct a Box with the given size and color (and optionally alpha). - * - * @param width The width of the box. - * @param height The height of the box. - * @param boxColor The color of the box. - * @param boxAlpha (Optional) The alpha of the box. Default is 255 (solid). - */ - Box(uint16_t width, uint16_t height, colortype boxColor, uint8_t boxAlpha = 255) - : Widget(), alpha(boxAlpha), color(boxColor) - { - rect.width = width; - rect.height = height; - } - - virtual Rect getSolidRect() const; - - /** - * Sets the color of the Box. - * - * @param newColor The color of the box. - * - * @see getColor, Color::getColorFromRGB - */ - void setColor(colortype newColor) - { - color = newColor; - } - - /** - * Gets the current color of the Box. - * - * @return The current color of the box. - * - * @see setColor, Color::getRed, Color::getGreen, Color::getRed - */ - FORCE_INLINE_FUNCTION colortype getColor() const - { - return color; - } - - /** - * @copydoc Image::setAlpha - */ - void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** - * @copydoc Image::getAlpha - */ - FORCE_INLINE_FUNCTION uint8_t getAlpha() const - { - return alpha; - } - - virtual void draw(const Rect& area) const; - - virtual void invalidateContent() const - { - if (alpha > 0) - { - Widget::invalidateContent(); - } - } - -protected: - uint8_t alpha; ///< The alpha value used for this Box. - colortype color; ///< The fill color for this Box -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BOX_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp deleted file mode 100644 index 69110f4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/BoxWithBorder.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/BoxWithBorder.hpp - * - * Declares the touchgfx::BoxWithBorder class. - */ -#ifndef TOUCHGFX_BOXWITHBORDER_HPP -#define TOUCHGFX_BOXWITHBORDER_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The BoxWithBorder class is used to create objects that can draw a box with a border on the - * display. The width of the border can be specified. If the border width is 0 the - * BoxWithBorder will function just like a Box. - */ -class BoxWithBorder : public Box -{ -public: - BoxWithBorder() - : Box(), borderColor(0), borderSize(0) - { - } - - /** - * Constructor that allows specification of dimensions and colors of the BoxWithBorder. - * - * @param width The width. - * @param height The height. - * @param colorMiddle The color of the middle of the box. - * @param colorBorder The border color. - * @param borderWidth Size (width) of the border. - * @param boxAlpha (Optional) The alpha of the box and the border. - */ - BoxWithBorder(uint16_t width, uint16_t height, colortype colorMiddle, colortype colorBorder, uint16_t borderWidth, uint8_t boxAlpha = 255) - : Box(width, height, colorMiddle, boxAlpha), borderColor(colorBorder), borderSize(borderWidth) - { - } - - /** - * Sets the color of the border drawn along the edge of the BoxWithBorder. - * - * @param colorBorder The color of the border. - * - * @see setColor, getBorderColor, Color::getColorFromRGB - */ - void setBorderColor(colortype colorBorder) - { - borderColor = colorBorder; - } - - /** - * Gets the color of the border drawn along the edge of the BoxWithBorder. - * - * @return The color of the border. - * @see setBorderColor, getColor, Color::getRed, Color::getGreen, Color::getRed - */ - FORCE_INLINE_FUNCTION colortype getBorderColor() const - { - return borderColor; - } - - /** - * Sets the width of the border. If the width is set to 0, the BoxWithBorder will look - * exactly like a Box. - * - * @param size The width of the border. - * - * @see getBorderSize - */ - void setBorderSize(uint16_t size) - { - borderSize = size; - } - - /** - * Gets the width of the border. - * - * @return The width of the border. - * - * @see setBorderSize - */ - FORCE_INLINE_FUNCTION uint16_t getBorderSize() const - { - return borderSize; - } - - virtual void draw(const Rect& area) const; - -protected: - colortype borderColor; ///< The color of the border along the edge - uint16_t borderSize; ///< Width of the border along the edge -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BOXWITHBORDER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp deleted file mode 100644 index a7d5890..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Button.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/Button.hpp - * - * Declares the touchgfx::Button class. - */ -#ifndef TOUCHGFX_BUTTON_HPP -#define TOUCHGFX_BUTTON_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A button with two images. One image showing the unpressed button and one image showing the - * pressed state. - */ -class Button : public AbstractButton -{ -public: - Button() - : AbstractButton(), up(), down(), alpha(255) - { - } - - virtual void draw(const Rect& invalidatedArea) const; - - /** - * Sets the two bitmaps used by this button. One bitmap for the released (normal) state - * and one bitmap for the pressed state. The images are expected to be of the same - * dimensions, and the Button is resized to the dimensions of the pressed Bitmap. - * - * @param bitmapReleased Bitmap to use when button is released. - * @param bitmapPressed Bitmap to use when button is pressed. - * - * @note It is assumed that the dimensions of the bitmaps are the same. Unexpected (visual) - * behavior may be observed if the bitmaps are of different sizes. - * @note The user code must call invalidate() in order to update the button on the display. - */ - virtual void setBitmaps(const Bitmap& bitmapReleased, const Bitmap& bitmapPressed); - - virtual Rect getSolidRect() const; - - /** - * @copydoc Image::setAlpha - */ - void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** - * @copydoc Image::getAlpha - */ - uint8_t getAlpha() const - { - return alpha; - } - - /** - * Gets currently displayed bitmap. This depends on the current state of the button, - * released (normal) or pressed. - * - * @return The bitmap currently displayed. - */ - Bitmap getCurrentlyDisplayedBitmap() const - { - return (pressed ? down : up); - } - - virtual void invalidateContent() const - { - if (alpha > 0) - { - Widget::invalidateContent(); - } - } - -protected: - Bitmap up; ///< The image to display when button is released (normal state). - Bitmap down; ///< The image to display when button is pressed. - uint8_t alpha; ///< The current alpha value. 255=solid, 0=invisible. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BUTTON_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp deleted file mode 100644 index 14367aa..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithIcon.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/ButtonWithIcon.hpp - * - * Declares the touchgfx::ButtonWithIcon class. - */ -#ifndef TOUCHGFX_BUTTONWITHICON_HPP -#define TOUCHGFX_BUTTONWITHICON_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A Button that has a bitmap with an icon on top of it. It is possible to have two different - * icons depending on the current state of the button (released or pressed). - * - * Typical use case could be a blue button with a released and a pressed image. Those - * images can be reused across several buttons. The ButtonWithIcon will then allow an - * image to superimposed on top of the blue button. - */ -class ButtonWithIcon : public Button -{ -public: - ButtonWithIcon(); - -#ifdef __IAR_SYSTEMS_ICC__ // Only include in IAR compilation -#pragma diag_suppress = Pe997 // Suppress warning for intentional virtual function override -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000) -#pragma diag_suppress 997 -#endif - - /** - * Sets the four bitmaps used by this button. The last two bitmaps are drawn on top of - * the first two, again depending on the current state of the Button. This means that - * when the button state is released (normal), the newIconReleased is drawn on top of - * the newBackgroundReleased, and when the button state is pressed, the newIconPressed - * is drawn on top of the newBackgroundPressed. - * - * The default position if the icons is set to the center of the bitmaps. The two icons - * are assumed to have the same dimensions. The size of the released icon is used to - * position the icons centered on the Button. - * - * @param newBackgroundReleased Bitmap to use when button is released. - * @param newBackgroundPressed Bitmap to use when button is pressed. - * @param newIconReleased The bitmap for the icon in the released (normal) button state. - * @param newIconPressed The bitmap for the icon in the pressed button state. - * - * @note The user code must call invalidate() in order to update the button on the display. - */ - virtual void setBitmaps(const Bitmap& newBackgroundReleased, const Bitmap& newBackgroundPressed, - const Bitmap& newIconReleased, const Bitmap& newIconPressed); -#ifdef __IAR_SYSTEMS_ICC__ // Only include in IAR compilation -#pragma diag_default = Pe997 -#endif - - /** - * Sets the x coordinate of the icon bitmaps. The same x coordinate is used for both - * icons (released and pressed). - * - * @param x The new x value, relative to the background bitmap. A negative value is - * allowed. - * - * @note The user code must call invalidate() in order to update the button on the display. - * @note The value set is overwritten on a subsequent call to setBitmaps. - */ - void setIconX(int16_t x) - { - iconX = x; - } - - /** - * Sets the y coordinate of the icon bitmaps. The same y coordinate is used for both - * icons (released and pressed). - * - * @param y The new y value, relative to the background bitmap. A negative value is - * allowed. - * - * @note The user code must call invalidate() in order to update the button on the display. - * @note The value set is overwritten on a subsequent call to setBitmaps. - */ - void setIconY(int16_t y) - { - iconY = y; - } - - /** - * Sets the x and y coordinates of the icon bitmap. Same as calling setIconX and - * setIconY. - * - * @param x The new x value, relative to the background bitmap. A negative value is - * allowed. - * @param y The new y value, relative to the background bitmap. A negative value is - * allowed. - * - * @note The user code must call invalidate() in order to update the button on the display. - * @note The values set are overwritten on a subsequent call to setBitmaps. - */ - void setIconXY(int16_t x, int16_t y) - { - setIconX(x); - setIconY(y); - } - - /** - * Gets currently displayed icon. This depends on the current state of the button, - * released (normal) or pressed. - * - * @return The icon currently displayed. - */ - Bitmap getCurrentlyDisplayedIcon() const - { - return (pressed ? iconPressed : iconReleased); - } - - /** - * Gets the x coordinate of the icon bitmap. - * - * @return The x coordinate of the icon bitmap. - */ - int16_t getIconX() const - { - return iconX; - } - - /** - * Gets the y coordinate of the icon bitmap. - * - * @return The y coordinate of the icon bitmap. - */ - int16_t getIconY() const - { - return iconY; - } - - virtual void draw(const Rect& invalidatedArea) const; - -protected: - Bitmap iconReleased; ///< Icon to display when button is not pressed. - Bitmap iconPressed; ///< Icon to display when button is pressed. - int16_t iconX; ///< x coordinate offset for icon. - int16_t iconY; ///< y coordinate offset for icon. - -private: - virtual void setBitmaps(const Bitmap& /*bitmapReleased*/, const Bitmap& /*bitmapPressed*/) - { - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BUTTONWITHICON_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp deleted file mode 100644 index e3d10fb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ButtonWithLabel.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/ButtonWithLabel.hpp - * - * Declares the touchgfx::ButtonWithLabel class. - */ -#ifndef TOUCHGFX_BUTTONWITHLABEL_HPP -#define TOUCHGFX_BUTTONWITHLABEL_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A Button that has a bitmap with a text on top of it. It is possible to have two different - * colors for the text depending on the current state of the button (released or - * pressed). - * - * Typical use case could be a red button with a normal and a pressed image. Those - * images can be reused across several buttons. The ButtonWithLabel will then allow a - * text to be superimposed on top of the red button. - * - * @see Button - */ -class ButtonWithLabel : public Button -{ -public: - ButtonWithLabel(); - - /** - * Sets the text to display on the button. Texts with wildcards are not supported. - * - * @param t The text to display. - * - * @note The user code must call invalidate() in order to update the button on the display. - */ - void setLabelText(TypedText t) - { - typedText = t; - updateTextPosition(); - } - - /** - * Gets the text used for the label. - * - * @return The text used for the label. - */ - const TypedText& getLabelText() const - { - return typedText; - } - - /** - * Sets label color for the text when the button is in the normal, released state. - * - * @param col The color with which the text label should be drawn. - * - * @see setLabelColorPressed - * - * @note If the button is currently in the normal, released state, the button should be forced - * to redraw itself. This is done by calling invalidate() on the ButtonWithLabel. - * @note The user code must call invalidate() in order to update the button on the display. - */ - void setLabelColor(colortype col) - { - color = col; - } - - /** - * Sets label color for the text when the button is in the pressed state. - * - * @param col The color with which the text label should be drawn when the - * button is pressed. - * - * @see setLabelColor - * - * @note If the button is currently in the pressed state, the button should be forced to - * redraw itself. This is done by calling invalidate() on the ButtonWithLabel. - * @note The user code must call invalidate() in order to update the button on the display. - */ - void setLabelColorPressed(colortype col) - { - colorPressed = col; - } - - /** - * Sets the rotation of the text on the label. The text can be rotated in steps of 90 - * degrees. - * - * @param textRotation The rotation of the text. Default is TEXT_ROTATE_0. - * - * @see TextArea::setRotation - * - * @note that this will not rotate the bitmap of the label, only the text. - * @note The user code must call invalidate() in order to update the button on the display. - */ - void setLabelRotation(TextRotation textRotation) - { - rotation = textRotation; - } - - /** - * Gets the current rotation of the text on the label. - * - * @return The current rotation of the text. - */ - TextRotation getLabelRotation() - { - return rotation; - } - - /** - * Positions the label text horizontally centered. If the text changes due to a language - * change you may need to reposition the label text by calling this function to keep the - * text horizontally centered. - * - * @note The user code must call invalidate() in order to update the button on the display. - */ - void updateTextPosition() - { - if (typedText.hasValidId()) - { - const Font* f = typedText.getFont(); - const Unicode::UnicodeChar* s = typedText.getText(); - textHeightIncludingSpacing = f->getHeight() * f->getNumberOfLines(s) + f->getSpacingAbove(s); - } - else - { - textHeightIncludingSpacing = 0; - } - } - - virtual void draw(const Rect& area) const; - -protected: - TypedText typedText; ///< The TypedText used for the button label. - colortype color; ///< The color used for the label when the button is in the released, normal state. - colortype colorPressed; ///< The color used for the label when the button is in the pressed state. - TextRotation rotation; ///< The rotation used for the label. - int16_t textHeightIncludingSpacing; ///< Total height of the label (text height + spacing). -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_BUTTONWITHLABEL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp deleted file mode 100644 index b72ad72..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Gauge.hpp +++ /dev/null @@ -1,225 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/Gauge.hpp - * - * Declares the gauge class. - */ -#ifndef TOUCHGFX_GAUGE_HPP -#define TOUCHGFX_GAUGE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * A gauge is a graphical element that shows a needle on a dial, often a speedometer or similar. - * Much like a progress indicator, the minimum and maximum value of the Gauge, as well as steps - * can be set. For more information on this, consult the documentation on ProgressIndicators. - * - * A Gauge has a needle and optionally an arc that follows the needle. - */ -class Gauge : public AbstractProgressIndicator -{ -public: - /** Initializes a new instance of the Gauge class. */ - Gauge(); - - virtual void setWidth(int16_t width); - - virtual void setHeight(int16_t height); - - /** - * Sets background offset inside the Gauge. If the dial is smaller than the size needed for - * the Gauge to show the needle, the background image can be moved inside the Gauge. - * - * @param offsetX The offset x coordinate. - * @param offsetY The offset y coordinate. - * - * @see setBackground - */ - void setBackgroundOffset(int16_t offsetX, int16_t offsetY); - - /** - * Sets the center of the texture mapper and the arc inside the Gauge. - * - * @param x The x coordinate of the center of the texture mapper. - * @param y The y coordinate of the center of the texture mapper. - * - * @see getCenter - */ - virtual void setCenter(int x, int y); - - /** - * Gets the texture mapper center coordinates. - * - * @param [out] x The x coordinate of the center of the texture mapper. - * @param [out] y The y coordinate of the center of the texture mapper. - * - * @see setCenter - */ - virtual void getCenter(int& x, int& y) const - { - x = gaugeCenterX; - y = gaugeCenterY; - } - - /** - * Sets arc position inside the Gauge. This is especially useful if the arc is using a - * bitmap painter. If the center has previously been set, the arc center will be updated - * to be at the same offset relative to the top left corner of the Gauge. - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param width The width. - * @param height The height. - * - * @see setCenter, getArc - */ - void setArcPosition(int16_t x, int16_t y, int16_t width, int16_t height); - - /** - * Sets a bitmap for the needle and the rotation point in the needle bitmap. - * - * @param bitmapId Identifier for the bitmap. - * @param rotationCenterX The rotation center x coordinate. - * @param rotationCenterY The rotation center y coordinate. - */ - void setNeedle(const BitmapId bitmapId, int16_t rotationCenterX, int16_t rotationCenterY); - - /** - * Sets rendering algorithm used when the needle is moving during an animation. For better - * performance, this can be set to TextureMapper::NEAREST_NEIGHBOR. For nicer graphics, it - * should be set to TextureMapper::BILINEAR_INTERPOLATION (this is the default behavior). - * - * @param algorithm The algorithm. - * - * @see updateValue, setSteadyNeedleRenderingAlgorithm - */ - void setMovingNeedleRenderingAlgorithm(TextureMapper::RenderingAlgorithm algorithm); - - /** - * Sets rendering algorithm used when the needle is steady (after an animation). For better - * performance, this can be set to TextureMapper::NEAREST_NEIGHBOR. For nicer graphics, it - * should be set to TextureMapper::BILINEAR_INTERPOLATION (this is the default behavior). - * - * @param algorithm The algorithm. - * - * @see updateValue, setMovingNeedleRenderingAlgorithm - */ - void setSteadyNeedleRenderingAlgorithm(TextureMapper::RenderingAlgorithm algorithm); - - /** - * Sets start and end angle in degrees for the needle and arc. By swapping end and start angles, - * these can progress backwards. - * - * @param startAngle The start angle. - * @param endAngle The end angle. - * - * @note Angles are given in degrees, so a full circle is 360. - */ - virtual void setStartEndAngle(int startAngle, int endAngle); - - /** - * Gets start angle in degrees for the needle (and arc). - * - * @return The start angle. - * - * @see setStartEndAngle, getEndAngle - * - * @note Angles are given in degrees, so a full circle is 360. - */ - virtual int getStartAngle() const; - - /** - * Gets end angle in degrees. Beware that the value returned is not related to the current - * progress of the texture mapper but rather the end point of the Gauge when it is at max value. - * - * @return The end angle. - * - * @see setStartEndAngle - * - * @note Angles are given in degrees, so a full circle is 360. - */ - virtual int getEndAngle() const; - - /** - * Allow the arc to be shown or hidden. - * - * @param show (Optional) True to show, false to hide. Default is to show the arc. - */ - void setArcVisible(bool show = true); - - /** - * Shows the arc on top of the needle. By default the needle is drawn on top of the arc. - * - * @param arcOnTop (Optional) True to put the arc on top of the needle (default), false to - * put the needle on top of the arc. - */ - void putArcOnTop(bool arcOnTop = true); - - /** - * Gets a reference to the arc (Circle). This allows for setting radius, line width, painter, - * etc. on the arc (Circle). - * - * @return The arc (Circle). - */ - Circle& getArc(); - - virtual void setValue(int value); - - /** - * @copydoc Image::setAlpha(uint8_t) - */ - virtual void setAlpha(uint8_t newAlpha); - - virtual void invalidateContent() const - { - if (getAlpha() > 0) - { - AbstractProgressIndicator::invalidateContent(); - } - } - -protected: - TextureMapper needle; ///< The textureMapper - TextureMapper::RenderingAlgorithm algorithmMoving; ///< The algorithm used when the needle is moving - TextureMapper::RenderingAlgorithm algorithmSteady; ///< The algorithm used when the needle is steady - int needleStartAngle; ///< The start angle in degrees - int needleEndAngle; ///< The end angle in degrees - int16_t gaugeCenterX; ///< The x coordinate of the rotation point of the hands - int16_t gaugeCenterY; ///< The y coordinate of the rotation point of the hands - int16_t needleCenterX; ///< The x coordinate of the rotation point of the hands - int16_t needleCenterY; ///< The y coordinate of the rotation point of the hands - Circle arc; ///< The arc - - /** Sets up the needle texture mapper. */ - void setupNeedleTextureMapper(); - - /** - * This function has no effect on a Gauge. - * - * @param x unused - * @param y unused - * @param width unused - * @param height unused - */ - virtual void setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GAUGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp deleted file mode 100644 index ef2057b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Image.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/Image.hpp - * - * Declares the touchgfx::Image class. - */ -#ifndef TOUCHGFX_IMAGE_HPP -#define TOUCHGFX_IMAGE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Simple widget capable of showing a bitmap on the display. The bitmap can be alpha-blended - * with the background (or whichever other Drawable might be "underneath" the Image). - * The bitmap can and have areas of varying opacity. - * - * The conversion from image.bmp or image.png to a bitmap that can be used in TouchGFX - * is handled by the Image Converter as part of compiling the project. Each image is - * assigned a unique BITMAP identifier which. - * - * @see Bitmap - */ -class Image : public Widget -{ -public: - /** - * Constructs a new Image with a default alpha value of 255 (solid) and a default Bitmap - * (undefined) if none is specified. If a Bitmap is passed to the constructor, the width and - * height of this widget is set to those of the bitmap. - * - * @param bmp (Optional) The bitmap to display. - * - * @see setBitmap - */ - Image(const Bitmap& bmp = Bitmap()) - : Widget(), bitmap(bmp), alpha(255) - { - Image::setBitmap(bmp); - } - - /** - * Sets the bitmap for this Image and updates the width and height of this widget to match those - * of the Bitmap. - * - * @param bmp The bitmap instance. - * - * @note The user code must call invalidate() in order to update the image on the display. - */ - virtual void setBitmap(const Bitmap& bmp); - - /** - * Sets the opacity (alpha value). This can be used to fade it away by gradually - * decreasing the alpha value from 255 (solid) to 0 (invisible). - * - * @param newAlpha The new alpha value. 255=solid, 0=invisible. - * - * @see getAlpha - * - * @note The user code must call invalidate() in order to update the display. - */ - void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - virtual void draw(const Rect& invalidatedArea) const; - - /** - * Gets the Bitmap currently assigned to the Image widget. - * - * @return The current Bitmap of the widget. - */ - Bitmap getBitmap() const - { - return bitmap; - } - - /** - * Gets the BitmapId currently assigned to the Image widget. - * - * @return The current BitmapId of the widget. - */ - BitmapId getBitmapId() const - { - return bitmap.getId(); - } - - /** - * Gets the current alpha value of the widget. The alpha value is in range 255 - * (solid) to 0 (invisible). - * - * @return The current alpha value. - * - * @see setAlpha - */ - uint8_t getAlpha() const - { - return alpha; - } - - virtual Rect getSolidRect() const; - - virtual void invalidateContent() const - { - if (alpha > 0) - { - Widget::invalidateContent(); - } - } - -protected: - Bitmap bitmap; ///< The Bitmap to display. - uint8_t alpha; ///< The Alpha for this image. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_IMAGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp deleted file mode 100644 index 80cf001..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Keyboard.hpp +++ /dev/null @@ -1,303 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/Keyboard.hpp - * - * Declares the touchgfx::Keyboard class. - */ -#ifndef TOUCHGFX_KEYBOARD_HPP -#define TOUCHGFX_KEYBOARD_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The keyboard provides text input for touch devices. It is configured using a Layout and a - * KeyMappingList, both of which can be changed at runtime. The class using the keyboard - * must provide a buffer where the entered text is placed. The Layout contains a bitmap - * id for the image to display and two mappings: rectangles to key ids and rectangles to - * callback methods. - * - * The KeyMappingList maps key ids to Unicode characters. When the user presses a key, - * the keyboard looks in its layout for a rectangle containing the coordinates pressed. - * If it finds a mapping to a callback method, it will invoke that method. If it finds a - * mapping to a key it will look up the Unicode character for that key and place it in a - * text buffer. The sequence is: (x,y) -> KeyId -> UnicodeChar. - * - * A keyboard with multiple key mappings e.g. lower case alpha, upper case alpha and - * numeric mappings can be created by implementing callback methods for shift and mode - * areas in the provided bitmap and then changing the KeyMappingList when those areas - * are pressed. - */ -class Keyboard : public Container -{ -public: - /** Mapping from rectangle to key id. */ - struct Key - { - uint8_t keyId; ///< The id of a key - Rect keyArea; ///< The area occupied by the key - BitmapId highlightBitmapId; ///< A bitmap to show when the area is "pressed" - }; - - /** Mapping from rectangle to a callback method to execute. */ - struct CallbackArea - { - Rect keyArea; ///< The area occupied by a key - GenericCallback<>* callback; ///< The callback to execute, when the area is "pressed". The callback should be a Callback member in the class using the keyboard - BitmapId highlightBitmapId; ///< A bitmap to show when the area is "pressed" - }; - - /** - * Definition of the keyboard layout. The keyboard can handle changing layouts, so - * different keyboard modes can be implemented by changing layouts and key mappings. - */ - struct Layout - { - BitmapId bitmap; ///< The bitmap used for the keyboard layout - const Key* keyArray; ///< The keys on the keyboard layout - uint8_t numberOfKeys; ///< The number of keys on this keyboard layout - CallbackArea* callbackAreaArray; ///< The array of areas and corresponding callbacks - uint8_t numberOfCallbackAreas; ///< The number of areas and corresponding callbacks - Rect textAreaPosition; ///< The area where text is written - TypedText textAreaFont; ///< The font used for typing text - colortype textAreaFontColor; ///< The color used for the typing text - FontId keyFont; ///< The font used for the keys - colortype keyFontColor; ///< The color used for the keys - }; - - /** Mapping from key id to Unicode character. */ - struct KeyMapping - { - uint8_t keyId; ///< Id of a key - Unicode::UnicodeChar keyValue; ///< Unicode equivalent of the key id - }; - - /** List of KeyMappings to use. */ - struct KeyMappingList - { - const KeyMapping* keyMappingArray; ///< The array of key mappings used by the keyboard - uint8_t numberOfKeys; ///< The number of keys in the list - }; - - Keyboard(); - - /** - * Sets the buffer to be used by the keyboard. Keys entered are added to the buffer. - * - * @param [in] newBuffer Pointer to a buffer holding the text edited by the keyboard. - * If the buffer is not empty, the edit position for the - * keyboard will be set to the end of the provided text. - * @param newBufferSize Length of the buffer, i.e. number of UnicodeChar's. - * - * @see getBuffer - */ - void setBuffer(Unicode::UnicodeChar* newBuffer, uint16_t newBufferSize); - - /** - * Set/change the Keyboard::Layout to use.The Keyboard will invalidate the space it - * occupies to request a redraw. - * - * @param newLayout The new layout. - * - * @see getLayout - */ - void setLayout(const Layout* newLayout); - - /** - * Sets text indentation by making the area for entered text slightly larger. The result - * is that some characters (often 'j' and '_') will not be cut off. Indentation is added - * to both sides of the text area in case the text is right-to-left. Indentation is - * automatically set so all characters will display properly. - * - * @see TextArea::setIndentation - */ - void setTextIndentation(); - - /** - * Gets the layout. - * - * @return The layout used by the Keyboard. - * - * @see setLayout - */ - const Layout* getLayout() const - { - return layout; - } - - /** - * Set/change the KeyMappingList to use. The Keyboard will invalidate the space it - * occupies to request a redraw. - * - * @param newKeyMappingList The new KeyMappingList. - */ - void setKeymappingList(const KeyMappingList* newKeyMappingList); - - /** - * Gets key mapping list. - * - * @return The KeyMappingList used by the Keyboard. - */ - const KeyMappingList* getKeyMappingList() const - { - return keyMappingList; - } - - /** - * Change the buffer position i.e. the next index to place a character when a key is - * pressed. This can be used to implement backspace functionality if the class using the - * Keyboard implements a callback and maps it to a backspace implementation. Setting the - * position will cause the TextArea displaying the text to be invalidated to request a - * redraw. - * - * @param newPos The buffer position. - * - * @see setTextIndentation - */ - void setBufferPosition(uint16_t newPos); - - /** - * Gets buffer position. - * - * @return the buffer position, i.e. the current index where new characters will be - * placed. - * - * @see setBufferPosition - */ - uint16_t getBufferPosition() - { - return bufferPosition; - } - - /** - * Gets the buffer. - * - * @return The buffer containing entered text currently being displayed. - * - * @see setBuffer - */ - Unicode::UnicodeChar* getBuffer() const - { - return buffer; - } - - /** - * Overrides the draw implementation on the Container. First invokes the container draw - * implementation to draw the keyboard bitmap and text area holding the entered text. If - * additional drawables have been added to the keyboard, they will also be draw. After - * invoking the container draw, the glyphs mapped to keys are drawn and if a key has - * been pressed, it will be highlighted. - * - * @param invalidatedArea The area to draw. - */ - virtual void draw(const Rect& invalidatedArea) const; - - /** - * Overrides the handleClickEvent on the container. The keyboard handles all click - * events internally and click events are _not_ propagated to drawables added to the - * keyboard. - * - * @param event The ClickEvent. - */ - virtual void handleClickEvent(const ClickEvent& event); - - /** - * Overrides the handleDragEvent on the container. The keyboard handles drag events to - * enable the container to, emit a CANCEL, if the user drags outside the currently - * pressed key. - * - * @param event The DragEvent. - */ - virtual void handleDragEvent(const DragEvent& event); - - /** - * Sets the callback for the keyboard. The callback will be executed every time a key is - * clicked. The callback argument contains the key that was just pressed. - * - * @param [in] callback The Callback to invoke. - * - * @note Backspace, shift and mode keys report a 0 as value. - */ - void setKeyListener(GenericCallback& callback) - { - keyListener = &callback; - } - -protected: - GenericCallback* keyListener; ///< Pointer to callback being executed when a key is pressed. - - Unicode::UnicodeChar* buffer; ///< Pointer to null-terminated buffer where the entered text is being displayed. - uint16_t bufferSize; ///< Size of the buffer - uint16_t bufferPosition; ///< Current position in buffer. - Image image; ///< Layout bitmap. - TextAreaWithOneWildcard enteredText; ///< Widget capable of displaying the entered text buffer. - const Layout* layout; ///< Pointer to layout. - const KeyMappingList* keyMappingList; ///< Pointer to key mapping. - Image highlightImage; ///< Image to display when a key is highlighted. - bool cancelIsEmitted; ///< Tells if a cancel is emitted to check when a key is released - - /** - * Gets key for coordinates. - * - * @param x The x coordinate to perform key look up with. - * @param y The y coordinate to perform key look up with. - * - * @return The key for the given coordinates. - */ - Key getKeyForCoordinates(int16_t x, int16_t y) const; - - /** - * Maps a keyId to the UnicodeChar being displayed by that key. - * - * @param keyId The id of the key to perform lookup with. - * - * @return the UnicodeChar used for the specified key. - */ - Unicode::UnicodeChar getCharForKey(uint8_t keyId) const; - - /** - * Gets the callback area defined by the layout for the specified coordinates. - * - * @param x The x coordinate to perform key look up with. - * @param y The y coordinate to perform key look up with. - * - * @return The CallbackArea, which is empty if not found. - */ - CallbackArea getCallbackAreaForCoordinates(int16_t x, int16_t y) const; - - /// @cond - /** - * Add to draw chain. - * - * @param invalidatedArea Include drawables that intersect with this area only. - * @param [in,out] nextPreviousElement Modifiable element in linked list. - * - * @note For TouchGFX internal use only. - */ - virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement); - /// @endcond -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_KEYBOARD_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp deleted file mode 100644 index 07ba4e2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/PixelDataWidget.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/PixelDataWidget.hpp - * - * Declares the touchgfx::PixelDataWidget class. - */ -#ifndef TOUCHGFX_PIXELDATAWIDGET_HPP -#define TOUCHGFX_PIXELDATAWIDGET_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A widget for displaying a buffer of pixel data. This can also be though of as a dynamic - * bitmap where the dimensions of the bitmap is the same as the dimensions of the widget - * and the actual bitmap data can be set and updated dynamically. The size of the buffer - * must match the number of bytes required for the widget calculated as WIDTH x HEIGHT x - * BYTES_PER_PIXEL. If the LCD is 16 bit per pixel the buffer must hold 2 bytes for each - * pixel. If the LCD is 24 bit the buffer must hold 3 bytes for each pixel. - */ -class PixelDataWidget : public Widget -{ -public: - PixelDataWidget() - : Widget(), - buffer(0), - format(Bitmap::RGB888), - alpha(255) - { - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - - /** - * Set the pixel data to display. The given pointer must contain WIDTH x HEIGHT x - * BYTES_PER_PIXEL bytes of addressable image data. - * - * @param [in] data Image data. - * - * @see getPixelData, setBitmapFormat - */ - void setPixelData(uint8_t* const data) - { - buffer = data; - } - - /** - * Get the pixel data memory pointer, previously set with setPixelData(). - * - * @return The pixel data. - * - * @see setPixelData, setBitmapFormat - */ - uint8_t* getPixelData() const - { - return buffer; - } - - /** - * Set the format of the pixel data. The supported formats depend on the display type. For - * example grayscale displays do not support color images. - * - * @param bitmapFormat Describes the format to use when reading the pixel data. - * - * @see getBitmapFormat - */ - void setBitmapFormat(Bitmap::BitmapFormat bitmapFormat) - { - format = bitmapFormat; - } - - /** - * Get the format of the pixel data previously set using setBitmapFormat(). - * - * @return The bitmap format. - * - * @see setBitmapFormat - */ - Bitmap::BitmapFormat getBitmapFormat() const - { - return format; - } - - /** - * @copydoc Image::setAlpha - */ - void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** - * @copydoc Image::getAlpha - */ - uint8_t getAlpha() const - { - return alpha; - } - - virtual void invalidateContent() const - { - if (alpha > 0) - { - Widget::invalidateContent(); - } - } - -protected: - uint8_t* buffer; ///< The buffer where the pixels are copied from - Bitmap::BitmapFormat format; ///< The pixel format for the data. - uint8_t alpha; ///< The Alpha for this widget. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PIXELDATAWIDGET_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp deleted file mode 100644 index bb24587..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButton.hpp +++ /dev/null @@ -1,206 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/RadioButton.hpp - * - * Declares the touchgfx::RadioButton class. - */ -#ifndef TOUCHGFX_RADIOBUTTON_HPP -#define TOUCHGFX_RADIOBUTTON_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Radio button with two states. A RadioButton is a button that changes appearance (state) when - * it has been pushed. Pushing the RadioButton again will return the to original state. - * - * To make managing radio buttons much easier, they can be added to a RadioButtonGroup - * which then automates deselecting radio buttons when a new radio button is pressed. - * - * @see RadioButtonGroup - */ -class RadioButton : public AbstractButton -{ -public: - RadioButton() - : AbstractButton(), bitmapUnselected(), bitmapUnselectedPressed(), bitmapSelected(), bitmapSelectedPressed(), alpha(255), selected(false), deselectionEnabled(false), deselectedAction(0) - { - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual void handleClickEvent(const ClickEvent& event); - - /** - * Sets the four bitmaps used by this button. The first two bitmaps must show the - * unselected Button when it is released and pressed. The last two bitmaps must show the - * selected Button when it is released and pressed. - * - * @param bmpUnselected Bitmap to use when button is unselected and released. - * @param bmpUnselectedPressed Bitmap to use when button is unselected and pressed. - * @param bmpSelected Bitmap to use when button is selected and released. - * @param bmpSelectedPressed Bitmap to use when button is selected and pressed. - * - * @note It is not uncommon to have the same bitmap for released (normal) and pressed state. - */ - virtual void setBitmaps(const Bitmap& bmpUnselected, const Bitmap& bmpUnselectedPressed, const Bitmap& bmpSelected, const Bitmap& bmpSelectedPressed); - - /** - * Associates an action to be performed when the RadioButton is deselected. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the AbstractButton. - * - * @note The action performed when the RadioButton is selected, is set using - * setAction(). - */ - void setDeselectedAction(GenericCallback& callback) - { - deselectedAction = &callback; - } - - virtual Rect getSolidRect() const; - - /** - * Executes the previously set action. - * - * @see setDeselectedAction - */ - void executeDeselectedAction() - { - if (deselectedAction && deselectedAction->isValid()) - { - deselectedAction->execute(*this); - } - } - - /** - * Sets the alpha channel for the RadioButton, i.e. all the images used. The default alpha value - * on a RadioButton is 255. - * - * @param newAlpha The alpha value ranging from 255=solid to 0=invisible. - * - * @see getAlpha - */ - void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** - * Gets the current alpha value, as previously set using setAlpha. The default alpha - * value (if the alpha value has not been changed using setAlpha) is 255=solid. - * - * @return The current alpha value ranging from 255=solid to 0=invisible. - * - * @see setAlpha - */ - uint8_t getAlpha() const - { - return alpha; - } - - /** - * Sets whether or not it is possible to deselect the RadioButton by clicking it. By - * default it is not possible to deselect a RadioButton. The meaning of this is most - * clear when the RadioButton is used in a RadioButtonGroup where exactly one - * RadioButton should always be selected. Pressing the currently selected RadioButton - * should not deselect it, but rather select it again. This makes the button "sticky", - * i.e. a button can only be deselected by selecting another RadioButton in the same - * RadioButtonGroup. - * - * @param state true if it should be possible to deselect by click. Default is false. - * - * @see getDeselectionEnabled - */ - void setDeselectionEnabled(bool state) - { - deselectionEnabled = state; - } - - /** - * Gets the current deselectionEnabled state. - * - * @return The current deselectionEnabled state. - * - * @see setDeselectionEnabled - */ - bool getDeselectionEnabled() const - { - return deselectionEnabled; - } - - /** - * Sets the radio buttons selected state. Note that the associated action is also - * performed. - * - * @param newSelected The new selected state. - * - * @see setAction, setDeselectedAction, RadioButtonGroup - * - * @note If the RadioButton is part of a RadioButtonGroup, setting the selected state of - * individual RadioButtons is not recommended. - */ - void setSelected(bool newSelected); - - /** - * Gets the current selected state. - * - * @return The current selected state. - */ - bool getSelected() const - { - return selected; - } - - /** - * Gets currently displayed bitmap. This depends on whether the RadioButton is currently - * selected or not and whether it is being pressed or not, i.e. it depends on the radio - * button's pressed and selected state. - * - * @return The bitmap currently displayed. - */ - Bitmap getCurrentlyDisplayedBitmap() const - { - return (selected ? (AbstractButton::pressed ? bitmapSelectedPressed : bitmapSelected) : (AbstractButton::pressed ? bitmapUnselectedPressed : bitmapUnselected)); - } - - virtual void invalidateContent() const - { - if (alpha > 0) - { - AbstractButton::invalidateContent(); - } - } - -protected: - Bitmap bitmapUnselected; ///< The image to display when radio button unselected and released. - Bitmap bitmapUnselectedPressed; ///< The image to display when radio button unselected and pressed. - Bitmap bitmapSelected; ///< The image to display when radio button selected and released. - Bitmap bitmapSelectedPressed; ///< The image to display when radio button selected and pressed. - uint8_t alpha; ///< The current alpha value. 255=solid, 0=invisible. - bool selected; ///< The current selected state. - bool deselectionEnabled; ///< Is it possible to deselect by pressing a selected RadioButton. - - GenericCallback* deselectedAction; ///< The callback to be executed when this AbstractButton is deselected. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_RADIOBUTTON_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp deleted file mode 100644 index db0a9e4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RadioButtonGroup.hpp +++ /dev/null @@ -1,238 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/RadioButtonGroup.hpp - * - * Declares the touchgfx::RadioButtonGroup class. - */ -#ifndef TOUCHGFX_RADIOBUTTONGROUP_HPP -#define TOUCHGFX_RADIOBUTTONGROUP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Class for handling a collection of RadioButton objects. The RadioButtonGroup handles the - * automatic deselection of other radio buttons when a new RadioButton is selected. A - * callback is executed when a new selection occurs reporting the newly selected - * RadioButton. - * - * @tparam CAPACITY The number of RadioButtons to store in the RadioButtonGroup. - * - * @see RadioButton - */ -template -class RadioButtonGroup -{ -public: - /** Initializes a new instance of the RadioButtonGroup class. */ - RadioButtonGroup() - : size(0), - radioButtonClicked(this, &RadioButtonGroup::radioButtonClickedHandler), - radioButtonUnselected(this, &RadioButtonGroup::radioButtonDeselectedHandler), - radioButtonSelectedCallback(0), - radioButtonDeselectedCallback(0) - { - } - - /** Finalizes an instance of the RadioButtonGroup class. */ - virtual ~RadioButtonGroup() - { - } - - /** - * Add the RadioButton to the RadioButtonGroup. Adding more radio buttons than the - * \a CAPACITY of the RadioButtonGroup raises an assert. - * - * @param [in] radioButton The RadioButton to add. - */ - virtual void add(RadioButton& radioButton) - { - assert(size < CAPACITY && "RadioButtonGroup capacity exceeded!"); - radioButton.setAction(radioButtonClicked); - radioButton.setDeselectedAction(radioButtonUnselected); - radioButtons[size++] = &radioButton; - } - - /** - * Gets the RadioButton at the specified index. - * - * @param index the index of the RadioButton to return. - * - * @return the RadioButton at the specified index. Returns 0 if the index is illegal. - */ - virtual RadioButton* getRadioButton(uint16_t index) const - { - return (size > index) ? radioButtons[index] : 0; - } - - /** - * Gets the index of the currently selected RadioButton. - * - * @return the index of the selected RadioButton. Returns -1 if no RadioButton is - * selected. - */ - virtual int32_t getSelectedRadioButtonIndex() const - { - for (uint16_t i = 0; i < size; i++) - { - if (radioButtons[i]->getSelected()) - { - return i; - } - } - return -1; - } - - /** - * Gets the currently selected RadioButton - * - * @return a pointer to the selected RadioButton. Returns 0 if no RadioButton is - * selected. - */ - virtual RadioButton* getSelectedRadioButton() const - { - int32_t index = getSelectedRadioButtonIndex(); - return (index < 0) ? 0 : getRadioButton(index); - } - - /** - * Sets the specified RadioButton to be selected. - * - * Sets the specified RadioButton to be selected and all other radio buttons to be - * deselected. Do not call this function before all RadioButton objects have been added - * to the RadioButtonGroup. Will call the radioButtonSelected callback. - * - * @param [in] radioButton the RadioButton to be selected. - */ - virtual void setSelected(RadioButton& radioButton) - { - radioButton.setSelected(true); - radioButtonClickedHandler(radioButton); - } - - /** - * Sets whether or not it is possible to deselect RadioButtons by clicking them when - * they are selected. If deselection is enabled, it will be possible to select a - * RadioButton (and as a result deselect all other radio buttons) and the push the same - * RadioButton again to deselect it. The result is that no RadioButton is selected. - * - * @param deselectionEnabled true if it should be possible to deselect by click. - * - * @see getDeselectionEnabled - */ - virtual void setDeselectionEnabled(bool deselectionEnabled) - { - for (uint16_t i = 0; i < size; i++) - { - radioButtons[i]->setDeselectionEnabled(deselectionEnabled); - } - } - - /** - * Gets the current deselectionEnabled state. - * - * @return The current deselectionEnabled state. - * - * @see setDeselectionEnabled - */ - virtual bool getDeselectionEnabled() const - { - return (size > 0) ? radioButtons[0]->getDeselectionEnabled() : false; - } - - /** - * Associates an action to be performed when a radio button belonging to this group is - * selected. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the RadioButton that was selected. - * - * @see GenericCallback - */ - void setRadioButtonSelectedHandler(GenericCallback& callback) - { - radioButtonSelectedCallback = &callback; - } - - /** - * Associates an action to be performed when a radio button belonging to this group - * transition from selected to unselected. - * - * @param callback The callback to be executed. The callback will be given a reference - * to the RadioButton that was selected. - * - * @see GenericCallback - */ - void setRadioButtonDeselectedHandler(GenericCallback& callback) - { - radioButtonDeselectedCallback = &callback; - } - -protected: - RadioButton* radioButtons[CAPACITY]; ///< The list of added RadioButtons. - uint16_t size; ///< The current number of added RadioButtons. - - Callback radioButtonClicked; ///< Callback that is attached to the RadioButtons. - Callback radioButtonUnselected; ///< Callback that is attached to the RadioButtons. - - GenericCallback* radioButtonSelectedCallback; ///< The callback to be executed when a radio button belonging to this group is selected. - GenericCallback* radioButtonDeselectedCallback; ///< The callback to be executed when a radio button belonging to this group is deselected. - - /** - * Handles the event that a RadioButton has been selected. deselects all other - * RadioButtons. - * - * @param radioButton the RadioButton that has been selected. - */ - virtual void radioButtonClickedHandler(const AbstractButton& radioButton) - { - // Deselect other radio buttons - for (uint16_t i = 0; i < size; i++) - { - if (radioButtons[i] != &radioButton) - { - if (radioButtons[i]->getSelected()) - { - radioButtons[i]->setSelected(false); - } - } - } - - if (radioButtonSelectedCallback && radioButtonSelectedCallback->isValid()) - { - radioButtonSelectedCallback->execute(radioButton); - } - } - - /** - * Handles the event that a RadioButton has been deselected. - * - * @param radioButton the RadioButton that has been deselected. - */ - virtual void radioButtonDeselectedHandler(const AbstractButton& radioButton) - { - if (radioButtonDeselectedCallback && radioButtonDeselectedCallback->isValid()) - { - radioButtonDeselectedCallback->execute(radioButton); - } - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_RADIOBUTTONGROUP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp deleted file mode 100644 index 16a9e21..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/RepeatButton.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/RepeatButton.hpp - * - * Declares the touchgfx::RepeatButton class. - */ -#ifndef TOUCHGFX_REPEATBUTTON_HPP -#define TOUCHGFX_REPEATBUTTON_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A RepeatButton is similar to a regular Button, but it will 'repeat' if pressed for a long - * period of time. The RepeatButton differs from a regular Button with regards to - * activation. A Button is activated when the button is released, whereas a RepeatButton - * is activated immediately when pressed and then at regular intervals. A RepeatButton - * does not activate when released. - * - * As for other well-known repeat buttons, the interval from the first activation until - * the second activation as well as the subsequent interval between activations can be - * set for the RepeatButton. - * - * The default values for initial delay is 10 ticks, and the default value for the - * following delays between button activations is 5 ticks. - */ -class RepeatButton : public Button -{ -public: - RepeatButton(); - - /** - * Sets the delay (in number of ticks) from the first button activation until the next - * time it will be automatically activated. - * - * @param delay The delay, measured in ticks, between first activation and second activation. - * - * @see setInterval, getDelay - */ - virtual void setDelay(int delay); - - /** - * Gets the delay in ticks from first button activation until next activation. - * - * @return The delay, measured in ticks, between first activation and second activation. - * - * @see setDelay - */ - virtual int getDelay(); - - /** - * Sets the interval in number of ticks between each each activation of the pressed - * button after the second activation. - * - * @param interval The interval between repeated activations, measured in ticks. - * - * @see setDelay, getInterval - */ - virtual void setInterval(int interval); - - /** - * The interval between repeated activations, measured in ticks. This is the number of - * ticks between the an activation beyond the first and the following activation. - * - * @return The interval between repeated activations, measured in ticks. - * - * @see setInterval - */ - virtual int getInterval(); - - virtual void handleClickEvent(const ClickEvent& event); - - virtual void handleTickEvent(); - -private: - int16_t ticksDelay; - int16_t ticksInterval; - - int16_t ticks; - int16_t ticksBeforeContinuous; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_REPEATBUTTON_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp deleted file mode 100644 index 53c6a3d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SVGImage.hpp +++ /dev/null @@ -1,285 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/SVGImage.hpp - * - * Defines the touchgfx::SVGImage class. - */ -#ifndef TOUCHGFX_SVGIMAGE_HPP -#define TOUCHGFX_SVGIMAGE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -const uint16_t SVG_INVALID = 0xFFFFU; ///< Define the svgId of an invalid SVG - -/** - * Simple widget capable of showing a SVG image on the display. - * - * @see Image - */ -class SVGImage : public Widget -{ -public: - /** - * Constructs a new Image with a default SVG (undefined) if none is specified. - * - * @see setSVG - */ - SVGImage() - : Widget(), svgId(SVG_INVALID), - scaleX(1.0f), scaleY(1.0f), rotation(0.0f), rotationCenterX(0.0f), rotationCenterY(0.0f), - imagePositionX(0.0f), imagePositionY(0.0f) - { - } - - /** - * Sets the SVG for this SVGImage and updates the width and height of this widget (if the widget - * has not already been assigned a width and height) to match those of the SVG drawing. See the - * file generated/images/include/images/SVGDatabase.hpp. - * - * @param id The SVG ID. - * - * @see resizeToCurrentSVG - * - * @note The image is not resized and invalidated after setting the id. - */ - virtual void setSVG(uint16_t id); - - /** Resize the Widget to match the size of the SVG drawing. */ - void resizeToCurrentSVG(); - - /** Resets all adjustments made to the svg proportions. */ - void reset(); - - /** - * Gets SVG width as given in the SVG image file. This is the width before applying any rotation - * and scaling. - * - * @return The SVG width. - */ - float getImageWidth() const; - - /** - * Gets SVG height as given in the SVG image file. This is the width before applying any - * rotation and scaling. - * - * @return The SVG height. - */ - float getImageHeight() const; - - /** - * Sets SVG scale for both width and height. - * - * @param scale The scale to apply to width and height. - */ - void setScale(float scale) - { - setScale(scale, scale); - } - - /** - * Sets SVG scale for width and for height. - * - * @param xScale The scale for width. - * @param yScale The scale for height. - * - * @see setScale(float), getScaleX, getScaleY - */ - void setScale(float xScale, float yScale) - { - setScaleX(xScale); - setScaleY(yScale); - } - - /** - * Sets SVG scale for width. - * - * @param scale The scale for width. - * - * @see setScale(float), setScale(float,float), getScaleX - */ - void setScaleX(float scale) - { - scaleX = scale; - } - - /** - * Gets SVG scale for width. - * - * @return The SVG scale for width. - * - * @see setScale, setScaleX - */ - float getScaleX() const - { - return scaleX; - } - - /** - * Sets SVG height scale. - * - * @param scale The scale for height. - * - * @see setScale(float), setScale(float,float), getScaleY - */ - void setScaleY(float scale) - { - scaleY = scale; - } - - /** - * Gets SVG height scale. - * - * @return The SVG scale for height. - * - * @see setScale, setScaleY - */ - float getScaleY() const - { - return scaleY; - } - - /** - * Sets SVG rotation center. The position is relative to the topleft corner of the SVGImage - * widget, not relative to the SVG. The center is the position before applying any scaling. - * - * @param centerX The center x coordinate. - * @param centerY The center y coordinate. - * - * @see getRotationCenterX, getRotationCenterY, setImagePosition - */ - void setRotationCenter(float centerX, float centerY) - { - rotationCenterX = centerX; - rotationCenterY = centerY; - } - - /** - * Gets rotation center x coordinate. - * - * @return The rotation center x coordinate. - */ - float getRotationCenterX() const - { - return rotationCenterX; - } - - /** - * Gets rotation center y coordinate. - * - * @return The rotation center y coordinate. - */ - float getRotationCenterY() const - { - return rotationCenterY; - } - - /** - * Sets SVG rotation. The rotation is done around the position set in the previously set - * rotation center. - * - * @param angle The rotation angle. - * - * @see setRotationCenter, getRotation - */ - void setRotation(float angle) - { - rotation = angle; - } - - /** - * Gets SVG rotation. - * - * @return The SVG rotation. - * - * @see setRotation - */ - float getRotation() const - { - return rotation; - } - - /** - * Sets image position. This is used to move the SVG on the screen. Negative values move the SVG - * to the left and up. - * - * @param imageX The image x coordinate. - * @param imageY The image y coordinate. - * - * @see getImagePositionX, getImagePositionY - */ - void setImagePosition(float imageX, float imageY) - { - imagePositionX = imageX; - imagePositionY = imageY; - } - - /** - * Gets image position x coordinate. - * - * @return The image position x coordinate. - * - * @see setImagePosition - */ - float getImagePositionX() const - { - return imagePositionX; - } - - /** - * Gets image position y coordinate. - * - * @return The image position y coordinate. - * - * @see setImagePosition - */ - float getImagePositionY() const - { - return imagePositionY; - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual void invalidateContent() const; - - virtual Rect getSolidRect() const - { - return Rect(); - } - -protected: - /** - * Calculate the transformation matrix used when drawing the SVG. - * - * @return The transformation matrix. - */ - Matrix3x3 getTransformationMatrix() const; - - uint16_t svgId; ///< The SVG to display. - float scaleX; ///< The scale for width - float scaleY; ///< The scale for height - float rotation; ///< The rotation - float rotationCenterX; ///< The rotation center x coordinate - float rotationCenterY; ///< The rotation center y coordinate - float imagePositionX; ///< The SVG image position x coordinate - float imagePositionY; ///< The SVG image position y coordinate -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SVGIMAGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp deleted file mode 100644 index 3188f14..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ScalableImage.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/ScalableImage.hpp - * - * Declares the touchgfx::ScalableImage class. - */ -#ifndef TOUCHGFX_SCALABLEIMAGE_HPP -#define TOUCHGFX_SCALABLEIMAGE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Widget for representing a scaled version of a bitmap. Simply change the width/height of the - * widget to resize the image. The quality of the scaled image depends of the rendering - * algorithm used. The rendering algorithm can be changed dynamically. Please note that - * scaling images is done at runtime and may require a lot of calculations. - * - * @note Note that this widget does not support 1 bit per pixel color depth. - */ -class ScalableImage : public Image -{ -public: - /** - * Rendering algorithm to use when scaling the bitmap. Nearest neighbor simply finds the - * closest pixel in the source bitmap. Bi-linear interpolation averages 4 pixels to find - * a much better pixel representation. - */ - enum ScalingAlgorithm - { - NEAREST_NEIGHBOR, ///< Fast but not a very good image quality. Good for fast animations. - BILINEAR_INTERPOLATION ///< Slower but better image quality. Good for static representation of a scaled image. - }; - - /** - * Constructs a new ScalableImage with a default alpha value of 255 (solid) and a default Bitmap - * (undefined) if none is specified. If a Bitmap is passed to the constructor, the width and - * height of this widget is set to those of the bitmap. - * - * @param bmp (Optional) The bitmap to display. - * - * @see setBitmap - */ - ScalableImage(const Bitmap& bmp = Bitmap()); - - /** - * Sets the algorithm to be used. In short, there is currently a value for fast (nearest - * neighbor) and a value for slow (bi-linear interpolation). - * - * @param algorithm The algorithm to use when rendering. - * - * @see ScalingAlgorithm - */ - virtual void setScalingAlgorithm(ScalingAlgorithm algorithm); - - /** - * Gets the algorithm used when rendering. - * - * @return The algorithm used when rendering. - * - * @see ScalingAlgorithm - */ - virtual ScalingAlgorithm getScalingAlgorithm(); - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - -protected: - ScalingAlgorithm currentScalingAlgorithm; ///< The current scaling algorithm. - -private: - /// @cond - /** - * Draw a triangle part of the bitmap. - * - * @param invalidatedArea The invalidated area. - * @param [in] fb If non-null, the fb. - * @param triangleXs The triangle xs. - * @param triangleYs The triangle ys. - * @param triangleZs The triangle zs. - * @param triangleUs The triangle us. - * @param triangleVs The triangle vs. - */ - void drawQuad(const Rect& invalidatedArea, uint16_t* fb, const float* triangleXs, const float* triangleYs, const float* triangleZs, const float* triangleUs, const float* triangleVs) const; - - /** - * Looks up the appropriate render variant based on the bitmap format and scaling - * algorithm. - * - * Looks up the appropriate render variant based on the bitmap format and scaling - * algorithm. - * - * @return A RenderingVariant. - */ - RenderingVariant lookupRenderVariant() const; - /// @endcond -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SCALABLEIMAGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp deleted file mode 100644 index 31047e6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/SnapshotWidget.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/SnapshotWidget.hpp - * - * Declares the touchgfx::SnapshotWidget class. - */ -#ifndef TOUCHGFX_SNAPSHOTWIDGET_HPP -#define TOUCHGFX_SNAPSHOTWIDGET_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * A widget that is able to make a snapshot of the area the SnapshotWidget covers into either a - * Bitmap or into animation storage (if this available). Once the snapshot has been - * taken using SnapshowWidget::makeSnapshot(), the SnapshotWidget will show the captured - * snapshot when it is subsequently drawn. - */ -class SnapshotWidget : public Widget -{ -public: - SnapshotWidget(); - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - - /** - * Makes a snapshot of the area the SnapshotWidget currently covers. This area is - * defined by setting the dimensions and the position of the SnapshotWidget. The - * snapshot is stored in Animation Storage. - * - * @see setPosition - */ - virtual void makeSnapshot(); - - /** - * Makes a snapshot of the area the SnapshotWidget currently covers. This area is - * defined by setting the dimensions and the position of the SnapshotWidget. The - * snapshot is stored in the provided dynamic bitmap. The format of the Bitmap must - * match the format of the display. - * - * @param bmp The target dynamic bitmap. - */ - virtual void makeSnapshot(const BitmapId bmp); - - /** - * @copydoc Image::setAlpha - */ - void setAlpha(const uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** - * @copydoc Image::getAlpha - */ - uint8_t getAlpha() const - { - return alpha; - } - - virtual void invalidateContent() const - { - if (alpha > 0) - { - Widget::invalidateContent(); - } - } - -protected: - BitmapId bitmapId; ///< BitmapId where copy is stored s copied to. - uint8_t alpha; ///< The alpha with which to draw this snapshot. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SNAPSHOTWIDGET_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp deleted file mode 100644 index c5aa1fe..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextArea.hpp +++ /dev/null @@ -1,484 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/TextArea.hpp - * - * Declares the touchgfx::TextArea class. - */ -#ifndef TOUCHGFX_TEXTAREA_HPP -#define TOUCHGFX_TEXTAREA_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * This widget is capable of showing a text area on the screen. The text must be a predefined - * TypedText in the text sheet in the assets folder. In order to display a dynamic text, - * use TextAreaWithOneWildcard or TextAreaWithTwoWildcards. - * - * @see TypedText, TextAreaWithOneWildcard, TextAreaWithTwoWildcards - * - * @note A TextArea just holds a pointer to the text displayed. The developer must ensure that - * the pointer remains valid when drawing. - */ -class TextArea : public Widget -{ -public: - TextArea() - : Widget(), typedText(TYPED_TEXT_INVALID), color(0), linespace(0), alpha(255), indentation(0), rotation(TEXT_ROTATE_0), wideTextAction(WIDE_TEXT_NONE), boundingArea() - { - } - - virtual void setWidth(int16_t width) - { - Widget::setWidth(width); - boundingArea = calculateBoundingArea(); - } - - virtual void setHeight(int16_t height) - { - Widget::setHeight(height); - boundingArea = calculateBoundingArea(); - } - - virtual Rect getSolidRect() const - { - return Rect(); - } - - /** - * Sets the color of the text. If no color is set, the default color (black) is used. - * - * @param newColor The color to use. - */ - FORCE_INLINE_FUNCTION void setColor(colortype newColor) - { - color = newColor; - } - - /** - * Gets the color of the text. If no color has been set, the default color, black, is - * returned. - * - * @return The color to used for drawing the text. - */ - FORCE_INLINE_FUNCTION colortype getColor() const - { - return color; - } - - /** - * @copydoc Image::setAlpha - */ - virtual void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** - * @copydoc Image::getAlpha - */ - uint8_t getAlpha() const - { - return alpha; - } - - /** - * Adjusts the TextArea y coordinate so the text will have its baseline at the specified - * value. The placements is relative to the specified TypedText so if the TypedText is - * changed, you have to set the baseline again. - * - * @param baselineY The y coordinate of the baseline of the text. - * - * @note setTypedText() must be called prior to setting the baseline. - */ - virtual void setBaselineY(int16_t baselineY) - { - setY(baselineY - getTypedText().getFont()->getBaseline()); - } - - /** - * Adjusts the TextArea x and y coordinates so the text will have its baseline at the - * specified y value. The placements is relative to the specified TypedText so if the - * TypedText is changed you have to set the baseline again. The specified x coordinate - * will be used as the x coordinate of the TextArea. - * - * @param x The x coordinate of the TextArea. - * @param baselineY The y coordinate of the baseline of the text. - * - * @note setTypedText() must be called prior to setting the baseline. - */ - virtual void setXBaselineY(int16_t x, int16_t baselineY) - { - setX(x); - setBaselineY(baselineY); - } - - /** - * Sets the line spacing of the TextArea. Setting a larger value will increase the space - * between lines. It is possible to set a negative value to have lines (partially) - * overlap. Default line spacing, if not set, is 0. - * - * @param space The line spacing of use in the TextArea. - * - * @see getLinespacing - */ - FORCE_INLINE_FUNCTION void setLinespacing(int16_t space) - { - linespace = space; - boundingArea = calculateBoundingArea(); - } - - /** - * Gets the line spacing of the TextArea. If no line spacing has been set, the line - * spacing is 0. - * - * @return The line spacing. - * - * @see setLinespacing - */ - FORCE_INLINE_FUNCTION int16_t getLinespacing() const - { - return linespace; - } - - /** - * Sets the indentation for the text. This can be very useful when a font is an italic - * font where letters such as "j" and "g" extend a lot to the left under the previous - * character(s). if a line starts with a "j" or "g" this letter would either have to be - * pushed to the right to be able to see all of it, e.g. using spaces (which would ruin - * a multi line text which is left aligned) - or by clipping the first letter (which - * could ruin the nice graphics). The solution is to change - * @code - * textarea.setPosition(50, 50, 100, 100); - * @endcode - * to - * @code - * textarea.setPosition(45, 50, 110, 100); - * textarea.setIndentation(5); - * @endcode - * Characters that do not extend to the left under the previous characters will be drawn - * in the same position in either case, but "j" and "g" will be aligned with other lines. - * - * The function Font::getMaxPixelsLeft() will give you the maximum number of pixels any glyph - * in the font extends to the left. - * - * @param indent The indentation from left (when left aligned text) and right (when right - * aligned text). - * - * @see Font::getMaxPixelsLeft - */ - FORCE_INLINE_FUNCTION void setIndentation(uint8_t indent) - { - indentation = indent; - boundingArea = calculateBoundingArea(); - } - - /** - * Gets the indentation of text inside the TextArea. - * - * @return The indentation. - * - * @see setIndentation - */ - FORCE_INLINE_FUNCTION uint8_t getIndentation() - { - return indentation; - } - - /** - * Gets the alignment of text inside the TextArea. - * - * @return The alignment. - * - */ - virtual Alignment getAlignment() const; - - /** - * Gets the total height needed by the text, taking number of lines and line spacing - * into consideration. - * - * @return the total height needed by the text. - */ - virtual int16_t getTextHeight() const; - - /** - * Gets the width in pixels of the current associated text in the current selected - * language. In case of multi-lined text the width of the widest line is returned. - * - * @return The width in pixels of the current text. - */ - virtual uint16_t getTextWidth() const; - - virtual void draw(const Rect& area) const; - - /** - * Sets the TypedText of the text area. If no prior size has been set, the TextArea will - * be resized to fit the new TypedText. - * - * @param t The TypedText for this widget to display. - * - * @see resizeToCurrentText - */ - void setTypedText(const TypedText& t); - - /** - * Gets the TypedText of the text area. - * - * @return The currently used TypedText. - */ - const TypedText& getTypedText() const - { - return typedText; - } - - /** - * Sets rotation of the text in the TextArea. The value TEXT_ROTATE_0 is the default for - * normal text. The value TEXT_ROTATE_90 will rotate the text clockwise, thus writing - * from the top of the display and down. Similarly TEXT_ROTATE_180 and TEXT_ROTATE_270 - * will each rotate the text further 90 degrees clockwise. - * - * @param textRotation The rotation of the text. - */ - FORCE_INLINE_FUNCTION void setRotation(const TextRotation textRotation) - { - rotation = textRotation; - boundingArea = calculateBoundingArea(); - } - - /** - * Gets rotation of the text in the TextArea. - * - * @return The rotation of the text. - * - * @see setRotation - */ - TextRotation getRotation() const - { - return rotation; - } - - /** - * Sets the dimensions of the TextArea to match the width and height of the current - * associated text for the current selected language. - * - * If WordWrap is turned on for the TextArea, the height might be set to an unexpected - * value, as only manually insert line breaks in the text will be respected - use - * resizeHeightToCurrentText() to keep the width of the TextArea and therefore retain - * word wrapping. - * - * If the text is centered or right aligned, calling resizeToCurrentText() will actually - * move the text on the screen, as the x and y coordinates of the TextArea widget is not - * changed. To simply minimize the size of the TextArea but keep the TypedText in the - * same position on the screen, use resizeToCurrentTextWithAlignment(). This is also the - * case if the text is rotated, e.g. 180 degrees. - * - * @see setRotation, resizeHeightToCurrentText - * - * @note If the current text rotation is either 90 or 270 degrees, the width of the text area - * will be set to the height of the text and vice versa, as the text is rotated. - */ - void resizeToCurrentText(); - - /** - * Sets the dimensions of the TextArea to match the width and height of the current - * associated text for the current selected language, and for centered and right aligned - * text, the position of the TextArea widget is also updated to keep the text in the - * same position on the display. Text that is rotated is also handled properly. - * - * @see setRotation, resizeHeightToCurrentText - * - * @note If the current text rotation is either 90 or 270 degrees, the width of the text area - * will be set to the height of the text and vice versa, as the text is rotated. - */ - void resizeToCurrentTextWithAlignment(); - - /** - * Sets the height of the TextArea to match the height of the current associated text - * for the current selected language. This is especially useful for texts with WordWrap - * enabled. - * - * @see resizeToCurrentText, setWideTextAction, setRotation, - * resizeHeightToCurrentTextWithRotation - * - * @note If the current text rotation is either 90 or 270 degrees, the width of the text area - * will be set and not the height, as the text is rotated. - * @note If the current text is rotated, the x/y coordinate is not updated, which means that - * the text will be repositioned on the display. - */ - void resizeHeightToCurrentText(); - - /** - * Sets the height of the TextArea to match the height of the current associated text - * for the current selected language. This is especially useful for texts with WordWrap - * enabled. - * - * @see resizeToCurrentText, setWideTextAction, setRotation, resizeHeightToCurrentText - * - * @note If the current text rotation is either 90 or 270 degrees, the width of the text area - * will be set and not the height, as the text is rotated. Also, the x or y - * coordinates will be updated. - */ - void resizeHeightToCurrentTextWithRotation(); - - /** - * Defines what to do if a line of text is wider than the text area. Default action is - * ::WIDE_TEXT_NONE which means that text lines are only broken if there is a manually - * inserted newline in the text. - * - * If wrapping is enabled and the text would occupy more lines than the size of the - * TextArea, the end of the last line will get an ellipsis (often …) to signal - * that some text is missing. The character used for ellipsis is taken from the text - * spreadsheet. - * - * @param action The action to perform for wide lines of text. - * - * @see WideTextAction, getWideTextAction, resizeHeightToCurrentText - */ - FORCE_INLINE_FUNCTION void setWideTextAction(WideTextAction action) - { - wideTextAction = action; - boundingArea = calculateBoundingArea(); - } - - /** - * Gets wide text action previously set using setWideTextAction. - * - * @return current WideTextAction setting. - * - * @see setWideTextAction, WideTextAction - */ - WideTextAction getWideTextAction() const - { - return wideTextAction; - } - - /** - * Gets the total height needed by the text. Determined by number of lines and - * linespace. The number of parameters passed after the format, must match the number of - * wildcards in the TypedText. - * - * @param format The text containing <placeholder> wildcards. - * @param ... Variable arguments providing additional information. - * - * @return the total height needed by the text. - */ - virtual int16_t calculateTextHeight(const Unicode::UnicodeChar* format, ...) const; - - /** - * Gets the first wildcard used in the TypedText. - * - * @return A pointer to the first wildcard, if this text area has a wildcard, otherwise 0. - * - * @see TextAreaWithOneWildcard, TextAreaWithTwoWildcards - */ - virtual const Unicode::UnicodeChar* getWildcard1() const - { - return 0; - } - - /** - * Gets the second wildcard used in the TypedText. - * - * @return A pointer to the second wildcard, if this text area has two wildcards, otherwise 0. - * - * @see TextAreaWithOneWildcard, TextAreaWithTwoWildcards - */ - virtual const Unicode::UnicodeChar* getWildcard2() const - { - return 0; - } - - virtual void invalidateContent() const; - -protected: - /** Structure for the relationship between a bounding rectangle and the contained text. */ - class BoundingArea - { - public: - /** - * Initializes a new instance of the BoundingArea class. - * - * @param boundingRect The bounding rectangle of this text area. - * @param containedText A pointer to the text contained in the bounding rectangle. - */ - BoundingArea(const Rect& boundingRect, const Unicode::UnicodeChar* containedText) - : rect(boundingRect), text(containedText) - { - } - - /** - * Initializes a new instance of the BoundingArea class which is invalid by default. - */ - BoundingArea() - : rect(Rect(0, 0, -1, -1)), // Negative width and height means invalid rectangle - text(0) - { - } - - /** - * Gets bounding rectangle. - * - * @return The bounding rectangle. - */ - Rect getRect() const - { - return rect; - } - - /** - * Query if the bounding area is valid. - * - * @param currentText A pointer to the current text of this text area. - * - * @return True if valid otherwise false. - */ - bool isValid(const Unicode::UnicodeChar* currentText) const - { - return (rect.height >= 0 && rect.width >= 0 && text == currentText); - } - - private: - Rect rect; - const Unicode::UnicodeChar* text; - }; - - /** - * Calculates the minimum bounding rectangle of this text area and correlates it - * with the containing text, to get the bounding area. - * Note: The bounding rectangle is adjusted according to alignment and rotation. - * - * @return The bounding area. - */ - virtual TextArea::BoundingArea calculateBoundingArea() const; - - TypedText typedText; ///< The TypedText to display - colortype color; ///< The color to use for the text. - int16_t linespace; ///< The extra space between lines of text, measured in pixels. - uint8_t alpha; ///< The alpha to use. - uint8_t indentation; ///< The indentation of the text inside the text area. - TextRotation rotation; ///< The text rotation to use in steps of 90 degrees. - WideTextAction wideTextAction; ///< What to do if the lines of text are wider than the text area. - static const uint16_t newLine = 10; ///< NewLine value. - BoundingArea boundingArea; ///< Bounding area of this text area. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTAREA_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp deleted file mode 100644 index edbc02c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextAreaWithWildcard.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/TextAreaWithWildcard.hpp - * - * Declares the touchgfx::TextAreaWithOneWildcard and touchgfx::TextAreaWithTwoWildcards classes. - */ -#ifndef TOUCHGFX_TEXTAREAWITHWILDCARD_HPP -#define TOUCHGFX_TEXTAREAWITHWILDCARD_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Base class for TextArea with one or two wildcards. - * - * @see TextAreaWithOneWildcard, TextAreaWithTwoWildcards - * - */ -class TextAreaWithWildcardBase : public TextArea -{ -public: - TextAreaWithWildcardBase() - : TextArea() - { - } - - virtual void draw(const Rect& area) const; - - virtual void invalidateContent() const - { - Widget::invalidateContent(); - } - -protected: - virtual TextArea::BoundingArea calculateBoundingArea() const - { - return TextArea::BoundingArea(); - } -}; - -/** - * TextArea with one wildcard. The format string (i.e. the TypedText set in setTypedText()) is - * expected to contain a wildcard <placeholder> from the text. - * - * @note the text converter tool converts the <...> to ascii value 2 which is then being - * replaced by a wildcard text. - */ -class TextAreaWithOneWildcard : public TextAreaWithWildcardBase -{ -public: - TextAreaWithOneWildcard() - : TextAreaWithWildcardBase(), wc1(0) - { - } - - /** - * Sets the wildcard used in the TypedText where <placeholder> is placed. Wildcard - * string must be a null-terminated UnicodeChar array. - * - * @param value A pointer to the UnicodeChar to set the wildcard to. - * - * @note The pointer passed is saved, and must be accessible whenever TextAreaWithOneWildcard - * may need it. - */ - void setWildcard1(const Unicode::UnicodeChar* value) - { - wc1 = value; - } - - virtual const Unicode::UnicodeChar* getWildcard1() const - { - return wc1; - } - - /** - * Sets the wildcard used in the TypedText where <placeholder> is placed. Wildcard - * string must be a null-terminated UnicodeChar array. - * - * @param value A pointer to the UnicodeChar to set the wildcard to. - * - * @note The pointer passed is saved, and must be accessible whenever TextAreaWithOneWildcard - * may need it. - */ - void setWildcard(const Unicode::UnicodeChar* value) - { - setWildcard1(value); - } - - /** - * Gets the wildcard used in the TypedText as previously set using setWildcard(). - * - * @return The wildcard used in the text. - */ - const Unicode::UnicodeChar* getWildcard() const - { - return getWildcard1(); - } - -protected: - const Unicode::UnicodeChar* wc1; ///< Pointer to the wildcard string. Must be null-terminated. -}; - -/** - * TextArea with two wildcards. The format string (i.e. the TypedText set in setTypedText()) is - * expected to contain two wildcards <placeholders> from the text. - * - * - * @note the text converter tool converts the <...> to ascii value 2 which is what is - * being replaced by a wildcard text. - */ -class TextAreaWithTwoWildcards : public TextAreaWithWildcardBase -{ -public: - TextAreaWithTwoWildcards() - : TextAreaWithWildcardBase(), wc1(0), wc2(0) - { - } - - /** - * Sets the wildcard used in the TypedText where first <placeholder> is placed. - * Wildcard string must be a null-terminated UnicodeChar array. - * - * @param value A pointer to the UnicodeChar to set the wildcard to. - * - * @note The pointer passed is saved, and must be accessible whenever TextAreaWithTwoWildcard - * may need it. - */ - void setWildcard1(const Unicode::UnicodeChar* value) - { - wc1 = value; - } - - virtual const Unicode::UnicodeChar* getWildcard1() const - { - return wc1; - } - - /** - * Sets the wildcard used in the TypedText where second <placeholder> is placed. - * Wildcard string must be a null-terminated UnicodeChar array. - * - * @param value A pointer to the UnicodeChar to set the wildcard to. - * - * @note The pointer passed is saved, and must be accessible whenever TextAreaWithTwoWildcard - * may need it. - */ - void setWildcard2(const Unicode::UnicodeChar* value) - { - wc2 = value; - } - - virtual const Unicode::UnicodeChar* getWildcard2() const - { - return wc2; - } - -protected: - const Unicode::UnicodeChar* wc1; ///< Pointer to the first wildcard string. Must be null-terminated. - const Unicode::UnicodeChar* wc2; ///< Pointer to the second wildcard string. Must be null-terminated. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTAREAWITHWILDCARD_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp deleted file mode 100644 index 2e1c204..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TextureMapper.hpp +++ /dev/null @@ -1,697 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/TextureMapper.hpp - * - * Declares the touchgfx::TextureMapper class. - */ -#ifndef TOUCHGFX_TEXTUREMAPPER_HPP -#define TOUCHGFX_TEXTUREMAPPER_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * The TextureMapper widget displays a transformed image. It can be used to generate effects - * where an image should be rotated in two or three dimensions. - * - * The image can be freely scaled and rotated in three dimensions. The scaling and - * rotation is done around the adjustable origin. A virtual camera is applied to the - * rendered image yielding a perspective impression. The amount of perspective - * impression can be adjusted. The transformed image is clipped according to the - * dimensions of the TextureMapper widget. In order to make the image fully visible the - * TextureMapper should be large enough to accommodate the transformed image, which may - * be larger than the raw image. - * - * @see Widget - * - * @note The drawing of this widget is not trivial and typically has a significant performance - * penalty. The number of pixels drawn, the presence of global alpha or per pixel alpha - * inflicts the computation and should be considered. - * @note This widget does not support 1 bit per pixel color depth. - */ -class TextureMapper : public Image -{ -public: - /** - * Rendering algorithm to use when scaling the bitmap. Nearest neighbor simply finds the - * closest pixel in the source bitmap. Bilinear interpolation averages 4 pixels to find - * a much better pixel representation, and is therefore slower than the Nearest neighbor - * algorithm. - */ - enum RenderingAlgorithm - { - NEAREST_NEIGHBOR, ///< Fast but not a very good image quality. Good for fast animations. - BILINEAR_INTERPOLATION ///< Slower but better image quality. Good for static representation of a scaled image. - }; - - /** - * Constructs a new TextureMapper with a default alpha value of 255 (solid) and a default Bitmap - * (undefined) if none is specified. If a Bitmap is passed to the constructor, the width and - * height of this widget is set to those of the bitmap. - * - * @param bmp (Optional) The bitmap to display. - * - * @see setBitmap - */ - TextureMapper(const Bitmap& bmp = Bitmap()); - - /** - * Sets the bitmap for this TextureMapper and updates the width and height of this widget to - * match those of the Bitmap. - * - * @param bmp The bitmap instance. - * - * @note The user code must call invalidate() in order to update the image on the display. - */ - virtual void setBitmap(const Bitmap& bmp); - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - - /** - * Sets the render algorithm to be used. Default setting is NEAREST_NEIGHBOR. - * - * @param algorithm The algorithm to use when rendering. - */ - virtual void setRenderingAlgorithm(RenderingAlgorithm algorithm) - { - currentRenderingAlgorithm = algorithm; - } - - /** - * Gets the algorithm used when rendering. - * - * @return The algorithm used when rendering. - */ - virtual RenderingAlgorithm getRenderingAlgorithm() const - { - return currentRenderingAlgorithm; - } - - /** - * Sets the angles in radians of the image. - * - * @param newXAngle The new x Angle. - * @param newYAngle The new y Angle. - * @param newZAngle The new x Angle. - * - * @see updateAngles, getXAngle, getYAngle, getZAngle - * - * @note The area covered by the image before/after changing the angles is NOT invalidated. - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void setAngles(float newXAngle, float newYAngle, float newZAngle); - - /** - * Sets the x angle in radians. - * - * @param newXAngle The new x angle. - * - * @see setAngles, updateXAngle, getXAngle - * - * @note The area covered by the image before/after changing the angle is NOT invalidated. - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void setXAngle(float newXAngle) - { - setAngles(newXAngle, yAngle, zAngle); - } - - /** - * Sets the y angle in radians. - * - * @param newYAngle The new y angle. - * - * @see setAngles, updateYAngle, getYAngle - * - * @note The area covered by the image before/after changing the angle is NOT invalidated. - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void setYAngle(float newYAngle) - { - setAngles(xAngle, newYAngle, zAngle); - } - - /** - * Sets the z angle in radians. - * - * @param newZAngle The new z angle. - * - * @see setAngles, updateZAngle, getZAngle - * - * @note The area covered by the image before/after changing the angle is NOT invalidated. - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void setZAngle(float newZAngle) - { - setAngles(xAngle, yAngle, newZAngle); - } - - /** - * Updates the angles in radians of the image. The area covered by the image before and after - * changing the angles is invalidated, which is the smallest required rectangle. - * - * @param newXAngle The new x Angle. - * @param newYAngle The new y Angle. - * @param newZAngle The new x Angle. - * - * @see setAngles, updateXAngle, updateYAngle, updateZAngle, getXAngle, getYAngle, getZAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void updateAngles(float newXAngle, float newYAngle, float newZAngle); - - /** - * Updates the x angle in radians. - * - * @param newXAngle The new x angle. - * - * @see updateAngles, getXAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void updateXAngle(float newXAngle) - { - updateAngles(newXAngle, yAngle, zAngle); - } - - /** - * Updates the y angle in radians. - * - * @param newYAngle The new y angle. - * - * @see updateAngles, getYAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void updateYAngle(float newYAngle) - { - updateAngles(xAngle, newYAngle, zAngle); - } - - /** - * Updates the z angle in radians. - * - * @param newZAngle The new z angle. - * - * @see updateAngles, getZAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual void updateZAngle(float newZAngle) - { - updateAngles(xAngle, yAngle, newZAngle); - } - - /** - * Get the x angle in radians. - * - * @return The x angle. - * - * @see updateXAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual float getXAngle() const - { - return xAngle; - } - - /** - * Get the y angle in radians. - * - * @return The y angle. - * - * @see updateYAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual float getYAngle() const - { - return yAngle; - } - - /** - * Get the z angle in radians. - * - * @return The z angle. - * - * @see updateZAngle - * - * @note Angles are given in radians, so a full circle is 2*PI. - */ - virtual float getZAngle() const - { - return zAngle; - } - - /** - * Sets the scale of the image. - * - * @param newScale The new scale value. - * - * @see updateScale, getScale - */ - virtual void setScale(float newScale); - - /** - * Updates the scale of the image. This implies invalidating the area covered by the texture - * mapper. - * - * @param newScale The new scale value. - * - * @see setScale, getScale - */ - virtual void updateScale(float newScale); - - /** - * Gets the scale of the image. - * - * @return The scale. - * - * @see setScale - */ - virtual float getScale() const - { - return scale; - } - - /** - * Sets the transformation origo (center). - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param z The z coordinate. - * - * @see getOrigoX, getOrigoY, getOrigoZ - */ - virtual void setOrigo(float x, float y, float z) - { - xOrigo = x; - yOrigo = y; - zOrigo = z; - applyTransformation(); - } - - /** - * Sets the transformation origo (center) in two dimensions. Leaves the z coordinate - * untouched. - * - * @param x The x coordinate. - * @param y The y coordinate. - * - * @see getOrigoX, getOrigoY - */ - virtual void setOrigo(float x, float y) - { - xOrigo = x; - yOrigo = y; - applyTransformation(); - } - - /** - * Gets transformation origo x coordinate. - * - * @return The transformation origo x coordinate. - * - * @see setOrigo - */ - virtual float getOrigoX() const - { - return xOrigo; - } - - /** - * Gets transformation origo y coordinate. - * - * @return The transformation origo y coordinate. - * - * @see setOrigo - */ - virtual float getOrigoY() const - { - return yOrigo; - } - - /** - * Gets transformation origo z coordinate. - * - * @return The transformation origo z coordinate. - * - * @see setOrigo - */ - virtual float getOrigoZ() const - { - return zOrigo; - } - - /** - * Sets the camera coordinate. - * - * @param x The x coordinate for the camera. - * @param y The y coordinate for the camera. - * - * @see getCameraX, getCameraY - */ - virtual void setCamera(float x, float y) - { - xCamera = x; - yCamera = y; - applyTransformation(); - } - - /** - * Gets camera x coordinate. - * - * @return The camera x coordinate. - * - * @see setCamera - */ - virtual float getCameraX() const - { - return xCamera; - } - - /** - * Gets camera y coordinate. - * - * @return The camera y coordinate. - * - * @see setCamera - */ - virtual float getCameraY() const - { - return yCamera; - } - - /** - * Sets camera distance. If the given value is below - * TextureMapper::MINIMAL_CAMERA_DISTANCE, it will be set to - * TextureMapper::MINIMAL_CAMERA_DISTANCE. - * - * @param d The new camera distance. - * - * @see getCameraDistance - */ - virtual void setCameraDistance(float d) - { - cameraDistance = MAX(d, MINIMAL_CAMERA_DISTANCE); - applyTransformation(); - } - - /** - * Gets camera distance. - * - * @return The camera distance. - * - * @see setCameraDistance - */ - virtual float getCameraDistance() const - { - return cameraDistance; - } - - /** - * Sets the position of the bitmap within the TextureMapper. The bitmap is clipped with - * respect to the dimensions of the TextureMapper widget. - * - * @param x The x coordinate. - * @param y The y coordinate. - * - * @see getBitmapPositionX, getBitmapPositionY - */ - virtual void setBitmapPosition(float x, float y) - { - xBitmapPosition = x; - yBitmapPosition = y; - applyTransformation(); - } - - /** - * Sets the position of the bitmap within the TextureMapper. The bitmap is clipped with - * respect to the dimensions of the TextureMapper widget. - * - * @param x The x coordinate. - * @param y The y coordinate. - * - * @see getBitmapPositionX, getBitmapPositionY - */ - virtual void setBitmapPosition(int x, int y) - { - setBitmapPosition((float)x, (float)y); - } - - /** - * Gets bitmap position x coordinate. - * - * @return The bitmap position x coordinate. - * - * @see setBitmapPosition - */ - virtual float getBitmapPositionX() const - { - return xBitmapPosition; - } - - /** - * Gets bitmap position y coordinate. - * - * @return The bitmap position y coordinate. - * - * @see setBitmapPosition - */ - virtual float getBitmapPositionY() const - { - return yBitmapPosition; - } - - /** - * Get the x coordinate of the top left corner of the transformed bitmap. - * - * @return The X0 coordinate. - */ - virtual float getX0() const - { - return imageX0; - } - - /** - * Get the x coordinate of the top right corner of the transformed bitmap. - * - * @return The X1 coordinate. - */ - virtual float getX1() const - { - return imageX1; - } - - /** - * Get the x coordinate of the bottom right of the transformed bitmap. - * - * @return The X2 coordinate. - */ - virtual float getX2() const - { - return imageX2; - } - - /** - * Get the x coordinate of the bottom left corner of the transformed bitmap. - * - * @return The X3 coordinate. - */ - virtual float getX3() const - { - return imageX3; - } - - /** - * Get the y coordinate of the top left corner of the transformed bitmap. - * - * @return The Y0 coordinate. - */ - virtual float getY0() const - { - return imageY0; - } - - /** - * Get the y coordinate of the top right corner of the transformed bitmap. - * - * @return The Y1 coordinate. - */ - virtual float getY1() const - { - return imageY1; - } - - /** - * Get the y coordinate of the bottom right corner of the transformed bitmap. - * - * @return The Y2 coordinate. - */ - virtual float getY2() const - { - return imageY2; - } - - /** - * Get the y coordinate of the bottom left corner of the transformed bitmap. - * - * @return The Y3 coordinate. - */ - virtual float getY3() const - { - return imageY3; - } - - /** - * Get the z coordinate of the top left corner of the transformed bitmap. - * - * @return The Z0 coordinate. - */ - virtual float getZ0() const - { - return imageZ0; - } - - /** - * Get the z coordinate of the top right corner of the transformed bitmap. - * - * @return The Z1 coordinate. - */ - virtual float getZ1() const - { - return imageZ1; - } - - /** - * Get the z coordinate of the bottom right corner of the transformed bitmap. - * - * @return The Z2 coordinate. - */ - virtual float getZ2() const - { - return imageZ2; - } - - /** - * Get the z coordinate of the bottom left corner of the transformed bitmap. - * - * @return The Z3 coordinate. - */ - virtual float getZ3() const - { - return imageZ3; - } - - /** - * Invalidate the bounding rectangle of the transformed bitmap. - * - * @see getBoundingRect - * - * @deprecated Please use invalidateContent() instead. - */ - TOUCHGFX_DEPRECATED("Please use invalidateContent() instead.", void invalidateBoundingRect() const); - - virtual void invalidateContent() const - { - if (alpha > 0) - { - Rect r = getBoundingRect(); - invalidateRect(r); - } - } - -protected: - /** - * Transform the bitmap using the supplied origo, scale, rotation and camera. This - * method is called by all the methods that manipulate origo, scale, rotation and camera. - */ - void applyTransformation(); - - /** - * Gets bounding rectangle of the transformed bitmap. This is the smallest possible - * rectangle which covers the image of the bitmap after applying scale and rotation. - * - * @return The bounding rectangle. - */ - Rect getBoundingRect() const; - - /** - * The TextureMapper will draw the transformed bitmap by drawing one transformed quad. - * The quad is drawn from the points 0,1,2,3 using the x,y,z values from each point along - * with the u,v coordinates in the bitmap associated with each point. - * - * @param invalidatedArea The invalidated area. - * @param [in] fb The framebuffer. - * @param triangleXs The triangle xs. - * @param triangleYs The triangle ys. - * @param triangleZs The triangle zs. - * @param triangleUs The triangle us. - * @param triangleVs The triangle vs. - */ - void drawQuad(const Rect& invalidatedArea, uint16_t* fb, const float* triangleXs, const float* triangleYs, const float* triangleZs, const float* triangleUs, const float* triangleVs) const; - - /** - * Returns the rendering variant based on the bitmap format, alpha value and rendering - * algorithm. - * - * @return The RenderingVariant. - */ - RenderingVariant lookupRenderVariant() const; - - RenderingAlgorithm currentRenderingAlgorithm; ///< The current rendering algorithm. - - static const int MINIMAL_CAMERA_DISTANCE = 1; ///< The minimal camera distance - - float xBitmapPosition; ///< The bitmap position x - float yBitmapPosition; ///< The bitmap position y - - float xAngle; ///< The angle x in radians - float yAngle; ///< The angle y in radians - float zAngle; ///< The angle z in radians - float scale; ///< The scale - - float xOrigo; ///< The origo x coordinate - float yOrigo; ///< The origo y coordinate - float zOrigo; ///< The origo z coordinate - - float xCamera; ///< The camera x coordinate - float yCamera; ///< The camera y coordinate - float cameraDistance; ///< The camera distance - - float imageX0; ///< The coordinate for the image points - float imageY0; ///< The coordinate for the image points - float imageZ0; ///< The coordinate for the image points - float imageX1; ///< The coordinate for the image points - float imageY1; ///< The coordinate for the image points - float imageZ1; ///< The coordinate for the image points - float imageX2; ///< The coordinate for the image points - float imageY2; ///< The coordinate for the image points - float imageZ2; ///< The coordinate for the image points - float imageX3; ///< The coordinate for the image points - float imageY3; ///< The coordinate for the image points - float imageZ3; ///< The coordinate for the image points - - uint16_t subDivisionSize; ///< The size of the affine sub divisions -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TEXTUREMAPPER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp deleted file mode 100644 index 02cc21f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TiledImage.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/TiledImage.hpp - * - * Declares the touchgfx::TiledImage class. - */ -#ifndef TOUCHGFX_TILEDIMAGE_HPP -#define TOUCHGFX_TILEDIMAGE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Simple widget capable of showing a bitmap tiled indefinitely horizontally and vertically. - * This means that when the TiledImage Widget is larger than the provided Bitmap, the - * Bitmap is repeated over and over horizontally and vertically. The bitmap can be alpha- - * blended with the background and have areas of transparency. - */ -class TiledImage : public Image -{ -public: - /** - * Constructs a new TiledImage with a default alpha value of 255 (solid) and a default - * Bitmap (undefined) if none is specified. If a Bitmap is passed to the constructor, - * the width and height of this widget is set to those of the bitmap. - * - * @param bmp (Optional) The bitmap to display. - * - * @see setBitmap - */ - TiledImage(const Bitmap& bmp = Bitmap()) - : Image(bmp), xOffset(0), yOffset(0) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - /** - * Sets an offset into the bitmap where the tile drawing should start. By default the - * first image is aligned along the top and left, i.e. offset at (0, 0). - * - * @param x The x coordinate offset. - * @param y The y coordinate offset. - * - * @see setXOffset, setYOffset - */ - virtual void setOffset(int16_t x, int16_t y); - - /** - * Sets x offset into the bitmap where the tile drawing should start. Setting the x - * offset to 1 will push all images one pixel to the left. - * - * @param x The x offset. - * - * @see setYOffset, setOffset - */ - virtual void setXOffset(int16_t x); - - /** - * Sets y offset into the bitmap where the tile drawing should start. Setting the y - * offset to 1 will push all images one pixel up. - * - * @param y The y offset. - * - * @see setXOffset, setOffset - */ - virtual void setYOffset(int16_t y); - - /** - * Gets the offset into the bitmap where the tile drawing should start. Please note that - * the offsets set using setOffset have been normalized so that x is in the range 0 to - * bitmap width - 1, and y is in the range 0 to bitmap height - 1. - * - * @param [out] x The x offset. - * @param [out] y The y offset. - * - * @see getXOffset, getYOffset - */ - virtual void getOffset(int16_t& x, int16_t& y); - - /** - * Get x offset. This is the value set using setXOffset() (or setOffset()) normalized to be - * in the range 0 to bitmap width - 1. - * - * @return The x offset. - * - * @see getYOffset, getOffset - */ - virtual int16_t getXOffset(); - - /** - * Get y coordinate offset. This is the value set using setYOffset() (or setOffset()) - * normalized to be in the range 0 to bitmap height - 1. - * - * @return The y offset. - * - * @see getXOffset, getOffset - */ - virtual int16_t getYOffset(); - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - -protected: - int16_t xOffset; ///< The X offset into the bitmap to start drawing in range 0..bitmap.width-1 - int16_t yOffset; ///< The Y offset into the bitmap to start drawing in range 0..bitmap.height-1 -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TILEDIMAGE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp deleted file mode 100644 index f475db4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/ToggleButton.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/ToggleButton.hpp - * - * Declares the touchgfx::ToggleButton class. - */ -#ifndef TOUCHGFX_TOGGLEBUTTON_HPP -#define TOUCHGFX_TOGGLEBUTTON_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A ToggleButton is a Button specialization that swaps the two bitmaps when clicked, such that - * the previous "pressed" bitmap, now becomes the one displayed when button is not - * pressed. This can by used to give the effect of a button that can be pressed in and - * when it is subsequently pressed, it will pop back out. - */ -class ToggleButton : public Button -{ -public: - virtual void setBitmaps(const Bitmap& bitmapReleased, const Bitmap& bitmapPressed) - { - originalPressed = bitmapPressed; - Button::setBitmaps(bitmapReleased, bitmapPressed); - } - - /** - * Allows the ToggleButton to be forced into either the pressed state, or the normal - * state. In the pressed state, the Button will always be shown as pressed down (and - * shown as released when the user presses it). In the normal state, the Button will be - * show as released or pressed depending on its actual state. - * - * @param activeState If true, swap the images for released and pressed. If false display - * the Button normally. - */ - void forceState(bool activeState); - - /** - * Gets the state of the ToggleButton as set with forceState. - * - * @return True if the button has been toggled, i.e. the pressed state is shown when the - * button is not pressed. - */ - bool getState() const - { - return up.getId() == originalPressed.getId(); - } - - virtual void handleClickEvent(const ClickEvent& event); - -protected: - Bitmap originalPressed; ///< Contains the bitmap that was originally being displayed when button is pressed. -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TOGGLEBUTTON_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp deleted file mode 100644 index f369913..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/TouchArea.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/TouchArea.hpp - * - * Declares the touchgfx::TouchArea class. - */ -#ifndef TOUCHGFX_TOUCHAREA_HPP -#define TOUCHGFX_TOUCHAREA_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Invisible widget used to capture touch events. The TouchArea consumes drag events without the - * widget it self moving. - */ -class TouchArea : public AbstractButton -{ -public: - TouchArea() - : AbstractButton(), pressedAction(0) - { - } - - virtual void draw(const Rect& /*invalidatedArea*/) const - { - } - - virtual void handleDragEvent(const DragEvent& /*event*/) - { - } - - virtual void handleClickEvent(const ClickEvent& event); - - virtual Rect getSolidRect() const - { - return Rect(); - } - - /** - * Associates an action to be performed when the TouchArea is pressed. - * - * @param callback The callback is given a reference to this touch area. - */ - void setPressedAction(GenericCallback& callback) - { - pressedAction = &callback; - } - - virtual void invalidateContent() const - { - // A TouchArea is invisible, do nothing - } - -protected: - GenericCallback* pressedAction; ///< The action to perform when the TouchArea is clicked -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_TOUCHAREA_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp deleted file mode 100644 index aaa5336..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/VideoWidget.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/VideoWidget.hpp - * - * Declares the touchgfx::VideoWidget class. - */ -#ifndef TOUCHGFX_VIDEOWIDGET_HPP -#define TOUCHGFX_VIDEOWIDGET_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -class VideoWidget; - -/** - * A Widget for displaying video. - * - * The Widget interacts with a VideoController instance. - * - * @see VideoController - */ -class VideoWidget : public Widget -{ -public: - /** Default constructor. */ - VideoWidget(); - - /** Destructor. Unregisters the Widget from the Controller. */ - virtual ~VideoWidget(); - - /** Play the video. */ - void play() const; - - /** Pause the video. */ - void pause() const; - - /** Stop the video. */ - void stop() const; - - /** - * Check if the video is playing (not paused or stopped). - * - * @return Returns true if the video is playing. - */ - bool isPlaying() const; - - /** - * Set repeat mode. When set the video is restarted when the end is reached. - * - * @param repeat When true, the video is repeated. - */ - void setRepeat(bool repeat) const; - - /** - * Seek to specific frame. Frame number 1 is the first frame. The display is not updated updated - * unless the video is playing. - * - * @param frameNumber The frame number to seek to. - * - * @see showFrame - */ - void seek(uint32_t frameNumber) const; - - /** - * Seek to a specific frame and update the display. Equal to seek if the video is playing. - * - * @param frameNumber The frame number to seek to. - * - * @see seek - */ - void showFrame(uint32_t frameNumber) const; - - /** - * Get the current frame number. - * - * @return Returns the current frame number. - */ - uint32_t getCurrentFrameNumber() const; - - /** - * Associates an action to be performed when the movie has ended. If the video is set to repeat, - * the action is also triggered when the animation starts over. - * - * @param callback The callback is executed when done. The callback is given the VideoWidget. - */ - void setMovieEndedAction(GenericCallback& callback) - { - movieEndedAction = &callback; - } - - /** - * Clears the movie ended action previously set by setMovieEndedAction. - * - * @see setMovieEndedAction - */ - void clearMovieEndedAction() - { - movieEndedAction = 0; - } - - /** - * Sets the frame rate of the video. - * - * To get 20 video frames pr second on a 60 fps display use video_frames = 20 and ui_frames = 60. - * - * @param ui_frames Number of UI frames (divider) - * @param video_frames Number of video_frames (dividend) - */ - void setFrameRate(uint32_t ui_frames, uint32_t video_frames) const; - - /** - * Set the video data for the stream. - * The video is paused and set to start on the first frame. - * - * @param movie Pointer to the video data. - * @param length Length of the vide data. - */ - void setVideoData(const uint8_t* movie, const uint32_t length); - - /** - * Set the video data for the stream. - * The video is paused and set to start on the first frame. - * - * @param [in,out] reader Reference to a VideoDataReader object. - */ - void setVideoData(VideoDataReader& reader); - - /** - * Get Video information. - * - * Get information from the video data. - * - * @param [in,out] data Pointer to VideoInformation where information should be stored. - */ - void getVideoInformation(VideoInformation* data) const; - - /** - * Set video buffer data. - * Only used when video frames are decoded to a buffer and not directly to the framebuffer. - * - * @param [in] videoBuffer Video buffer. - */ - void setVideoBuffer(uint8_t* const videoBuffer) - { - buffer = videoBuffer; - } - - /** - * Set video buffer format. - * Only used when video frames are decoded to a buffer and not directly to the framebuffer. - * - * @param bufferFormat Format of the videoBuffer (RGB565 or RGB888) - * @param width Width of the videoBuffer in pixels - * @param height Height of the videoBuffer in pixels - */ - void setVideoBufferFormat(Bitmap::BitmapFormat bufferFormat, int16_t width, int16_t height) - { - format = bufferFormat; - bufferWidth = width; - bufferHeight = height; - } - - virtual void handleTickEvent(); - - virtual void draw(const Rect& invalidatedArea) const; - - virtual Rect getSolidRect() const; - -private: - /** - * Reads information from the video. Sets the video width and height. - * Sets the framerate to speed specified in movie. Assumes 60 ui - * frame pr. second. - */ - void readVideoInformation(); - - VideoController::Handle handle; ///< The handle of this video stream - GenericCallback* movieEndedAction; ///< Pointer to the callback to be executed when the video is done. - uint8_t* buffer; ///< The buffer where the pixels are copied from - Bitmap::BitmapFormat format; ///< The pixel format for the data. - int16_t bufferWidth; ///< Width (stride) of buffer in pixels (when used) - int16_t bufferHeight; ///< Height of buffer in pixels (when used) - int16_t videoWidth; ///< Width of video in pixels - int16_t videoHeight; ///< Height of video in pixels -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_VIDEOWIDGET_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp deleted file mode 100644 index 4932d00..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/Widget.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/Widget.hpp - * - * Declares the touchgfx::Widget class. - */ -#ifndef TOUCHGFX_WIDGET_HPP -#define TOUCHGFX_WIDGET_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A Widget is an element which can be displayed (drawn) in the framebuffer. Hence a Widget is a - * subclass of Drawable. It implements getLastChild(), but leaves the implementation of - * draw() and getSolidRect() to subclasses of Widget, so it is still an abstract class. - * - * If a Widget contains more than one logical element, consider implementing several - * subclasses of Widget and create a Container with the Widgets. - * - * @see Drawable - */ -class Widget : public Drawable -{ -public: - /** - * Since a Widget is only one Drawable, Widget::getLastChild simply yields itself as - * result, but only if the Widget isVisible and isTouchable. - * - * @param [out] last Result, the address of the actual instance of the Widget. - */ - virtual void getLastChild(int16_t /*x*/, int16_t /*y*/, Drawable** last) - { - if (isVisible() && isTouchable()) - { - *last = this; - } - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_WIDGET_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp deleted file mode 100644 index 8470be5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainter.hpp +++ /dev/null @@ -1,160 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainter.hpp - * - * Declares the touchgfx::AbstractPainter class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTER_HPP -#define TOUCHGFX_ABSTRACTPAINTER_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets - * need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide the - * color of a pixel on a given coordinate, which will the be blended into the framebuffer depending - * on the position of the canvas widget and the transparency of the given pixel. - * - * The AbstractPainter also implements a function which will blend each pixel in a scanline snippet - * into the framebuffer, but for better performance, the function should be reimplemented in each - * painter. - */ -class AbstractPainter -{ -public: - /** Initializes a new instance of the AbstractPainter class. */ - AbstractPainter() - : widgetWidth(0) - { - } - - /** Finalizes an instance of the AbstractPainter class. */ - virtual ~AbstractPainter() - { - } - - /** - * Return the applicable rendering method of the painter. - * HARDWARE if the painter uses hardware based drawing, - * SOFTWARE otherwise. Relevant on platforms using DCACHE. - * - * @return HARDWARE if painter uses hardware based drawing, SOFTWARE otherwise. - */ - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::SOFTWARE; - } - - /** - * This function is called before any actual paint operation is started. This allows the painter - * to initialize variables and optional dma queues. This happens before the first scan line - * segment is being drawn. If the painter is unable to draw, e.g. no bitmap assigned to a bitmap - * painter, 'false' should be returned. - * - * @param widgetRect The widget rectangle. - * - * @return True if the painter is ready to paint, false otherwise. - * - * @see AbstractPainter::paint, AbstractPainter::tearDown - */ - virtual bool setup(const Rect& widgetRect) const - { - widgetWidth = widgetRect.width; - return true; - } - - /** - * This function is called after all paint operation have finished. This allows the painter to - * close down dma queues etc. This happens after the last scan line segment has been drawn. - * - * @see AbstractPainter::paint, AbstractPainter::setup - */ - virtual void tearDown() const - { - return; - } - - /** - * Convert Framebuffer widget coordinates to display widget coordinates. This is handy when - * creating a custom painter and the X,Y is needed in the same coordinate system as the widget - * on the display. - * - * @param [in,out] widgetX The widget x coordinate. - * @param [in,out] widgetY The widget y coordinate. - * - * @see AbstractPainter::paint - */ - void framebufferToDisplay(int16_t& widgetX, int16_t& widgetY) const - { - if (HAL::DISPLAY_ROTATION == rotate0) - { - return; - } - const int16_t tmpX = widgetX; - widgetX = (widgetWidth - 1) - widgetY; - widgetY = tmpX; - } - - /** - * Paints a streak of pixels (all with the same alpha) in the framebuffer. The first pixel to - * paint is at 'offset' relative to 'destination' (to be able to support 1bpp, 2bpp and 4bpp). - * The first pixel to paint is at the given 'widgetX', 'widgetY' coordinate. The number of - * pixels to paint is 'count' and the alpha to apply is 'alpha'. - * - * Note that the widgetX, widgetY is relative to the widget in the framebuffer, not the display. - * To convert the coordinate to display widget coordinates, use framebufferToDisplay(). - * - * @param [in] destination If non-null, the pointer. - * @param offset The offset to add to the destination. - * @param widgetX The widget x coordinate. - * @param widgetY The widget y coordinate. - * @param count Number of pixels. - * @param alpha The alpha of the pixels. - * - * @see AbstractPainter::setup, AbstractPainter::tearDown, AbstractPainter::framebufferToDisplay - */ - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const = 0; - -protected: - /** - * Helper function to check if the provided bitmap format matches the current - * framebuffer format. - * - * @param format A bitmap format. - * - * @return True if the format matches the framebuffer format, false otherwise. - */ - FORCE_INLINE_FUNCTION static bool compatibleFramebuffer(Bitmap::BitmapFormat format) - { - bool compat = HAL::lcd().framebufferFormat() == format; - if (HAL::getInstance()->getAuxiliaryLCD()) - { - compat |= HAL::getInstance()->getAuxiliaryLCD()->framebufferFormat() == format; - } - return compat; - } - - mutable int16_t widgetWidth; ///< The width of the widget on screen, used by framebufferToDisplay() -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp deleted file mode 100644 index 0107c73..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterABGR2222.hpp - * - * Declares the touchgfx::AbstractPainterABGR2222 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERABGR2222_HPP -#define TOUCHGFX_ABSTRACTPAINTERABGR2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterABGR2222 class is an abstract class for creating a painter to draw on a - * ABGR2222 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterABGR2222 : public AbstractPainter -{ -public: - AbstractPainterABGR2222() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::ABGR2222) && "The chosen painter only works with ABGR2222 displays"); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param newpix The new pixel value. - * @param bufpix The buffer pixel value. - * @param alpha The alpha to apply to the new pixel. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t newpix, uint8_t bufpix, uint8_t alpha) const - { - return alphaBlend(LCD8bpp_ABGR2222::getRedFromNativeColor(newpix), - LCD8bpp_ABGR2222::getGreenFromNativeColor(newpix), - LCD8bpp_ABGR2222::getBlueFromNativeColor(newpix), bufpix, alpha); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, - * and the inverse alpha applied to the buffer pixel. - * - * @param R The red color. - * @param G The green color. - * @param B The blue color. - * @param bufpix The buffer pixel value. - * @param alpha The alpha of the R,G,B. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t R, uint8_t G, uint8_t B, uint8_t bufpix, uint8_t alpha) const - { - const uint8_t ialpha = 0xFF - alpha; - const uint8_t p_red = LCD8bpp_ABGR2222::getRedFromNativeColor(bufpix); - const uint8_t p_green = LCD8bpp_ABGR2222::getGreenFromNativeColor(bufpix); - const uint8_t p_blue = LCD8bpp_ABGR2222::getBlueFromNativeColor(bufpix); - const uint8_t red = LCD::div255(R * alpha + p_red * ialpha); - const uint8_t green = LCD::div255(G * alpha + p_green * ialpha); - const uint8_t blue = LCD::div255(B * alpha + p_blue * ialpha); - return LCD8bpp_ABGR2222::getNativeColorFromRGB(red, green, blue); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERABGR2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp deleted file mode 100644 index 6e3e814..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterARGB2222.hpp - * - * Declares the touchgfx::AbstractPainterARGB2222 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERARGB2222_HPP -#define TOUCHGFX_ABSTRACTPAINTERARGB2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterARGB2222 class is an abstract class for creating a painter to draw on a - * ARGB2222 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterARGB2222 : public AbstractPainter -{ -public: - AbstractPainterARGB2222() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::ARGB2222) && "The chosen painter only works with ARGB2222 displays"); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param newpix The new pixel value. - * @param bufpix The buffer pixel value. - * @param alpha The alpha to apply to the new pixel. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t newpix, uint8_t bufpix, uint8_t alpha) const - { - return alphaBlend(LCD8bpp_ARGB2222::getRedFromNativeColor(newpix), - LCD8bpp_ARGB2222::getGreenFromNativeColor(newpix), - LCD8bpp_ARGB2222::getBlueFromNativeColor(newpix), bufpix, alpha); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, - * and the inverse alpha applied to the buffer pixel. - * - * @param R The red color. - * @param G The green color. - * @param B The blue color. - * @param bufpix The buffer pixel value. - * @param alpha The alpha of the R,G,B. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t R, uint8_t G, uint8_t B, uint8_t bufpix, uint8_t alpha) const - { - const uint8_t ialpha = 0xFF - alpha; - const uint8_t p_red = LCD8bpp_ARGB2222::getRedFromNativeColor(bufpix); - const uint8_t p_green = LCD8bpp_ARGB2222::getGreenFromNativeColor(bufpix); - const uint8_t p_blue = LCD8bpp_ARGB2222::getBlueFromNativeColor(bufpix); - const uint8_t red = LCD::div255(R * alpha + p_red * ialpha); - const uint8_t green = LCD::div255(G * alpha + p_green * ialpha); - const uint8_t blue = LCD::div255(B * alpha + p_blue * ialpha); - return LCD8bpp_ARGB2222::getNativeColorFromRGB(red, green, blue); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERARGB2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp deleted file mode 100644 index d08595f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterARGB8888.hpp - * - * Declares the touchgfx::AbstractPainterARGB8888 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERARGB8888_HPP -#define TOUCHGFX_ABSTRACTPAINTERARGB8888_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterARGB8888 class is an abstract class for creating a painter to draw on a - * ARGB8888 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterARGB8888 : public AbstractPainter -{ -public: - AbstractPainterARGB8888() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::ARGB8888) && "The chosen painter only works with ARGB8888 displays"); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERARGB8888_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp deleted file mode 100644 index ac23bfd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterBGRA2222.hpp - * - * Declares the touchgfx::AbstractPainterBGRA2222 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERBGRA2222_HPP -#define TOUCHGFX_ABSTRACTPAINTERBGRA2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterBGRA2222 class is an abstract class for creating a painter to draw on a - * BGRA2222 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterBGRA2222 : public AbstractPainter -{ -public: - AbstractPainterBGRA2222() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::BGRA2222) && "The chosen painter only works with BGRA2222 displays"); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param newpix The new pixel value. - * @param bufpix The buffer pixel value. - * @param alpha The alpha to apply to the new pixel. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t newpix, uint8_t bufpix, uint8_t alpha) const - { - return alphaBlend(LCD8bpp_BGRA2222::getRedFromNativeColor(newpix), - LCD8bpp_BGRA2222::getGreenFromNativeColor(newpix), - LCD8bpp_BGRA2222::getBlueFromNativeColor(newpix), bufpix, alpha); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, - * and the inverse alpha applied to the buffer pixel. - * - * @param R The red color. - * @param G The green color. - * @param B The blue color. - * @param bufpix The buffer pixel value. - * @param alpha The alpha of the R,G,B. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t R, uint8_t G, uint8_t B, uint8_t bufpix, uint8_t alpha) const - { - const uint8_t ialpha = 0xFF - alpha; - const uint8_t p_red = LCD8bpp_BGRA2222::getRedFromNativeColor(bufpix); - const uint8_t p_green = LCD8bpp_BGRA2222::getGreenFromNativeColor(bufpix); - const uint8_t p_blue = LCD8bpp_BGRA2222::getBlueFromNativeColor(bufpix); - const uint8_t red = LCD::div255(R * alpha + p_red * ialpha); - const uint8_t green = LCD::div255(G * alpha + p_green * ialpha); - const uint8_t blue = LCD::div255(B * alpha + p_blue * ialpha); - return LCD8bpp_BGRA2222::getNativeColorFromRGB(red, green, blue); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERBGRA2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp deleted file mode 100644 index bed9c23..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBW.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterBW.hpp - * - * Declares the touchgfx::AbstractPainterBW class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERBW_HPP -#define TOUCHGFX_ABSTRACTPAINTERBW_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterBW class is an abstract class for creating a painter to draw on a BW - * display using CanvasWidgetRenderer. Pixels are either set or removed. - * - * @see AbstractPainter - */ -class AbstractPainterBW : public AbstractPainter -{ -public: - AbstractPainterBW() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::BW) && "The chosen painter only works with BW displays"); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERBW_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp deleted file mode 100644 index ad6c54a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterBitmap.hpp +++ /dev/null @@ -1,213 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterBitmap.hpp - * - * Declares the touchgfx::AbstractPainterBitmap class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERBITMAP_HPP -#define TOUCHGFX_ABSTRACTPAINTERBITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets - * need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide the - * color of a pixel on a given coordinate, which will the be blended into the framebuffer depending - * on the position of the canvas widget and the transparency of the given pixel. - * - * The AbstractPainter also implements a function which will blend each pixel in a scanline snippet - * into the framebuffer, but for better performance, the function should be reimplemented in each - * painter. - */ -class AbstractPainterBitmap -{ -public: - /** - * Constructor - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - AbstractPainterBitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : bitmap(bmp), bitmapFormat(), bitmapRect(), bitmapData(0), xOffset(0), yOffset(0), isTiled(false) - { - setBitmap(bmp); - } - - /** Destructor */ - virtual ~AbstractPainterBitmap() - { - } - - /** - * Sets a bitmap to be used when drawing the CanvasWidget. - * - * @param bmp The bitmap. - */ - virtual void setBitmap(const Bitmap& bmp) - { - bitmap = bmp; - bitmapFormat = bitmap.getFormat(); - bitmapRect = bitmap.getRect(); - DisplayTransformation::transformDisplayToFrameBuffer(bitmapRect); - bitmapData = bitmap.getData(); - } - - /** - * Gets the bitmap previously set using setBitmap(). - * - * @return The bitmap. - */ - Bitmap getBitmap() const - { - return bitmap; - } - - /** - * Instruct the painter to tile the bitmap specified. The bitmap will be tiled both horizontally - * and vertically. - * - * @param tiled True if tiled. - * - * @see setOffset - */ - virtual void setTiled(bool tiled) - { - isTiled = tiled; - } - - /** - * Gets the tiled setting, previously set using setTiled(). - * - * @return True if the bitmap is tiled, false otherwise. - */ - bool getTiled() const - { - return isTiled; - } - - /** - * Sets an offset for the bitmap used. The x and y coordinates specifies how far the bitmap - * should be moved to the right and down. This works for tiled bitmaps and non-tiled bitmaps. - * - * @param x The x coordinate. - * @param y The y coordinate. - * - * @see setTiled - */ - virtual void setOffset(int16_t x, int16_t y) - { - xOffset = x; - yOffset = y; - } - - /** - * Gets the bitmap offset previously set using setOffset(). - * - * @param [out] x The x coordinate. - * @param [out] y The y coordinate. - */ - void getOffset(int16_t& x, int16_t& y) - { - x = xOffset; - y = yOffset; - } - -protected: - Bitmap bitmap; ///< The bitmap to be used when painting - Bitmap::BitmapFormat bitmapFormat; ///< Copy of the bitmap format (for speed reasons) - Rect bitmapRect; ///< Bitmap rectangle translated to framebuffer coordinates - const uint8_t* bitmapData; ///< Pointer to the bitmap data - int16_t xOffset; ///< The x offset of the bitmap - int16_t yOffset; ///< The y offset of the bitmap - bool isTiled; ///< True if bitmap should be tiled, false if not - - /** - * Updates the bitmap offsets described by widgetWidth, these offset are used by bitmap painters - * adjust the coordinate position inside the widget. - * - * @param widgetWidth Width of the widget. - */ - void updateBitmapOffsets(int16_t widgetWidth) const - { - xDelta = (HAL::DISPLAY_ROTATION == rotate0) ? xOffset : yOffset; - yDelta = (HAL::DISPLAY_ROTATION == rotate0) ? yOffset : -(xOffset + (widgetWidth - bitmap.getWidth())); - } - - /** - * Adjust bitmap x and y. For a tiled bitmap painters, the coordinates are fixed to be inside - * the bitmap, for non-tiled bitmap painters, false is returned if the entire span (considering - * offset and count) is outside the bitmap - otherwise, the parameters are adjust to make sure - * that the requested number of pixels can be read from the bitmap at the given coordinate and - * count pixels ahead. - * - * @param [in,out] bitmapX The bitmap x coordinate. - * @param [in,out] bitmapY The bitmap y coordinate. - * @param [in,out] offset The pointer x coordinate. - * @param [in,out] count Number of. - * - * @returns True if anything should be painted, false if nothing has to be painted. - */ - bool adjustBitmapXY(int16_t& bitmapX, int16_t& bitmapY, int16_t& offset, int16_t& count) const - { - bitmapX += xDelta; - bitmapY += yDelta; - if (isTiled) - { - bitmapX %= bitmapRect.width; - if (bitmapX < 0) - { - bitmapX += bitmapRect.width; - } - bitmapY %= bitmapRect.height; - if (bitmapY < 0) - { - bitmapY += bitmapRect.height; - } - return true; - } - - if (bitmapX < 0) - { - if (bitmapX + count <= 0) - { - return false; - } - count += bitmapX; - offset -= bitmapX; - bitmapX = 0; - } - if ((bitmapX >= bitmapRect.width) || (bitmapY < 0) || (bitmapY >= bitmapRect.height)) - { - return false; - } - if (bitmapX + (int)count > bitmapRect.width) - { - count = bitmapRect.width - bitmapX; - } - return true; - } - -private: - mutable int16_t xDelta; - mutable int16_t yDelta; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERBITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp deleted file mode 100644 index 2ec63dd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterColor.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterBitmap.hpp - * - * Declares the touchgfx::AbstractPainterBitmap class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERCOLOR_HPP -#define TOUCHGFX_ABSTRACTPAINTERCOLOR_HPP - -#include - -namespace touchgfx -{ -/** - * An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets - * need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide the - * color of a pixel on a given coordinate, which will the be blended into the framebuffer depending - * on the position of the canvas widget and the transparency of the given pixel. - * - * The AbstractPainter also implements a function which will blend each pixel in a scanline snippet - * into the framebuffer, but for better performance, the function should be reimplemented in each - * painter. - */ -class AbstractPainterColor -{ -public: - /** - * Constructor. - * - * @param color (Optional) The color to use in the painter. - */ - AbstractPainterColor(colortype color = 0) - { - setColor(color); - } - - /** Destructor */ - virtual ~AbstractPainterColor() - { - } - - /** - * Sets color to use when drawing the CanvasWidget. - * - * @param color The color. - */ - virtual void setColor(colortype color) - { - painterColor = color; - } - - /** - * Gets the current color. - * - * @return The color. - */ - colortype getColor() const - { - return painterColor; - } - -protected: - colortype painterColor; ///< The color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERCOLOR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp deleted file mode 100644 index fde2be8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterGRAY2.hpp - * - * Declares the touchgfx::AbstractPainterGRAY2 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERGRAY2_HPP -#define TOUCHGFX_ABSTRACTPAINTERGRAY2_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterGRAY2 class is an abstract class for creating a painter to draw on a - * GRAY2 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterGRAY2 : public AbstractPainter -{ -public: - AbstractPainterGRAY2() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::GRAY2) && "The chosen painter only works with GRAY2 displays"); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERGRAY2_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp deleted file mode 100644 index 345f5d6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterGRAY4.hpp - * - * Declares the touchgfx::AbstractPainterGRAY4 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERGRAY4_HPP -#define TOUCHGFX_ABSTRACTPAINTERGRAY4_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterGRAY4 class is an abstract class for creating a painter to draw on a - * GRAY4 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterGRAY4 : public AbstractPainter -{ -public: - AbstractPainterGRAY4() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::GRAY4) && "The chosen painter only works with GRAY4 displays"); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERGRAY4_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp deleted file mode 100644 index ab8a068..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterLinearGradient.hpp - * - * Declares the touchgfx::AbstractPainterLinearGradient class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERLINEARGRADIENT_HPP -#define TOUCHGFX_ABSTRACTPAINTERLINEARGRADIENT_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets - * need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide the - * color of a pixel on a given coordinate, which will the be blended into the framebuffer depending - * on the position of the canvas widget and the transparency of the given pixel. - */ -class AbstractPainterLinearGradient : public AbstractPainter -{ -public: - /** Constructor. */ - AbstractPainterLinearGradient() - : AbstractPainter(), - coord0(0), coord1(100), texture(0), isSolid(false), isVertical(false), isHorizontal(false), clSlope(0.0f), clOffset(0.0f), horizontalDistance(0.0f), deltaColor(0.0f) - { - } - - /** Destructor */ - virtual ~AbstractPainterLinearGradient() - { - } - - /** - * Set the gradient line. First coordinate (startX, startY) - * specifies the position of the first color. Last coordinate (endX, endY) specifies the - * position of the last color. - * - * @param startX X coordinate of the gradient line start point. - * @param startY Y coordinate of the gradient line start point. - * @param endX X coordinate of the gradient line end point. - * @param endY Y coordinate of the gradient line end point. - * @param width Width of gradient. - * @param height Height of gradient. - * @param m Transformation. - */ - void setGradientEndPoints(float startX, float startY, float endX, float endY, float width, float height, const Matrix3x3& m) - { - const Matrix3x3::Point start = m.affineTransform(startX, startY); - const Matrix3x3::Point end = m.affineTransform(endX, endY); - - isVertical = (start.x == end.x); - isHorizontal = (start.y == end.y); - - if (!isVertical && !isHorizontal) - { - // Calculate slope and position of first color line and horizontal distance to last - // Note: startX, startY, endX, endY are given in bounding box coordinate system [0;width]x[0;height] - // Color lines are perpendicular to gradient vector (cvy, cvx), in the square bounding-box coordinate system [0;1]x[0;1]. - const float cvx = endX - startX; - const float cvy = endY - startY; - - // So we scale gradient back from width x height - const float cvxbb = cvx / width; - const float cvybb = cvy / height; - - // Equal Colors vector is orthogonal to gradient vector, but scale to real size of shape - const float colorlinedx = -cvybb * width; - const float colorlinedy = cvxbb * height; - - // Rotate color vector according to transformation - const Matrix3x3::Point transformed = m.affineTransform(startX + colorlinedx, startY + colorlinedy); - - // Translate back to startX,Y - const float transformedlinedx = transformed.x - start.x; - - // If the color line has dx==0, the gradient (not the color line) is horizontal - if (transformedlinedx == 0.0f) - { - isHorizontal = true; - } - else - { - const float transformedlinedy = transformed.y - start.y; - - clSlope = transformedlinedy / transformedlinedx; - - // If the slope of the colorline is zero, the gradient is vertical - if (clSlope == 0.0f) - { - isVertical = true; - } - else - { - // First color line intersects (x0, coord0) - clOffset = start.y - start.x * clSlope; - - // Pixel distance between first and last color line horizontally - const float transformed_cvx = end.x - start.x; - const float transformed_cvy = end.y - start.y; - horizontalDistance = transformed_cvx - transformed_cvy / clSlope; - - // Color increment when moving 1 pixel horizontally - deltaColor = 1024.0f / horizontalDistance; - - if (horizontalDistance < 0) - { - horizontalDistance = -horizontalDistance; - } - return; - } - } - } - - if (isVertical) - { - // Color change over one line - deltaColor = 1023.9999f / (end.y - start.y); - - // Save y-coordinates for the vertical gradient. - // With coord0 lowest y coordinate, coord1 highest - if (start.y < end.y) - { - coord0 = static_cast(start.y); - coord1 = static_cast(end.y); - } - else - { - coord0 = static_cast(end.y); - coord1 = static_cast(start.y); - } - } - else if (isHorizontal) - { - // Color change over one line - deltaColor = 1023.9999f / (end.x - start.x); - - // Save x-coordinates for the horizontal gradient. - // With x0 lowest x coordinate, x1 highest - if (start.x < end.x) - { - coord0 = static_cast(start.x); - coord1 = static_cast(end.x); - } - else - { - coord0 = static_cast(end.x); - coord1 = static_cast(start.x); - } - horizontalDistance = static_cast(coord1 - coord0); - } - } - - /** - * Set the 1024x1 texture used to color this texture. The texture is mapped to the gradient line - * (startX, startY) to (endX, endY). - * - * The texture must be in ARGB8888 format. - * - * @param tex The gradient texture. - * @param solid True if all colors in the gradient are solid. - */ - void setGradientTexture(const uint32_t* tex, bool solid) - { - texture = tex; - isSolid = solid; - } - -protected: - int16_t coord0; ///< The gradient line start. - int16_t coord1; ///< The gradient line end. - const uint32_t* texture; ///< The gradient color texture 1 x 1024. - bool isSolid; ///< True if all the gradient colors are solid. - bool isVertical; ///< True if the gradient is vertical (x0 == x1). - bool isHorizontal; ///< True if the gradient is horizontal (y0 == y1). - float clSlope; ///< Slope of lines with same color - float clOffset; ///< Vertical offset for line with first color - float horizontalDistance; ///< Horizontal distance between pixels with the first color and the last color - float deltaColor; ///< Color increment when moving 1 pixel horizontally -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERLINEARGRADIENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp deleted file mode 100644 index 9169168..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB565.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterRGB565.hpp - * - * Declares the touchgfx::AbstractPainterRGB565 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERRGB565_HPP -#define TOUCHGFX_ABSTRACTPAINTERRGB565_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterRGB565 class is an abstract class for creating a painter to draw on a - * RGB565 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterRGB565 : public AbstractPainter -{ -public: - static const uint16_t RMASK = 0xF800; ///< Mask for red (1111100000000000) - static const uint16_t GMASK = 0x07E0; ///< Mask for green (0000011111100000) - static const uint16_t BMASK = 0x001F; ///< Mask for blue (0000000000011111) - - AbstractPainterRGB565() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::RGB565) && "The chosen painter only works with RGB565 displays"); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param newpix The new pixel value. - * @param bufpix The buffer pixel value. - * @param alpha The alpha to apply to the new pixel. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint16_t alphaBlend(uint16_t newpix, uint16_t bufpix, uint8_t alpha) const - { - return alphaBlend(newpix & RMASK, newpix & GMASK, newpix & BMASK, bufpix, alpha); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the - * new pixel, and the inverse alpha applied to the buffer pixel. - * - * @param R The red color (0-31 shifted into #RMASK). - * @param G The green color (0-63 shifted into #GMASK). - * @param B The blue color (0-31 shifted into #BMASK). - * @param bufpix The buffer pixel value. - * @param alpha The alpha of the R,G,B. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint16_t alphaBlend(uint16_t R, uint16_t G, uint16_t B, uint16_t bufpix, uint8_t alpha) const - { - const uint8_t ialpha = 0xFF - alpha; - return (((R * alpha + (bufpix & RMASK) * ialpha) / 255) & RMASK) | - (((G * alpha + (bufpix & GMASK) * ialpha) / 255) & GMASK) | - (((B * alpha + (bufpix & BMASK) * ialpha) / 255) & BMASK); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERRGB565_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp deleted file mode 100644 index db50b0e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGB888.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterRGB888.hpp - * - * Declares the touchgfx::AbstractPainterRGB888 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERRGB888_HPP -#define TOUCHGFX_ABSTRACTPAINTERRGB888_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterRGB888 class is an abstract class for creating a painter to draw on a - * RGB888 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterRGB888 : public AbstractPainter -{ -public: - AbstractPainterRGB888() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::RGB888) && "The chosen painter only works with RGB888 displays"); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERRGB888_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp deleted file mode 100644 index bffdb99..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractPainterRGBA2222.hpp - * - * Declares the touchgfx::AbstractPainterRGBA2222 class. - */ -#ifndef TOUCHGFX_ABSTRACTPAINTERRGBA2222_HPP -#define TOUCHGFX_ABSTRACTPAINTERRGBA2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The AbstractPainterRGBA2222 class is an abstract class for creating a painter to draw on a - * RGBA2222 display using CanvasWidgetRenderer. - * - * @see AbstractPainter - */ -class AbstractPainterRGBA2222 : public AbstractPainter -{ -public: - AbstractPainterRGBA2222() - : AbstractPainter() - { - assert(compatibleFramebuffer(Bitmap::RGBA2222) && "The chosen painter only works with RGBA2222 displays"); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, - * and the inverse alpha applied to the buffer pixel. - * - * @param newpix The new pixel value. - * @param bufpix The buffer pixel value. - * @param alpha The alpha to apply to the new pixel. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t newpix, uint8_t bufpix, uint8_t alpha) const - { - return alphaBlend(LCD8bpp_RGBA2222::getRedFromNativeColor(newpix), - LCD8bpp_RGBA2222::getGreenFromNativeColor(newpix), - LCD8bpp_RGBA2222::getBlueFromNativeColor(newpix), bufpix, alpha); - } - - /** - * Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, - * and the inverse alpha applied to the buffer pixel. - * - * @param R The red color. - * @param G The green color. - * @param B The blue color. - * @param bufpix The buffer pixel value. - * @param alpha The alpha of the R,G,B. - * - * @return The result of blending the two colors into a new color. - */ - FORCE_INLINE_FUNCTION uint8_t alphaBlend(uint8_t R, uint8_t G, uint8_t B, uint8_t bufpix, uint8_t alpha) const - { - const uint8_t ialpha = 0xFF - alpha; - const uint8_t p_red = LCD8bpp_RGBA2222::getRedFromNativeColor(bufpix); - const uint8_t p_green = LCD8bpp_RGBA2222::getGreenFromNativeColor(bufpix); - const uint8_t p_blue = LCD8bpp_RGBA2222::getBlueFromNativeColor(bufpix); - const uint8_t red = LCD::div255(R * alpha + p_red * ialpha); - const uint8_t green = LCD::div255(G * alpha + p_green * ialpha); - const uint8_t blue = LCD::div255(B * alpha + p_blue * ialpha); - return LCD8bpp_RGBA2222::getNativeColorFromRGB(red, green, blue); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTPAINTERRGBA2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp deleted file mode 100644 index c32c9b4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/AbstractShape.hpp +++ /dev/null @@ -1,469 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/AbstractShape.hpp - * - * Declares the touchgfx::AbstractShape class. - */ -#ifndef TOUCHGFX_ABSTRACTSHAPE_HPP -#define TOUCHGFX_ABSTRACTSHAPE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Simple widget capable of drawing a abstractShape. The abstractShape can be scaled and rotated - * around 0,0. The shapes points (corners) are calculated with regards to scaling and - * rotation to allow for faster redrawing. Care must be taken to call - * updateAbstractShapeCache() after updating the shape, the scale of the shape or the - * rotation of the shape. - */ -class AbstractShape : public CanvasWidget -{ -public: - /** - * Defines an alias for a single point. Users of the AbstractShape can chose to store - * the coordinates as int or float depending on the needs. This will help setting up the - * abstractShape very easily using setAbstractShape(). - * - * @tparam T Generic type parameter, either int or float. - * - * @see setShape - */ - template - struct ShapePoint - { - T x; ///< The x coordinate of the points. - T y; ///< The y coordinate of the points. - }; - - AbstractShape(); - - /** - * Gets number of points used to make up the shape. - * - * @return The number of points. - */ - virtual int getNumPoints() const = 0; - - /** - * Sets one of the points (a corner) of the shape in CWRUtil::Q5 format. - * - * @param i Zero-based index of the corner. - * @param x The x coordinate in CWRUtil::Q5 format. - * @param y The y coordinate in CWRUtil::Q5 format. - * - * @see updateAbstractShapeCache - * - * @note Remember to call updateAbstractShapeCache() after calling setCorner one or more times, - * to make sure that the cached outline of the shape is correct. - */ - virtual void setCorner(int i, CWRUtil::Q5 x, CWRUtil::Q5 y) = 0; - - /** - * Gets the x coordinate of a corner (a point) of the shape. - * - * @param i Zero-based index of the corner. - * - * @return The corner x coordinate in CWRUtil::Q5 format. - */ - virtual CWRUtil::Q5 getCornerX(int i) const = 0; - - /** - * Gets the y coordinate of a corner (a point) of the shape. - * - * @param i Zero-based index of the corner. - * - * @return The corner y coordinate in CWRUtil::Q5 format. - */ - virtual CWRUtil::Q5 getCornerY(int i) const = 0; - - /** - * Sets a shape the struct Points. The cached outline of the shape is automatically - * updated. - * - * @tparam T Generic type parameter, either int or float. - * @param [in] points The points that make up the shape. The pointer must point to an array - * of getNumPoints() elements of type ShapePoint. - * - * @note The area containing the shape is not invalidated. - */ - template - void setShape(ShapePoint* points) - { - int numPoints = getNumPoints(); - for (int i = 0; i < numPoints; i++) - { - setCorner(i, CWRUtil::toQ5(points[i].x), CWRUtil::toQ5(points[i].y)); - } - updateAbstractShapeCache(); - } - - /** - * Sets a shape the struct Points. The cached outline of the shape is automatically - * updated. - * - * @tparam T Generic type parameter, either int or float. - * @param [in] points The points that make up the shape. The pointer must point to an array - * of getNumPoints() elements of type ShapePoint. - * - * @note The area containing the shape is not invalidated. - */ - template - void setShape(const ShapePoint* points) - { - int numPoints = getNumPoints(); - for (int i = 0; i < numPoints; i++) - { - setCorner(i, CWRUtil::toQ5(points[i].x), CWRUtil::toQ5(points[i].y)); - } - updateAbstractShapeCache(); - } - - /** - * Sets the position of the shape's (0,0) in the widget. This means that all coordinates - * initially used when created the shape are moved relative to these given offsets. - * Subsequent calls to setOrigin() or moveOrigin() will replace the old values for - * origin. The cached outline of the shape is automatically updated. - * - * @tparam T Generic type parameter, either int or float. - * @param x The absolute x coordinate of the shapes position (0,0). - * @param y The absolute y coordinate of the shapes position (0,0). - * - * @see moveOrigin - * - * @note The area containing the AbstractShape is not invalidated. - */ - template - void setOrigin(T x, T y) - { - CWRUtil::Q5 dxNew = CWRUtil::toQ5(x); - CWRUtil::Q5 dyNew = CWRUtil::toQ5(y); - - if (dx == dxNew && dy == dyNew) - { - return; - } - - dx = dxNew; - dy = dyNew; - - updateAbstractShapeCache(); - } - - /** - * Sets the position of the shape's (0,0) in the widget. This means that all coordinates - * initially used when created the shape are moved relative to these given offsets. - * Subsequent calls to moveOrigin() or setOrigin() will replace the old values for - * origin. The cached outline of the shape is automatically updated. - * - * @tparam T Generic type parameter, either int or float. - * @param x The absolute x coordinate of the shapes position (0,0). - * @param y The absolute y coordinate of the shapes position (0,0). - * - * @see setOrigin - * - * @note The area containing the AbstractShape is invalidated before and after the change. - */ - template - void moveOrigin(T x, T y) - { - CWRUtil::Q5 xNew = CWRUtil::toQ5(x); - CWRUtil::Q5 yNew = CWRUtil::toQ5(y); - - if (dx == xNew && dy == yNew) - { - return; - } - - Rect rectBefore = getMinimalRect(); - invalidateRect(rectBefore); - - dx = xNew; - dy = yNew; - - updateAbstractShapeCache(); - - Rect rectAfter = getMinimalRect(); - invalidateRect(rectAfter); - } - - /** - * Gets the position of the shapes (0,0). - * - * @tparam T Generic type parameter, either int or float. - * @param [out] xOrigin The x coordinate rounded down to the precision of T. - * @param [out] yOrigin The y coordinate rounded down to the precision of T. - */ - template - void getOrigin(T& xOrigin, T& yOrigin) const - { - xOrigin = dx.to(); - yOrigin = dy.to(); - } - - /** - * Sets the absolute angle in degrees to turn the AbstractShape. 0 degrees means no rotation and - * 90 degrees is rotate the shape clockwise. Repeated calls to setAngle(10) will therefore not - * rotate the shape by an additional 10 degrees. The cached outline of the shape is - * automatically updated. - * - * @tparam T Generic type parameter. - * @param angle The absolute angle to turn the abstractShape to relative to 0 (straight up). - * - * @see updateAngle - * - * @note The area containing the AbstractShape is not invalidated. - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void setAngle(T angle) - { - CWRUtil::Q5 angleQ5 = CWRUtil::toQ5(angle); - if (shapeAngle != angleQ5) - { - shapeAngle = angleQ5; - updateAbstractShapeCache(); - } - } - - /** - * Gets the abstractShape's angle in degrees. - * - * @tparam T Generic type parameter. - * @param [out] angle The current AbstractShape rotation angle rounded down to the precision of - * T. - * - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void getAngle(T& angle) - { - angle = this->shapeAngle.to(); - } - - /** - * Sets the absolute angle in degrees to turn the AbstractShape. 0 degrees means no rotation and - * 90 degrees is rotate the shape clockwise. Repeated calls to setAngle(10) will therefore not - * rotate the shape by an additional 10 degrees. The cached outline of the shape is - * automatically updated. - * - * @tparam T Generic type parameter. - * @param angle The angle to turn the abstractShape. - * - * @see setAngle - * - * @note The area containing the AbstractShape is invalidated before and after the change. - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void updateAngle(T angle) - { - CWRUtil::Q5 angleQ5 = CWRUtil::toQ5(angle); - if (shapeAngle != angleQ5) - { - Rect rectBefore = getMinimalRect(); - invalidateRect(rectBefore); - - shapeAngle = angleQ5; - updateAbstractShapeCache(); - - Rect rectAfter = getMinimalRect(); - invalidateRect(rectAfter); - } - } - - /** - * Gets the current angle in degrees of the abstractShape. - * - * @return The angle of the AbstractShaperounded down to the precision of int. - * - * @note Angles are given in degrees, so a full circle is 360. - */ - int getAngle() const - { - return shapeAngle.to(); - } - - /** - * Scale the AbstractShape the given amounts in the x direction and the y direction. The - * new scaling factors do not multiply to previously set scaling factors, so scaling by - * 2 and later scaling by 2 again will not scale by 4, only by 2. The cached outline of - * the shape is automatically updated. - * - * @tparam T Generic type parameter, either int or float. - * @param newXScale The new scale in the x direction. - * @param newYScale The new scale in the y direction. - * - * @see getScale, updateScale - * - * @note The area containing the AbstractShape is not invalidated. - */ - template - void setScale(T newXScale, T newYScale) - { - xScale = CWRUtil::toQ10(newXScale); - yScale = CWRUtil::toQ10(newYScale); - updateAbstractShapeCache(); - } - - /** - * Scale the AbstractShape the given amount in the x direction and the y direction. The - * new scaling factors do not multiply to previously set scaling factors, so scaling by - * 2 and later scaling by 2 again will not scale by 4, only by 2. The cached outline of - * the shape is automatically updated. - * - * @tparam T Generic type parameter, either int or float. - * @param scale The scale in the x direction. - * - * @see getScale - * - * @note The area containing the AbstractShape is not invalidated. - */ - template - void setScale(T scale) - { - setScale(scale, scale); - } - - /** - * Scale the AbstractShape the given amount in the x direction and the y direction. The - * new scaling factors do not multiply to previously set scaling factors, so scaling by - * 2 and later scaling by 2 again will not scale by 4, only by 2. The cached outline of - * the shape is automatically updated. - * - * @tparam T Generic type parameter, either int or float. - * @param newXScale The new scale in the x direction. - * @param newYScale The new scale in the y direction. - * - * @see setScale - * - * @note The area containing the AbstractShape is invalidated before and after the change. - */ - template - void updateScale(T newXScale, T newYScale) - { - CWRUtil::Q10 xScaleQ10 = CWRUtil::toQ10(newXScale); - CWRUtil::Q10 yScaleQ10 = CWRUtil::toQ10(newYScale); - - if (xScale != xScaleQ10 || yScale != yScaleQ10) - { - Rect rectBefore = getMinimalRect(); - invalidateRect(rectBefore); - - xScale = xScaleQ10; - yScale = yScaleQ10; - updateAbstractShapeCache(); - - Rect rectAfter = getMinimalRect(); - invalidateRect(rectAfter); - } - } - - /** - * Gets the x scale and y scale of the shape as previously set using setScale. Default - * is 1 for both x scale and y scale. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] x Scaling of x coordinates rounded down to the precision of T. - * @param [out] y Scaling of y coordinates rounded down to the precision of T. - * - * @see setScale - */ - template - void getScale(T& x, T& y) const - { - x = xScale.to(); - y = yScale.to(); - } - - /** - * Sets the filling rule to be used when rendering the outline. - * - * @param rule The filling rule. - * - * @see getFillingRule - */ - void setFillingRule(Rasterizer::FillingRule rule) - { - fillingRule = rule; - } - - /** - * Gets the filling rule being used when rendering the outline. - * - * @return The filling rule. - * - * @see setFillingRule - */ - Rasterizer::FillingRule getFillingRule() const - { - return fillingRule; - } - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - /** - * Updates the AbstractShape cache. The cache is used to be able to quickly redraw the - * AbstractShape without calculating the points that make up the abstractShape (with - * regards to scaling and rotation). - */ - void updateAbstractShapeCache(); - -protected: - Rasterizer::FillingRule fillingRule; ///< The filling rule used by the rasterizer - - /** - * Sets the cached coordinates of a given point/corner. The coordinates in the cache are - * the coordinates from the corners after rotation and scaling has been applied to the - * coordinate. - * - * @param i Zero-based index of the corner. - * @param x The x coordinate. - * @param y The y coordinate. - */ - virtual void setCache(int i, CWRUtil::Q5 x, CWRUtil::Q5 y) = 0; - - /** - * Gets cached x coordinate of a point/corner. - * - * @param i Zero-based index of the point/corner. - * - * @return The cached x coordinate, or zero if nothing is cached for the given i. - */ - virtual CWRUtil::Q5 getCacheX(int i) const = 0; - - /** - * Gets cached y coordinate of a point/corner. - * - * @param i Zero-based index of the point/corner. - * - * @return The cached y coordinate, or zero if nothing is cached for the given i. - */ - virtual CWRUtil::Q5 getCacheY(int i) const = 0; - - virtual Rect getMinimalRect() const; - -private: - CWRUtil::Q5 dx, dy; - CWRUtil::Q5 shapeAngle; - CWRUtil::Q10 xScale, yScale; - Rect minimalRect; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTSHAPE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp deleted file mode 100644 index a52b21c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRUtil.hpp +++ /dev/null @@ -1,923 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/CWRUtil.hpp - * - * Declares the touchgfx:: class. - */ -#ifndef TOUCHGFX_CWRUTIL_HPP -#define TOUCHGFX_CWRUTIL_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Helper classes and functions for CanvasWidget. A handful of utility functions can be found - * here. These include helper functions for converting between float, int and Q5/Q10/Q15 - * formats. There are also functions for calculating sin() and cos() in integers with a - * high number of bits (15) reserved for fraction. Having sin() and cos() pre-calculated - * in this way allows very fast drawing of circles without the need for floating point - * arithmetic. - * - * Using Q5, which uses 32 bit value internally, numbers from -67108865 to - * +67108864.96875 with a precision of 1/32 = 0.03125 can be represented, as described - * in http://en.wikipedia.org/wiki/Q_%28number_format%29. - * - * Doing arithmetic operations on Q5, Q10 and Q15 numbers is described in detail on - * http://en.wikipedia.org/wiki/Fixed-point_arithmetic. - */ -struct CWRUtil -{ - class Q10; - class Q15; - - /** - * Defines a "floating point number" with 5 bits reserved for the fractional part of the - * decimal number. Q5 implements some simple arithmetic operations, most yielding a Q5 - * number and some yielding a Q10 number as a result. Other operations also work with - * Q15 numbers. - * - * @see Q10, Q15 - */ - class Q5 - { - public: - /** Initializes a new instance of the Q5 class. */ - Q5() - : v(0) - { - } - - /** - * Constructor from integer. No conversion is done - the integer is assumed to already - * be in Q5 format. - * - * @param i Integer pre-formattet in Q5 format. - */ - explicit Q5(int i) - : v(i) - { - } - - /** - * Constructor from Q10. The Q10 is shifted down to convert it to Q5, thus the value is - * rounded down in the conversion. - * - * @param q10 The Q10 value to convert to a Q5 value. - * - * @see Q10 - */ - Q5(const Q10 q10) - : v((int)q10 / Rasterizer::POLY_BASE_SIZE) - { - } - - /** - * Gets the Q5 as an integer without conversion. - * - * @return The unconverted Q5 value. - */ - operator int() const - { - return v; - } - - /** - * Negation operator. - * - * @return The negative value of this. - */ - Q5 operator-() const - { - return Q5(-v); - } - - /** - * Addition operator. - * - * @param q5 The Q5 to add to this. - * - * @return The result of the operation. - */ - Q5 operator+(const Q5& q5) const - { - return Q5(v + q5.v); - } - - /** - * Addition operator. - * - * @param q5 The Q5 to add to this. - * - * @return The result of the operation. - */ - Q5& operator+=(const Q5& q5) - { - v += q5.v; - return *this; - } - - /** - * Subtraction operator. - * - * @param q5 The Q5 to subtract from this. - * - * @return The result of the operation. - */ - Q5 operator-(const Q5& q5) const - { - return Q5(v - q5.v); - } - - /** - * Subtraction operator. - * - * @param q5 The Q5 to subtract from this. - * - * @return The result of the operation. - */ - Q5& operator-=(const Q5& q5) - { - v -= q5.v; - return *this; - } - - /** - * Multiplication operator. The result is a Q10, not a Q5, for increased precision. - * - * @param q5 The Q5 to multiply this with. - * - * @return The result of the operation. - * - * @see Q10 - */ - Q10 operator*(const Q5& q5) const - { - return Q10(v * q5.v); - } - - /** - * Multiplication operator. Often used in relation with sine and cosine calculation - * which are pre-calculated as Q15. As the result is needed as a Q5, this - * operator multiplies with the given Q15 and converts the result to a Q5. - * - * @param q15 The Q15 to multiply this with. - * - * @return The result of the operation. - * - * @see Q15 - */ - Q5 operator*(const Q15& q15) const - { - int32_t remainder; - return Q5(muldiv(v, (int)q15, Rasterizer::POLY_BASE_SIZE * Rasterizer::POLY_BASE_SIZE * Rasterizer::POLY_BASE_SIZE, remainder)); - } - - /** - * Multiplication operator. - * - * @param i The integer to multiply this with. - * - * @return The result of the operation. - */ - Q5 operator*(const int i) const - { - return Q5(v * i); - } - - /** - * Division operator. - * - * @param i The integer to divide this by. - * - * @return The result of the operation. - */ - Q5 operator/(const int i) const - { - return Q5(v / i); - } - - /** - * Division operator. Internally this Q5 is converted to Q10 before the division to - * increased precision. - * - * @param q5 The Q5 to divide this by. - * - * @return The result of the operation. - * - * @see Q10 - */ - Q5 operator/(const Q5 q5) const - { - return Q5(v * Rasterizer::POLY_BASE_SIZE / q5.v); - } - - /** - * Modulus operator. - * - * @param q5 The Q5 to modulus this by. - * - * @return The result of the operation. - */ - Q5 operator%(const Q5 q5) const - { - return Q5(v % q5.v); - } - - /** - * Modulus operator. - * - * @param q5 The Q5 to modulus this by. - * - * @return The result of the operation. - */ - Q5& operator%=(const Q5 q5) - { - v %= q5.v; - return *this; - } - - /** - * Convert the Q5 value to an integer by removing the 5 bits used for the fraction, or - * to a floating point value by dividing by 32, depending on the type specified as T. - * - * @tparam T Either int or float. - * - * @return Q5 value as a type T. - * - * @note Using "to()" result in loss of precision. Use "(int16_t)to()" instead. - */ - template - T to() const - { - return (T)((T)v / (T)Rasterizer::POLY_BASE_SIZE); - } - - /** - * Convert the Q5 value to an integer by removing the 5 bits used for the fraction. The number - * is rounded down to the nearest integer. - * - * @return The first integer value higher than (or equal to) the Q5 value. - * - * @see ceil - */ - int floor() const - { - return to(); - } - - /** - * Convert the Q5 value to an integer by removing the 5 bits used for the fraction. The number - * is rounded up to the nearest integer. - * - * @return The first integer value higher than (or equal to) the Q5 value. - * - * @see floor - */ - int ceil() const - { - return v < 0 ? to() : (v + (Rasterizer::POLY_BASE_SIZE - 1)) / Rasterizer::POLY_BASE_SIZE; - } - - /** - * Round the Q5 value to the nearest integer value. - * - * @return The integer closest to the Q5 value. - */ - int round() const - { - return v < 0 ? Q5((v + 1) - toQ5(1).v / 2).to() : Q5(v + toQ5(1).v / 2).to(); - } - - private: - int32_t v; - }; - - /** - * Defines a "floating point number" with 10 bits reserved for the fractional part of - * the decimal number. Q10 implements some simple arithmetic operations, most yielding a - * Q10 number and some yielding a Q5 number or a Q15 number as a result. - * - * Q5*Q5=Q10, Q10/Q5=Q5, ... - * - * @see Q5, Q15 - */ - class Q10 - { - public: - /** Initializes a new instance of the Q10 class. */ - Q10() - : v(0) - { - } - - /** - * Constructor from integer. No conversion is done - the integer is assumed to already - * be in Q10 format. - * - * @param i int pre-formattet in Q10 format. - */ - explicit Q10(int i) - : v(i) - { - } - - /** - * Gets the Q10 as an integer without conversion. - * - * @return The unconverted Q10 value. - */ - operator int() const - { - return v; - } - - /** - * Negation operator. - * - * @return The negative value of this. - */ - Q10 operator-() const - { - return Q10(-v); - } - - /** - * Addition operator. - * - * @param q10 The Q10 to add to this. - * - * @return The result of the operation. - */ - Q10 operator+(const Q10& q10) const - { - return Q10(v + q10.v); - } - - /** - * Multiplication operator. The result is a Q15, not a Q10, for increased precision. - * - * @param q5 The Q5 to multiply this with. - * - * @return The result of the operation. - */ - Q15 operator*(const Q5& q5) const - { - return Q15(v * (int)q5); - } - - /** - * Division operator. - * - * @param q5 The Q5 to divide this by. - * - * @return The result of the operation. - */ - Q5 operator/(const Q5& q5) const - { - return Q5(v / (int)q5); - } - - /** - * Converts the Q10 value to an int or a float. - * - * Convert the Q10 value to an integer by removing the 10 bits used for the - * fraction, or to a floating point value by dividing by 32 * 32, depending on - * the type specified as T. - * - * @tparam T Either int or float. - * - * @return Q10 value as a type T. - */ - template - T to() const - { - return (T)(v / (Rasterizer::POLY_BASE_SIZE * Rasterizer::POLY_BASE_SIZE)); - } - - private: - int32_t v; - }; - - /** - * Defines a "floating point number" with 15 bits reserved for the fractional part of - * the decimal number. Q15 is only used for sine/cosine and for intermediate - * calculations when multiplying. - * - * Q5*Q5=Q10, Q10/Q5=Q5, ... - * - * @see Q5, Q10 - */ - class Q15 - { - public: - /** - * Constructor from integer. No conversion is done - the integer is assumed to already - * be in Q15 format. - * - * @param i int pre-formattet in Q15 format. - */ - explicit Q15(int i) - : v(i) - { - } - - /** - * Gets the Q15 as an integer without conversion. - * - * @return The unconverted Q15 value. - */ - operator int() const - { - return v; - } - - /** - * Negation operator. - * - * @return The negative value of this. - */ - Q15 operator-() const - { - return Q15(-v); - } - - /** - * Addition operator. - * - * @param q15 The Q15 to add to this. - * - * @return The result of the operation. - */ - Q15 operator+(const Q15& q15) const - { - return Q15(v + q15.v); - } - - /** - * Calculate Q15 / Q5 as a Q10. - * - * @param q5 The Q5 to divide this by. - * - * @return The result of the operation. - */ - Q10 operator/(const Q5& q5) const - { - return Q10(v / (int)q5); - } - - private: - int32_t v; - }; - - /** - * Convert a Q5 to itself. Allows toQ5 to be called with a variable that is already Q5. - * - * @param value the Q5. - * - * @return the value passed. - */ - FORCE_INLINE_FUNCTION static Q5 toQ5(Q5 value) - { - return value; - } - - /** - * Convert an integer to a fixed point number. This is done by multiplying - * the floating point value by (1 << 5) - * - * @tparam T Should be either int or float. - * @param value the integer to convert. - * - * @return the converted integer. - */ -#ifdef __ICCARM__ - FORCE_INLINE_FUNCTION - template -#else - template - FORCE_INLINE_FUNCTION -#endif - static Q5 toQ5(T value) - { - return Q5((int)(value * Rasterizer::POLY_BASE_SIZE)); - } - - /** - * Convert an integer to a fixed point number. This is done by multiplying - * the floating point value by (1 << 10). - * - * @tparam T Should be either int or float. - * @param value the integer to convert. - * - * @return the converted integer. - */ -#ifdef __ICCARM__ - FORCE_INLINE_FUNCTION - template -#else - template - FORCE_INLINE_FUNCTION -#endif - static Q10 toQ10(T value) - { - return Q10((int)(value * Rasterizer::POLY_BASE_SIZE * Rasterizer::POLY_BASE_SIZE)); - } - - /** - * Find the value of sin(i) with 15 bits precision. The returned value can be converted - * to a floating point number and divided by (1<<15) to get the rounded value - * of sin(i). By using this function, a complete circle can be drawn without - * the need for using floating point math. - * - * @param i the angle in degrees. The angle follows the angles of the clock, 0 being - * straight up and 90 being 3 o'clock. - * - * @return the value of sin(i) with 15 bits precision on the fractional part. - */ - static Q15 sine(int i) - { - const static uint16_t sineTable[91] = { - 0x0000, 0x023C, 0x0478, 0x06B3, 0x08EE, 0x0B28, 0x0D61, 0x0F99, 0x11D0, 0x1406, - 0x163A, 0x186C, 0x1A9D, 0x1CCB, 0x1EF7, 0x2121, 0x2348, 0x256C, 0x278E, 0x29AC, - 0x2BC7, 0x2DDF, 0x2FF3, 0x3203, 0x3410, 0x3618, 0x381D, 0x3A1C, 0x3C18, 0x3E0E, - 0x4000, 0x41ED, 0x43D4, 0x45B7, 0x4794, 0x496B, 0x4B3D, 0x4D08, 0x4ECE, 0x508E, - 0x5247, 0x53FA, 0x55A6, 0x574C, 0x58EB, 0x5A82, 0x5C13, 0x5D9D, 0x5F1F, 0x609A, - 0x620E, 0x637A, 0x64DE, 0x663A, 0x678E, 0x68DA, 0x6A1E, 0x6B5A, 0x6C8D, 0x6DB8, - 0x6EDA, 0x6FF4, 0x7104, 0x720D, 0x730C, 0x7402, 0x74EF, 0x75D3, 0x76AE, 0x7780, - 0x7848, 0x7907, 0x79BC, 0x7A68, 0x7B0B, 0x7BA3, 0x7C33, 0x7CB8, 0x7D34, 0x7DA6, - 0x7E0E, 0x7E6D, 0x7EC1, 0x7F0C, 0x7F4C, 0x7F83, 0x7FB0, 0x7FD3, 0x7FEC, 0x7FFB, 0x8000 - }; - i %= 360; - if (i < 0) - { - i += 360; - } - if (i <= 90) - { - return Q15(sineTable[i]); - } - if (i <= 180) - { - return Q15(sineTable[180 - i]); - } - if (i <= 270) - { - return Q15(-int32_t(sineTable[i - 180])); - } - return Q15(-int32_t(sineTable[360 - i])); - } - - /** - * Find the value of sin(i) with 15 bits precision. The returned value can be converted - * to a floating point number and divided by (1<<15) to get the rounded value - * of sin(i). By using this function, a complete circle can be drawn without - * the need for using floating point math. - * - * If the given degree is not an integer, the value is approximated by interpolation - * between sin(floor(i)) and sin(ceil(i)). - * - * @param i the angle in degrees. The angle follows the angles of the clock, 0 being - * straight up and 90 being 3 o'clock. - * - * @return the value of sin(i) with 15 bits precision on the fractional part. - */ - static Q15 sine(Q5 i) - { - Q5 _360 = toQ5(360); - i %= _360; - if (i < 0) - { - i += _360; - } - int16_t fraction = i % Rasterizer::POLY_BASE_SIZE; - Q15 sineLow = sine(i.to()); - if (fraction == 0) - { - return sineLow; - } - Q15 sineHigh = sine(i.to() + 1); - int32_t remainder; - return Q15(muldiv((int)(sineHigh - sineLow), fraction, Rasterizer::POLY_BASE_SIZE, remainder)) + sineLow; - } - - /** - * Find the value of cos(i) with 15 bits precision using the fact that cos(i)=sin(90-i). - * - * @param i the angle in degrees. The angle follows the angles of the clock, 0 being - * straight up and 90 being 3 o'clock. - * - * @return the value of cos(i) with 15 bits precision on the fractional part. - * - * @see sine - */ - static Q15 cosine(int i) - { - return sine(90 - i); - } - - /** - * Find the value of cos(i) with 15 bits precision using the fact that cos(i)=sin(90-i). - * - * @param i the angle in degrees. The angle follows the angles of the clock, 0 being - * straight up and 90 being 3 o'clock. - * - * @return the value of cos(i) with 15 bits precision on the fractional part. - * - * @see sine - */ - static Q15 cosine(Q5 i) - { - return sine(toQ5(90) - i); - } - - /** - * Gets the arcsine of the given fraction (given as Q10). The function is most precise - * for angles 0-45. To limit memory requirements, values above sqrt(1/2) is calculated - * as 90-arcsine(sqrt(1-q10^2)). Internally. - * - * @param q10 The 10. - * - * @return An int8_t. - */ - static int8_t arcsine(Q10 q10) - { - const static uint8_t arcsineTable[91] = { - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, - 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, - 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, - 36, 36, 37, 38, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45 - }; - if (q10 < 0) - { - return -arcsine(-q10); - } - if (q10 > toQ10(1)) - { - return 0; // error - } - // sqrt(1/2) as Q10 is "724" so if q10>724 calculate 90-arcsine(sqrt(1-q10^2)) - if ((int)q10 > 724) - { - return 90 - arcsine(Q10(isqrt((1 << (Rasterizer::POLY_BASE_SHIFT * 4)) - (int)q10 * (int)q10))); - } - int q7 = ((int)q10 + 3) >> 3; // Round Q10 to nearest Q7 - return arcsineTable[q7]; - } - - /** - * Find angle of a coordinate relative to (0,0). - * - * @tparam T Generic type parameter (int or float). - * @param x The x coordinate. - * @param y The y coordinate. - * - * @return The angle of the coordinate. - */ - template - static int angle(T x, T y) - { - Q5 dist; - return angle(toQ5(x), toQ5(y), dist); - } - - /** - * Find angle of a coordinate relative to (0,0). - * - * @tparam T Generic type parameter (int or float). - * @param x The x coordinate. - * @param y The y coordinate. - * @param [out] d The distance from (0,0) to (x,y). - * - * @return The angle of the coordinate. - */ - template - static int angle(T x, T y, T& d) - { - Q5 dist; - int a = angle(toQ5(x), toQ5(y), dist); - d = dist.to(); - return a; - } - - /** - * Find angle of a coordinate relative to (0,0). - * - * @param x The x coordinate. - * @param y The y coordinate. - * - * @return The angle of the coordinate. - */ - static int angle(Q5 x, Q5 y) - { - Q5 dist; - return angle(x, y, dist); - } - - /** - * Find the angle of the coordinate (x, y) relative to (0, 0). - * - * @param x The x coordinate. - * @param y The y coordinate. - * @param [out] d The distance from (0,0) to (x,y). - * - * @return The angle. - */ - static int angle(Q5 x, Q5 y, Q5& d) - { - // Map to quadrant 1 - if (x >= 0) - { - if (y >= 0) - { - return 90 + _angle(x, y, d); - } - // y < 0 - return 90 - _angle(x, -y, d); - } - // x < 0 - if (y >= 0) - { - return 270 - _angle(-x, y, d); - } - // y < 0 - return 270 + _angle(-x, -y, d); - } - - /** - * Find the square root of the given value. Consider using length to avoid possible overflow - * when calculating a length. - * - * @param value The value to find the square root of. - * - * @return The square root of the given value. - * - * @see length - */ - static Q5 sqrtQ10(Q10 value) - { - return Q5(isqrt(uint32_t((int)value))); - } - - /** - * Find the length of a given distance x,y as sqrt(x*x+y*y) while avoiding overflow. The - * function uses sqrtQ10(Q10) as a helper function. - * - * @param x The x distance. - * @param y The y distance. - * - * @return The length of the vector (x,y). - * - * @see sqrtQ10 - */ - static Q5 length(Q5 x, Q5 y) - { - // Check if x*x or y*y is likely to overflow - const int absx = abs((int)x); - const int absy = abs((int)y); - // Find a scaling factor to make the calulation overflow-safe - const int factor = MAX(absx >> 14, absy >> 14); - if (factor > 1) - { - // Recursive call on a smaller number - return length(x / factor, y / factor) * factor; - } - return sqrtQ10(x * x + y * y); - } - - /** - * Multiply two Q5's and divide by a Q5 without overflowing the multiplication (assuming - * that the final result can be stored in a Q5). - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * @param divisor The divisor. - * - * @return factor1 * factor2 / divisor. - */ - static Q5 muldivQ5(Q5 factor1, Q5 factor2, Q5 divisor) - { - return Q5(muldiv((int)factor1, (int)factor2, (int)divisor)); - } - - /** - * Multiply two integers and divide by an integer without overflowing the multiplication. - * The result is returned in a Q5 thus allowing a more precise calculation to be performed. - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * @param divisor The divisor. - * - * @return factor1 * factor2 / divisor as a Q5 - */ - static Q5 muldiv_toQ5(int32_t factor1, int32_t factor2, int32_t divisor) - { - int32_t remainder; - int32_t result = muldiv(factor1, factor2, divisor, remainder); - if (result >= 0) - { - return toQ5(result) + muldivQ5(Q5(Rasterizer::POLY_BASE_SIZE), Q5(remainder), Q5(divisor)); - } - return toQ5(result) - muldivQ5(Q5(Rasterizer::POLY_BASE_SIZE), Q5(remainder), Q5(divisor)); - } - - /** - * Multiply two Q5's and divide by a Q5 without overflowing the multiplication (assuming - * that the final result can be stored in a Q5). - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * @param divisor The divisor. - * - * @return factor1 * factor2 / divisor. - */ - static Q5 muldivQ10(Q10 factor1, Q10 factor2, Q10 divisor) - { - int32_t remainder; - return Q5(muldiv((int)factor1, (int)factor2, (int)divisor, remainder) / Rasterizer::POLY_BASE_SIZE); - } - - /** - * Multiply two Q5's returning a new Q5 without overflowing. - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * - * @return factor1 * factor2. - */ - static Q5 mulQ5(Q5 factor1, Q5 factor2) - { - return muldivQ5(factor1, factor2, toQ5(1)); - } - - /** - * Multiply one Q5 by a Q10 returning a new Q5 without overflowing. - * - * @param factor1 The first factor. - * @param factor2 The second factor. - * - * @return factor1 * factor2. - */ - static Q5 mulQ5(Q5 factor1, Q10 factor2) - { - return muldivQ10(Q10((int)factor1 * Rasterizer::POLY_BASE_SIZE), factor2, toQ10(1)); - } - -private: - static int _angle(Q5 x, Q5 y, Q5& d) - { - assert(x >= 0 && y >= 0); - // The sine table from 0-45 is more precise, so swap x/y to get the angle in that range - if (x < y) - { - return 90 - _angle(y, x, d); - } - - Q5 _1 = toQ5(1); // Used to convert Q5->Q10->Q15 - d = length(x, y); - if (d == 0) - { - return 0; // Error - } - int32_t remainder; - Q10 dy = Q10(muldiv((int)y, (int)(_1 * _1), (int)d, remainder)); - return arcsine(dy); - } - - static uint32_t isqrt(uint32_t n) - { - uint32_t root = 0, bit, trial; - bit = (n >= 0x10000) ? 1 << 30 : 1 << 14; - do - { - trial = root + bit; - if (n >= trial) - { - n -= trial; - root = trial + bit; - } - root >>= 1; - bit >>= 2; - } while (bit); - return root; - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CWRUTIL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp deleted file mode 100644 index 8ab33c6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CWRVectorRenderer.hpp +++ /dev/null @@ -1,369 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/CWRVectorRenderer.hpp - * - * Defines the touchgfx::CWRVectorRenderer class. - */ -#ifndef TOUCHGFX_CWRVECTORRENDERER_HPP -#define TOUCHGFX_CWRVECTORRENDERER_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Implementation of the VectorRendererInterface based on the - * CanvasWidgetRenderer. The class needs to be subclasses to provide - * the painter objecs. - * - * @see CWRVectorRendererRGB888, CWRVectorRendererRGB565 - */ -class CWRVectorRenderer : public VectorRenderer -{ -public: - /** - * Start a new drawing in the given area. The area typically - * corresponds to an invalidated area of a Widget. - * Implementations may lock the framebuffer here. - * The drawing area is given in the widget coordinate system. - * - * @param renderer The Widget that does the rendering. - * @param drawingArea The area of the screen to draw in. - */ - virtual void setup(const Widget& renderer, const Rect& drawingArea); - - /** - * Set the drawing mode for the VectorRenderer. The mode will be - * used for all subsequent drawings until setMode is called again. - * - * The default mode is non-zero filling. - * - * @param mode The filling mode. - */ - virtual void setMode(DrawMode mode) - { - drawMode = mode; - } - - virtual void setStrokeMiterLimit(float miterLimit) - { - strokeMiterLimit = miterLimit; - } - - virtual void setStrokeLineJoin(VGStrokeLineJoin lineJoin) - { - strokeLineJoin = lineJoin; - } - - virtual void setStrokeLineCap(VGStrokeLineCap lineCap) - { - strokeLineCap = lineCap; - } - - /** - * Finalizes the current drawing. The implementation may block - * here until the drawing is done. - * - * The implementation is required to unlock the framebuffer when - * tearDown is called. - */ - virtual void tearDown(); - - /** - * Draw a Path defined by the given array of primitives - * (commands) and an array of the corresponding floating point - * coordinates. - * - * @param cmds An uint8_t array of VectorPrimitives values - * @param nCmds The number of commands in cmds - * @param points An array of coordinates for the commands - * @param nPoints The number of values in the points arrays - * @param bbox Array describing the bounding box of the path [minx,miny,maxx,maxy] or 0 if unknown - */ - virtual void drawPath(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const float* bbox = 0); - - /** - * Set the width used for future drawings using the VECTOR_STROKE - * drawing mode. - * - * @param w The width used for stroke drawing. - */ - virtual void setStrokeWidth(float w); - - /** - * Set a constant color used for future drawings. - * - * @param c An ARGB color value - */ - virtual void setColor(colortype c); - - /** - * Set the alpha value (opacity) used for future drawings. - * The alpha is specified in the interval [0;1]. - * - * @param a The alpha value. - */ - virtual void setAlpha(uint8_t a); - - /** - * Set a linear gradient used for future drawings. - * The linear gradient is transformed using the current - * transformation matrix. - * Multiple colors (stops) can be specified for the gradient. The - * stop positions are given in the range [0;1]. - * - * @param x0 X-coordinate for gradient starting point - * @param y0 Y-coordinate for gradient starting point - * @param x1 X-coordinate for gradient end point - * @param y1 Y-coordinate for gradient end point - * @param stops Number of stops - * @param stopPositions Positions of the stops on the line - * @param stopColors Colors of the stops - * @param width Width of the box to fill - * @param height Height of the box to fill - * @param solid True if all colors in the gradient are solid - * @param palette The gradient palette - */ - virtual void setLinearGradient(float x0, float y0, float x1, float y1, - uint32_t stops, - const float* stopPositions, - const uint32_t* stopColors, - float width, - float height, - bool solid, - const uint32_t* palette); - - /** - * Set a radial gradient used for future drawings. - * The radial gradient is transformed using the current - * transformation matrix. - * Multiple colors (stops) can be specified for the gradient. The - * stop positions are given in the range [0;1]. - * - * @param cx X-coordinate for the gradient center - * @param cy Y-coordinate for the gradient center - * @param radius Radius of the gradient - * @param stops Number of stops - * @param stopPositions Positions of the stops on the line - * @param stopColors Colors of the stops - */ - virtual void setRadialGradient(float cx, float cy, float radius, - uint32_t stops, - const float* stopPositions, - const colortype* stopColors); - - /** - * Sets the transformation matrix used for future drawings. - * The transformation is reset when setup is called. - * - * @param m The transformation matrix - * - */ - virtual void setTransformationMatrix(const Matrix3x3& m); - -private: - DrawMode drawMode; - uint8_t alpha; - uint8_t colorAlpha; - float strokeMiterLimit; - VGStrokeLineJoin strokeLineJoin; - VGStrokeLineCap strokeLineCap; - - Rect drawArea; - float strokeWidth; - Matrix3x3 matrix; - - class StrokeCanvas; - virtual AbstractPainterLinearGradient& getLinearPainter() = 0; - virtual AbstractPainterColor& getColorPainterColor() = 0; - virtual AbstractPainter& getColorPainter() = 0; - bool drawPathArea(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const Rect& area) const; - - bool drawFill(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const Rect& area) const; - bool drawStroke(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const Rect& area) const; - void drawStrokeBackwards(uint32_t cmdInxPathStart, uint32_t cmdInx, uint32_t pointInx, const uint8_t* cmds, const float* points, bool drawLineCaps, StrokeCanvas& canvas) const; - void getPreviousDestination(float& positionX, float& positionY, uint32_t cmdInx, uint32_t pointInx, const uint8_t* cmds, const float* points) const; - - class CanvasWidgetProxy : public CanvasWidget - { - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const - { - return true; - } - - public: - void setParent(Drawable* p) - { - parent = p; - } - } proxyWidget; - - class StrokeCanvas : private Canvas - { - public: - StrokeCanvas(const CanvasWidget* widget, const Rect& invalidatedArea, const Matrix3x3& m) - : Canvas(widget, invalidatedArea), - matrix(m), - firstLineTo(false), noLineHasBeenDrawn(true), drawLineCapInsteadOfLineJoin(false), - strokeWidthHalf(1.0f), miterLimitSquared(0.0f), strokeLineJoin(VG_STROKE_LINEJOIN_BEVEL), strokeLineCap(VG_STROKE_LINECAP_BUTT), strokeAlpha(255), - lastX(0.0f), lastY(0.0f), - initialStrokeStartX(0.0f), initialStrokeStartY(0.0f), initialStrokeEndX(0.0f), initialStrokeEndY(0.0f), - lastStrokeStartX(0.0f), lastStrokeStartY(0.0f), lastStrokeEndX(0.0f), lastStrokeEndY(0.0f) - { - setFillingRule(Rasterizer::FILL_NON_ZERO); - } - - void strokeMoveTo(float x, float y); - void strokeLineTo(float x, float y); - bool strokeClose(float x, float y); - bool strokeDrawDoubleLineCap(); - - void strokeBezierQuad(float x0, float y0, const float x1, const float y1, const float x, const float y) - { - Canvas::quadraticBezierTo(x0, y0, x1, y1, x, y); - } - - void strokeBezierCubic(float x0, float y0, float x1, float y1, float x2, float y2, float x, float y) - { - Canvas::cubicBezierTo(x0, y0, x1, y1, x2, y2, x, y); - } - - bool strokeRender() - { - return Canvas::render(strokeAlpha); - } - - void setStroke(float width, float miterLimit, VGStrokeLineJoin lineJoin, VGStrokeLineCap lineCap, uint8_t alpha) - { - strokeWidthHalf = abs(width) / 2.0f; - miterLimitSquared = miterLimit * strokeWidthHalf * miterLimit * strokeWidthHalf; - strokeLineJoin = lineJoin; - strokeLineCap = lineCap; - strokeAlpha = alpha; - } - - void lineCapInsteadOfLineJoin(bool drawLineCaps); - - void drawFinalLineCap(); - - private: - const Matrix3x3& matrix; - bool firstLineTo; - bool noLineHasBeenDrawn; - bool drawLineCapInsteadOfLineJoin; - float strokeWidthHalf; - float miterLimitSquared; - VGStrokeLineJoin strokeLineJoin; - VGStrokeLineCap strokeLineCap; - uint8_t strokeAlpha; - float lastX; - float lastY; - float initialStrokeStartX; - float initialStrokeStartY; - float initialStrokeEndX; - float initialStrokeEndY; - float lastStrokeStartX; - float lastStrokeStartY; - float lastStrokeEndX; - float lastStrokeEndY; - - void strokeDrawLineJoin(float x, float y, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); - void strokeDrawLineJoinRound(float x, float y, float x2, float y2, float x3, float y3, int level); - void strokeDrawLineCap(float x2, float y2, float x3, float y3); - - virtual void lineTo(CWRUtil::Q5 x, CWRUtil::Q5 y) - { - // This function is called from the Canvas Bezier curve functions, so we need to call our own function to draw the stroke. - strokeLineTo(x.to(), y.to()); - } - - void moveToWithTransform(float x, float y) - { - Matrix3x3::Point point = matrix.affineTransform(x, y); - Canvas::moveTo(CWRUtil::toQ5(point.x), CWRUtil::toQ5(point.y)); - } - - void lineToWithTransform(float x, float y) - { - Matrix3x3::Point point = matrix.affineTransform(x, y); - Canvas::lineTo(CWRUtil::toQ5(point.x), CWRUtil::toQ5(point.y)); - } - }; -}; - -/** - * Implementation of the CWRVectorRendererInterface - * for the RGB565 framebuffer format. - */ -class CWRVectorRendererRGB565 : public CWRVectorRenderer -{ - virtual AbstractPainterLinearGradient& getLinearPainter() - { - return linearPainter; - } - - virtual AbstractPainterColor& getColorPainterColor() - { - return colorPainter; - } - - virtual AbstractPainter& getColorPainter() - { - return colorPainter; - } - -private: - PainterRGB565 colorPainter; - PainterRGB565LinearGradient linearPainter; -}; - -/** - * Implementation of the CWRVectorRendererInterface - * for the RGB888 framebuffer format. - */ -class CWRVectorRendererRGB888 : public CWRVectorRenderer -{ - virtual AbstractPainterLinearGradient& getLinearPainter() - { - return linearPainter; - } - - virtual AbstractPainterColor& getColorPainterColor() - { - return colorPainter; - } - - virtual AbstractPainter& getColorPainter() - { - return colorPainter; - } - -private: - PainterRGB888 colorPainter; - PainterRGB888LinearGradient linearPainter; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CWRVECTORRENDERER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp deleted file mode 100644 index 3ec65fd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Canvas.hpp +++ /dev/null @@ -1,247 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/Canvas.hpp - * - * Declares the touchgfx::Canvas class. - */ -#ifndef TOUCHGFX_CANVAS_HPP -#define TOUCHGFX_CANVAS_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Class for easy rendering using CanvasWidgetRenderer. - * - * The Canvas class will make implementation of a new CanvasWidget very easy. The few simple - * primitives allows moving a "pen" and drawing the outline of a shape which can then be - * rendered. - * - * The Canvas class has been optimized to eliminate drawing unnecessary lines outside the - * currently invalidated rectangle. - */ -class Canvas -{ -public: - /** - * Canvas Constructor. Locks the framebuffer and prepares for drawing only in the allowed area - * which has been invalidated. The color depth of the LCD is taken into account. - * - * @param _widget a pointer to the CanvasWidget using this Canvas. Used for getting the - * canvas dimensions. - * @param invalidatedArea the are which should be updated. - * - * @note Locks the framebuffer. - */ - Canvas(const CanvasWidget* _widget, const Rect& invalidatedArea); - - /** - * Finalizes an instance of the Canvas class. - * - * @note Unlocks the framebuffer. - */ - virtual ~Canvas() - { - } - - /** - * Sets the filling rule to be used when rendering the outline. - * - * @param rule The filling rule. - * - * @see getFillingRule - */ - void setFillingRule(Rasterizer::FillingRule rule) - { - rasterizer.setFillingRule(rule); - } - - /** - * Gets the filling rule being used when rendering the outline. - * - * @return The filling rule. - * - * @see setFillingRule - */ - Rasterizer::FillingRule getFillingRule() const - { - return rasterizer.getFillingRule(); - } - - /** - * Move the current pen position to (x, y). If the pen is outside the drawing area, nothing is - * done, but the coordinates are saved in case the next operation is lineTo a coordinate which - * is inside (or on the opposite side of) the drawing area. - * - * @param x The x coordinate for the pen position in CWRUtil::Q5 format. - * @param y The y coordinate for the pen position in CWRUtil::Q5 format. - */ - void moveTo(CWRUtil::Q5 x, CWRUtil::Q5 y); - - /** - * Draw line from the current (x, y) to the new (x, y) as part of the shape being drawn. As for - * moveTo, lineTo commands completely outside the drawing are are discarded. - * - * @param x The x coordinate for the pen position in CWRUtil::Q5 format. - * @param y The y coordinate for the pen position in CWRUtil::Q5 format. - * - * @see CWRUtil::Q5, moveTo - */ - virtual void lineTo(CWRUtil::Q5 x, CWRUtil::Q5 y); - - /** - * Draw a Quadratic Bezier curve via x1,y1 to x2,y2. - * - * @param x0 The start x coordinate. - * @param y0 The start y coordinate. - * @param x1 The 'via' x coordinate. - * @param y1 The 'via' y coordinate. - * @param x The end x coordinate. - * @param y The end y coordinate. - */ - void quadraticBezierTo(float x0, float y0, const float x1, const float y1, const float x, const float y) - { - recursiveQuadraticBezier(x0, y0, x1, y1, x, y, 0); - lineTo(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Draw a Cubic Bezier curve via x1,y1 and x2,y2 to x3,y3. - * - * @param x0 The start x coordinate. - * @param y0 The start y coordinate. - * @param x1 The first 'via' x coordinate. - * @param y1 The first 'via' y coordinate. - * @param x2 The second 'via' x coordinate. - * @param y2 The second 'via' y coordinate. - * @param x The end x coordinate. - * @param y The end y coordinate. - */ - void cubicBezierTo(float x0, float y0, float x1, float y1, float x2, float y2, float x, float y) - { - recursiveCubicBezier(x0, y0, x1, y1, x2, y2, x, y, 0); - lineTo(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Closes the current shape so that the inside can be filled using a Painter. - * - * @return True if there is enough memory to calculate the shape outline, false if there is too - * little memory. - */ - bool close(); - - /** - * Move the current pen position to (x, y). If the pen is outside (above or below) - * the drawing area, nothing is done, but the coordinates are saved in case the next operation - * is lineTo a coordinate which is inside (or on the opposite side of) the drawing area. - * - * @tparam T Either int or float. - * @param x The x coordinate for the pen position. - * @param y The y coordinate for the pen position. - */ - template - void moveTo(T x, T y) - { - moveTo(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Draw line from the current (x, y) to the new (x, y) as part of the shape being drawn. As for - * moveTo, lineTo commands completely outside the drawing are are discarded. - * - * @tparam T either int or float. - * @param x The x coordinate for the pen position. - * @param y The y coordinate for the pen position. - */ - template - void lineTo(T x, T y) - { - lineTo(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Render the graphical shape drawn using moveTo() and lineTo() with the given Painter. The - * shape is automatically closed, i.e. a lineTo() is automatically inserted connecting the - * current pen position with the initial pen position given in the first moveTo() command. - * - * @param customAlpha (Optional) Alpha to apply to the entire canvas. Useful if the canvas is - * part of a more complex container setup that needs to be faded. Default is - * solid. - * - * @return true if the widget was rendered, false if insufficient memory was available to render - * the widget. - */ - bool render(uint8_t customAlpha = 255); - - /** - * Determines if we the outline was too complex to draw completely. - * - * @return True if it was too complex, false if not. - */ - FORCE_INLINE_FUNCTION bool wasOutlineTooComplex() - { - return rasterizer.wasOutlineTooComplex(); - } - -private: - // Pointer to the widget using the Canvas - const CanvasWidget* widget; - - // Invalidate area in Q5 coordinates - CWRUtil::Q5 invalidatedAreaX; - CWRUtil::Q5 invalidatedAreaY; - CWRUtil::Q5 invalidatedAreaWidth; - CWRUtil::Q5 invalidatedAreaHeight; - - // For drawing - Rect dirtyAreaAbsolute; - Rasterizer rasterizer; - - // Used for optimization of drawing algorithm - bool isPenDown; - bool wasPenDown; - CWRUtil::Q5 previousX; - CWRUtil::Q5 previousY; - uint8_t previousOutside; - uint8_t penDownOutside; - CWRUtil::Q5 initialMoveToX; - CWRUtil::Q5 initialMoveToY; - - enum - { - POINT_IS_ABOVE = 1 << 0, - POINT_IS_BELOW = 1 << 1, - POINT_IS_LEFT = 1 << 2, - POINT_IS_RIGHT = 1 << 3 - }; - - FORCE_INLINE_FUNCTION uint8_t isOutside(const CWRUtil::Q5& x, const CWRUtil::Q5& y, const CWRUtil::Q5& width, const CWRUtil::Q5& height) const - { - return ((y < 0) ? (POINT_IS_ABOVE) : (y >= height ? POINT_IS_BELOW : 0)) | - ((x < 0) ? (POINT_IS_LEFT) : (x >= width ? POINT_IS_RIGHT : 0)); - } - - void transformFrameBufferToDisplay(CWRUtil::Q5& x, CWRUtil::Q5& y) const; - - void recursiveQuadraticBezier(const float x1, const float y1, const float x2, const float y2, const float x3, const float y3, const unsigned level); - void recursiveCubicBezier(const float x1, const float y1, const float x2, const float y2, const float x3, const float y3, const float x4, const float y4, const unsigned level); -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CANVAS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp deleted file mode 100644 index 7565a4e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/CanvasWidget.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/CanvasWidget.hpp - * - * Declares the touchgfx::CanvasWidget class. - */ -#ifndef TOUCHGFX_CANVASWIDGET_HPP -#define TOUCHGFX_CANVASWIDGET_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Class for drawing complex polygons on the display using CanvasWidgetRenderer. The - * CanvasWidget is used by passing it to a Canvas object, drawing the outline of the - * object and then having CanvasWidget render the outline on the display using the - * assigned painter. - */ -class CanvasWidget : public Widget -{ -public: - CanvasWidget(); - - /** - * Sets a painter for the CanvasWidget. - * - * @param [in] painter The painter for the CanvasWidget. - * - * @see getPainter - * - * @note If setPainter() is used to change the painter to a different painter, the area - * containing the CanvasWidget is not automatically invalidated. - */ - void setPainter(const AbstractPainter& painter) - { - canvasPainter = &painter; - } - - /** - * Gets the current painter for the CanvasWidget. - * - * @return The painter. - * - * @see setPainter - */ - const AbstractPainter* getPainter() const - { - return canvasPainter; - } - - /** @copydoc Image::setAlpha */ - virtual void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** @copydoc Image::getAlpha() */ - virtual uint8_t getAlpha() const - { - return alpha; - } - - /** - * Draws the given invalidated area. If the underlying CanvasWidgetRenderer fail to - * render the widget (if the widget is too complex), the invalidated area is cut into - * smaller slices (horizontally) which are then drawn separately. If drawing a single - * raster line fails, that line is considered too complex and skipped (it is left - * blank/transparent) and drawing continues on the next raster line. - * - * If drawing has failed at least once, which means that the number of horizontal lines - * draw has been reduced, the number of successfully drawn horizontal lines is - * remembered for the next invocation of draw(). A future call to draw() would then - * start off with the reduced number of horizontal lines to prevent potentially drawing - * the canvas widget in vain, as happened previously in draw(). - * - * @param invalidatedArea The invalidated area. - * - * @see drawCanvasWidget - * - * @note Subclasses of CanvasWidget should implement drawCanvasWidget(), not draw(). - * @note The term "too complex" means that the size of the buffer (assigned to - * CanvasWidgetRenderer using CanvasWidgetRenderer::setupBuffer()) is too small. - */ - virtual void draw(const Rect& invalidatedArea) const; - - /** - * Invalidates the area covered by this CanvasWidget. Since many widgets are a lot - * smaller than the actual size of the canvas widget, each widget must be able to tell - * the smallest rectangle completely containing the shape drawn by the widget. For - * example a circle arc is typically much smaller than the widget containing the circle. - * - * @see getMinimalRect - */ - virtual void invalidate() const; - - /** - * Gets minimal rectangle containing the shape drawn by this widget. Default - * implementation returns the size of the entire widget, but this function should be - * overwritten in subclasses and return the minimal rectangle containing the shape. See - * classes such as Circle for example implementations. - * - * @return The minimal rectangle containing the shape drawn. - */ - virtual Rect getMinimalRect() const - { - return Rect(0, 0, getWidth(), getHeight()); - } - - /** - * Gets the largest solid (non-transparent) rectangle. Since canvas widgets typically do - * not have a solid rect, it is recommended to return an empty rectangle. - * - * @return The largest solid (non-transparent) rectangle. - * - * @see draw - * - * @note Function draw() might fail for some horizontal lines due to memory constraints. These - * lines will not be drawn and may cause strange display artifacts. - */ - virtual Rect getSolidRect() const - { - return Rect(); - } - - /** - * Draw canvas widget for the given invalidated area. Similar to draw(), but might be - * invoked several times with increasingly smaller areas to due to memory constraints - * from the underlying CanvasWidgetRenderer. - * - * @param invalidatedArea The invalidated area. - * - * @return true if the widget was drawn properly, false if not. - * - * @see draw - */ - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const = 0; - -protected: - uint8_t alpha; ///< The Alpha for this CanvasWidget. - -private: - const AbstractPainter* canvasPainter; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CANVASWIDGET_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp deleted file mode 100644 index ec7ddfd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Circle.hpp +++ /dev/null @@ -1,558 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/Circle.hpp - * - * Declares the touchgfx::Circle class. - */ -#ifndef TOUCHGFX_CIRCLE_HPP -#define TOUCHGFX_CIRCLE_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * Simple widget capable of drawing a circle, or part of a circle (an arc). The Circle can be - * filled or be drawn as a simple line along the circumference of the circle. Several - * parameters of the circle can be changed: Center, radius, line width, line cap, start - * angle and end angle. - * - * @note Since the underlying CanwasWidgetRenderer only supports straight lines, the circle is - * drawn using many small straight lines segments. The granularity can be adjusted to - * match the requirements - large circles need more line segments, small circles need - * fewer line segments, to look smooth and round. - * @note All circle parameters are internally handled as CWRUtil::Q5 which means that floating - * point values are rounded down to a fixed number of binary digits, for example: - * @code - * Circle circle; - * circle.setCircle(1.1f, 1.1f, 0.9); // Will use (35/32, 35/32, 28/32) = (1.09375f, 1.09375f, 0.875f) - * int x, y, r; - * circle.getCenter(&x, &y); // Will return (1, 1) - * circle.getRadius(&r); // Will return 0 - * @endcode. - */ -class Circle : public CanvasWidget -{ -public: - Circle(); - - /** - * Sets the center and radius of the Circle. - * - * @tparam T Generic type parameter, either int or float. - * @param x The x coordinate of center. - * @param y The y coordinate of center. - * @param r The radius. - * - * @see setCenter, setRadius - * - * @note The area containing the Circle is not invalidated. - */ - template - void setCircle(const T x, const T y, const T r) - { - setCenter(x, y); - setRadius(r); - } - - /** - * Sets the center and radius of the Circle. - * - * @param x The x coordinate of center. - * @param y The y coordinate of center. - * @param r The radius. - * - * @see setCenter, setRadius - * - * @note The area containing the Circle is not invalidated. - */ - void setCircle(const int16_t x, const int16_t y, const int16_t r) - { - setCircle(x, y, r); - } - - /** - * Sets the center of the Circle. - * - * @tparam T Generic type parameter, either int or float. - * @param x The x coordinate of center. - * @param y The y coordinate of center. - * - * @see setRadius, setCircle, getCenter - * - * @note The area containing the Circle is not invalidated. - */ - template - void setCenter(const T x, const T y) - { - this->circleCenterX = CWRUtil::toQ5(x); - this->circleCenterY = CWRUtil::toQ5(y); - } - - /** - * Sets the center of the Circle. - * - * @param x The x coordinate of center. - * @param y The y coordinate of center. - * - * @see setRadius, setCircle, getCenter - * - * @note The area containing the Circle is not invalidated. - */ - void setCenter(const int16_t x, const int16_t y) - { - setCenter(x, y); - } - - /** - * Sets the center of the circle / arc in the middle of a pixel. Normally the coordinate is - * between pixel number x and x+1 horizontally and between pixel y and y+1 vertically. This - * function will set the center in the middle of the pixel by adding 0.5 to both x and y. - * - * @param x The x coordinate of the center of the circle. - * @param y The y coordinate of the center of the circle. - */ - void setPixelCenter(int x, int y) - { - int32_t half = (int32_t)CWRUtil::toQ5(1) / 2; - setCenter(CWRUtil::Q5((int32_t)CWRUtil::toQ5(x) + half), CWRUtil::Q5((int32_t)CWRUtil::toQ5(y) + half)); - } - - /** - * Gets the center coordinates of the Circle. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] x The x coordinate of the center rounded down to the precision of T. - * @param [out] y The y coordinate of the center rounded down to the precision of T. - * - * @see setCenter - */ - template - void getCenter(T& x, T& y) const - { - x = circleCenterX.to(); - y = circleCenterY.to(); - } - - /** - * Sets the radius of the Circle. - * - * @tparam T Generic type parameter, either int or float. - * @param r The radius. - * - * @see setCircle, setCenter, getRadius - * - * @note The area containing the Circle is not invalidated. - */ - template - void setRadius(const T r) - { - this->circleRadius = CWRUtil::toQ5(r); - this->circleRadius = MAX(CWRUtil::toQ5(0), this->circleRadius); - } - - /** - * Gets the radius of the Circle. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] r The radius rounded down to the precision of T. - */ - template - void getRadius(T& r) const - { - r = circleRadius.to(); - } - - /** - * Sets the start and end angles in degrees of the Circle arc. 0 degrees is straight up (12 - * o'clock) and 90 degrees is to the left (3 o'clock). Any positive or negative degrees can be - * used to specify the part of the Circle to draw. - * - * @tparam T Generic type parameter, either int or float. - * @param startAngle The start degrees. - * @param endAngle The end degrees. - * - * @see getArc, updateArcStart, updateArcEnd, updateArc - * - * @note The area containing the Circle is not invalidated. - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void setArc(const T startAngle, const T endAngle) - { - circleArcAngleStart = CWRUtil::toQ5(startAngle); - circleArcAngleEnd = CWRUtil::toQ5(endAngle); - } - - /** - * Sets the start and end angles in degrees of the Circle arc. 0 degrees is straight up (12 - * o'clock) and 90 degrees is to the left (3 o'clock). Any positive or negative degrees can be - * used to specify the part of the Circle to draw. - * - * @param startAngle The start degrees. - * @param endAngle The end degrees. - * - * @see getArc, updateArcStart, updateArcEnd, updateArc - * - * @note The area containing the Circle is not invalidated. - * @note Angles are given in degrees, so a full circle is 360. - */ - void setArc(const int16_t startAngle, const int16_t endAngle) - { - setArc(startAngle, endAngle); - } - - /** - * Gets the start and end angles in degrees for the circle arc. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] startAngle The start angle rounded down to the precision of T. - * @param [out] endAngle The end angle rounded down to the precision of T. - * - * @see setArc - * - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void getArc(T& startAngle, T& endAngle) const - { - startAngle = circleArcAngleStart.to(); - endAngle = circleArcAngleEnd.to(); - } - - /** - * Gets the start angle in degrees for the arc. - * - * @return The starting angle for the arc rounded down to an integer. - * - * @see getArc, setArc - * - * @note Angles are given in degrees, so a full circle is 360. - */ - int16_t getArcStart() const - { - return circleArcAngleStart.to(); - } - - /** - * Gets the start angle in degrees for the arc. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] angle The starting angle rounded down to the precision of T. - * - * @see getArc, setArc - * - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void getArcStart(T& angle) const - { - angle = circleArcAngleStart.to(); - } - - /** - * Gets the end angle in degrees for the arc. - * - * @return The end angle for the arc rounded down to an integer. - * - * @see getArc, setArc - * - * @note Angles are given in degrees, so a full circle is 360. - */ - int16_t getArcEnd() const - { - return circleArcAngleEnd.to(); - } - - /** - * Gets the end angle in degrees for the arc. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] angle The end angle rounded down to the precision of T. - * - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void getArcEnd(T& angle) const - { - angle = circleArcAngleEnd.to(); - } - - /** - * Updates the start angle in degrees for this Circle arc. - * - * @tparam T Generic type parameter, either int or float. - * @param startAngle The start angle in degrees. - * - * @see setArc, updateArcEnd, updateArc - * - * @note The area containing the updated Circle arc is invalidated. - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void updateArcStart(const T startAngle) - { - CWRUtil::Q5 startAngleQ5 = CWRUtil::toQ5(startAngle); - if (circleArcAngleStart == startAngleQ5) - { - return; - } - Rect minimalRect = getMinimalRectForUpdatedStartAngle(startAngleQ5); - circleArcAngleStart = startAngleQ5; - invalidateRect(minimalRect); - } - - /** - * Updates the end angle in degrees for this Circle arc. - * - * @tparam T Generic type parameter, either int or float. - * @param endAngle The end angle in degrees. - * - * @see setArc, updateArcStart, updateArc - * - * @note The area containing the updated Circle arc is invalidated. - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void updateArcEnd(const T endAngle) - { - CWRUtil::Q5 endAngleQ5 = CWRUtil::toQ5(endAngle); - if (circleArcAngleEnd == endAngleQ5) - { - return; - } - Rect minimalRect = getMinimalRectForUpdatedEndAngle(endAngleQ5); - circleArcAngleEnd = endAngleQ5; - invalidateRect(minimalRect); - } - - /** - * Updates the start and end angle in degrees for this Circle arc. - * - * @tparam T Generic type parameter, either int or float. - * @param startAngle The new start angle in degrees. - * @param endAngle The new end angle in degrees. - * - * @see setArc, getArc, updateArcStart, updateArcEnd - * - * @note The areas containing the updated Circle arcs are invalidated. As little as possible - * will be invalidated for best performance. - * @note Angles are given in degrees, so a full circle is 360. - */ - template - void updateArc(const T startAngle, const T endAngle) - { - updateArc(CWRUtil::toQ5(startAngle), CWRUtil::toQ5(endAngle)); - } - - /** - * Sets the line width for this Circle. If the line width is set to zero, the circle - * will be filled. - * - * @tparam T Generic type parameter, either int or float. - * @param width The width of the line measured in pixels. - * - * @note The area containing the Circle is not invalidated. - * @note if the new line with is smaller than the old width, the circle should be invalidated - * before updating the width to ensure that the old circle is completely erased. - */ - template - void setLineWidth(const T width) - { - this->circleLineWidth = CWRUtil::toQ5(width); - this->circleLineWidth = MAX(CWRUtil::toQ5(0), this->circleLineWidth); - } - - /** - * Gets line width. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] width The line width rounded down to the precision of T. - * - * @see setLineWidth - */ - template - void getLineWidth(T& width) const - { - width = circleLineWidth.to(); - } - - /** - * Sets precision of the Circle drawing function. The number given as precision is the - * number of degrees used as step counter when drawing the line fragments around the - * circumference of the circle, five being a reasonable value. Higher values results in - * less nice circles but faster rendering and possibly sufficient for very small - * circles. Large circles might require a precision smaller than five to make the edge - * of the circle look nice and smooth. - * - * @param precision The precision measured in degrees. - * - * @note The circle is not invalidated. - */ - void setPrecision(const int precision); - - /** - * Gets the precision of the circle drawing function. The precision is the number of - * degrees used as step counter when drawing smaller line fragments around the - * circumference of the circle, the default being 5. - * - * @return The precision. - * - * @see setPrecision - */ - int getPrecision() const; - - /** - * Sets the precision of the ends of the Circle arc. The precision is given in degrees - * where 180 is the default which results in a square ended arc (aka "butt cap"). 90 - * will draw "an arrow head" and smaller values gives a round cap. Larger values of - * precision results in faster rendering of the circle. - * - * @param precision The new cap precision. - * - * @note The circle is not invalidated. - * @note The cap precision is not used if the circle is filled (if line width is zero) or when - * a full circle is drawn. - */ - void setCapPrecision(const int precision); - - /** - * Gets the precision of the ends of the Circle arc. - * - * @return The cap precision in degrees. - * - * @see getCapPrecision - */ - int getCapPrecision() const; - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - virtual Rect getMinimalRect() const - { - return getMinimalRect(circleArcAngleStart, circleArcAngleEnd); - } - - /** - * Gets minimal rectangle containing a given circle arc using the set line width. - * - * @param arcStart The arc start. - * @param arcEnd The arc end. - * - * @return The minimal rectangle. - */ - Rect getMinimalRect(int16_t arcStart, int16_t arcEnd) const - { - return getMinimalRect(CWRUtil::toQ5(arcStart), CWRUtil::toQ5(arcEnd)); - } - - /** - * Gets minimal rectangle containing a given circle arc using the set line width. - * - * @param arcStart The arc start. - * @param arcEnd The arc end. - * - * @return The minimal rectangle. - */ - Rect getMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd) const; - -protected: - /** - * Updates the start and end angle in degrees for this Circle arc. - * - * @param setStartAngleQ5 The new start angle in degrees. - * @param setEndAngleQ5 The new end angle in degrees. - * - * @see setArc, getArc, updateArcStart, updateArcEnd - * - * @note The areas containing the updated Circle arcs are invalidated. As little as possible - * will be invalidated for best performance. - */ - void updateArc(const CWRUtil::Q5 setStartAngleQ5, const CWRUtil::Q5 setEndAngleQ5); - -private: - CWRUtil::Q5 circleCenterX; - CWRUtil::Q5 circleCenterY; - CWRUtil::Q5 circleRadius; - CWRUtil::Q5 circleArcAngleStart; - CWRUtil::Q5 circleArcAngleEnd; - CWRUtil::Q5 circleLineWidth; - uint8_t circleArcIncrement; - uint8_t circleCapArcIncrement; - - FORCE_INLINE_FUNCTION void moveToAngleRadius2(Canvas& canvas, const CWRUtil::Q5& angle, const CWRUtil::Q5& r2) const - { - canvas.moveTo(circleCenterX + ((r2 * CWRUtil::sine(angle)) / 2), circleCenterY - ((r2 * CWRUtil::cosine(angle)) / 2)); - } - - FORCE_INLINE_FUNCTION void lineToAngleRadius2(Canvas& canvas, const CWRUtil::Q5& angle, const CWRUtil::Q5& r2) const - { - lineToXYAngleRadius2(canvas, circleCenterX, circleCenterY, angle, r2); - } - - FORCE_INLINE_FUNCTION void lineToXYAngleRadius2(Canvas& canvas, const CWRUtil::Q5& x, const CWRUtil::Q5& y, const CWRUtil::Q5& angle, const CWRUtil::Q5& r2) const - { - canvas.lineTo(x + ((r2 * CWRUtil::sine(angle)) / 2), y - ((r2 * CWRUtil::cosine(angle)) / 2)); - } - - FORCE_INLINE_FUNCTION void updateMinMaxAngleLine(const CWRUtil::Q5& angle, const CWRUtil::Q5& halfLineWidth, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const - { - const CWRUtil::Q5 xNew = circleCenterX + (circleRadius * CWRUtil::sine(angle)); - updateMinMaxX(xNew - halfLineWidth, xMin, xMax); - updateMinMaxX(xNew + halfLineWidth, xMin, xMax); - const CWRUtil::Q5 yNew = circleCenterY - (circleRadius * CWRUtil::cosine(angle)); - updateMinMaxY(yNew - halfLineWidth, yMin, yMax); - updateMinMaxY(yNew + halfLineWidth, yMin, yMax); - } - - FORCE_INLINE_FUNCTION void updateMinMaxAngleSolid(const CWRUtil::Q5& angle, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const - { - updateMinMaxX(circleCenterX + (circleRadius * CWRUtil::sine(angle)), xMin, xMax); - updateMinMaxY(circleCenterY - (circleRadius * CWRUtil::cosine(angle)), yMin, yMax); - } - - FORCE_INLINE_FUNCTION void updateMinMaxX(const CWRUtil::Q5& xNew, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax) const - { - if (xNew < xMin) - { - xMin = xNew; - } - if (xNew > xMax) - { - xMax = xNew; - } - } - - FORCE_INLINE_FUNCTION void updateMinMaxY(const CWRUtil::Q5& yNew, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const - { - if (yNew < yMin) - { - yMin = yNew; - } - if (yNew > yMax) - { - yMax = yNew; - } - } - - void calculateMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const; - Rect getMinimalRectForUpdatedStartAngle(const CWRUtil::Q5& startAngleQ5) const; - Rect getMinimalRectForUpdatedEndAngle(const CWRUtil::Q5& endAngleQ5) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_CIRCLE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp deleted file mode 100644 index a971d2e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Line.hpp +++ /dev/null @@ -1,424 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/Line.hpp - * - * Declares the touchgfx::Line class. - */ -#ifndef TOUCHGFX_LINE_HPP -#define TOUCHGFX_LINE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Simple CanvasWidget capable of drawing a line from one point to another point. The end points - * can be moved to new locations and the line width can be set and changed. A 10 pixel - * long line along the top of the screen with a width on 1 pixel has endpoints in (0, - * 0.5) and (10, 0.5) and line width 1. The Line class calculates the corners of the - * shape, which in this case would be (0, 0), (10, 0), (10, 1) and (0, 1) - * and tells CanvasWidgetRenderer to moveTo() the first coordinate and then lineTo() the - * next coordinates in order. Finally it tells CWR to render the inside of the shape - * using the set Painter object. - * - * The Line class caches the four corners of the shape to speed up redrawing. In general, - * drawing lines involve some extra mathematics for calculating the normal vector of the - * line and this computation would slow down re-draws if not cached. - * - * @note All coordinates are internally handled as CWRUtil::Q5 which means that floating point - * values are rounded down to a fixed number of binary digits, for example: - * @code - * Line line; - * line.setStart(1.1f, 1.1f); // Will use (35/32, 35/32) = (1.09375f, 1.09375f) - * int x, y; - * line.getStart(&x, &y); // Will return (1, 1) - * @endcode. - */ -class Line : public CanvasWidget -{ -public: - /** Values that represent line ending styles. */ - enum LINE_ENDING_STYLE - { - BUTT_CAP_ENDING, ///< The line ending is cut 90 degrees at the end of the line - ROUND_CAP_ENDING, ///< The line ending is rounded as a circle with center at the end of the line - SQUARE_CAP_ENDING ///< The line ending is cut 90 degrees, but extends half the width of the line - }; - - Line(); - - /** - * Sets the starting point and ending point of the line. - * - * @tparam T Generic type parameter, either int or float. - * @param startX The x coordinate of the start point. - * @param startY The y coordinate of the start point. - * @param endX The x coordinate of the end point. - * @param endY The y coordinate of the end point. - * - * @see setStart, setEnd - * - * @note The area containing the Line is not invalidated. - */ - template - void setLine(T startX, T startY, T endX, T endY) - { - setStart(startX, startY); - setEnd(endX, endY); - } - - /** - * Sets the starting point of the line. - * - * @tparam T Generic type parameter, either int or float. - * @param x The x coordinate of the start point. - * @param y The y coordinate of the start point. - * - * @see updateStart, getStart, setLine, setEnd - * - * @note The area containing the Line is not invalidated. - */ - template - void setStart(T x, T y) - { - setStart(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Sets the starting point of the line. - * - * @param xQ5 The x coordinate of the start point in Q5 format. - * @param yQ5 The y coordinate of the start point in Q5 format. - * - * @see updateStart, getStart, setLine, setEnd - * - * @note The area containing the Line is not invalidated. - */ - void setStart(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5); - - /** - * Update the start point for this Line. The rectangle that surrounds the line before - * and after will be invalidated. - * - * @tparam T Generic type parameter, either int or float. - * @param x The x coordinate of the start point. - * @param y The y coordinate of the start point. - * - * @see setStart, updateEnd - * - * @note The area containing the Line is invalidated before and after the change. - */ - template - void updateStart(T x, T y) - { - updateStart(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Update the start point for this Line. The rectangle that surrounds the line before - * and after will be invalidated. - * - * @param xQ5 The x coordinate of the start point in CWRUtil::Q5 format. - * @param yQ5 The y coordinate of the start point in CWRUtil::Q5 format. - * - * @see setStart, updateEnd - * - * @note The area containing the Line is invalidated before and after the change. - */ - void updateStart(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5); - - /** - * Gets the starting point of the line as either integers or floats. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] x The x coordinate rounded down to the precision of T. - * @param [out] y The y coordinate rounded down to the precision of T. - * - * @see setStart, setLine - */ - template - void getStart(T& x, T& y) const - { - x = startXQ5.to(); - y = startYQ5.to(); - } - - /** - * Sets the endpoint coordinates of the line. - * - * @tparam T Generic type parameter, either int or float. - * @param x The x coordinate of the end point. - * @param y The y coordinate of the end point. - * - * @see updateEnd, getEnd - * - * @note The area containing the Line is not invalidated. - */ - template - void setEnd(T x, T y) - { - setEnd(CWRUtil::toQ5(x), CWRUtil::toQ5(y)); - } - - /** - * Sets the endpoint coordinates of the line. - * - * @param xQ5 The x coordinate of the end point in Q5 format. - * @param yQ5 The y coordinate of the end point in Q5 format. - * - * @see updateEnd, getEnd - * - * @note The area containing the Line is not invalidated. - */ - void setEnd(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5); - - /** - * Update the endpoint for this Line. The rectangle that surrounds the line before and - * after will be invalidated. - * - * @tparam T Generic type parameter, either int or float. - * @param x The x coordinate of the end point. - * @param y The y coordinate of the end point. - * - * @see setEnd, updateStart - * - * @note The area containing the Line is invalidated before and after the change. - */ - template - void updateEnd(T x, T y) - { - CWRUtil::Q5 xQ5 = CWRUtil::toQ5(x); - CWRUtil::Q5 yQ5 = CWRUtil::toQ5(y); - updateEnd(xQ5, yQ5); - } - - /** - * Update the endpoint for this Line. The rectangle that surrounds the line before and - * after will be invalidated. - * - * @param xQ5 The x coordinate of the end point in Q5 format. - * @param yQ5 The y coordinate of the end point in Q5 format. - * - * @see setEnd, updateStart - * - * @note The area containing the Line is invalidated before and after the change. - */ - void updateEnd(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5); - - /** - * Gets the endpoint coordinates for the line. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] x The x coordinate rounded down to the precision of T. - * @param [out] y The y coordinate rounded down to the precision of T. - * - * @see setEnd, updateEnd - */ - template - void getEnd(T& x, T& y) const - { - x = endXQ5.to(); - y = endYQ5.to(); - } - - /** - * Sets the width for this Line. - * - * @tparam T Generic type parameter, either int or float. - * @param width The width of the line measured in pixels. - * - * @see updateLineWidth - * - * @note The area containing the Line is not invalidated. - */ - template - void setLineWidth(T width) - { - setLineWidth(CWRUtil::toQ5(width)); - } - - /** - * Sets the width for this Line. - * - * @param widthQ5 The width of the line measured in pixels in Q5 format. - * - * @see updateLineWidth - * - * @note The area containing the Line is not invalidated. - */ - void setLineWidth(CWRUtil::Q5 widthQ5) - { - if (lineWidthQ5 == widthQ5) - { - return; - } - - lineWidthQ5 = widthQ5; - - updateCachedShape(); - } - - /** - * Update the width for this Line and invalidates the minimal rectangle surrounding the - * line on screen. - * - * @tparam T Generic type parameter, either int or float. - * @param width The width of the line measured in pixels. - * - * @see setLineWidth - * - * @note The area containing the Line is invalidated before and after the change. - */ - template - void updateLineWidth(T width) - { - updateLineWidth(CWRUtil::toQ5(width)); - } - - /** - * Update the width for this Line. - * - * Update the width for this Line and invalidates the minimal rectangle surrounding the - * line on screen. - * - * @param widthQ5 The width of the line measured in pixels in Q5 format. - * - * @see setLineWidth - * - * @note The area containing the Line is invalidated before and after the change. - */ - void updateLineWidth(CWRUtil::Q5 widthQ5) - { - if (lineWidthQ5 == widthQ5) - { - return; - } - - Rect rectBefore = getMinimalRect(); - invalidateRect(rectBefore); - - lineWidthQ5 = widthQ5; - - updateCachedShape(); - - Rect rectAfter = getMinimalRect(); - invalidateRect(rectAfter); - } - - /** - * Gets line width. - * - * @tparam T Generic type parameter, either int or float. - * @param [out] width The line width rounded down to the precision of T. - * - * @see setLineWidth - */ - template - void getLineWidth(T& width) const - { - width = lineWidthQ5.to(); - } - - /** - * Gets line width. - * - * @tparam T Generic type parameter, either int or float. - * - * @return The line width rounded down to the precision of T. - * - * @see setLineWidth - */ - template - T getLineWidth() const - { - return lineWidthQ5.to(); - } - - /** - * Sets line ending style. The same style is applied to both ends of the line. - * - * @param lineEnding The line ending style. - * - * @see LINE_ENDING_STYLE, getLineEndingStyle - * - * @note The area containing the Line is not invalidated. - */ - void setLineEndingStyle(LINE_ENDING_STYLE lineEnding); - - /** - * Gets line ending style. - * - * @return The line ending style. - * - * @see LINE_ENDING_STYLE, setLineEndingStyle - */ - LINE_ENDING_STYLE getLineEndingStyle() const; - - /** - * Sets a precision of the arc at the ends of the Line. This only works for - * ROUND_CAP_ENDING. The precision is given in degrees where 18 is the default which - * results in a nice half circle with 10 line segments. 90 will draw "an arrow head", - * 180 will look exactly like a BUTT_CAP_ENDING. - * - * @param precision The new ROUND_CAP_ENDING precision. - * - * @note The line is not invalidated. - * @note This is only used if line ending is set to ROUND_CAP_ENDING. - */ - void setCapPrecision(int precision); - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - virtual Rect getMinimalRect() const; - - /** - * Update the end point for this Line given the new length and angle in degrees. The rectangle - * that surrounds the line before and after will be invalidated. The starting coordinates will - * be fixed but the ending point will be updated. This is simply a different way to update the - * ending point. - * - * @param length The new length of the line in Q5 format. - * @param angle The new angle of the line in Q5 format. - * - * @see updateEnd - * - * @note The area containing the Line is invalidated before and after the change. - * @note Angles are given in degrees, so a full circle is 360. - */ - void updateLengthAndAngle(CWRUtil::Q5 length, CWRUtil::Q5 angle); - - virtual void invalidateContent() const; - -private: - CWRUtil::Q5 startXQ5; - CWRUtil::Q5 startYQ5; - CWRUtil::Q5 endXQ5; - CWRUtil::Q5 endYQ5; - CWRUtil::Q5 lineWidthQ5; - LINE_ENDING_STYLE lineEnding; - CWRUtil::Q5 cornerXQ5[4]; - CWRUtil::Q5 cornerYQ5[4]; - Rect minimalRect; - int lineCapArcIncrement; - - void updateCachedShape(); - - Rect rectContainingPoints(const Rect& fullRect, CWRUtil::Q5 x0, CWRUtil::Q5 y0, CWRUtil::Q5 x1, CWRUtil::Q5 y1, CWRUtil::Q5 x2, CWRUtil::Q5 y2) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_LINE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp deleted file mode 100644 index f49fc90..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterABGR2222.hpp - * - * Declares the touchgfx::PainterABGR2222 class. - */ -#ifndef TOUCHGFX_PAINTERABGR2222_HPP -#define TOUCHGFX_PAINTERABGR2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterABGR2222 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterABGR2222 : public AbstractPainterABGR2222, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterABGR2222 class. - * - * @param color (Optional) the color, default is black. - */ - PainterABGR2222(colortype color = 0) - : AbstractPainterABGR2222(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - color8 = LCD8bpp_ABGR2222::getNativeColor(painterColor); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterRed; ///< The red part of the color, used when alpha blending - uint8_t painterGreen; ///< The green part of the color, used when alpha blending - uint8_t painterBlue; ///< The blue part of the color, used when alpha blending - uint8_t color8; ///< Pre-calculated native color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERABGR2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp deleted file mode 100644 index 55a6fd6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterABGR2222Bitmap.hpp - * - * Declares the touchgfx::PainterABGR2222Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERABGR2222BITMAP_HPP -#define TOUCHGFX_PAINTERABGR2222BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterABGR2222Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterABGR2222Bitmap : public AbstractPainterABGR2222, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterABGR2222Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterABGR2222(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterABGR2222::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERABGR2222BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp deleted file mode 100644 index ad1f9b7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterARGB2222.hpp - * - * Declares the touchgfx::PainterARGB2222 class. - */ -#ifndef TOUCHGFX_PAINTERARGB2222_HPP -#define TOUCHGFX_PAINTERARGB2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterARGB2222 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterARGB2222 : public AbstractPainterARGB2222, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterARGB2222 class. - * - * @param color (Optional) the color, default is black. - */ - PainterARGB2222(colortype color = 0) - : AbstractPainterARGB2222(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - color8 = LCD8bpp_ARGB2222::getNativeColor(painterColor); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterRed; ///< The red part of the color, used when alpha blending - uint8_t painterGreen; ///< The green part of the color, used when alpha blending - uint8_t painterBlue; ///< The blue part of the color, used when alpha blending - uint8_t color8; ///< Pre-calculated native color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERARGB2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp deleted file mode 100644 index 58f1248..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterARGB2222Bitmap.hpp - * - * Declares the touchgfx::PainterARGB2222Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERARGB2222BITMAP_HPP -#define TOUCHGFX_PAINTERARGB2222BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterARGB2222Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterARGB2222Bitmap : public AbstractPainterARGB2222, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterARGB2222Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterARGB2222(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterARGB2222::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERARGB2222BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp deleted file mode 100644 index 4e5a66e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterARGB8888.hpp - * - * Declares the touchgfx::PainterARGB8888 class. - */ -#ifndef TOUCHGFX_PAINTERARGB8888_HPP -#define TOUCHGFX_PAINTERARGB8888_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterARGB8888 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterARGB8888 : public AbstractPainterARGB8888, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterARGB8888 class. - * - * @param color (Optional) the color, default is black. - */ - PainterARGB8888(colortype color = 0) - : AbstractPainterARGB8888(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterRed; ///< The red part of the color - uint8_t painterGreen; ///< The green part of the color - uint8_t painterBlue; ///< The blue part of the color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERARGB8888_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp deleted file mode 100644 index 3505a53..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterARGB8888Bitmap.hpp - * - * Declares the touchgfx::PainterARGB8888Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERARGB8888BITMAP_HPP -#define TOUCHGFX_PAINTERARGB8888BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterARGB8888Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterARGB8888Bitmap : public AbstractPainterARGB8888, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterARGB8888Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterARGB8888(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterARGB8888::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - const uint8_t* bitmapExtraData; ///< Pointer to the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERARGB8888BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp deleted file mode 100644 index f7d7205..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.hpp - * - * Declares the touchgfx::PainterARGB8888L8Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERARGB8888L8BITMAP_HPP -#define TOUCHGFX_PAINTERARGB8888L8BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterARGB8888L8Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterARGB8888L8Bitmap : public AbstractPainterARGB8888, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterARGB8888L8Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterARGB8888(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterARGB8888::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - const uint8_t* bitmapCLUT; ///< Pointer to the CLUT - Bitmap::ClutFormat l8format; ///< The l8format read from the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERARGB8888L8BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp deleted file mode 100644 index 6ec052e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterBGRA2222.hpp - * - * Declares the touchgfx::PainterBGRA2222 class. - */ -#ifndef TOUCHGFX_PAINTERBGRA2222_HPP -#define TOUCHGFX_PAINTERBGRA2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterBGRA2222 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterBGRA2222 : public AbstractPainterBGRA2222, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterBGRA2222 class. - * - * @param color (Optional) the color, default is black. - */ - PainterBGRA2222(colortype color = 0) - : AbstractPainterBGRA2222(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - color8 = LCD8bpp_BGRA2222::getNativeColor(painterColor); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterRed; ///< The red part of the color, used when alpha blending - uint8_t painterGreen; ///< The green part of the color, used when alpha blending - uint8_t painterBlue; ///< The blue part of the color, used when alpha blending - uint8_t color8; ///< Pre-calculated native color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERBGRA2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp deleted file mode 100644 index 38af41e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterBGRA2222Bitmap.hpp - * - * Declares the touchgfx::PainterBGRA2222Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERBGRA2222BITMAP_HPP -#define TOUCHGFX_PAINTERBGRA2222BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterBGRA2222Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterBGRA2222Bitmap : public AbstractPainterBGRA2222, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterBGRA2222Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterBGRA2222(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterBGRA2222::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERBGRA2222BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp deleted file mode 100644 index 501eeca..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBW.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterBW.hpp - * - * Declares the touchgfx::PainterBW class. - */ -#ifndef TOUCHGFX_PAINTERBW_HPP -#define TOUCHGFX_PAINTERBW_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterBW is used for drawing one 1bpp displays. The color is either on or off. No - * transparency is supported. - * - * @see AbstractPainter - */ -class PainterBW : public AbstractPainterBW, public AbstractPainterColor -{ -public: - /** - * Constructor. - * - * @param color (Optional) The color. - */ - PainterBW(colortype color = 0) - : AbstractPainterBW(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterBW = LCD1bpp::getNativeColor(color); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterBW; ///< The color to use when painting -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERBW_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp deleted file mode 100644 index 9589d5a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterBWBitmap.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterBWBitmap.hpp - * - * Declares the touchgfx::PainterBWBitmap class. - */ -#ifndef TOUCHGFX_PAINTERBWBITMAP_HPP -#define TOUCHGFX_PAINTERBWBITMAP_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterBWBitmap will take the color for a given point in the shape from a bitmap. Please be - * aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so any - * rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterBWBitmap : public AbstractPainterBW, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterBWBitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterBW(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterBW::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERBWBITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp deleted file mode 100644 index ada3f8e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterGRAY2.hpp - * - * Declares the touchgfx::PainterGRAY2 class. - */ -#ifndef TOUCHGFX_PAINTERGRAY2_HPP -#define TOUCHGFX_PAINTERGRAY2_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterGRAY2 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterGRAY2 : public AbstractPainterGRAY2, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterGRAY2 class. - * - * @param color (Optional) the color, default is black. - */ - - PainterGRAY2(colortype color = 0) - : AbstractPainterGRAY2(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterGray = LCD2bpp::getNativeColor(color); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterGray; ///< The gray color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERGRAY2_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp deleted file mode 100644 index 0b87b7b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterGRAY2Bitmap.hpp - * - * Declares the touchgfx::PainterGRAY2Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERGRAY2BITMAP_HPP -#define TOUCHGFX_PAINTERGRAY2BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterGRAY2Bitmap will take the color for a given point in the shape from a bitmap. Please - * be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so any - * rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterGRAY2Bitmap : public AbstractPainterGRAY2, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterGRAY2Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterGRAY2(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterGRAY2::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - const uint8_t* bitmapExtraData; ///< Pointer to the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERGRAY2BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp deleted file mode 100644 index 9f08684..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterGRAY4.hpp - * - * Declares the touchgfx::PainterGRAY4 class. - */ -#ifndef TOUCHGFX_PAINTERGRAY4_HPP -#define TOUCHGFX_PAINTERGRAY4_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterGRAY4 class allows a shape to be filled with a given color and alpha - * value. This allows transparent, anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterGRAY4 : public AbstractPainterGRAY4, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterGRAY4 class. - * - * @param color (Optional) the color, default is black. - */ - PainterGRAY4(colortype color = 0) - : AbstractPainterGRAY4(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterGray = LCD4bpp::getNativeColor(color); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterGray; ///< The gray color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERGRAY4_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp deleted file mode 100644 index 9dac5a5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterGRAY4Bitmap.hpp - * - * Declares the touchgfx::PainterGRAY4Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERGRAY4BITMAP_HPP -#define TOUCHGFX_PAINTERGRAY4BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterGRAY4Bitmap will take the color for a given point in the shape from a bitmap. Please - * be aware, the the bitmap is used by the CanvasWidgetRendere (not Shape), so any - * rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterGRAY4Bitmap : public AbstractPainterGRAY4, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterGRAY4Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterGRAY4(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterGRAY4::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - const uint8_t* bitmapExtraData; ///< Pointer to the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERGRAY4BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp deleted file mode 100644 index 6ba7287..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB565.hpp - * - * Declares the touchgfx::PainterRGB565 class. - */ -#ifndef TOUCHGFX_PAINTERRGB565_HPP -#define TOUCHGFX_PAINTERRGB565_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterRGB565 class allows a shape to be filled with a given color and alpha - * value. This allows transparent, anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterRGB565 : public AbstractPainterRGB565, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterRGB565 class. - * - * @param color (Optional) the color, default is black. - */ - PainterRGB565(colortype color = 0) - : AbstractPainterRGB565(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - color565 = LCD16bpp::getNativeColor(painterColor); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; - - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::getInstance()->getDMAType() == DMA_TYPE_CHROMART ? HAL::HARDWARE : HAL::SOFTWARE; - } - -protected: - uint16_t color565; ///< The native color in 565 format (for speed reasons) -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB565_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp deleted file mode 100644 index ab1a39c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB565Bitmap.hpp - * - * Declares the touchgfx::PainterRGB565Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERRGB565BITMAP_HPP -#define TOUCHGFX_PAINTERRGB565BITMAP_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterRGB565Bitmap will take the color for a given point in the shape from a bitmap. Please - * be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so any - * rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterRGB565Bitmap : public AbstractPainterRGB565, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterRGB565Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterRGB565(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterRGB565::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; - - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::getInstance()->getDMAType() == DMA_TYPE_CHROMART ? HAL::HARDWARE : HAL::SOFTWARE; - } - -protected: - const uint8_t* bitmapExtraData; ///< Pointer to the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB565BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp deleted file mode 100644 index d1a9c22..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB565L8Bitmap.hpp - * - * Declares the touchgfx::PainterRGB565L8Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERRGB565L8BITMAP_HPP -#define TOUCHGFX_PAINTERRGB565L8BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterRGB565L8Bitmap will take the color for a given point in the shape from a - * bitmap. Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not - * Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not - * applied to the bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterRGB565L8Bitmap : public AbstractPainterRGB565, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterRGB565L8Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterRGB565(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const; - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; - - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::getInstance()->getDMAType() == DMA_TYPE_CHROMART ? HAL::HARDWARE : HAL::SOFTWARE; - } - -protected: - const uint8_t* bitmapCLUT; ///< Pointer to the CLUT - Bitmap::ClutFormat l8format; ///< The l8format read from the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB565L8BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp deleted file mode 100644 index efad0d5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB565LinearGradient.hpp - * - * Declares the touchgfx::PainterRGB565LinearGradient class. - */ -#ifndef TOUCHGFX_PAINTERRGB565LINEARGRADIENT_HPP -#define TOUCHGFX_PAINTERRGB565LINEARGRADIENT_HPP - -#include -#include - -namespace touchgfx -{ -/** - * An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets - * need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide - * the color of a pixel on a given coordinate, which will the be blended into the framebuffer - * depending on the position of the canvas widget and the transparency of the given pixel. - */ -class PainterRGB565LinearGradient : public AbstractPainterLinearGradient -{ -public: - /** Constructor. */ - PainterRGB565LinearGradient() - : AbstractPainterLinearGradient() - { - } - - /** Destructor */ - virtual ~PainterRGB565LinearGradient() - { - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB565LINEARGRADIENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp deleted file mode 100644 index d32a2cc..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB888.hpp - * - * Declares the touchgfx::PainterRGB888 class. - */ -#ifndef TOUCHGFX_PAINTERRGB888_HPP -#define TOUCHGFX_PAINTERRGB888_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterRGB888 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterRGB888 : public AbstractPainterRGB888, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterRGB888 class. - * - * @param color (Optional) the color, default is black. - */ - PainterRGB888(colortype color = 0) - : AbstractPainterRGB888(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; - - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::getInstance()->getDMAType() == DMA_TYPE_CHROMART ? HAL::HARDWARE : HAL::SOFTWARE; - } - -protected: - uint8_t painterRed; ///< The red part of the color - uint8_t painterGreen; ///< The green part of the color - uint8_t painterBlue; ///< The blue part of the color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB888_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp deleted file mode 100644 index 69bb8cf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp - * - * Declares the touchgfx::PainterRGB888Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERRGB888BITMAP_HPP -#define TOUCHGFX_PAINTERRGB888BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterRGB888Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterRGB888Bitmap : public AbstractPainterRGB888, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterRGB888Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterRGB888(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterRGB888::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; - - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::getInstance()->getDMAType() == DMA_TYPE_CHROMART ? HAL::HARDWARE : HAL::SOFTWARE; - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB888BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp deleted file mode 100644 index 59baa74..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB888L8Bitmap.hpp - * - * Declares the touchgfx::PainterRGB888L8Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERRGB888L8BITMAP_HPP -#define TOUCHGFX_PAINTERRGB888L8BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterRGB888L8Bitmap will take the color for a given point in the shape from a - * bitmap. Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not - * Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not - * applied to the bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterRGB888L8Bitmap : public AbstractPainterRGB888, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterRGB888L8Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterRGB888(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const; - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; - - virtual HAL::RenderingMethod getRenderingMethod() const - { - return HAL::getInstance()->getDMAType() == DMA_TYPE_CHROMART ? HAL::HARDWARE : HAL::SOFTWARE; - } - -protected: - const uint8_t* bitmapCLUT; ///< Pointer to the CLUT - Bitmap::ClutFormat l8format; ///< The l8format read from the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB888L8BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp deleted file mode 100644 index 31cbc62..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGB888LinearGradient.hpp - * - * Declares the touchgfx::PainterRGB888LinearGradient class. - */ -#ifndef TOUCHGFX_PAINTERRGB888LINEARGRADIENT_HPP -#define TOUCHGFX_PAINTERRGB888LINEARGRADIENT_HPP - -#include -#include - -namespace touchgfx -{ -/** - * An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets - * need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide - * the color of a pixel on a given coordinate, which will the be blended into the framebuffer - * depending on the position of the canvas widget and the transparency of the given pixel. - */ -class PainterRGB888LinearGradient : public AbstractPainterLinearGradient -{ -public: - /** Destructor. */ - virtual ~PainterRGB888LinearGradient() - { - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - - virtual void tearDown() const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGB888LINEARGRADIENT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp deleted file mode 100644 index 85aad53..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGBA2222.hpp - * - * Declares the touchgfx::PainterRGBA2222 class. - */ -#ifndef TOUCHGFX_PAINTERRGBA2222_HPP -#define TOUCHGFX_PAINTERRGBA2222_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterRGBA2222 class allows a shape to be filled with a given color value. - * This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterRGBA2222 : public AbstractPainterRGBA2222, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterRGBA2222 class. - * - * @param color (Optional) the color, default is black. - */ - PainterRGBA2222(colortype color = 0) - : AbstractPainterRGBA2222(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - color8 = LCD8bpp_RGBA2222::getNativeColor(painterColor); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterRed; ///< The red part of the color, used when alpha blending - uint8_t painterGreen; ///< The green part of the color, used when alpha blending - uint8_t painterBlue; ///< The blue part of the color, used when alpha blending - uint8_t color8; ///< Pre-calculated native color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGBA2222_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp deleted file mode 100644 index f86b7d6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterRGBA2222Bitmap.hpp - * - * Declares the touchgfx::PainterRGBA2222Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERRGBA2222BITMAP_HPP -#define TOUCHGFX_PAINTERRGBA2222BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterRGBA2222Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterRGBA2222Bitmap : public AbstractPainterRGBA2222, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterRGBA2222Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterRGBA2222(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterRGBA2222::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERRGBA2222BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp deleted file mode 100644 index b40c560..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterXRGB8888.hpp - * - * Declares the touchgfx::PainterXRGB8888 class. - */ -#ifndef TOUCHGFX_PAINTERXRGB8888_HPP -#define TOUCHGFX_PAINTERXRGB8888_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * The PainterXRGB8888 class allows a shape to be filled with a given color - * value. This allows anti-aliased elements to be drawn. - * - * @see AbstractPainter - */ -class PainterXRGB8888 : public AbstractPainterARGB8888, public AbstractPainterColor -{ -public: - /** - * Initializes a new instance of the PainterXRGB8888 class. - * - * @param color (Optional) the color, default is black. - */ - PainterXRGB8888(colortype color = 0) - : AbstractPainterARGB8888(), AbstractPainterColor(color) - { - } - - virtual void setColor(colortype color) - { - AbstractPainterColor::setColor(color); - painterRed = Color::getRed(color); - painterGreen = Color::getGreen(color); - painterBlue = Color::getBlue(color); - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - uint8_t painterRed; ///< The red part of the color - uint8_t painterGreen; ///< The green part of the color - uint8_t painterBlue; ///< The blue part of the color -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERXRGB8888_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp deleted file mode 100644 index 5504d33..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterXRGB8888Bitmap.hpp - * - * Declares the touchgfx::PainterXRGB8888Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERXRGB8888BITMAP_HPP -#define TOUCHGFX_PAINTERXRGB8888BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterXRGB8888Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterXRGB8888Bitmap : public AbstractPainterARGB8888, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterXRGB8888Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterARGB8888(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterARGB8888::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERXRGB8888BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp deleted file mode 100644 index 34a5e7c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.hpp - * - * Declares the touchgfx::PainterXRGB8888L8Bitmap class. - */ -#ifndef TOUCHGFX_PAINTERXRGB8888L8BITMAP_HPP -#define TOUCHGFX_PAINTERXRGB8888L8BITMAP_HPP - -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * PainterXRGB8888L8Bitmap will take the color for a given point in the shape from a bitmap. - * Please be aware, the the bitmap is used by the CanvasWidgetRenderer (not Shape), so - * any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied to the - * bitmap as CWR is not aware of this rotation. - * - * @see AbstractPainter - */ -class PainterXRGB8888L8Bitmap : public AbstractPainterARGB8888, public AbstractPainterBitmap -{ -public: - /** - * Constructor. - * - * @param bmp (Optional) The bitmap to use in the painter. - */ - PainterXRGB8888L8Bitmap(const Bitmap& bmp = Bitmap(BITMAP_INVALID)) - : AbstractPainterARGB8888(), AbstractPainterBitmap(bmp) - { - } - - virtual void setBitmap(const Bitmap& bmp); - - virtual bool setup(const Rect& widgetRect) const - { - if (!AbstractPainterARGB8888::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - return bitmap.getId() != BITMAP_INVALID; - } - - virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const; - -protected: - const uint8_t* bitmapCLUT; ///< Pointer to the CLUT - Bitmap::ClutFormat l8format; ///< The l8format read from the bitmap extra data -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_PAINTERXRGB8888L8BITMAP_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp deleted file mode 100644 index 771e829..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/canvas/Shape.hpp +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/canvas/Shape.hpp - * - * Declares the touchgfx::Shape class. - */ -#ifndef TOUCHGFX_SHAPE_HPP -#define TOUCHGFX_SHAPE_HPP - -#include -#include -#include - -namespace touchgfx -{ -/** - * Simple widget capable of drawing a fully filled shape. The shape can be scaled and rotated. - * The Shape class allows the user to draw any shape and allows the defined shape to be - * scaled, rotated and moved freely. Example uses could be the hands of a clock. - * - * @see AbstractShape - */ -template -class Shape : public AbstractShape -{ -public: - virtual int getNumPoints() const - { - return POINTS; - } - - virtual void setCorner(int i, CWRUtil::Q5 x, CWRUtil::Q5 y) - { - if (i >= 0 && i < POINTS) - { - xCorner[i] = x, yCorner[i] = y; - } - } - - virtual CWRUtil::Q5 getCornerX(int i) const - { - if (i >= 0 && i < POINTS) - { - return xCorner[i]; - } - return CWRUtil::toQ5(0); - } - - virtual CWRUtil::Q5 getCornerY(int i) const - { - if (i >= 0 && i < POINTS) - { - return yCorner[i]; - } - return CWRUtil::toQ5(0); - } - -protected: - virtual void setCache(int i, CWRUtil::Q5 x, CWRUtil::Q5 y) - { - if (i >= 0 && i < POINTS) - { - xCache[i] = x, yCache[i] = y; - } - } - - virtual CWRUtil::Q5 getCacheX(int i) const - { - if (i >= 0 && i < POINTS) - { - return xCache[i]; - } - return CWRUtil::toQ5(0); - } - - virtual CWRUtil::Q5 getCacheY(int i) const - { - if (i >= 0 && i < POINTS) - { - return yCache[i]; - } - return CWRUtil::toQ5(0); - } - -private: - CWRUtil::Q5 xCorner[POINTS]; - CWRUtil::Q5 yCorner[POINTS]; - CWRUtil::Q5 xCache[POINTS]; - CWRUtil::Q5 yCache[POINTS]; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_SHAPE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp deleted file mode 100644 index 5461183..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/AbstractDataGraph.hpp +++ /dev/null @@ -1,1900 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/AbstractDataGraph.hpp - * - * Declares classes touchgfx::AbstractDataGraph, touchgfx::AbstractDataGraphWithY and touchgfx::AbstractDataGraphWithXY - */ -#ifndef TOUCHGFX_ABSTRACTDATAGRAPH_HPP -#define TOUCHGFX_ABSTRACTDATAGRAPH_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -class AbstractGraphElement; -class AbstractGraphDecoration; - -/** - * An abstract data graph. This class is the base for other graphs. For specific graphs, please - * refer to those implementation, e.g. GraphScroll, GraphWrapAndClear, GraphWrapAndOverwrite and - * StaticGraph. - */ -class AbstractDataGraph : public Container -{ -public: - /** - * An object of this type is passed with each callback that is sent when the graph is - * clicked. The object contains the data index that was pressed and the details of the click - * event, e.g. PRESSED, RELEASED and screen coordinates. - */ - class GraphClickEvent - { - public: - /** - * Initializes a new instance of the GraphClickEvent class. - * - * @param i The index of the item clicked. - * @param event The ClickEvent that caused the callback to be executed. - * - * @see setClickAction - */ - GraphClickEvent(int16_t i, const ClickEvent& event) - : index(i), clickEvent(event) - { - } - - int16_t index; ///< The index of the item clicked. - const ClickEvent& clickEvent; ///< The ClickEvent that caused the callback to be executed. - }; - - /** - * An object of this type is passed with each callback that is sent when the graph is - * dragged. The object contains the data index that was pressed and the details of the drag - * event, e.g. old and new screen coordinates. - */ - class GraphDragEvent - { - public: - /** - * Initializes a new instance of the GraphDragEvent class. - * - * @param i The index of the item where the drag has ended. - * @param event The DragEvent that caused the callback to be executed. - * - * @see setDragAction - */ - GraphDragEvent(int16_t i, const DragEvent& event) - : index(i), dragEvent(event) - { - } - - int16_t index; ///< The index of the item where the drag has ended. - const DragEvent& dragEvent; ///< The DragEvent that caused the callback to be executed. - }; - - /** - * Initializes a new instance of the AbstractDataGraph class. - * - * @param capacity The capacity, i.e. the number of points in the graph. - */ - AbstractDataGraph(int16_t capacity); - - /** - * Sets a scaling factor to be multiplied on each X value added. Since the graph only stores - * integer values internally, it is possible to set a scale to e.g. 1000 and make the graph - * work as if there are three digits of precision. The addDataPoint() will multiply the x - * argument with the scaling factor and store this value. Please note the addDataPointScaled, - * which allows adding a value that is assumed to have already been multiplied by the - * scaling factor. Other functions exist in a "scaled" version where the arguments are - * assumed to already be scaled. - * - * By setting the scale to 1 it is possible to simply use integer values for the graph. - * - * @param scale The scaling factor. - * @param updateData (Optional) True to update all existing x value. - * - * @see getScaleX, setScaleY, getScaleY - */ - virtual void setScaleX(int scale, bool updateData = false) - { - (void)updateData; // Unused variable - assert(scale != 0); - xScale = scale; - } - - /** - * Gets the scaling factor previously set using setScaleX(). - * - * @return The scaling factor. - * - * @see setScaleX, setScaleY, getScaleY - */ - virtual int getScaleX() const - { - return xScale; - } - - /** - * Sets a scaling factor to be multiplied on each Y value added. Since the graph only stores - * integer values internally, it is possible to set a scale to e.g. 1000 and make the graph - * work as if there are three digits of precision. The addDataPoint() will multiply the y - * argument with the scaling factor and store this value. Please note the addDataPointScaled, - * which allows adding a value that is assumed to have already been multiplied by the - * scaling factor. Other functions exist in a "scaled" version where the arguments are - * assumed to already be scaled. - * - * By setting the scale to 1 it is possible to simply use integer values for the graph. - * - * @param scale The scaling factor. - * @param updateData (Optional) True to update all existing y value. - * - * @see getScaleY, setScaleX, getScaleX - */ - virtual void setScaleY(int scale, bool updateData = false) - { - (void)updateData; // Unused variable - assert(scale != 0); - yScale = scale; - } - - /** - * Gets the scaling factor previously set using setScaleY(). - * - * @return The scaling factor. - * - * @see setScaleY, setScaleX, getScaleX - */ - virtual int getScaleY() const - { - return yScale; - } - - /** - * @copydoc Image::setAlpha() - * - * @note All graph elements have to take this alpha into consideration. - */ - virtual void setAlpha(uint8_t newAlpha) - { - alpha = newAlpha; - } - - /** @copydoc Image::getAlpha() */ - FORCE_INLINE_FUNCTION uint8_t getAlpha() const - { - return alpha; - } - - virtual void setWidth(int16_t width); - - virtual void setHeight(int16_t height); - - /** - * Sets graph position inside the widget by reserving a margin around the graph. These areas - * to the left, the right, above and below are used for drawing optional axis and titles. - * - * @param top The top margin in pixels. - * @param left The left margin in pixels. - * @param right The right margin in pixels. - * @param bottom The bottom margin in pixels. - * - * @see GraphLabelsX, GraphLabelsY, GraphTitle, getGraphAreaMarginTop, getGraphAreaMarginLeft, - * getGraphAreaMarginRight, getGraphAreaMarginBottom, setGraphAreaPadding - * - * @note The graph is automatically invalidated when the graph margins are changed. - */ - void setGraphAreaMargin(int16_t top, int16_t left, int16_t right, int16_t bottom); - - /** - * Gets graph margin top. - * - * @return The graph margin top. - * - * @see setGraphAreaMargin - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaMarginTop() const - { - return topArea.getHeight(); - } - - /** - * Gets graph margin left. - * - * @return The graph margin left. - * - * @see setGraphAreaMargin - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaMarginLeft() const - { - return leftArea.getWidth(); - } - - /** - * Gets graph margin right. - * - * @return The graph margin right. - * - * @see setGraphAreaMargin - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaMarginRight() const - { - return rightArea.getWidth(); - } - - /** - * Gets graph margin bottom. - * - * @return The graph margin bottom. - * - * @see setGraphAreaMargin - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaMarginBottom() const - { - return bottomArea.getHeight(); - } - - /** - * Adds padding around the graph that will not be drawn in (apart from dots, boxes, lines - * etc. that extend around the actual data point). The set padding will also work to make a - * gap between the graph and any labels that might have been added to the graph. To reserve - * an area that the graph will not be drawn in, use setGraphAreaMargin. - * - * @param top The top padding in pixels. - * @param left The left padding in pixels. - * @param right The right padding in pixels. - * @param bottom The bottom padding in pixels. - * - * @see setGraphAreaMargin, getGraphAreaPaddingTop, getGraphAreaPaddingLeft, - * getGraphAreaPaddingRight, getGraphAreaPaddingBottom - * - * @note The graph is automatically invalidated when the margins are set. - */ - void setGraphAreaPadding(int16_t top, int16_t left, int16_t right, int16_t bottom); - - /** - * Gets graph area padding top. - * - * @return The graph area padding top. - * - * @see setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaPaddingTop() const - { - return topPadding; - } - - /** - * Gets graph area padding left. - * - * @return The graph area padding left. - * - * @see setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaPaddingLeft() const - { - return leftPadding; - } - - /** - * Gets graph area padding right. - * - * @return The graph area padding right. - * - * @see setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaPaddingRight() const - { - return rightPadding; - } - - /** - * Gets graph area padding bottom. - * - * @return The graph area padding bottom. - * - * @see setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaPaddingBottom() const - { - return bottomPadding; - } - - /** - * Gets graph area width. This is the width of the actual graph area and is the same as the - * width of the graph widget minus margin and padding. - * - * @return The graph area width. - * - * @see setGraphAreaMargin, setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaWidth() const - { - return graphArea.getWidth() - (leftPadding + rightPadding); - } - - /** - * Gets graph area width including padding (but not margin). This is the width of the actual - * graph area and is the same as the width of the graph widget minus margin. - * - * @return The graph width including graph padding. - * - * @see setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaWidthIncludingPadding() const - { - return graphArea.getWidth(); - } - - /** - * Gets graph area height. This is the height of the actual graph area and is the same as - * the height of the graph widget minus margin and padding. - * - * @return The graph area height. - * - * @see setGraphAreaMargin, setGraphAreaPadding - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaHeight() const - { - return graphArea.getHeight() - (topPadding + bottomPadding); - } - - /** - * Gets graph area height including padding (but not margin). This is the height of the - * actual graph area and is the same as the height of the graph widget minus margin. - * - * @return The graph area height including graph padding. - * - * @see setGraphAreaMargin - */ - FORCE_INLINE_FUNCTION int16_t getGraphAreaHeightIncludingPadding() const - { - return graphArea.getHeight(); - } - - /** - * Sets minimum and maximum x and y coordinate ranges for the graph. This can be used to - * zoom in or out and only show parts of the graph. The range given is scaled. - * - * @param xMin The minimum x value. - * @param xMax The maximum x value. - * @param yMin The minimum y value. - * @param yMax The maximum y value. - * - * @see setScaleX, setScaleY, setGraphRangeX, setGraphRangeY, setGraphRangeXAuto, - * setGraphRangeYAuto, setGraphRangeScaled - */ - FORCE_INLINE_FUNCTION void setGraphRange(int xMin, int xMax, int yMin, int yMax) - { - setGraphRangeX(xMin, xMax); - setGraphRangeY(yMin, yMax); - } - - /** - * @copydoc AbstractDataGraph::setGraphRange(int, int, int, int) - */ - FORCE_INLINE_FUNCTION void setGraphRange(int xMin, int xMax, float yMin, float yMax) - { - setGraphRangeX(xMin, xMax); - setGraphRangeY(yMin, yMax); - } - - /** - * @copydoc AbstractDataGraph::setGraphRange(int, int, int, int) - */ - FORCE_INLINE_FUNCTION void setGraphRange(float xMin, float xMax, int yMin, int yMax) - { - setGraphRangeX(xMin, xMax); - setGraphRangeY(yMin, yMax); - } - - /** - * @copydoc AbstractDataGraph::setGraphRange(int, int, int, int) - */ - FORCE_INLINE_FUNCTION void setGraphRange(float xMin, float xMax, float yMin, float yMax) - { - setGraphRangeX(xMin, xMax); - setGraphRangeY(yMin, yMax); - } - - /** - * Same as setGraphRange(int, int, int, int) except the passed arguments are assumed scaled. - * This means that if the scale is 1000, a value of 1 is interpreted as 0.001 (i.e. 1/1000). - * - * @param xMin The minimum x value. - * @param xMax The maximum x value. - * @param yMin The minimum y value. - * @param yMax The maximum y value. - * - * @see setGraphRange - */ - FORCE_INLINE_FUNCTION void setGraphRangeScaled(int xMin, int xMax, int yMin, int yMax) - { - setGraphRangeXScaled(xMin, xMax); - setGraphRangeYScaled(yMin, yMax); - } - - /** - * Sets minimum and maximum x coordinates for the graph. This can be used to zoom in or out - * and only show parts of the graph. - * - * @param min The minimum x value. - * @param max The maximum x value. - * - * @note The graph as well as the area above and below are automatically redrawn (invalidated). - */ - virtual void setGraphRangeX(int min, int max) - { - setGraphRangeXScaled(int2scaledX(min), int2scaledX(max)); - } - - /** @copydoc AbstractDataGraph::setGraphRangeX(int, int) */ - virtual void setGraphRangeX(float min, float max) - { - setGraphRangeXScaled(float2scaledX(min), float2scaledX(max)); - } - - /** - * @copydoc AbstractDataGraph::setGraphRangeX(int, int) - * - * @see setGraphRangeX - * - * @note The arguments are assumed scaled. This means that if the scale is 1000, a value of 1 - * is interpreted as 0.001 (i.e. 1/1000). - */ - virtual void setGraphRangeXScaled(int min, int max); - - /** - * Automatically adjust min and max x coordinate to show entire graph. It is possible to - * ensure that the y axis (i.e. x=0) is included in the new range. If the graph range is - * changed as a consequence of calling this function, the graph is automatically redrawn - * (invalidated). - * - * @param showYaxis (Optional) True to ensure that the y axis is visible (default is true). - * @param margin (Optional) The margin to add above/below the max/min x value (default is - * no margin). - * - * @see setGraphRangeXAuto, setGraphRangeXAutoScaled, setGraphRangeYAuto, - * setGraphRangeYAutoScaled - * - * @note This takes the currently visible y coordinate range into account. - * @note If data in the graph is changed, added or deleted, the graph range is not - * automatically recalculated. Call this function again to achieve this functionality. - */ - virtual void setGraphRangeXAuto(bool showYaxis = true, int margin = 0) - { - setGraphRangeXAutoScaled(showYaxis, int2scaledX(margin)); - } - - /** @copydoc AbstractDataGraph::setGraphRangeXAuto(bool, int) */ - virtual void setGraphRangeXAuto(bool showYaxis, float margin) - { - setGraphRangeXAutoScaled(showYaxis, float2scaledX(margin)); - } - - /** - * @copydoc AbstractDataGraph::setGraphRangeXAuto(bool, int) - * - * @note The arguments are assumed scaled. This means that if the scale is 1000, a value of 1 - * is interpreted as 0.001 (i.e. 1/1000). - */ - virtual void setGraphRangeXAutoScaled(bool showYaxis, int margin) = 0; - - /** - * Sets minimum and maximum y coordinates for the graph. This can be used to zoom in or out - * and only show parts of the graph. - * - * @param min The minimum y value. - * @param max The maximum y value. - * - * @note The graph as well as the area to the left and to the right of the graph are - * automatically redrawn (invalidated) - */ - virtual void setGraphRangeY(int min, int max) - { - setGraphRangeYScaled(int2scaledY(min), int2scaledY(max)); - } - - /** - * @copydoc AbstractDataGraph::setGraphRangeY(int, int) - */ - virtual void setGraphRangeY(float min, float max) - { - setGraphRangeYScaled(float2scaledY(min), float2scaledY(max)); - } - - /** - * Same as setGraphRangeY(int, int) except the passed arguments are assumed scaled. - * - * @param min The minimum y value. - * @param max The maximum y value. - * - * @see setGraphRangeY - */ - virtual void setGraphRangeYScaled(int min, int max); - - /** - * Automatic adjust min and max y coordinate to show entire graph. It is possible to ensure - * that the x axis (i.e. y=0) is included in the new range. If the graph range is changed, - * the graph is automatically redrawn (invalidated). - * - * @param showXaxis True to ensure that the x axis is visible (default is true). - * @param margin The margin to add above/below the max/min y value (default is no margin). - * - * @note This takes the current visible x coordinate range into account. - */ - virtual void setGraphRangeYAutoScaled(bool showXaxis, int margin) = 0; - - /** @copydoc AbstractDataGraph::setGraphRangeYAutoScaled(bool, int) */ - virtual void setGraphRangeYAuto(bool showXaxis = true, int margin = 0) - { - setGraphRangeYAutoScaled(showXaxis, int2scaledY(margin)); - } - - /** @copydoc AbstractDataGraph::setGraphRangeYAutoScaled(bool, int) */ - virtual void setGraphRangeYAuto(bool showXaxis, float margin) - { - setGraphRangeYAutoScaled(showXaxis, float2scaledY(margin)); - } - - /** - * Gets minimum x value for the graph. - * - * @return The minimum x value. - */ - virtual int getGraphRangeXMinAsInt() const - { - return scaled2intX(graphRangeMinX); - } - - /** - * Gets minimum x value for the graph. - * - * @return The minimum x value. - */ - virtual float getGraphRangeXMinAsFloat() const - { - return scaled2floatX(graphRangeMinX); - } - - /** - * @copydoc AbstractDataGraph::getGraphRangeXMinAsInt() - * - * @return The graph range x coordinate minimum scaled. - * - * @see AbstractDataGraph::getGraphRangeXMinAsInt, AbstractDataGraph::getGraphRangeXMinAsFloat - * - * @note The returned value is left scaled. - */ - virtual int getGraphRangeXMinScaled() const - { - return graphRangeMinX; - } - - /** - * Gets maximum x value for the graph. - * - * @return The maximum x value. - */ - virtual int getGraphRangeXMaxAsInt() const - { - return scaled2intX(graphRangeMaxX); - } - - /** - * Gets maximum x value for the graph. - * - * @return The maximum x value. - */ - virtual float getGraphRangeXMaxAsFloat() const - { - return scaled2floatX(graphRangeMaxX); - } - - /** - * @copydoc AbstractDataGraph::getGraphRangeXMaxAsInt() - * - * @return The graph range x coordinate maximum scaled. - * - * @see AbstractDataGraph::getGraphRangeXMaxAsInt, AbstractDataGraph::getGraphRangeXMaxAsFloat - * - * @note The returned value is left scaled. - */ - virtual int getGraphRangeXMaxScaled() const - { - return graphRangeMaxX; - } - - /** - * Gets minimum y value for the graph. - * - * @return The minimum y value. - */ - virtual int getGraphRangeYMinAsInt() const - { - return scaled2intY(graphRangeMinY); - } - - /** - * Gets minimum y value for the graph. - * - * @return The minimum y value. - */ - virtual float getGraphRangeYMinAsFloat() const - { - return scaled2floatY(graphRangeMinY); - } - - /** - * @copydoc AbstractDataGraph::getGraphRangeYMinAsInt() - * - * @see AbstractDataGraph::getGraphRangeYMinAsInt, AbstractDataGraph::getGraphRangeYMinAsFloat - * - * @note The returned value is left scaled. - */ - virtual int getGraphRangeYMinScaled() const - { - return graphRangeMinY; - } - - /** - * Gets maximum y value for the graph. - * - * @return The maximum y value. - */ - virtual int getGraphRangeYMaxAsInt() const - { - return scaled2intY(graphRangeMaxY); - } - - /** - * Gets maximum y value for the graph. - * - * @return The maximum y value. - */ - virtual float getGraphRangeYMaxAsFloat() const - { - return scaled2floatY(graphRangeMaxY); - } - - /** - * @copydoc AbstractDataGraph::getGraphRangeYMaxAsInt() - * - * @see AbstractDataGraph::getGraphRangeYMaxAsInt, AbstractDataGraph::getGraphRangeYMaxAsFloat - * - * @note The returned value is left scaled. - */ - virtual int getGraphRangeYMaxScaled() const - { - return graphRangeMaxY; - } - - /** - * Clears the graph to its blank/initial state. The graph is invalidated so that the empty - * graph will be drawn after a call to clear. - */ - virtual void clear(); - - /** - * Makes gap before the specified index. This can be used to split a graph in two, but for - * some graph types, e.g. histograms, this has no effect. Only one gap can be specified at a - * time. Specifying a new gap automatically removes the previous gap. - * - * @param index Zero-based index where the gap should be placed. - */ - FORCE_INLINE_FUNCTION void setGapBeforeIndex(int16_t index) - { - gapBeforeIndex = index; - } - - /** - * Gets gap before index as set using setGapBeforeIndex(). - * - * @return The gap before index. - * - * @see setGapBeforeIndex - */ - FORCE_INLINE_FUNCTION int16_t getGapBeforeIndex() const - { - return gapBeforeIndex; - } - - /** - * Adds a graph element which will display the graph. Several graph elements can be added. - * Examples of graph elements are lines, dots, histograms as well as horizontal and vertical - * grid lines. - * - * @param [in] d an AbstractGraphElement to add. - * - * @see GraphElementGridX, GraphElementGridY, GraphElementArea, GraphElementBoxes, - * GraphElementDiamonds, GraphElementDots, GraphElementHistogram, GraphElementLine, - */ - void addGraphElement(AbstractGraphElement& d); - - /** - * Adds an element to be shown in the area above the graph. Labels and titles can be added - * here. - * - * @param [in] d an AbstractGraphElement to add. - * - * @see GraphLabelsX, GraphTitle - */ - void addTopElement(AbstractGraphDecoration& d); - - /** - * Adds an element to be shown in the area to the left of the graph. Labels and titles can - * be added here. - * - * @param [in] d an AbstractGraphElement to add. - * - * @see GraphLabelsY, GraphTitle - */ - void addLeftElement(AbstractGraphDecoration& d); - - /** - * Adds an element to be shown in the area to the right of the graph. Labels and titles can - * be added here. - * - * @param [in] d an AbstractGraphElement to add. - * - * @see GraphLabelsY, GraphTitle - */ - void addRightElement(AbstractGraphDecoration& d); - - /** - * Adds an element to be shown in the area below the graph. Labels and titles can be added - * here. - * - * @param [in] d an AbstractGraphElement to add. - * - * @see GraphLabelsX, GraphTitle - */ - void addBottomElement(AbstractGraphDecoration& d); - - /** - * Gets the number of point used by the graph. - * - * @return The number of point used by the graph. - */ - FORCE_INLINE_FUNCTION int16_t getUsedCapacity() const - { - return usedCapacity; - } - - /** - * Gets the capacity (max number of points) of the graph. - * - * @return The capacity. - */ - FORCE_INLINE_FUNCTION int16_t getMaxCapacity() const - { - return maxCapacity; - } - - /** - * Gets graph index nearest to the given screen position. The distance to each point on the - * graph is measured and the index of the point closest to the given position handed back. - * - * @param x The x value. - * @param y The y value. - * @param [out] index Zero-based index of the point closest to the given position. - * - * @return True if it succeeds, false if it fails. - * - * @see getNearestIndexForScreenX - */ - virtual bool getNearestIndexForScreenXY(int16_t x, int16_t y, int16_t& index); - - /** - * Gets graph index nearest to the given screen x value. The index of the graph point - * closest to the given x coordinate is handed back. - * - * @param x The x value. - * @param [out] index Zero-based index of the. - * - * @return True if it succeeds, false if it fails. - * - * @see getNearestIndexForScreenXY - */ - virtual bool getNearestIndexForScreenX(int16_t x, int16_t& index) const; - - /** - * Get the screen x coordinate for the given graph point index. - * - * @param index Zero-based index of the point. - * - * @return The screen x value. - */ - FORCE_INLINE_FUNCTION int16_t indexToScreenX(int16_t index) const - { - return indexToScreenXQ5(index).round(); - } - - /** - * Get the screen y coordinate for the given graph point index. - * - * @param index Zero-based index of the point. - * - * @return The screen x value. - */ - FORCE_INLINE_FUNCTION int16_t indexToScreenY(int16_t index) const - { - return indexToScreenYQ5(index).round(); - } - - /** - * Gets data point x coordinate as int. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point x coordinate as int. - * - * @see indexToDataPointXAsFloat, indexToDataPointXScaled, indexToDataPointYAsInt, indexToDataPoint - */ - FORCE_INLINE_FUNCTION int indexToDataPointXAsInt(int16_t index) const - { - return scaled2intX(indexToDataPointXScaled(index)); - } - - /** - * Gets data point x coordinate as float. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point x coordinate as float. - * - * @see indexToDataPointXAsInt, indexToDataPointXScaled, indexToDataPointYAsFloat, indexToDataPoint - */ - FORCE_INLINE_FUNCTION float indexToDataPointXAsFloat(int16_t index) const - { - return scaled2floatX(indexToDataPointXScaled(index)); - } - - /** - * Gets data point x coordinate scaled. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point x coordinate scaled. - * - * @see indexToDataPointXAsInt, indexToDataPointXAsFloat, indexToDataPointYScaled, indexToDataPoint, - * indexToDataPointScaled - */ - virtual int indexToDataPointXScaled(int16_t index) const = 0; - - /** - * Gets data point y coordinate as int. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point y coordinate as int. - * - * @see indexToDataPointYAsFloat, indexToDataPointYScaled, indexToDataPointXAsInt, indexToDataPoint - */ - FORCE_INLINE_FUNCTION int indexToDataPointYAsInt(int16_t index) const - { - return scaled2intY(indexToDataPointYScaled(index)); - } - - /** - * Gets data point y coordinate as float. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point y coordinate as float. - * - * @see indexToDataPointYAsInt, indexToDataPointYScaled, indexToDataPointXAsFloat, indexToDataPoint - */ - FORCE_INLINE_FUNCTION float indexToDataPointYAsFloat(int16_t index) const - { - return scaled2floatY(indexToDataPointYScaled(index)); - } - - /** - * Gets data point y coordinate scaled. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point y coordinate scaled. - * - * @see indexToDataPointYAsInt, indexToDataPointYAsFloat, indexToDataPointXScaled, indexToDataPoint, - * indexToDataPointScaled - */ - virtual int indexToDataPointYScaled(int16_t index) const = 0; - - /** - * Gets data point as integer values. - * - * @param index Zero-based index of the values to fetch. - * @param [out] xvalue The x value. - * @param [out] yvalue The y value. - * - * @see indexToDataPointXAsInt, indexToDataPointYAsInt, indexToDataPointScaled - */ - FORCE_INLINE_FUNCTION void indexToDataPoint(int16_t index, int& xvalue, int& yvalue) const - { - xvalue = indexToDataPointXAsInt(index); - yvalue = indexToDataPointYAsInt(index); - } - - /** - * Gets data point as floating point values. - * - * @param index Zero-based index of the values to fetch. - * @param [out] xvalue The x value. - * @param [out] yvalue The y value. - * - * @see indexToDataPointXAsFloat, indexToDataPointYAsFloat, indexToDataPointScaled - */ - FORCE_INLINE_FUNCTION void indexToDataPoint(int16_t index, float& xvalue, float& yvalue) const - { - xvalue = indexToDataPointXAsFloat(index); - yvalue = indexToDataPointYAsFloat(index); - } - - /** - * Gets data point as raw (scaled) values. - * - * @param index Zero-based index of the values to fetch. - * @param [out] xvalue The x value. - * @param [out] yvalue The y value. - */ - FORCE_INLINE_FUNCTION void indexToDataPointScaled(int16_t index, int& xvalue, int& yvalue) const - { - xvalue = indexToDataPointXScaled(index); - yvalue = indexToDataPointYScaled(index); - } - - /** - * Sets an action to be executed when the graph is clicked. - * - * @param callback The callback. - * - * @see GraphClickEvent - */ - FORCE_INLINE_FUNCTION void setClickAction(GenericCallback& callback) - { - clickAction = &callback; - } - - /** - * Sets an action to be executed when the graph is dragged. - * - * @param callback The callback. - * - * @see GraphDragEvent - */ - FORCE_INLINE_FUNCTION void setDragAction(GenericCallback& callback) - { - dragAction = &callback; - } - - virtual void handleClickEvent(const ClickEvent& event); - - virtual void handleDragEvent(const DragEvent& event); - - /** - * Multiply an integer value with a constant. - * - * @param i the value to scale. - * @param scale The scale. - * - * @return The product of the two numbers. - */ - FORCE_INLINE_FUNCTION static int int2scaled(int i, int scale) - { - return i * scale; - } - - /** - * Same as int2scaled(int, int) using the graph's x scale. - * - * @param i The integer value to scale. - * - * @return The scaled integer. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION int int2scaledX(int i) const - { - return int2scaled(i, xScale); - } - - /** - * Same as int2scaled(int, int) using the graph's y scale. - * - * @param i The integer value to scale. - * - * @return The scaled integer. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION int int2scaledY(int i) const - { - return int2scaled(i, yScale); - } - - /** - * Multiply a floating point value with a constant and round the result. - * - * @param f the value to scale. - * @param scale The scale. - * - * @return The product of the two numbers, rounded to nearest integer value. - */ - FORCE_INLINE_FUNCTION static int float2scaled(float f, int scale) - { - const float fs = f * (float)scale; - if (fs >= 0) - { - return (int)(fs + 0.5f); - } - return ((int)fs - 1) + (int)(1.5f + (fs - (float)(int)fs)); - } - - /** - * Same as float2scaled(float, int) using the graph's x scale. - * - * @param f The floating point value to scale. - * - * @return The scaled value. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION int float2scaledX(float f) const - { - return float2scaled(f, xScale); - } - - /** - * Same as float2scaled(float, int) using the graph's y scale. - * - * @param f The floating point value to scale. - * - * @return The scaled value. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION int float2scaledY(float f) const - { - return float2scaled(f, yScale); - } - - /** - * Divide an integer with a constant and round the result. - * - * @param i The number to divide. - * @param scale The divisor (scale). - * - * @return The number divided by the scale, rounded to nearest integer. - */ - FORCE_INLINE_FUNCTION static int scaled2int(int i, int scale) - { - if (i >= 0) - { - return ((i * 2 + scale) / scale) / 2; - } - return -(((-i * 2 + scale - 1) / scale) / 2); - } - - /** - * Same as scaled2int(int, int) using the graph's x scale. - * - * @param i The scaled value to convert to an integer. - * - * @return The unscaled value. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION int scaled2intX(int i) const - { - return scaled2int(i, xScale); - } - - /** - * Same as scaled2int(int, int) using the graph's y scale. - * - * @param i The scaled value to convert to an integer. - * - * @return The unscaled value. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION int scaled2intY(int i) const - { - return scaled2int(i, yScale); - } - - /** - * Divide a floating point number with a constant. - * - * @param i The number to divide. - * @param scale The divisor (scale). - * - * @return The number divided by the scale. - */ - FORCE_INLINE_FUNCTION static float scaled2float(int i, int scale) - { - return (float)i / (float)scale; - } - - /** - * Same as scaled2float(int, int) using the graph's x scale. - * - * @param i The scaled value to convert to a floating point value. - * - * @return The unscaled value. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION float scaled2floatX(int i) const - { - return scaled2float(i, xScale); - } - - /** - * Same as scaled2float(int, int) using the graph's y scale. - * - * @param i The scaled value to convert to a floating point value. - * - * @return The unscaled value. - * - * @note For internal use. - */ - FORCE_INLINE_FUNCTION float scaled2floatY(int i) const - { - return scaled2float(i, yScale); - } - - /** - * Converts a value from one scale to another scale. This would convert eg. 21 in scale 10 to - * 210 in scale 100 or to 2 in scale 1. - * - * @param value The value to convert to another scale. - * @param oldScale The old (current) scale of the value. - * @param newScale The new scale that the value should be converted to. - * - * @return The given data converted to a new scale. - */ - static int convertToNewScale(int value, int oldScale, int newScale); - - /** Invalidate content. */ - virtual void invalidateContent() const - { - if (alpha > 0) - { - Container::invalidateContent(); - } - } - -protected: - uint8_t alpha; ///< The alpha of the entire graph - int xScale; ///< The data scale for the x values - int yScale; ///< The data scale for the y values - Container graphArea; ///< The graph area (the center area) - Container leftArea; ///< The area to the left of the graph - Container rightArea; ///< The area to the right of the graph - Container topArea; ///< The area above the graph - Container bottomArea; ///< The area below the graph - int16_t topPadding; ///< The graph area top padding - int16_t leftPadding; ///< The graph area left padding - int16_t rightPadding; ///< The graph area right padding - int16_t bottomPadding; ///< The graph area bottom padding - int16_t maxCapacity; ///< Maximum number of points in the graph - int16_t usedCapacity; ///< The number of used points in the graph - int16_t gapBeforeIndex; ///< The graph is disconnected (there is a gap) before this element index. - - GenericCallback* clickAction; ///< The callback to be executed when this Graph is clicked - GenericCallback* dragAction; ///< The callback to be executed when this Graph is dragged - - int graphRangeMinX; ///< The graph range minimum x coordinate - int graphRangeMaxX; ///< The graph range maximum x coordinate - int graphRangeMinY; ///< The graph range minimum y coordinate - int graphRangeMaxY; ///< The graph range maximum y coordinate - - /** - * Invalidate point at a given index. This will call the function invalidateGraphPointAt() - * on every element added to the graphArea which in turn is responsible for invalidating the - * part of the screen occupied by its element. - * - * @param index Zero-based index of the element to invalidate. - */ - void invalidateGraphPointAt(int16_t index); - - /** - * Invalidate entire graph area (the center of the graph). This is often useful when a graph - * is cleared or the X or Y range is changed. - */ - FORCE_INLINE_FUNCTION void invalidateGraphArea() const - { - graphArea.invalidate(); - } - - /** - * Invalidate x axis point at the given index. Since the y axis is often static, the x axis - * can change, and all labels need to be updated without redrawing the entire graph. - * - * @param index The x index to invalidate. - * - * @see invalidateAllXAxisPoints - */ - void invalidateXAxisPointAt(int16_t index); - - /** - * Invalidate all x axis points. Similar to invalidateXAxisPointAt, this function will - * iterate all visible x values and invalidate them in turn. - * - * @see invalidateXAxisPointAt - */ - void invalidateAllXAxisPoints(); - - /** - * Updates the position of all elements in all area after a change in size of the graph area - * and/or label padding. - * - * @note The entire graph area is invalidated. - */ - void updateAreasPosition(); - - /** - * Convert the given valueScaled (index) to x axis value. - * - * @param valueScaled The value scaled. - * @param labelScaled The label scaled. - * - * @return The x axis value. - */ - virtual int indexToXAxis(const int valueScaled, const int labelScaled) const = 0; - - /** - * Gets screen x coordinate for an absolute value. - * - * @param x The x value. - * - * @return The screen x coordinate for the given value. - */ - virtual CWRUtil::Q5 valueToScreenXQ5(int x) const - { - return CWRUtil::muldiv_toQ5(x - graphRangeMinX, getGraphAreaWidth() - 1, graphRangeMaxX - graphRangeMinX) + CWRUtil::toQ5(leftPadding); - } - - /** - * Gets screen y coordinate for an absolute value. - * - * @param y The y value. - * - * @return The screen y coordinate for the given value. - */ - virtual CWRUtil::Q5 valueToScreenYQ5(int y) const - { - const int16_t graphAreaHeight = getGraphAreaHeight(); - return CWRUtil::toQ5(graphAreaHeight + topPadding - 1) - CWRUtil::muldiv_toQ5(y - graphRangeMinY, graphAreaHeight - 1, graphRangeMaxY - graphRangeMinY); - } - - /** - * Gets screen x coordinate for a specific data point added to the graph. - * - * @param index The index of the element to get the x coordinate for. - * - * @return The screen x coordinate for the specific data point. - */ - virtual CWRUtil::Q5 indexToScreenXQ5(int16_t index) const = 0; - - /** - * Gets screen y coordinate for a specific data point added to the graph. - * - * @param index The index of the element to get the y coordinate for. - * - * @return The screen x coordinate for the specific data point. - */ - virtual CWRUtil::Q5 indexToScreenYQ5(int16_t index) const = 0; - - /** - * Gets index range for screen x coordinate range taking the current graph range into - * account. - * - * @param xMin The low screen x coordinate. - * @param xMax The high screen x coordinate. - * @param [out] indexMin The low element index. - * @param [out] indexMax The high element index. - * - * @return True if the range from low index to high index is legal. - * - * @note For internal use. - */ - virtual bool xScreenRangeToIndexRange(int16_t xMin, int16_t xMax, int16_t& indexMin, int16_t& indexMax) const = 0; - - /** An abstract graph element. */ - friend class AbstractGraphElement; -}; - -/** - * Abstract helper class used to implement graphs with the same distance between the x values - * (i.e. x is ignored). - */ -class DynamicDataGraph : public AbstractDataGraph -{ -public: - /** - * Initializes a new instance of the AbstractDataGraphWithY class. - * - * @param capacity The capacity. - * @param [in] values Address where to store the y values of the graph. - */ - DynamicDataGraph(int16_t capacity, int* values) - : AbstractDataGraph(capacity), xAxisFactor(1), xAxisOffset(0), yValues(values), dataCounter(0) - { - DynamicDataGraph::setGraphRangeX(0, capacity - 1); - } - - /** - * Sets a scaling factor to be multiplied on each added element. Since the graph only stores - * integer values internally, it is possible to set a scale to e.g. 1000 and make the graph - * work as if there are three digits of precision. The addDataPoint() will multiply the - * argument with the scaling factor and store this value. - * - * By setting the scale to 1 it is possible to simply use integer values for the graph. - * - * @param scale The scaling factor. - * @param updateData (Optional) True to update all existing y value. - * - * @see getScale - * - * @note The current xAxisFactor, xAxisOffet and xGraphRange values are updated to reflect the - * new scale being set. - */ - virtual void setScale(int scale, bool updateData = false) - { - setScaleX(scale, updateData); - setScaleY(scale, updateData); - } - - /** - * Gets the scaling factor previously set using setScale(). - * - * @return The scaling factor. - * - * @see setScale - */ - virtual int getScale() const - { - return getScaleY(); - } - - /** - * Adds a new data point to the end of the graph. The part of the graph that is changed, is - * automatically redrawn (invalidated). - * - * @param y The new data point. - * - * @return The index of the just added value. - */ - FORCE_INLINE_FUNCTION int16_t addDataPoint(int y) - { - return addDataPointScaled(int2scaledY(y)); - } - - /** @copydoc addDataPoint(int) */ - FORCE_INLINE_FUNCTION int16_t addDataPoint(float y) - { - return addDataPointScaled(float2scaledY(y)); - } - - /** - * @copydoc addDataPoint(int) - * - * @return The index of the added data point. - * - * @note The y value must already be scaled. - */ - int16_t addDataPointScaled(int y); - - /** - * Gets the minimum x coordinate for the graph. - * - * @return The minimum x coordinate . - */ - virtual int getGraphRangeXMin() const - { - return getGraphRangeXMinScaled(); - } - - /** - * Gets the maximum x coordinate for the graph. - * - * @return The maximum x coordinate . - */ - virtual int getGraphRangeXMax() const - { - return getGraphRangeXMaxScaled(); - } - - virtual void setGraphRangeYAutoScaled(bool showXaxis, int margin); - - virtual void setGraphRangeXAutoScaled(bool /*showYaxis*/, int margin) - { - setGraphRangeXScaled(-scaled2intX(margin), (usedCapacity - 1) + scaled2intX(margin)); - } - - /// @cond - TOUCHGFX_DEPRECATED("Please use setXAxisFactor()", virtual void setXAxisScale(int scale)) - { - setXAxisFactor(scale); - } - - /// @endcond - - /** - * Set x coordinate axis factor value. This is the real x value increment between two data - * points added to the graph. - * - * @param factor The x axis factor. - */ - virtual void setXAxisFactor(int factor) - { - setXAxisFactorScaled(int2scaledX(factor)); - } - - /// @cond - TOUCHGFX_DEPRECATED("Please use setXAxisFactor()", virtual void setXAxisScale(float scale)) - { - setXAxisFactor(scale); - } - - /// @endcond - - /** @copydoc setXAxisFactor(int) */ - virtual void setXAxisFactor(float factor) - { - setXAxisFactorScaled(float2scaledX(factor)); - } - - /** - * Set x coordinate axis factor value using a pre-scaled value. This is the real x value - * increment between two data points added to the graph. - * - * @param factor The x axis factor. - * - * @see setXAxisFactorScaled,setXAxisFactor - */ - virtual void setXAxisFactorScaled(int factor) - { - xAxisFactor = factor; - } - - /// @cond - TOUCHGFX_DEPRECATED("Please use getXAxisFactorAsInt()", virtual int getXAxisScaleAsInt() const) - { - return getXAxisFactorAsInt(); - } - - /// @endcond - - /** - * Get x coordinate axis factor value. This is the real x value increment between two data - * points added to the graph. - * - * @return The x axis factor. - */ - virtual int getXAxisFactorAsInt() const - { - return scaled2intX(getXAxisFactorScaled()); - } - - /// @cond - TOUCHGFX_DEPRECATED("Please use getXAxisFactorAsFloat()", virtual float getXAxisScaleAsFloat() const) - { - return getXAxisFactorAsFloat(); - } - - /// @endcond - - /** @copydoc getXAxisFactorAsInt() */ - virtual float getXAxisFactorAsFloat() const - { - return scaled2floatX(getXAxisFactorScaled()); - } - - /** - * Get x axis factor as a scaled value. - * - * @return The x axis factor (scaled). - * - * @see getXAxisFactorAsInt, getXAxisFactorAsFloat, setXAxisFactor - */ - virtual int getXAxisFactorScaled() const - { - return xAxisFactor; - } - - /** - * Set x coordinate axis offset value. This is the real x value of the first data point - * added to the graph (i.e. the data point at index 0). - * - * @param offset The x axis offset. - */ - virtual void setXAxisOffset(int offset) - { - setXAxisOffsetScaled(int2scaledX(offset)); - } - - /** @copydoc setXAxisOffset(int) */ - virtual void setXAxisOffset(float offset) - { - setXAxisOffsetScaled(float2scaledX(offset)); - } - - /** - * Set x coordinate axis offset value with a pre-scaled offset value. This is the real x - * value of the first data point added to the graph (i.e. the data point at index 0). - * - * @param offset The x axis offset. - * - * @see setXAxisOffset - * - * @see setXAxisOffset, getXAxisOffsetScaled - */ - virtual void setXAxisOffsetScaled(int offset) - { - xAxisOffset = offset; - } - - /** - * Get x coordinate axis offset value. This is the real x value of the first data point - * added to the graph (i.e. the data point at index 0). - * - * @return The x axis offset. - */ - virtual int getXAxisOffsetAsInt() const - { - return scaled2intX(getXAxisOffsetScaled()); - } - - /** @copydoc getXAxisOffsetAsInt() */ - virtual float getXAxisOffsetAsFloat() const - { - return scaled2floatX(getXAxisOffsetScaled()); - } - - /** - * Get x axis offset as a scaled value. - * - * @return The x axis offset (scaled). - * - * @see getXAxisOffsetAsInt, getXAxisOffsetAsFloat, setXAxisOffsetScaled, setXAxisOffset - */ - virtual int getXAxisOffsetScaled() const - { - return xAxisOffset; - } - - virtual int indexToDataPointXScaled(int16_t index) const - { - assert(index >= 0 && index < usedCapacity); - return (indexToGlobalIndex(index) * xAxisFactor) + xAxisOffset; - } - - virtual int indexToDataPointYScaled(int16_t index) const - { - assert(index >= 0 && index < usedCapacity); - return yValues[dataIndex(index)]; - } - -protected: - int xAxisFactor; ///< The axis scale (real distance between two indices) - int xAxisOffset; ///< The x axis offset (real value of data point at index 0) - int* yValues; ///< The values of the graph - uint32_t dataCounter; ///< The data counter of how many times addDataPoint() has been called - - /** - * This function is called before a new value (data point) is added. This allows for - * invalidation to be calculated based on the global data counter before it is increased as - * a result of adding the new point. - */ - virtual void beforeAddValue() - { - } - - /** - * Adds a value to the internal data array and keeps track of when graph points, graph axis - * and the entire graph needs to be redrawn (invalidated). - * - * @param value The value to add to the array. - * - * @return The index of the newly added value. - */ - virtual int16_t addValue(int value) = 0; - - /** - * Get the data index in the yValues array of the given screen index. Normally this is just - * the 'i' but e.g. GraphScrollData does not, for performance reasons. - * - * @param screenIndex Zero-based screen index. - * - * @return The index in the yValues array. - */ - virtual int16_t dataIndex(int16_t screenIndex) const - { - return screenIndex; - } - - /** - * Convert an index to global index. The index is the index of any data point, The global - * index is a value that keeps growing whenever a new data point is added the the graph. - * - * @param index Zero-based index of the point. - * - * @return The global index. - */ - virtual int32_t indexToGlobalIndex(int16_t index) const - { - return (int32_t)index; - } - - virtual int indexToXAxis(const int valueScaled, const int /*labelScaled*/) const - { - // Value is also index for these types of graphs. - return (indexToGlobalIndex(scaled2intX(valueScaled)) * xAxisFactor) + xAxisOffset; - } - - virtual bool xScreenRangeToIndexRange(int16_t xMin, int16_t xMax, int16_t& indexMin, int16_t& indexMax) const; - - virtual void setScaleX(int scale, bool updateData = false); - - virtual int getScaleX() const - { - return AbstractDataGraph::getScaleX(); - } - - virtual void setScaleY(int scale, bool updateData = false); - - virtual int getScaleY() const - { - return AbstractDataGraph::getScaleY(); - } - - /// @cond - TOUCHGFX_DEPRECATED("Please use setXAxisFactorScaled()", virtual void setXAxisScaleScaled(int scale)) - { - setXAxisFactorScaled(scale); - } - - /// @endcond - - /// @cond - TOUCHGFX_DEPRECATED("Please use getXAxisFactorScaled()", virtual int getXAxisScaleScaled() const) - { - return getXAxisFactorScaled(); - } - - /// @endcond - - virtual CWRUtil::Q5 indexToScreenXQ5(int16_t index) const - { - return valueToScreenXQ5(int2scaledX(index)); - } - - virtual CWRUtil::Q5 indexToScreenYQ5(int16_t index) const - { - return valueToScreenYQ5(yValues[dataIndex(index)]); - } -}; - -/** - * Abstract helper class used to implement graphs with the same distance between the x values - * (i.e. x is ignored). - */ -class StaticDataGraph : public AbstractDataGraph -{ -public: - /** - * Initializes a new instance of the AbstractDataGraphWithY class. - * - * @param capacity The capacity. - * @param [in] xvalues Address where to store the x values of the graph. - * @param [in] yvalues Address where to store the y values of the graph. - */ - StaticDataGraph(int16_t capacity, int* xvalues, int* yvalues) - : AbstractDataGraph(capacity), xValues(xvalues), yValues(yvalues) - { - StaticDataGraph::setGraphRangeX(0, capacity - 1); - } - - virtual void setScaleX(int scale, bool updateData = false); - - virtual void setScaleY(int scale, bool updateData = false); - - /** - * Adds a new data point to the end of the graph. The part of the graph that is changed, is - * automatically redrawn (invalidated). - * - * @param x The x value. - * @param y The y value. - * - * @return The index of the just added value. - */ - FORCE_INLINE_FUNCTION int16_t addDataPoint(int x, int y) - { - return addValue(int2scaledX(x), int2scaledY(y)); - } - - /** @copydoc addDataPoint(int, int) */ - FORCE_INLINE_FUNCTION int16_t addDataPoint(float x, float y) - { - return addValue(float2scaledX(x), float2scaledY(y)); - } - - /** - * @copydoc addDataPoint(int, int) - * - * @return The index of the added data point. - * - * @note Same as addDataPoint(int, int) except the passed argument is assumed scaled. - */ - FORCE_INLINE_FUNCTION int16_t addDataPointScaled(int x, int y) - { - return addValue(x, y); - } - - /** - * Gets data point x coordinate scaled. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point x coordinate scaled. - * - * @see indexToDataPointXAsInt, indexToDataPointXAsFloat, indexToDataPointYScaled, - * indexToDataPoint, indexToDataPointScaled - */ - virtual int indexToDataPointXScaled(int16_t index) const - { - assert(index >= 0 && index < usedCapacity); - return xValues[index]; - } - - /** - * Gets data point y coordinate scaled. - * - * @param index Zero-based index of the value to fetch. - * - * @return The data point y coordinate scaled. - * - * @see indexToDataPointYAsInt, indexToDataPointYAsFloat, indexToDataPointXScaled, - * indexToDataPoint, indexToDataPointScaled - */ - virtual int indexToDataPointYScaled(int16_t index) const - { - assert(index >= 0 && index < usedCapacity); - return yValues[index]; - } - - /** - * Deletes the data point at the given x value. - * - * @param x The x value. - * - * @return The index of the deleted value, -1 if the x coordinate was not found. - */ - FORCE_INLINE_FUNCTION int deleteDataPoint(int x) - { - return deleteDataPointScaled(int2scaledX(x)); - } - - /** @copydoc deleteDataPoint(int)*/ - FORCE_INLINE_FUNCTION int deleteDataPoint(float x) - { - return deleteDataPointScaled(float2scaledX(x)); - } - - /** - * Same as dalateDataPoint(int) except the passed argument is assumed scaled. Deletes a data - * point scaled. - * - * @param x The x value. - * - * @return The index of the deleted value, -1 if the x coordinate was not found. - */ - FORCE_INLINE_FUNCTION int16_t deleteDataPointScaled(int x) - { - return deleteValue(x); - } - - /** - * Same as deleteDataPoint(int) except the passed argument is the index of the value to - * delete. Deletes a data point. - * - * @param index Zero-based index of the values to delete. - * - * @return The index of the deleted value, -1 if the x coordinate was not found. - */ - FORCE_INLINE_FUNCTION int16_t deleteDataPointIndex(int index) - { - return deleteIndex(index); - } - - /** - * Sets graph range x coordinate automatic scaled. - * - * @param showYaxis True to show, false to hide the y axis. - * @param margin The margin. - */ - virtual void setGraphRangeXAutoScaled(bool showYaxis, int margin); - - /** - * Sets graph range y coordinate automatic scaled. - * - * @param showXaxis (Optional) True to show, false to hide the x axis. - * @param margin (Optional) The margin. - */ - virtual void setGraphRangeYAutoScaled(bool showXaxis = true, int margin = 0); - -protected: - int* xValues; ///< The x values of the graph - int* yValues; ///< The y values of the graph - - /** - * Adds a value to the internal data array and keeps track of when graph points, graph axis - * and the entire graph needs to be redrawn (invalidated). - * - * @param xvalue The x value to add to the array. - * @param yvalue The y value to add to the array. - * - * @return The index of the newly added value, or -1 if the value could not be added. - */ - virtual int16_t addValue(int xvalue, int yvalue) = 0; - - /** - * Removes a value from the internal data array and keeps track of when graph points, graph - * axis and the entire graph needs to be redrawn (invalidated). - * - * @param xvalue The x value to remove from the array. - * - * @return The index of the removed value, or -1 if the value could not be removed. - */ - virtual int16_t deleteValue(int xvalue); - - /** - * Removes a value from the internal data array and keeps track of when graph points, graph - * axis and the entire graph needs to be redrawn (invalidated). - * - * @param index Zero-based index of the data point to delete. - * - * @return The index of the removed value, or -1 if the value could not be removed. - */ - virtual int16_t deleteIndex(int index); - - virtual int indexToXAxis(const int /*valueScaled*/, const int labelScaled) const - { - return labelScaled; - } - - virtual bool xScreenRangeToIndexRange(int16_t xMin, int16_t xMax, int16_t& indexMin, int16_t& indexMax) const; - - virtual CWRUtil::Q5 indexToScreenXQ5(int16_t index) const - { - return valueToScreenXQ5(xValues[index]); - } - - virtual CWRUtil::Q5 indexToScreenYQ5(int16_t index) const - { - return valueToScreenYQ5(yValues[index]); - } -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_ABSTRACTDATAGRAPH_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp deleted file mode 100644 index 10f8963..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/Graph.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/Graph.hpp - * - * Declares the touchgfx::GraphData and touchgfx::Graph classes. - */ -#ifndef TOUCHGFX_GRAPH_HPP -#define TOUCHGFX_GRAPH_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The GraphData will show a graph of data points, drawn from lower x valut to highest x value. - */ -class GraphData : public StaticDataGraph -{ -public: - /** - * Initializes a new instance of the GraphWrapAndOverwriteData class. - * - * @param capacity The capacity. - * @param [in] xvalues Pointer to memory with room for capacity x values. - * @param [in] yvalues Pointer to memory with room for capacity y values. - */ - GraphData(int16_t capacity, int* xvalues, int* yvalues) - : StaticDataGraph(capacity, xvalues, yvalues) - { - } - -protected: - virtual int16_t addValue(int xvalue, int yvalue); -}; - -/** - * The Graph will show a graph of data points, drawn from lower x valut to highest x value. - * - * @tparam CAPACITY The maximum number of data points on the graph. - */ -template -class Graph : public GraphData -{ -public: - Graph() - : GraphData(CAPACITY, x, y) - { - } - -private: - int x[CAPACITY]; - int y[CAPACITY]; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GRAPH_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp deleted file mode 100644 index ab4f9f3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphElements.hpp +++ /dev/null @@ -1,1191 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/GraphElements.hpp - * - * Declares the various graph element classes. Instances of these classes can be added to a graph. - */ -#ifndef TOUCHGFX_GRAPHELEMENTS_HPP -#define TOUCHGFX_GRAPHELEMENTS_HPP - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** - * An abstract graph element. Declares a couple of useful functions to help subclasses which use - * CWR (Canvas Widget Renderer). - */ -class AbstractGraphElement : public CanvasWidget -{ -public: - /** Default constructor. */ - AbstractGraphElement() - : CanvasWidget() - { - } - - /** - * Invalidate the point at the given index. This allows a graph element to only invalidate - * the minimum rectangle required for the given index. The Graph will call this function - * before and after changing a point to ensure that both the old and the new area are - * redrawn (invalidated). - * - * @param index Zero-based index of the point. - */ - virtual void invalidateGraphPointAt(int16_t index) = 0; - -protected: - /** - * Gets a pointer to the the graph containing the GraphElement. - * - * @return A pointer to the graph. - */ - FORCE_INLINE_FUNCTION AbstractDataGraph* getGraph() const - { - return parent ? (AbstractDataGraph*)(parent->getParent()) : (AbstractDataGraph*)0; - } - - /** - * Gets graph screen x for x value. - * - * @param graph The graph. - * @param x The x value. - * - * @return The graph screen x for value. - */ - FORCE_INLINE_FUNCTION CWRUtil::Q5 valueToScreenXQ5(const AbstractDataGraph* graph, int x) const - { - return graph->valueToScreenXQ5(x); - } - - /** - * Gets graph screen y for y value. - * - * @param graph The graph. - * @param y The y value. - * - * @return The graph screen y for value. - */ - FORCE_INLINE_FUNCTION CWRUtil::Q5 valueToScreenYQ5(const AbstractDataGraph* graph, int y) const - { - return graph->valueToScreenYQ5(y); - } - - /** - * Gets screen x coordinate for a specific data point added to the graph. - * - * @param graph The graph. - * @param index The index of the element to get the x coordinate for. - * - * @return The screen x coordinate for the specific data point. - */ - FORCE_INLINE_FUNCTION CWRUtil::Q5 indexToScreenXQ5(const AbstractDataGraph* graph, int16_t index) const - { - return graph->indexToScreenXQ5(index); - } - - /** - * Gets screen y coordinate for a specific data point added to the graph. - * - * @param graph The graph. - * @param index The index of the element to get the y coordinate for. - * - * @return The screen x coordinate for the specific data point. - */ - FORCE_INLINE_FUNCTION CWRUtil::Q5 indexToScreenYQ5(const AbstractDataGraph* graph, int16_t index) const - { - return graph->indexToScreenYQ5(index); - } - - /** - * Gets graph element range for screen x coordinate range. - * - * @param graph The graph. - * @param xMin The low X. - * @param xMax The high X. - * @param [out] indexMin The low index. - * @param [out] indexMax The high index. - * - * @return True if it succeeds, false if it fails. - */ - FORCE_INLINE_FUNCTION bool xScreenRangeToIndexRange(const AbstractDataGraph* graph, int16_t xMin, int16_t xMax, int16_t& indexMin, int16_t& indexMax) const - { - return graph->xScreenRangeToIndexRange(xMin, xMax, indexMin, indexMax); - } - - /** - * Find the screen rectangle containing the Q5 screen rectangle by rounding the coordinates - * up/down. - * - * @param screenXminQ5 The minimum screen x coordinate (in Q5). - * @param screenYminQ5 The maximum screen y coordinate (in Q5). - * @param screenXmaxQ5 The minimum screen x coordinate (in Q5). - * @param screenYmaxQ5 The maximum screen y coordinate (in Q5). - * - * @return A Rect containing the Q5 rectangle. - */ - Rect rectFromQ5Coordinates(CWRUtil::Q5 screenXminQ5, CWRUtil::Q5 screenYminQ5, CWRUtil::Q5 screenXmaxQ5, CWRUtil::Q5 screenYmaxQ5) const; - - /** - * Find the screen rectangle around a given point with the specified diameter. - * - * @param xQ5 The screen x coordinate (in Q5). - * @param yQ5 The screen y coordinate (in Q5). - * @param diameterQ5 The diameter (in Q5). - * - * @return A Rect containing the point (and diameter). - */ - Rect rectAround(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5, CWRUtil::Q5 diameterQ5) const; - - /** - * Round the given CWRUtil::Q5 to the nearest integer and return it as a CWRUtil::Q5 instead - * of an integer. - * - * @param q5 The CWRUtil::Q5 value to round. - * - * @return The nearest integer as a CWRUtil::Q5 value. - */ - FORCE_INLINE_FUNCTION CWRUtil::Q5 roundQ5(CWRUtil::Q5 q5) const - { - return CWRUtil::toQ5(q5.round()); - } - - /** - * Converts the value to the proper X scale of the graph. - * - * @param graph The graph. - * @param value The value. - * @param scale The scale. - * - * @return The given data converted to a graph scale x coordinate. - */ - FORCE_INLINE_FUNCTION int convertToGraphScaleX(const AbstractDataGraph* graph, int value, int scale) const - { - return AbstractDataGraph::convertToNewScale(value, scale, graph->getScaleX()); - } - - /** - * Converts the value to the proper Y scale of the graph. - * - * @param graph The graph. - * @param value The value. - * @param scale The scale. - * - * @return The given data converted to a graph scale y coordinate. - */ - FORCE_INLINE_FUNCTION int convertToGraphScaleY(const AbstractDataGraph* graph, int value, int scale) const - { - return AbstractDataGraph::convertToNewScale(value, scale, graph->getScaleY()); - } - - /** - * @copydoc AbstractDataGraph::indexToXAxis - * - * @param graph The graph. - * - * @return The x axis value. - */ - FORCE_INLINE_FUNCTION int getIndexToXAxis(const AbstractDataGraph* graph, const int valueScaled, const int labelScaled) const - { - return graph->indexToXAxis(valueScaled, labelScaled); - } - - /** - * Query if the center of a given data point index is visible inside the graph area. - * - * @param graph The graph. - * @param index The data point index. - * - * @return True if center invisible, false if not. - */ - bool isCenterInvisible(const AbstractDataGraph* graph, int16_t index) const; -}; - -/** - * An abstract graph element. Declares a couple of useful functions to help subclasses which do - * not use CWR (Canvas Widget Renderer). - */ -class AbstractGraphElementNoCWR : public AbstractGraphElement -{ -public: - AbstractGraphElementNoCWR() - : color(0) - { - } - - /** - * Sets the color of the graph element. - * - * @param newColor The new color. - * - * @see getColor - */ - virtual void setColor(colortype newColor) - { - color = newColor; - } - - /** - * Gets the color of the graph element. - * - * @return The color. - * - * @see setColor - */ - virtual colortype getColor() const - { - return color; - } - - virtual bool drawCanvasWidget(const Rect&) const - { - return true; - } - -protected: - colortype color; ///< The currently assigned color - - /** - * Normalize rectangle by changing a rectangle with negative width or height to a rectangle - * with positive width or height at the correct position. - * - * @param [in,out] r The rectangle. - */ - void normalizeRect(Rect& r) const; - -private: - virtual void setPainter(AbstractPainter& /*painter*/) - { - } -}; - -/** - * GraphElementGridBase is a helper class used to implement classed to draw grid lines in the - * graph. - */ -class GraphElementGridBase : public AbstractGraphElementNoCWR -{ -public: - /** Default constructor. */ - GraphElementGridBase() - : dataScale(1), gridInterval(10), lineWidth(1), majorGrid(0) - { - } - - virtual void draw(const Rect& invalidatedArea) const; - - /** - * Sets a scaling factor to be multiplied on the grid interval. Any already set grid interval - * will be updated to the new correctly scaled value. To avoid this, use setIntervalScaled() - * after setting scale. - * - * @param scale The scaling factor. - * - * @see getScale - */ - FORCE_INLINE_FUNCTION void setScale(int scale) - { - assert(scale != 0); - gridInterval = AbstractDataGraph::convertToNewScale(gridInterval, dataScale, scale); - dataScale = scale; - } - - /** - * Gets the scaling factor set using setScale. - * - * @return The scaling factor. - * - * @see setScale - */ - FORCE_INLINE_FUNCTION int getScale() const - { - return dataScale; - } - - /** - * Sets the interval between each grid line. - * - * @param interval The interval between each grid line. - * - * @see getIntervalAsInt, getIntervalAsFloat, setMajorGrid - * - * @note If interval is 0 only the axis is shown. - */ - FORCE_INLINE_FUNCTION void setInterval(int interval) - { - setIntervalScaled(abs(interval) * dataScale); - } - - /** @copydoc setInterval(int) */ - FORCE_INLINE_FUNCTION void setInterval(float interval) - { - setIntervalScaled(AbstractDataGraph::float2scaled(abs(interval), dataScale)); - } - - /** - * @copydoc setInterval(int) - * - * @note The interval set here must already be scaled. - */ - FORCE_INLINE_FUNCTION void setIntervalScaled(int interval) - { - gridInterval = abs(interval); - } - - /** - * Gets the interval between each grid line. - * - * @return The interval between each grid line. - * - * @see setInterval - */ - FORCE_INLINE_FUNCTION int getIntervalAsInt() const - { - return AbstractDataGraph::scaled2int(getIntervalScaled(), dataScale); - } - - /** @copydoc getIntervalAsInt() */ - FORCE_INLINE_FUNCTION float getIntervalAsFloat() const - { - return AbstractDataGraph::scaled2float(getIntervalScaled(), dataScale); - } - - /** - * @copydoc getIntervalAsInt() - * - * @note The interval returned here is left unscaled. - */ - FORCE_INLINE_FUNCTION int getIntervalScaled() const - { - return gridInterval; - } - - /** - * Sets "major" grid that will be responsible for drawing major grid lines. If a grid line - * would be drawn at the same position as the major grid line, the grid line will not be - * drawn. - * - * @param major Reference to a major grid line object. - */ - FORCE_INLINE_FUNCTION void setMajorGrid(const GraphElementGridBase& major) - { - majorGrid = &major; - } - - /** - * Sets line width of the grid lines. - * - * @param width The width of the grid lines. - * - * @see getLineWidth - */ - FORCE_INLINE_FUNCTION void setLineWidth(uint8_t width) - { - lineWidth = width; - } - - /** - * Gets line width. - * - * @return The line width. - * - * @see setLineWidth - */ - FORCE_INLINE_FUNCTION uint8_t getLineWidth() const - { - return lineWidth; - } - - virtual void invalidateGraphPointAt(int16_t) - { - } - - /** - * Gets correctly scaled minor interval, as the minor grid may have a scale that differs the - * scale of the graph and this grid line. - * - * @param graph The graph. - * - * @return The correctly scaled minor interval. - */ - virtual int getCorrectlyScaledGridInterval(const AbstractDataGraph* graph) const = 0; - - /** - * Gets correctly scaled major interval, as the major grid may have a scale that differs the - * scale of the graph and this grid line. - * - * @param graph The graph. - * - * @return The correctly scaled major interval. - */ - virtual int getCorrectlyScaledMajorInterval(const AbstractDataGraph* graph) const - { - return majorGrid == 0 ? 0 : majorGrid->getCorrectlyScaledGridInterval(graph); - } - -protected: - int dataScale; ///< The scaling factor - int gridInterval; ///< The grid line interval. - uint8_t lineWidth; ///< Width of the line. - const GraphElementGridBase* majorGrid; ///< A pointer to a major grid, if any - - /** - * Draw vertical line using LCD::fillRect and handles negative dimensions properly. - * - * @param invalidatedArea The invalidated area to intersect the line with. - * @param start The start coordinate (offset from edge). - * @param length The length of the line. - * @param pos The start coordinate (distance in span). - * @param width The width of the line. - * @param a The alpha of the line. - */ - virtual void drawLine(const Rect& invalidatedArea, int16_t start, int16_t length, int16_t pos, int16_t width, uint8_t a) const; - - /** - * Return the enclosing area for the grid lines. Vertical lines are allowed to go a bit to - * the left and right, but not above or below. Vice versa for horizontal gridlines. - * - * @param graph The graph. - * - * @return A Rect which the grid lines should be inside. - */ - virtual Rect enclosingArea(const AbstractDataGraph* graph) const = 0; - - /** - * Return the specific rectangle for line. - * - * @param start The start (distance from the border). - * @param length The length (length of the line). - * @param pos The position (horizonal offset for vertical lines, vertical offset for - * horizontal lines). - * @param width The (line) width. - * - * @return A Rect. - */ - virtual Rect lineRect(int16_t start, int16_t length, int16_t pos, int16_t width) const = 0; - - /** - * Gets graph range minimum x/y scaled. - * - * @param graph The graph. - * - * @return The graph range minimum scaled. - */ - virtual int getGraphRangeMinScaled(const AbstractDataGraph* graph) const = 0; - - /** - * Gets graph range maximum x/y scaled. - * - * @param graph The graph. - * - * @return The graph range maximum scaled. - */ - virtual int getGraphRangeMaxScaled(const AbstractDataGraph* graph) const = 0; - - /** - * Gets graph area start (distance from the border). - * - * @param graph The graph. - * - * @return The graph area start (distance from the border). - */ - virtual int getGraphAreaStart(const AbstractDataGraph* graph) const = 0; - - /** - * Gets graph area length (distance from border to border). - * - * @param graph The graph. - * - * @return The graph area length (distance from border to border. - */ - virtual int getGraphAreaLength(const AbstractDataGraph* graph) const = 0; - - /** - * Gets graph area start position. Horizontal offset of first vertical line or vertical - * offset of first horizontal line. - * - * @param graph The graph. - * - * @return The graph area start position. Horizontal offset of first vertical line or - * vertical offset og first horizontal line. - */ - virtual int getGraphAreaStartPos(const AbstractDataGraph* graph) const = 0; - - /** - * Gets graph area end position. Horizontal offset of last vertical line or vertical offset - * of last horizontal line. - * - * @param graph The graph. - * - * @return The graph area end position. Horizontal offset of last vertical line or vertical - * offset of last horizontal line. - */ - virtual int getGraphAreaEndPos(const AbstractDataGraph* graph) const = 0; - - /** - * The graph value to the correct screen coordinate in Q5. - * - * @param graph The graph. - * @param value The value. - * - * @return The graph value to the correct screen coordinate in Q5. - */ - virtual CWRUtil::Q5 valueToScreenQ5(const AbstractDataGraph* graph, int value) const = 0; -}; - -/** - * GraphElementGridX draws vertical lines at selected intervals along the x axis. By combining - * two GraphElementGridX instances, it is possible to have minor and major grid lines. - * - * @note The grid lines are drawn using LCD::fillRect for higher performance. - */ -class GraphElementGridX : public GraphElementGridBase -{ -public: - virtual int getCorrectlyScaledGridInterval(const AbstractDataGraph* graph) const - { - return convertToGraphScaleX(graph, gridInterval, dataScale); - } - -protected: - virtual Rect enclosingArea(const AbstractDataGraph* graph) const - { - return Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()); - } - - virtual Rect lineRect(int16_t start, int16_t length, int16_t pos, int16_t width) const - { - return Rect(pos, start, width, length); - } - - virtual int getGraphRangeMinScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeXMinScaled(); - } - - virtual int getGraphRangeMaxScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeXMaxScaled(); - } - - virtual int getGraphAreaStart(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaPaddingTop(); - } - - virtual int getGraphAreaLength(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaHeight(); - } - - virtual int getGraphAreaStartPos(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaPaddingLeft(); - } - - virtual int getGraphAreaEndPos(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaWidth(); - } - - virtual CWRUtil::Q5 valueToScreenQ5(const AbstractDataGraph* graph, int value) const - { - return valueToScreenXQ5(graph, value); - } -}; - -/** - * GraphElementGridY draws horizontal lines at selected intervals along the y axis. By combining - * two GraphElementGridY instances, it is possible to have minor and major grid lines. - * - * @note The grid lines are drawn using LCD::fillRect for higher performance. - */ -class GraphElementGridY : public GraphElementGridBase -{ -public: - virtual int getCorrectlyScaledGridInterval(const AbstractDataGraph* graph) const - { - return convertToGraphScaleY(graph, gridInterval, dataScale); - } - -protected: - virtual Rect enclosingArea(const AbstractDataGraph* graph) const - { - return Rect(graph->getGraphAreaPaddingLeft(), 0, graph->getGraphAreaWidth(), graph->getGraphAreaHeightIncludingPadding()); - } - - virtual Rect lineRect(int16_t start, int16_t length, int16_t pos, int16_t width) const - { - return Rect(start, pos, length, width); - } - - virtual int getGraphRangeMinScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeYMinScaled(); - } - - virtual int getGraphRangeMaxScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeYMaxScaled(); - } - - virtual int getGraphAreaStart(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaPaddingLeft(); - } - - virtual int getGraphAreaLength(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaWidth(); - } - - virtual int getGraphAreaStartPos(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaPaddingTop(); - } - - virtual int getGraphAreaEndPos(const AbstractDataGraph* graph) const - { - return graph->getGraphAreaHeight(); - } - - virtual CWRUtil::Q5 valueToScreenQ5(const AbstractDataGraph* graph, int value) const - { - return valueToScreenYQ5(graph, value); - } -}; - -/** - * GraphElementArea will fill the area below the line connecting the data points in the graph. - * - * @note The Area is drawn using Canvas Widget Renderer which is slower but produces much nicer - * graphics. - */ -class GraphElementArea : public AbstractGraphElement -{ -public: - GraphElementArea() - : dataScale(1), yBaseline(0) - { - } - - /** - * Sets a scaling factor to be multiplied on the baseline. Any already set baseline will be - * updated to the new correctly scaled value. To avoid this, use setBaselineScaled() - * after setting scale. - * - * @param scale The scaling factor. - * - * @see getScale - */ - FORCE_INLINE_FUNCTION void setScale(int scale) - { - assert(scale != 0); - yBaseline = AbstractDataGraph::convertToNewScale(yBaseline, dataScale, scale); - dataScale = scale; - } - - /** - * Gets the scaling factor set using setScale. - * - * @return The scaling factor. - * - * @see setScale - */ - FORCE_INLINE_FUNCTION int getScale() const - { - return dataScale; - } - - /** - * Sets the base of the area drawn. Normally, the base is 0 which means that the area is - * drawn below positive y values and above negative y values. Setting the base to a very - * high number will cause the area above the graph to be drawn. Setting the base to a very - * low number will cause the area below the graph to be drawn (even for negative numbers, - * which are higher than the base value). - * - * @param baseline The baseline value. - * - * @see getBaselineAsInt, getBaselineAsFloat - */ - FORCE_INLINE_FUNCTION void setBaseline(int baseline) - { - setBaselineScaled(baseline * dataScale); - } - - /** @copydoc setBaseline(int) */ - FORCE_INLINE_FUNCTION void setBaseline(float baseline) - { - setBaselineScaled(AbstractDataGraph::float2scaled(baseline, dataScale)); - } - - /** - * @copydoc setBaseline(int) - * - * @note The baseline set here must already be scaled. - */ - FORCE_INLINE_FUNCTION void setBaselineScaled(int baseline) - { - yBaseline = baseline; - } - - /** - * Gets the base previously set using setBase. - * - * @return The base value. - * - * @see setBaseline - */ - FORCE_INLINE_FUNCTION int getBaselineAsInt() const - { - return AbstractDataGraph::scaled2int(getBaselineScaled(), dataScale); - } - - /** @copydoc getBaselineAsInt() */ - FORCE_INLINE_FUNCTION float getBaselineAsFloat() const - { - return AbstractDataGraph::scaled2float(getBaselineScaled(), dataScale); - } - - /** - * @copydoc getBaselineAsInt() - * - * @note The baseline returned here is left unscaled. - */ - FORCE_INLINE_FUNCTION int getBaselineScaled() const - { - return yBaseline; - } - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - int dataScale; ///< The scaling factor - int yBaseline; ///< The base value. -}; - -/** - * GraphElementLine will draw a line with a given thickness through the data points in the graph. - * - * @note The Line is drawn using Canvas Widget Renderer which is slower but produces much nicer - * graphics. - */ -class GraphElementLine : public AbstractGraphElement -{ -public: - GraphElementLine() - : lineWidth(2) - { - } - - /** - * Sets line width. - * - * @param width The width. - * - * @see getLineWidth - */ - FORCE_INLINE_FUNCTION void setLineWidth(uint8_t width) - { - lineWidth = width; - } - - /** - * Gets line width. - * - * @return The line width. - * - * @see setLineWidth - */ - FORCE_INLINE_FUNCTION uint8_t getLineWidth() const - { - return lineWidth; - } - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - uint8_t lineWidth; ///< Width of the line - - /** - * Draw a line between all indexes in the given range. This is used where there is a gap in - * the graph and the line has to be drawn as two separate lines. - * - * @param [in] canvas The canvas. - * @param graph The graph. - * @param indexMin The minimum index. - * @param indexMax The maximum index. - */ - void drawIndexRange(Canvas& canvas, const AbstractDataGraph* graph, int16_t indexMin, int16_t indexMax) const; -}; - -/** - * The GraphElementVerticalGapLine is used to draw a vertical line where the gap in the graph - * is. This only makes sense to add to a GraphWrapAndOverwrite (or GraphWrapAndOverwriteData). - * - * @note The vertical line is drawn using LCD::fillRect for higher performance. - */ -class GraphElementVerticalGapLine : public AbstractGraphElementNoCWR -{ -public: - /** - * Sets the width of the gap line in pixels. If the gap line is set to 0 the gap line will - * extend to the next point in the graph. - * - * @param width The width. - * - * @see getGapLineWidth - */ - FORCE_INLINE_FUNCTION void setGapLineWidth(uint16_t width) - { - lineWidth = width; - } - - /** - * Gets the width of the gap line as set using setGapLineWidth(). - * - * @return The gap line width. - */ - FORCE_INLINE_FUNCTION uint16_t getGapLineWidth() const - { - return lineWidth; - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - uint16_t lineWidth; ///< Width of the line - -private: - void invalidateIndex(const AbstractDataGraph* graph, int16_t index) const; -}; - -/** - * The GraphElementHistogram is used to draw blocks from the x axis to the data point in the - * graph. If more graphs are placed on top of each other, the histogram can be moved slightly to - * the left/right. - * - * @note Historgram boxes are drawn using LCD::fillRect for higher performance. - */ -class GraphElementHistogram : public AbstractGraphElementNoCWR -{ -public: - GraphElementHistogram() - : dataScale(1), yBaseline(0), barWidth(2), barOffset(0) - { - } - - /** - * Sets a scaling factor to be multiplied on the baseline. Any already set baseline will be - * updated to the new correctly scaled value. To avoid this, use setBaselineScaled() - * after setting scale. - * - * @param scale The scaling factor. - * - * @see getScale - */ - FORCE_INLINE_FUNCTION void setScale(int scale) - { - assert(scale != 0); - yBaseline = AbstractDataGraph::convertToNewScale(yBaseline, dataScale, scale); - dataScale = scale; - } - - /** - * Gets the scaling factor set using setScale. - * - * @return The scaling factor. - * - * @see setScale - */ - FORCE_INLINE_FUNCTION int getScale() const - { - return dataScale; - } - - /** - * Sets the base of the area drawn. Normally, the base is 0 which means that the area is - * drawn below positive y values and above negative y values. Setting the base to a very - * high number will cause the area above the graph to be drawn. Setting the base to a very - * low number will cause the area below the graph to be drawn (even for negative numbers, - * which are higher than the base value). - * - * @param baseline The base value. - * - * @see getBaselineAsInt, getBaselineAsFloat - */ - FORCE_INLINE_FUNCTION void setBaseline(int baseline) - { - setBaselineScaled(baseline * dataScale); - } - - /** @copydoc setBaseline(int) */ - FORCE_INLINE_FUNCTION void setBaseline(float baseline) - { - setBaselineScaled(AbstractDataGraph::float2scaled(baseline, dataScale)); - } - - /** - * @copydoc setBaseline(int) - * - * @note The baseline set here must already be scaled. - */ - FORCE_INLINE_FUNCTION void setBaselineScaled(int baseline) - { - yBaseline = baseline; - } - - /** - * Gets the base previously set using setBaseline. - * - * @return The base value. - * - * @see setBaseline - */ - FORCE_INLINE_FUNCTION int getBaselineAsInt() const - { - return AbstractDataGraph::scaled2int(getBaselineScaled(), dataScale); - } - - /** @copydoc getBaselineAsInt() */ - FORCE_INLINE_FUNCTION float getBaselineAsFloat() const - { - return AbstractDataGraph::scaled2float(getBaselineScaled(), dataScale); - } - - /** - * @copydoc getBaselineAsInt() - * - * @note The baseline returned here is left unscaled. - */ - FORCE_INLINE_FUNCTION int getBaselineScaled() const - { - return yBaseline; - } - - /** - * Sets bar width of each histogram column in pixels. - * - * @param width The width. - * - * @see getBarWidth - */ - FORCE_INLINE_FUNCTION void setBarWidth(uint16_t width) - { - barWidth = width; - } - - /** - * Gets bar width of the histogram columns. - * - * @return The bar width. - * - * @see setBarWidth - */ - FORCE_INLINE_FUNCTION uint16_t getBarWidth() const - { - return barWidth; - } - - /** - * Sets bar offset (horizontally) in pixels. This can be used when there are two different histogram - * graphs on top of each other to prevent one histogram from covering the other. - * - * @param offset The offset. - * - * @see getBarOffset - */ - FORCE_INLINE_FUNCTION void setBarOffset(int16_t offset) - { - barOffset = offset; - } - - /** - * Gets bar offset (horizontally). Bar offset can be used when there are two different - * histogram graphs on top of each other to prevent one histogram from covering the other. - * - * @return The bar offset. - * - * @see setBarOffset - */ - FORCE_INLINE_FUNCTION int16_t getBarOffset() const - { - return barOffset; - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - int dataScale; ///< The scaling factor - int yBaseline; ///< The baseline - uint16_t barWidth; ///< Width of each bar - int16_t barOffset; ///< The horizontal bar offset -}; - -/** - * GraphElementBoxes will draw square box for every data point in graph. - * - * @note The boxes are drawn using LCD::fillRect for higher performance. This also means that - * boxes with an odd width will not align properly if combined with a GraphElementLine or - * any other GraphElement that uses Canvas Widget Renderer. Use an even number for box width - * in these cases. - */ -class GraphElementBoxes : public AbstractGraphElementNoCWR -{ -public: - GraphElementBoxes() - : boxWidth(2) - { - } - - /** - * Sets box width. - * - * @param width The width. - * - * @see getBoxWidth - */ - FORCE_INLINE_FUNCTION void setBoxWidth(uint16_t width) - { - boxWidth = width; - } - - /** - * Gets box width. - * - * @return The box width. - * - * @see setBoxWidth - */ - FORCE_INLINE_FUNCTION uint16_t getBoxWidth() const - { - return boxWidth; - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - uint16_t boxWidth; ///< Width of the box -}; - -/** - * GraphElementDots will draw a circular dot for every data point in graph. - * - * @note The Dots are drawn using Canvas Widget Renderer which is slower but produces much nicer - * graphics. - */ -class GraphElementDots : public AbstractGraphElement -{ -public: - GraphElementDots() - : dotWidth(2) - { - } - - /** - * Sets dot width. - * - * @param width The width. - * - * @see getDotWidth - */ - FORCE_INLINE_FUNCTION void setDotWidth(uint8_t width) - { - dotWidth = width; - } - - /** - * Gets dot width. - * - * @return The dot width. - * - * @see setDotWidth - */ - FORCE_INLINE_FUNCTION uint8_t getDotWidth() const - { - return dotWidth; - } - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - uint8_t dotWidth; ///< Width of the dot -}; - -/** - * GraphElementDiamonds will draw a diamond (a square with the corners up/down/left/right) for - * every data point in graph. - * - * @note The Diamonds are drawn using Canvas Widget Renderer which is slower but produces much - * nicer graphics. - */ -class GraphElementDiamonds : public AbstractGraphElement -{ -public: - GraphElementDiamonds() - : diamondWidth(2) - { - } - - /** - * Sets diamond width. - * - * @param width The width. - * - * @see getDiamondWidth - */ - FORCE_INLINE_FUNCTION void setDiamondWidth(uint8_t width) - { - diamondWidth = width; - } - - /** - * Gets diamond width. - * - * @return The diamond width. - * - * @see setDiamondWidth - */ - FORCE_INLINE_FUNCTION uint8_t getDiamondWidth() const - { - return diamondWidth; - } - - virtual bool drawCanvasWidget(const Rect& invalidatedArea) const; - - virtual void invalidateGraphPointAt(int16_t index); - -protected: - uint8_t diamondWidth; ///< Width of the diamond -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GRAPHELEMENTS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp deleted file mode 100644 index 63c6e1b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp +++ /dev/null @@ -1,475 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/GraphLabels.hpp - * - * Declares classes for adding labels and title to the graph. - */ -#ifndef TOUCHGFX_GRAPHLABELS_HPP -#define TOUCHGFX_GRAPHLABELS_HPP - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -/** Helper class used for adding labels around the graph. Currently empty. */ -class AbstractGraphDecoration : public AbstractGraphElementNoCWR -{ -}; - -/** - * Helper class for adding labels on the side of a graph. - * - * @see GraphLabelsX, GraphLabelsY - */ -class GraphLabelsBase : public AbstractGraphDecoration -{ -public: - GraphLabelsBase() - : AbstractGraphDecoration(), - dataScale(1), labelInterval(0), labelTypedText(TYPED_TEXT_INVALID), labelRotation(TEXT_ROTATE_0), labelDecimals(0), labelDecimalPoint('.'), majorLabel(0) - { - } - - virtual void draw(const Rect& invalidatedArea) const; - - /** - * Sets a scaling factor to be multiplied on the labelInterval. Any already set - * labelInterval will be updated to the new correctly scaled value. To avoid this, use - * setIntervalScaled after setting scale. - * - * @param scale The scaling factor. - * - * @see getScale - */ - FORCE_INLINE_FUNCTION void setScale(int scale) - { - assert(scale != 0); - labelInterval = AbstractDataGraph::convertToNewScale(labelInterval, dataScale, scale); - dataScale = scale; - } - - /** - * Gets the scaling factor set using setScale. - * - * @return The scaling factor. - * - * @see setScale - */ - FORCE_INLINE_FUNCTION int getScale() const - { - return dataScale; - } - - /** - * Sets the interval between each label. - * - * @param interval The interval between each label. - * - * @see getIntervalAsInt, getIntervalAsFloat, setMajorLabel - * - * @note If interval is 0 only the axis is shown. - */ - FORCE_INLINE_FUNCTION void setInterval(int interval) - { - setIntervalScaled(AbstractDataGraph::int2scaled(interval, dataScale)); - } - - /** @copydoc setInterval(int) */ - FORCE_INLINE_FUNCTION void setInterval(float interval) - { - setIntervalScaled(AbstractDataGraph::float2scaled(interval, dataScale)); - } - - /** - * @copydoc setInterval(int) - * - * @note The interval set here must already be scaled. - */ - FORCE_INLINE_FUNCTION void setIntervalScaled(int interval) - { - labelInterval = abs(interval); - } - - /** - * Gets the interval between each label. - * - * @return The interval between each label. - * - * @see setInterval - */ - FORCE_INLINE_FUNCTION int getIntervalAsInt() const - { - return AbstractDataGraph::scaled2int(getIntervalScaled(), dataScale); - } - - /** @copydoc getIntervalAsInt() */ - FORCE_INLINE_FUNCTION float getIntervalAsFloat() const - { - return AbstractDataGraph::scaled2float(getIntervalScaled(), dataScale); - } - - /** - * @copydoc getIntervalAsInt() - * - * @note The interval returned here is left unscaled. - */ - FORCE_INLINE_FUNCTION int getIntervalScaled() const - { - return labelInterval; - } - - /** - * Sets "major" label that will be responsible for drawing major labels. If a label would be - * drawn at the same position as the major label, the label will not be drawn. - * - * @param major Reference to a major label object. - */ - FORCE_INLINE_FUNCTION void setMajorLabel(const GraphLabelsBase& major) - { - majorLabel = &major; - } - - /** - * Sets TypedText to use for the label. The TypedText should contain exactly one wildcard. - * - * @param typedText The typed text. - * - * @see getLabelTypedText - */ - FORCE_INLINE_FUNCTION void setLabelTypedText(const TypedText& typedText) - { - labelTypedText = typedText; - } - - /** - * Gets TypedText label. - * - * @return The label typed text. - * - * @see setLabelTypedText - */ - FORCE_INLINE_FUNCTION const TypedText& getLabelTypedText() const - { - return labelTypedText; - } - - /** - * Sets label rotation. - * - * @param rotation The rotation or the text. - * - * @see getLabelRotation - */ - FORCE_INLINE_FUNCTION void setLabelRotation(TextRotation rotation) - { - labelRotation = rotation; - } - - /** - * Gets label rotation. - * - * @return The label rotation. - * - * @see setLabelRotation - */ - FORCE_INLINE_FUNCTION TextRotation getLabelRotation() const - { - return labelRotation; - } - - /** - * Sets number of decimals for labels, default is no decimals and no decimal point. - * - * @param decimals The number of label decimals. - * - * @see setLabelDecimalPoint - */ - FORCE_INLINE_FUNCTION void setLabelDecimals(uint16_t decimals) - { - labelDecimals = decimals; - } - - /** - * Gets number of decimals for labels. - * - * @return The number of label decimals. - */ - FORCE_INLINE_FUNCTION uint16_t getLabelDecimals() const - { - return labelDecimals; - } - - /** - * Sets label decimal point. Default is to use '.' but this can be changed using this - * function. - * - * @param decimalPoint The character to use for decimal point. - * - * @see setLabelDecimals - * - * @note The decimal point is only set if the label decimals > 0. - */ - FORCE_INLINE_FUNCTION void setLabelDecimalPoint(Unicode::UnicodeChar decimalPoint) - { - labelDecimalPoint = decimalPoint; - } - - /** - * Gets label decimal point previously set. - * - * @return The label decimal point. - * - * @see setLabelDecimalPoint - */ - FORCE_INLINE_FUNCTION Unicode::UnicodeChar getLabelDecimalPoint() const - { - return labelDecimalPoint; - } - - virtual void invalidateGraphPointAt(int16_t) - { - } - - /** - * Gets correctly scaled minor interval, as the minor label may have a scale that differs - * the scale of the graph and this label. - * - * @param graph The graph. - * - * @return The correctly scaled minor interval. - */ - virtual int getCorrectlyScaledLabelInterval(const AbstractDataGraph* graph) const = 0; - - /** - * Gets correctly scaled major interval, as the major label may have a scale that differs - * the scale of the graph and this label. - * - * @param graph The graph. - * - * @return The correctly scaled major interval. - */ - virtual int getCorrectlyScaledMajorInterval(const AbstractDataGraph* graph) const - { - return majorLabel == 0 ? 0 : majorLabel->getCorrectlyScaledLabelInterval(graph); - } - -protected: - int dataScale; ///< The scaling factor - int labelInterval; ///< The interval between each label. - TypedText labelTypedText; ///< The TypedText to use for the label. - TextRotation labelRotation; ///< The TextRotation to use for the label. - uint16_t labelDecimals; ///< The number of decimals on the label. - Unicode::UnicodeChar labelDecimalPoint; ///< The label decimal point character. - const GraphLabelsBase* majorLabel; ///< A pointer to a major label, if any - - /** - * Draw labels for all indexes in the given range. This is used where there is a gap in the - * graph and the labels have to be drawn using different x scales. - * - * @param [in] invalidatedArea The canvas. - * @param fontToDraw The font to draw. - * @param graph The graph. - * @param rangeMin The minimum index. - * @param rangeMax The maximum index. - * @param minorInterval The minor interval. - * @param majorInterval The major interval. - * @param a The alpha of the strings. - */ - virtual void drawIndexRange(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int rangeMin, const int rangeMax, const int minorInterval, const int majorInterval, const uint8_t a) const; - - /** - * Draw string. - * - * @param invalidatedArea The invalidated area. - * @param fontToDraw The font to draw. - * @param graph The graph. - * @param valueScaled The value scaled. - * @param labelScaled The label scaled. - * @param a The alpha of the string. - */ - virtual void drawString(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int valueScaled, const int labelScaled, const uint8_t a) const = 0; - - /** - * Gets graph range minimum scaled. - * - * @param graph The graph. - * - * @return The graph range minimum scaled. - */ - virtual int getGraphRangeMinScaled(const AbstractDataGraph* graph) const = 0; - - /** - * Gets graph range maximum scaled. - * - * @param graph The graph. - * - * @return The graph range maximum scaled. - */ - virtual int getGraphRangeMaxScaled(const AbstractDataGraph* graph) const = 0; - - /** - * Format label according to the set number of decimals and the decimal point. - * - * @param [in,out] buffer The buffer to fill with the formatted number. - * @param bufferSize Size of the buffer. - * @param label The label value. - * @param decimals The number of decimals. - * @param decimalPoint The decimal point. - * @param scale The scale of the label value. - */ - void formatLabel(Unicode::UnicodeChar* buffer, int16_t bufferSize, int label, int decimals, Unicode::UnicodeChar decimalPoint, int scale) const; -}; - -/** - * GraphLabelsX will draw labels along the X axis at given intervals. By combining two - * GraphLabelsX it is possible to have different appearance for major and minor y offsets. - */ -class GraphLabelsX : public GraphLabelsBase -{ -public: - virtual void invalidateGraphPointAt(int16_t index); - - virtual int getCorrectlyScaledLabelInterval(const AbstractDataGraph* graph) const - { - return convertToGraphScaleX(graph, labelInterval, dataScale); - } - -protected: - void drawIndexRange(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int rangeMin, const int rangeMax, const int minorInterval, const int majorInterval, const uint8_t a) const; - - virtual void drawString(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int valueScaled, const int labelScaled, const uint8_t a) const; - - virtual int getGraphRangeMinScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeXMinScaled(); - } - - virtual int getGraphRangeMaxScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeXMaxScaled(); - } -}; - -/** - * GraphLabelsY will draw labels along the Y axis at given intervals. By combining two - * GraphLabelsY it is possible to have different appearance for major and minor y offsets. - */ -class GraphLabelsY : public GraphLabelsBase -{ -public: - virtual int getCorrectlyScaledLabelInterval(const AbstractDataGraph* graph) const - { - return convertToGraphScaleY(graph, labelInterval, dataScale); - } - -protected: - virtual void drawString(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int valueScaled, const int labelScaled, const uint8_t a) const; - - virtual int getGraphRangeMinScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeYMinScaled(); - } - - virtual int getGraphRangeMaxScaled(const AbstractDataGraph* graph) const - { - return graph->getGraphRangeYMaxScaled(); - } -}; - -/** - * The GraphTitle is just a simple text, but it is automatically moved with the graph. Also, the - * alpha value is combined with the alpha of the graph and so it will be faded if the graph is - * faded. - */ -class GraphTitle : public AbstractGraphDecoration -{ -public: - GraphTitle() - : titleTypedText(TYPED_TEXT_INVALID), titleRotation(TEXT_ROTATE_0) - { - } - - /** - * Sets TypedText to use as a title. It can be any static text which is just added as a - * title. - * - * @param typedText The typed text. - * - * @see getTitleTypedText - */ - FORCE_INLINE_FUNCTION void setTitleTypedText(const TypedText& typedText) - { - titleTypedText = typedText; - } - - /** - * Gets title typed text. - * - * @return The title typed text. - * - * @see setTitleTypedText - */ - FORCE_INLINE_FUNCTION const TypedText& getTitleTypedText() const - { - return titleTypedText; - } - - /** - * Sets TextRotation of the title. - * - * @param rotation The rotation. - * - * @see setTitleTypedText, getTitleRotation - */ - FORCE_INLINE_FUNCTION void setTitleRotation(TextRotation rotation) - { - titleRotation = rotation; - } - - /** - * Gets title rotation. - * - * @return The title rotation. - * - * @see setTitleRotation - */ - FORCE_INLINE_FUNCTION TextRotation getTitleRotation() const - { - return titleRotation; - } - - virtual void draw(const Rect& invalidatedArea) const; - - virtual bool drawCanvasWidget(const Rect&) const - { - return true; - } - - virtual void invalidateGraphPointAt(int16_t) - { - } - -private: - TypedText titleTypedText; ///< The title typed text - TextRotation titleRotation; ///< The title rotation -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GRAPHLABELS_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp deleted file mode 100644 index 03cccf8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphScroll.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/GraphScroll.hpp - * - * Declares the touchgfx::GraphScrollData and touchgfx::GraphScroll classes. - */ -#ifndef TOUCHGFX_GRAPHSCROLL_HPP -#define TOUCHGFX_GRAPHSCROLL_HPP - -#include -#include - -namespace touchgfx -{ -/** - * GraphScrollData is used to display a graph that continuously scrolls to the left every time a - * new value is added to the graph. Because the graph is scrolled every time a new value is - * added, the graph has to be re-drawn which can be quite demanding for the hardware depending - * on the graph elements used in the graph. - */ -class GraphScrollData : public DynamicDataGraph -{ -public: - /** - * Initializes a new instance of the GraphScrollData class. - * - * @param capacity The capacity. - * @param [in] values Pointer to memory with room for capacity elements of type T. - */ - GraphScrollData(int16_t capacity, int* values) - : DynamicDataGraph(capacity, values), current(0) - { - } - - virtual void clear(); - - virtual int32_t indexToGlobalIndex(int16_t index) const; - -protected: - int16_t current; ///< The current position used for inserting new elements - - virtual void beforeAddValue(); - - virtual int16_t addValue(int value); - - virtual int16_t dataIndex(int16_t screenIndex) const - { - return usedCapacity < maxCapacity ? screenIndex : (screenIndex + current) % maxCapacity; - } - -private: - virtual CWRUtil::Q5 indexToXQ5(int16_t index) const - { - return CWRUtil::toQ5(index); - } -}; - -/** - * A Widget capable of drawing a graph with various visual styles and different appearances for - * the new values added to the graph. - * - * @tparam CAPACITY The maximum number of data points on the graph. - */ -template -class GraphScroll : public GraphScrollData -{ -public: - GraphScroll() - : GraphScrollData(CAPACITY, y) - { - } - -private: - int y[CAPACITY]; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GRAPHSCROLL_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp deleted file mode 100644 index 0abe59a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndClear.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/GraphWrapAndClear.hpp - * - * Declares the touchgfx::GraphWrapAndClearData and touchgfx::GraphWrapAndClear classes. - */ -#ifndef TOUCHGFX_GRAPHWRAPANDCLEAR_HPP -#define TOUCHGFX_GRAPHWRAPANDCLEAR_HPP - -#include -#include - -namespace touchgfx -{ -/** - * The GraphWrapAndClearData will show new points progressing across the graph. Once the graph - * is filled, the next point added will cause the graph to be cleared and a new graph will - * slowly be created as new values are added. - */ -class GraphWrapAndClearData : public DynamicDataGraph -{ -public: - /** - * Initializes a new instance of the GraphWrapAndOverwriteData class. - * - * @param capacity The capacity. - * @param [in] values Pointer to memory with room for capacity elements of type T. - */ - GraphWrapAndClearData(int16_t capacity, int* values) - : DynamicDataGraph(capacity, values) - { - } - - virtual void clear(); - - virtual int32_t indexToGlobalIndex(int16_t index) const - { - return (this->dataCounter - this->usedCapacity) + index; - } - -protected: - virtual void beforeAddValue(); - - virtual int16_t addValue(int value); -}; - -/** - * The GraphWrapAndClear will show new points progressing across the graph. Once the graph is - * filled, the next point added will cause the graph to be cleared and a new graph will slowly - * be created as new values are added. - * - * @tparam CAPACITY The maximum number of data points on the graph. - */ -template -class GraphWrapAndClear : public GraphWrapAndClearData -{ -public: - GraphWrapAndClear() - : GraphWrapAndClearData(CAPACITY, y) - { - } - -private: - int y[CAPACITY]; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GRAPHWRAPANDCLEAR_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp b/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp deleted file mode 100644 index a63accd..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/include/touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -/** - * @file touchgfx/widgets/graph/GraphWrapAndOverwrite.hpp - * - * Declares the touchgfx::GraphWrapAndOverwriteData and touchgfx::GraphWrapAndOverwrite classes. - */ -#ifndef TOUCHGFX_GRAPHWRAPANDOVERWRITE_HPP -#define TOUCHGFX_GRAPHWRAPANDOVERWRITE_HPP - -#include -#include - -namespace touchgfx -{ -/** - * A continuous data graph which will fill the graph with elements, and overwrite the first - * elements with new values after the graph has filled. There will be a gap between the newly - * inserted element and the element after. This similar behavior to a heart beat monitor. - */ -class GraphWrapAndOverwriteData : public DynamicDataGraph -{ -public: - /** - * Initializes a new instance of the GraphWrapAndOverwriteData class. - * - * @param capacity The capacity. - * @param [in] values Pointer to memory with room for capacity elements of type T. - */ - GraphWrapAndOverwriteData(int16_t capacity, int* values) - : DynamicDataGraph(capacity, values), current(0) - { - } - - virtual void clear(); - - virtual int32_t indexToGlobalIndex(int16_t index) const; - -protected: - int16_t current; ///< The current index (used to keep track of where to insert new data point in value array) - - virtual void beforeAddValue(); - - virtual int16_t addValue(int value); -}; - -/** - * A Continuous graph. A quick way to create a GraphWrapAndOverwriteData. - * - * @tparam CAPACITY The maximum number of data points on the graph. - */ -template -class GraphWrapAndOverwrite : public GraphWrapAndOverwriteData -{ -public: - GraphWrapAndOverwrite() - : GraphWrapAndOverwriteData(CAPACITY, y) - { - } - -private: - int y[CAPACITY]; -}; - -} // namespace touchgfx - -#endif // TOUCHGFX_GRAPHWRAPANDOVERWRITE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp deleted file mode 100644 index 4242c6a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -void SDL2TouchController::init() -{ -} - -bool SDL2TouchController::sampleTouch(int32_t& x, int32_t& y) -{ - return static_cast(HAL::getInstance())->doSampleTouch(x, y); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp deleted file mode 100644 index 7bbb52b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp +++ /dev/null @@ -1,1528 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -#include -#elif defined(__GNUC__) -#include -#include -#endif - -#ifdef __GNUC__ -#define sprintf_s snprintf -#define fopen_s(pFile, filename, mode) (((*(pFile)) = fopen((filename), (mode))) == NULL) -#define freopen_s(pFile, filename, mode, pStream) (((*(pFile)) = freopen((filename), (mode), (pStream))) == NULL) -#define localtime_s(timeinfo, rawtime) memcpy(timeinfo, localtime(rawtime), sizeof(tm)) -#define strncpy_s(dst, dstsize, src, srcsize) strncpy(dst, src, dstsize < srcsize ? dstsize : srcsize) -#define wcstombs_s(result, dst, dstsize, src, srcsize) *result = wcstombs(dst, src, dstsize < srcsize ? dstsize : srcsize) -#define memcpy_s(dst, dstsize, src, srcsize) memcpy(dst, src, dstsize < srcsize ? dstsize : srcsize) -#endif - -namespace touchgfx -{ -static bool isAlive = true; -bool sdl_initialized = false; -static int screenshotcount = 0; -static uint8_t* tft_display24 = NULL; -static bool tft_display24_allocated = false; -static uint8_t* tft_framebuffer24 = NULL; -static bool tft_framebuffer24_allocated = false; -static SDL_Window* simulatorWindow = 0; -static SDL_Renderer* simulatorRenderer = 0; -#ifndef __linux__ -static bool isConsoleAllocated = false; -#endif - -static uint16_t* tft = NULL; -static uint16_t HALSDL2__FRAME_BUFFER_WIDTH = 0; -static uint16_t HALSDL2__FRAME_BUFFER_HEIGHT = 0; -static uint16_t* single_buf = NULL; -static uint16_t* double_buf = NULL; -static uint16_t* anim_store = NULL; - -#if defined(WIN32) || defined(_WIN32) -static DWORD mainThreadHandle; -#endif - -static int transferThreadFunc(void* ptr); -static SDL_sem* sem_transfer_ready = 0; -static SDL_sem* sem_transfer_done = 0; - -bool HALSDL2::flashInvalidatedRect = false; - -void HALSDL2::renderLCD_FrameBufferToMemory(const Rect& _rectToUpdate, uint8_t* frameBuffer) -{ - Rect rectToUpdate = _rectToUpdate; - - if (isSkinActive && currentSkin != 0 && (currentSkin->isOpaque || currentSkin->hasSemiTransparency)) - { - // Opaque skin must be drawn before the framebuffer - SDL_Texture* currentSkinTexture = SDL_CreateTextureFromSurface(simulatorRenderer, currentSkin->surface); - SDL_RenderClear(simulatorRenderer); - SDL_RenderCopy(simulatorRenderer, currentSkinTexture, NULL, NULL); - // The skin will overwrite everything, so expand the rect to the entire framebuffer - rectToUpdate.x = 0; - rectToUpdate.y = 0; - rectToUpdate.width = DISPLAY_WIDTH; - rectToUpdate.height = DISPLAY_HEIGHT; - SDL_DestroyTexture(currentSkinTexture); - } - - if (flashInvalidatedRect) - { - SDL_Delay(1); - } - - // Now draw the requested area - SDL_Surface* framebufferSurface = SDL_CreateRGBSurfaceFrom((void*)frameBuffer, DISPLAY_WIDTH, DISPLAY_HEIGHT, 24, 3 * DISPLAY_WIDTH, 0, 0, 0, 0); - SDL_Texture* framebufferTexture = SDL_CreateTextureFromSurface(simulatorRenderer, framebufferSurface); - - SDL_Rect srcRect; - srcRect.x = rectToUpdate.x; - srcRect.y = rectToUpdate.y; - srcRect.h = rectToUpdate.height; - srcRect.w = rectToUpdate.width; - - SDL_Rect dstRect = srcRect; - dstRect.x = rectToUpdate.x + getCurrentSkinX(); - dstRect.y = rectToUpdate.y + getCurrentSkinY(); - - SDL_RenderCopy(simulatorRenderer, framebufferTexture, &srcRect, &dstRect); - - if (isSkinActive && currentSkin != 0 && !(currentSkin->isOpaque || currentSkin->hasSemiTransparency)) - { - // Non-opaque skin must be drawn last - SDL_Texture* currentSkinTexture = SDL_CreateTextureFromSurface(simulatorRenderer, currentSkin->surface); - SDL_RenderCopy(simulatorRenderer, currentSkinTexture, NULL, NULL); - SDL_DestroyTexture(currentSkinTexture); - } - - SDL_RenderPresent(simulatorRenderer); - SDL_DestroyTexture(framebufferTexture); - SDL_FreeSurface(framebufferSurface); -} - -static void sdlCleanup2() -{ -#if defined(WIN32) || defined(_WIN32) - if (mainThreadHandle == GetCurrentThreadId()) -#endif - { - if (sdl_initialized) - { - if (tft_display24_allocated) - { - delete tft_display24; - tft_display24 = NULL; - tft_display24_allocated = false; - } - if (tft_framebuffer24_allocated) - { - delete[] tft_framebuffer24; - tft_framebuffer24 = NULL; - tft_framebuffer24_allocated = false; - } - if (single_buf) - { - delete[] single_buf; - single_buf = NULL; - } - if (double_buf) - { - delete[] double_buf; - double_buf = NULL; - } - if (anim_store) - { - delete[] anim_store; - anim_store = NULL; - } - if (sem_transfer_ready) - { - SDL_DestroySemaphore(sem_transfer_ready); - sem_transfer_ready = 0; - } - if (sem_transfer_done) - { - SDL_DestroySemaphore(sem_transfer_done); - sem_transfer_done = 0; - } - - sdl_initialized = false; // Make sure we don't get in here again - SDL_DestroyRenderer(simulatorRenderer); - SDL_DestroyWindow(simulatorWindow); - SDL_VideoQuit(); - SDL_Quit(); - } - } -} - -Uint32 myTimerCallback2(Uint32 interval, void* param); - -Uint32 myTimerCallback2(Uint32 interval, void* /*param*/) -{ - SDL_Event event; - SDL_UserEvent userevent; - - /* In this example, our callback pushes an SDL_USEREVENT event - * into the queue, and causes ourself to be called again at the - * same interval: */ - - userevent.type = static_cast(SDL_USEREVENT); - userevent.code = 0; - userevent.data1 = 0; - userevent.data2 = 0; - - event.type = static_cast(SDL_USEREVENT); - event.user = userevent; - - SDL_PushEvent(&event); - - return interval; -} - -void HALSDL2::setFrameBufferSize(uint16_t width, uint16_t height) -{ - HAL::setFrameBufferSize(width, height); - - // Get a copy of the dimension of the complete framebuffer as the dimensions get overwritten when using Partial Framebuffer - HALSDL2__FRAME_BUFFER_WIDTH = FRAME_BUFFER_WIDTH; - HALSDL2__FRAME_BUFFER_HEIGHT = FRAME_BUFFER_HEIGHT; - - if (single_buf) - { - delete[] single_buf; - } - if (double_buf) - { - delete[] double_buf; - } - if (anim_store) - { - delete[] anim_store; - } - // Allocate framebuffers - const uint32_t bufferSizeInWords = (lcd().framebufferStride() * FRAME_BUFFER_HEIGHT + 1) / 2; - single_buf = new uint16_t[bufferSizeInWords]; - double_buf = new uint16_t[bufferSizeInWords]; - anim_store = new uint16_t[bufferSizeInWords]; - const bool use_animation_storage = USE_ANIMATION_STORAGE; - const bool use_double_buffering = USE_DOUBLE_BUFFERING; - setFrameBufferStartAddresses(single_buf, double_buf, anim_store); - USE_ANIMATION_STORAGE = use_animation_storage; - USE_DOUBLE_BUFFERING = use_double_buffering; - tft = single_buf; // Start off using single buffer for tft -} - -bool HALSDL2::sdl_init(int /*argcount*/, char** args) -{ - if (sdl_initialized) - { - touchgfx_printf("SDL already initialized\n"); - return false; - } - -#if defined(SIMULATOR) && !defined(__linux__) - if (getWindowVisible()) - { - // Create window and hide it ASAP to prevent problems with files being closed when stdio is redirected to the new console - touchgfx_enable_stdio(); // This will create a console window - HWND hwnd = GetConsoleWindow(); // Get a handle to the console window - if (hwnd) // If the console exists, quickly hide it - { - ShowWindow(hwnd, SW_HIDE); - } - } -#endif - - strncpy_s(programPath, sizeof(programPath), args[0], strlen(args[0])); - char* filenamePos = strrchr(programPath, '/'); - if (!filenamePos) - { - filenamePos = strrchr(programPath, '\\'); - } - if (filenamePos) - { - filenamePos++; // Skip path separator - } - else - { - filenamePos = programPath; - } - *filenamePos = '\0'; - - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) - { - touchgfx_printf("Unable to init SDL: %s\n", SDL_GetError()); - return false; - } - - // setFrameBufferSize will respect these, not set them. These can be overwritten in main() - USE_ANIMATION_STORAGE = true; - USE_DOUBLE_BUFFERING = true; - setFrameBufferSize(FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT); - - recreateWindow(false); - if (simulatorWindow == NULL) - { - touchgfx_printf("Unable to set video mode: %s\n", SDL_GetError()); - return false; - } - sdl_initialized = true; - atexit(sdlCleanup2); - - SDL_Surface* iconSurface = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 16, 32 * 2, 0xf800, 0x07e0, 0x001f, 0x0000); - SDL_SetWindowIcon(simulatorWindow, iconSurface); - SDL_FreeSurface(iconSurface); - - lockDMAToFrontPorch(false); - - if (getFrameRefreshStrategy() == REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER) - { - assert(getFrameBufferAllocator() && "Framebuffer allocator must be provided when using REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER"); - - sem_transfer_ready = SDL_CreateSemaphore(0); - sem_transfer_done = SDL_CreateSemaphore(0); - SDL_Thread* transfer_thread = SDL_CreateThread(transferThreadFunc, "FB TransferThread", (void*)NULL); - assert(transfer_thread); - } - - return true; -} - -const char* HALSDL2::customTitle = 0; - -void HALSDL2::setWindowTitle(const char* title) -{ - customTitle = title; -} - -const char* HALSDL2::getWindowTitle() -{ - if (customTitle != 0) - { - return customTitle; - } - static char title[100]; - sprintf_s(title, 100, "TouchGFX simulator v%d.%d.%d", TOUCHGFX_VERSION_MAJOR, TOUCHGFX_VERSION_MINOR, TOUCHGFX_VERSION_PATCH); - return title; -} - -void HALSDL2::loadSkin(DisplayOrientation orientation, int x, int y) -{ - char path[320]; - - assert(sdl_initialized && "Please call sdl_init() before loading a skin"); - - SkinInfo* skin; - const char* skinname; - - if (orientation == ORIENTATION_PORTRAIT) - { - skin = &portraitSkin; - skinname = "portrait.png"; - } - else - { - skin = &landscapeSkin; - skinname = "landscape.png"; - } - skin->offsetX = 0; - skin->offsetY = 0; - skin->surface = IMG_Load(localFileName(path, 320, skinname)); - if (skin->surface == 0) - { - touchgfx_printf("Unable to load skin image from %s\n", path); - } - else - { - skin->offsetX = x; - skin->offsetY = y; - alphaChannelCheck(skin->surface, skin->isOpaque, skin->hasSemiTransparency); - } - if (getDisplayOrientation() == orientation) - { - updateCurrentSkin(); - recreateWindow(false); - } -} - -void HALSDL2::performDisplayOrientationChange() -{ - HAL::performDisplayOrientationChange(); - updateCurrentSkin(); - recreateWindow(false); -} - -char* HALSDL2::localFileName(char* buffer, size_t buffer_size, const char* filename) -{ - sprintf_s(buffer, buffer_size, "%s%s", programPath, filename); - return buffer; -} - -void HALSDL2::updateCurrentSkin() -{ - currentSkin = 0; - if (getDisplayOrientation() == ORIENTATION_PORTRAIT) - { - if (portraitSkin.surface != 0) - { - currentSkin = &portraitSkin; - } - } - else - { - if (landscapeSkin.surface != 0) - { - currentSkin = &landscapeSkin; - } - } -} - -int HALSDL2::getCurrentSkinX() const -{ - return (isSkinActive && currentSkin != 0 && currentSkin->surface != 0) ? currentSkin->offsetX : 0; -} - -int HALSDL2::getCurrentSkinY() const -{ - return (isSkinActive && currentSkin != 0 && currentSkin->surface != 0) ? currentSkin->offsetY : 0; -} - -int32_t HALSDL2::_xMouse = 0; -int32_t HALSDL2::_yMouse = 0; -int32_t HALSDL2::_x = 0; -int32_t HALSDL2::_y = 0; -bool HALSDL2::isWindowBeingDragged = false; -int HALSDL2::initialWindowX; -int HALSDL2::initialWindowY; -int HALSDL2::initialMouseX; -int HALSDL2::initialMouseY; -bool HALSDL2::_lastTouch = false; -bool HALSDL2::_touches[5] = { false, false, false, false, false }; -int HALSDL2::_numTouches = 0; - -void HALSDL2::pushTouch(bool down) const -{ - if (_numTouches == 0) - { - // Save touch - _touches[_numTouches++] = down; - } - else if ((_numTouches < 4) && (_touches[_numTouches - 1] ^ down)) - { - // Only save touch if is different from the last one recorded - _touches[_numTouches++] = down; - } -} - -bool HALSDL2::popTouch() const -{ - if (_numTouches < 1) - { - // Keep returning the same state - return _lastTouch; - } - // Get first item in queue - _lastTouch = _touches[0]; - // Move items in queue - for (int i = 0; i < 4; i++) - { - _touches[i] = _touches[i + 1]; - } - _numTouches--; - return _lastTouch; -} - -bool HALSDL2::debugInfoEnabled = false; - -void HALSDL2::updateTitle() -{ - char title[500]; - int length = sprintf_s(title, 500, "%s", getWindowTitle()); - if (debugInfoEnabled) - { - length += sprintf_s(title + length, 500 - length, " @%d,%d", _xMouse, _yMouse); - if (tft_framebuffer24 != 0) - { - // Convert display coordinates to framebuffer coordinates - int16_t fb_x = _xMouse; - int16_t fb_y = _yMouse; - DisplayTransformation::transformDisplayToFrameBuffer(fb_x, fb_y); - const uint8_t* const pixel_ptr = tft_framebuffer24 + 3 * (fb_x + fb_y * FRAME_BUFFER_WIDTH); - length += sprintf_s(title + length, 500 - length, "=%02X.%02X.%02X", pixel_ptr[2], pixel_ptr[1], pixel_ptr[0]); - } - } - if (flashInvalidatedRect) - { - length += sprintf_s(title + length, 500 - length, " (flash)"); - } - if (isSingleStepping()) - { - length += sprintf_s(title + length, 500 - length, " (step)"); - } - SDL_SetWindowTitle(simulatorWindow, title); -} - -void HALSDL2::alphaChannelCheck(SDL_Surface* surface, bool& isOpaque, bool& hasSemiTransparency) -{ - isOpaque = true; - hasSemiTransparency = false; - if (surface->format->BitsPerPixel < 32 || surface->format->BytesPerPixel < 4) - { - return; - } - uint32_t alpha = surface->format->Amask; - uint8_t* data = (uint8_t*)surface->pixels; - for (int y = 0; y < surface->h; y++) - { - for (int x = 0; x < surface->w; x++) - { - uint32_t a = alpha & *(uint32_t*)(data + y * surface->pitch + x * 4); - if (a == 0) - { - isOpaque = false; - if (hasSemiTransparency) - { - return; - } - } - else if (a < alpha) - { - hasSemiTransparency = true; - if (!isOpaque) - { - return; - } - } - } - } - return; -} - -bool HALSDL2::doSampleTouch(int32_t& x, int32_t& y) const -{ - x = _x - getCurrentSkinX(); - y = _y - getCurrentSkinY(); - - if (DISPLAY_ROTATION == rotate90) - { - int32_t tmp = x; - x = y; - y = DISPLAY_WIDTH - tmp; - } - return popTouch(); -} - -uint8_t HALSDL2::keyPressed = 0; - -bool HALSDL2::sampleKey(uint8_t& key) -{ - if (keyPressed) - { - key = keyPressed; - keyPressed = 0; - return true; - } - return false; -} - -bool HALSDL2::singleSteppingEnabled = false; -uint16_t HALSDL2::singleSteppingSteps = 0; - -void HALSDL2::taskEntry() -{ - uint32_t lastTick = SDL_GetTicks(); - while (isAlive) - { - SDL_Event event; - if (SDL_PollEvent(&event) == 1) - { - switch (event.type) - { - case SDL_MOUSEMOTION: - _xMouse = event.motion.x; - _yMouse = event.motion.y; - if (debugInfoEnabled) - { - updateTitle(); - } - if ((event.motion.state & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0) - { - _x = _xMouse; - _y = _yMouse; - pushTouch(true); - } - if (isWindowBeingDragged) - { - int newMouseX; - int newMouseY; - SDL_GetGlobalMouseState(&newMouseX, &newMouseY); - SDL_SetWindowPosition(simulatorWindow, initialWindowX + (newMouseX - initialMouseX), initialWindowY + (newMouseY - initialMouseY)); - } - break; - - case SDL_MOUSEBUTTONDOWN: - SDL_CaptureMouse(SDL_TRUE); - if (event.button.button == SDL_BUTTON_LEFT) - { - _x = event.motion.x; - _y = event.motion.y; - pushTouch(true); - } - isWindowBeingDragged = (event.button.button == SDL_BUTTON_RIGHT); - if (isWindowBeingDragged) - { - SDL_GetWindowPosition(simulatorWindow, &initialWindowX, &initialWindowY); - SDL_GetGlobalMouseState(&initialMouseX, &initialMouseY); - } - break; - - case SDL_MOUSEBUTTONUP: - SDL_CaptureMouse(SDL_FALSE); - if (event.button.button == SDL_BUTTON_LEFT) - { - pushTouch(false); - } - if (isWindowBeingDragged) - { - int newMouseX; - int newMouseY; - SDL_GetGlobalMouseState(&newMouseX, &newMouseY); - SDL_SetWindowPosition(simulatorWindow, initialWindowX + (newMouseX - initialMouseX), initialWindowY + (newMouseY - initialMouseY)); - isWindowBeingDragged = false; - } - break; - - case SDL_TEXTINPUT: - if (strlen(event.text.text) == 1) - { - keyPressed = (uint8_t)(event.text.text[0]); - } - break; - - case SDL_KEYUP: - if (event.key.keysym.sym == SDLK_F1) - { - debugInfoEnabled = !debugInfoEnabled; - updateTitle(); - } - else if (event.key.keysym.sym == SDLK_F2) - { - setFlashInvalidatedAreas(!flashInvalidatedRect); - } - else if (event.key.keysym.sym == SDLK_F3) - { - if (event.key.keysym.mod & KMOD_CTRL) - { - // Repeat - saveNextScreenshots(50); - } - else if (event.key.keysym.mod & KMOD_SHIFT) - { - // clipboard - copyScreenshotToClipboard(); - } - else if (event.key.keysym.mod & KMOD_ALT) - { - // Do nothing - } - else if (event.key.keysym.mod & KMOD_GUI) - { - // Do nothing - } - else - { - // No modifiers - saveScreenshot(); - } - } - else if (event.key.keysym.sym == SDLK_F4) - { - if (currentSkin != 0 && currentSkin->surface) - { - isSkinActive = !isSkinActive; - } - else - { - isWindowBorderless = !isWindowBorderless; - } - recreateWindow(); - } - else if (event.key.keysym.sym == SDLK_ESCAPE) - { - isAlive = false; - } - else if (event.key.keysym.sym == SDLK_F5) - { - Application::getInstance()->changeToStartScreen(); - // If stopped in single stepping, perform one step - if (singleSteppingEnabled && singleSteppingSteps == 0) - { - singleSteppingSteps++; - } - } - else if (event.key.keysym.sym == SDLK_F9) - { - setSingleStepping(!singleSteppingEnabled); - } - else if (event.key.keysym.sym == SDLK_F10) - { - if (singleSteppingEnabled) - { - singleSteppingSteps++; - } - } - break; - - case SDL_QUIT: - isAlive = false; - break; - - case SDL_WINDOWEVENT: - switch (event.window.event) - { - case SDL_WINDOWEVENT_EXPOSED: - // Window has been exposed and should be redrawn - if (simulatorWindow != NULL) - { - Rect display(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT); - renderLCD_FrameBufferToMemory(display, doRotate(scaleTo24bpp(getTFTFrameBuffer(), lcd().framebufferFormat()))); - } - break; - case SDL_WINDOWEVENT_CLOSE: - // The window manager requests that the window be closed - isAlive = false; - break; - } - break; - default: - break; - } - } - else // No SDL event waiting - { - uint32_t thisTick = SDL_GetTicks(); - int msSinceLastTick = thisTick - lastTick; - lastTick = thisTick; - - msPassed += msSinceLastTick; - if (msPassed >= msBetweenTicks) - { - if (singleSteppingEnabled && singleSteppingSteps == 0) - { - // Eat up extra ms when waiting for next step - while (msPassed >= msBetweenTicks) - { - msPassed -= msBetweenTicks; - } - } - else - { - while (msPassed >= msBetweenTicks) - { - msPassed -= msBetweenTicks; - vSync(); - } - backPorchExited(); - frontPorchEntered(); - if (screenshotcount > 0) - { - screenshotcount--; - saveScreenshot(); - } - } - if (singleSteppingEnabled && singleSteppingSteps > 0) - { - singleSteppingSteps--; - } - } - else - { - // Sleep until we have the next tick - uint32_t delay = (uint32_t)(msBetweenTicks - msPassed); - // Due to rounding, delay might be zero. - SDL_Delay(delay == 0 ? 1 : delay); - } - } - } -} - -void HALSDL2::recreateWindow(bool updateContent /*= true*/) -{ -#if defined(WIN32) || defined(_WIN32) - mainThreadHandle = GetCurrentThreadId(); -#endif - - int windowX = SDL_WINDOWPOS_UNDEFINED; - int windowY = SDL_WINDOWPOS_UNDEFINED; - if (simulatorWindow != NULL) - { - // Save previous coordinates - SDL_GetWindowPosition(simulatorWindow, &windowX, &windowY); - SDL_DestroyRenderer(simulatorRenderer); - SDL_DestroyWindow(simulatorWindow); - } - int width = DISPLAY_WIDTH; - int height = DISPLAY_HEIGHT; - if (isSkinActive && currentSkin != 0) - { - width = currentSkin->surface->w; - height = currentSkin->surface->h; - } - if (isSkinActive && currentSkin != 0) - { - simulatorWindow = SDL_CreateShapedWindow(getWindowTitle(), windowX, windowY, width, height, SDL_WINDOW_BORDERLESS | (isWindowVisible ? 0 : SDL_WINDOW_HIDDEN)); - SDL_WindowShapeMode mode; - mode.mode = ShapeModeBinarizeAlpha; - mode.parameters.binarizationCutoff = 255; - SDL_SetWindowShape(simulatorWindow, currentSkin->surface, &mode); - SDL_SetWindowSize(simulatorWindow, width, height); - SDL_SetWindowPosition(simulatorWindow, windowX, windowY); - } - else - { - simulatorWindow = SDL_CreateWindow(getWindowTitle(), windowX, windowY, width, height, (isWindowBorderless ? SDL_WINDOW_BORDERLESS : 0) | (isWindowVisible ? 0 : SDL_WINDOW_HIDDEN)); - } - simulatorRenderer = SDL_CreateRenderer(simulatorWindow, -1, 0); - SDL_SetRenderDrawBlendMode(simulatorRenderer, SDL_BLENDMODE_ADD); - if (updateContent) - { - Rect display(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT); - renderLCD_FrameBufferToMemory(display, doRotate(scaleTo24bpp(getTFTFrameBuffer(), lcd().framebufferFormat()))); - } - updateTitle(); - // Re-add window icon in case - SDL_Surface* iconSurface = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 16, 32 * 2, 0xf800, 0x07e0, 0x001f, 0x0000); - SDL_SetWindowIcon(simulatorWindow, iconSurface); - SDL_FreeSurface(iconSurface); -} - -uint16_t* HALSDL2::getTFTFrameBuffer() const -{ - return tft; -} - -static Rect dirty; - -uint8_t* HALSDL2::scaleTo24bpp(uint16_t* src, Bitmap::BitmapFormat format) -{ - if (format == Bitmap::RGB888) - { - if (tft_framebuffer24_allocated) - { - delete[] tft_framebuffer24; - tft_framebuffer24_allocated = false; - } - tft_framebuffer24 = reinterpret_cast(src); - return tft_framebuffer24; - } - - if (!tft_framebuffer24_allocated) - { - tft_framebuffer24 = new uint8_t[HALSDL2__FRAME_BUFFER_WIDTH * HALSDL2__FRAME_BUFFER_HEIGHT * 3]; - tft_framebuffer24_allocated = true; - } - uint8_t* buffer = reinterpret_cast(src); - uint8_t* dst = tft_framebuffer24; - switch (format) - { - case Bitmap::BW: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcXbyte = 0; srcXbyte < HALSDL2__FRAME_BUFFER_WIDTH / 8; srcXbyte++) - { - uint8_t bufbyte = *buffer++; - for (int srcXpixel = 0; srcXpixel < 8; srcXpixel++) - { - uint8_t pixel = ((bufbyte << srcXpixel) & 0xFF) >> 7; - uint8_t pixelByte = pixel * 0xFF; - *dst++ = pixelByte; - *dst++ = pixelByte; - *dst++ = pixelByte; - } - } - // Check if there is a partial byte left - if (HALSDL2__FRAME_BUFFER_WIDTH % 8 != 0) - { - uint8_t bufbyte = *buffer++; - for (int srcXpixel = 0; srcXpixel < HALSDL2__FRAME_BUFFER_WIDTH % 8; srcXpixel++) - { - uint8_t pixel = ((bufbyte << srcXpixel) & 0xFF) >> 7; - uint8_t pixelByte = pixel * 0xFF; - *dst++ = pixelByte; - *dst++ = pixelByte; - *dst++ = pixelByte; - } - } - } - break; - - case Bitmap::GRAY2: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcXbyte = 0; srcXbyte < (HALSDL2__FRAME_BUFFER_WIDTH * 2) / 8; srcXbyte++) - { - uint8_t bufbyte = *buffer++; - for (int srcXpixel = 0; srcXpixel < 4; srcXpixel++) - { - uint8_t pixel = bufbyte & 3; - bufbyte >>= 2; - uint8_t pixelByte = pixel * 0x55; - *dst++ = pixelByte; - *dst++ = pixelByte; - *dst++ = pixelByte; - } - } - // Check if there is a partial byte left - if ((HALSDL2__FRAME_BUFFER_WIDTH * 2) % 8 != 0) - { - uint8_t bufbyte = *buffer++; - for (int srcXpixel = 0; srcXpixel < ((HALSDL2__FRAME_BUFFER_WIDTH * 2) % 8) / 2; srcXpixel++) - { - uint8_t pixel = bufbyte & 3; - bufbyte >>= 2; - uint8_t pixelByte = pixel * 0x55; - *dst++ = pixelByte; - *dst++ = pixelByte; - *dst++ = pixelByte; - } - } - } - break; - - case Bitmap::GRAY4: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcXbyte = 0; srcXbyte < (HALSDL2__FRAME_BUFFER_WIDTH * 4) / 8; srcXbyte++) - { - uint8_t bufbyte = *buffer++; - for (int srcXpixel = 0; srcXpixel < 2; srcXpixel++) - { - uint8_t pixel = bufbyte & 0xF; - bufbyte >>= 4; - uint8_t pixelByte = pixel * 0x11; - *dst++ = pixelByte; - *dst++ = pixelByte; - *dst++ = pixelByte; - } - } - // Check if there is a partial byte left - if ((HALSDL2__FRAME_BUFFER_WIDTH * 4) % 8 != 0) - { - uint8_t bufbyte = *buffer++; - for (int srcXpixel = 0; srcXpixel < ((HALSDL2__FRAME_BUFFER_WIDTH * 4) % 8) / 4; srcXpixel++) - { - uint8_t pixel = bufbyte & 0xF; - bufbyte >>= 4; - uint8_t pixelByte = pixel * 0x11; - *dst++ = pixelByte; - *dst++ = pixelByte; - *dst++ = pixelByte; - } - } - } - break; - - case Bitmap::ARGB2222: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcX = 0; srcX < HALSDL2__FRAME_BUFFER_WIDTH; srcX++) - { - uint16_t bufword = *buffer++; - uint8_t r = (bufword >> 4) & 0x3; - uint8_t g = (bufword >> 2) & 0x3; - uint8_t b = bufword & 0x3; - *dst++ = b * 0x55; - *dst++ = g * 0x55; - *dst++ = r * 0x55; - } - } - break; - - case Bitmap::ABGR2222: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcX = 0; srcX < HALSDL2__FRAME_BUFFER_WIDTH; srcX++) - { - uint16_t bufword = *buffer++; - uint8_t r = bufword & 0x3; - uint8_t g = (bufword >> 2) & 0x3; - uint8_t b = (bufword >> 4) & 0x3; - *dst++ = b * 0x55; - *dst++ = g * 0x55; - *dst++ = r * 0x55; - } - } - break; - - case Bitmap::RGBA2222: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcX = 0; srcX < HALSDL2__FRAME_BUFFER_WIDTH; srcX++) - { - uint16_t bufword = *buffer++; - uint8_t r = (bufword >> 6) & 0x3; - uint8_t g = (bufword >> 4) & 0x3; - uint8_t b = (bufword >> 2) & 0x3; - *dst++ = b * 0x55; - *dst++ = g * 0x55; - *dst++ = r * 0x55; - } - } - break; - - case Bitmap::BGRA2222: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcX = 0; srcX < HALSDL2__FRAME_BUFFER_WIDTH; srcX++) - { - uint16_t bufword = *buffer++; - uint8_t r = (bufword >> 2) & 0x3; - uint8_t g = (bufword >> 4) & 0x3; - uint8_t b = (bufword >> 6) & 0x3; - *dst++ = b * 0x55; - *dst++ = g * 0x55; - *dst++ = r * 0x55; - } - } - break; - - case Bitmap::RGB565: - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcX = 0; srcX < HALSDL2__FRAME_BUFFER_WIDTH; srcX++) - { - uint16_t bufword = *src++; - *dst++ = Color::getBlueFromRGB565(bufword); - *dst++ = Color::getGreenFromRGB565(bufword); - *dst++ = Color::getRedFromRGB565(bufword); - } - } - break; - - case Bitmap::ARGB8888: - { - uint32_t* src32 = reinterpret_cast(src); - for (int srcY = 0; srcY < HALSDL2__FRAME_BUFFER_HEIGHT; srcY++) - { - for (int srcX = 0; srcX < HALSDL2__FRAME_BUFFER_WIDTH; srcX++) - { - uint32_t pixel = *src32++; - uint8_t b = pixel & 0xFF; - uint8_t g = (pixel >> 8) & 0xFF; - uint8_t r = (pixel >> 16) & 0xFF; - *dst++ = b; - *dst++ = g; - *dst++ = r; - } - } - } - break; - case Bitmap::BW_RLE: - case Bitmap::RGB888: - case Bitmap::L8: - default: - assert(0 && "unsupported screen depth"); - break; - } - - return tft_framebuffer24; -} - -uint8_t* HALSDL2::doRotate(uint8_t* src) -{ - if (DISPLAY_ROTATION == rotate0 && DISPLAY_WIDTH == HALSDL2__FRAME_BUFFER_WIDTH) - { - // Height does not need to be exactly the same - return src; - } - if (!tft_display24_allocated) - { - tft_display24 = new uint8_t[DISPLAY_WIDTH * DISPLAY_HEIGHT * 3]; // 24bpp, hence *3 - tft_display24_allocated = true; - } - switch (DISPLAY_ROTATION) - { - case rotate0: - for (int16_t y = 0; y < DISPLAY_HEIGHT; y++) - { - for (int16_t x = 0; x < DISPLAY_WIDTH; x++) - { - for (int i = 0; i < 3; i++) - { - tft_display24[(x + y * DISPLAY_WIDTH) * 3 + i] = src[(x + y * HALSDL2__FRAME_BUFFER_WIDTH) * 3 + i]; - } - } - } - return tft_display24; - - case rotate90: - for (int16_t dstY = 0; dstY < DISPLAY_HEIGHT; dstY++) - { - const int16_t srcX = dstY; - for (int16_t dstX = 0; dstX < DISPLAY_WIDTH; dstX++) - { - const int16_t srcY = (DISPLAY_WIDTH - 1) - dstX; - for (int i = 0; i < 3; i++) - { - tft_display24[(dstX + dstY * DISPLAY_WIDTH) * 3 + i] = src[(srcX + srcY * HALSDL2__FRAME_BUFFER_WIDTH) * 3 + i]; - } - } - } - return tft_display24; - } - return 0; -} - -bool HALSDL2::printToFile(const char* filename) -{ - if (printFile) - { - fclose(printFile); - printFile = 0; - } - if (filename) - { -#ifdef __GNUC_ - printFile = fopen(filename, "w"); - return printFile != 0; -#else - return fopen_s(&printFile, filename, "w") == 0; -#endif - } - return true; -} - -void HALSDL2::setTFTFrameBuffer(uint16_t* adr) -{ - if (getFrameRefreshStrategy() != REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER) - { - // Save current framebuffer address - tft = adr; - renderLCD_FrameBufferToMemory(dirty, doRotate(scaleTo24bpp(adr, lcd().framebufferFormat()))); - } - else - { - // Wait for transfers to complete - while (frameBufferAllocator->hasBlockReadyForTransfer()) - { - FrameBufferAllocatorWaitOnTransfer(); - } - - // Always use the original tft buffer as screen memory GRAM - renderLCD_FrameBufferToMemory(dirty, doRotate(scaleTo24bpp(tft, lcd().framebufferFormat()))); - } - dirty = Rect(); -} - -void HALSDL2::flushFrameBuffer() -{ - Rect display(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT); - flushFrameBuffer(display); -} - -static int transferThreadFunc(void* ptr) -{ - FrameBufferAllocator* fbAllocator = HAL::getInstance()->getFrameBufferAllocator(); - Bitmap::BitmapFormat framebufferFormat = HAL::getInstance()->lcd().framebufferFormat(); - while (1) - { - // Wait for blocks to transfer - SDL_SemWait(sem_transfer_ready); - - while (fbAllocator->hasBlockReadyForTransfer()) - { - Rect transfer_rect; - const uint8_t* src = fbAllocator->getBlockForTransfer(transfer_rect); - // touchgfx_printf("transfer: (%d,%d w%d,h%d)\n", transfer_rect.x, transfer_rect.y, transfer_rect.width, transfer_rect.height); - - switch (framebufferFormat) - { - case Bitmap::RGB565: - { - const uint16_t* src16 = (const uint16_t*)src; - uint16_t* dst16 = tft + transfer_rect.y * HALSDL2__FRAME_BUFFER_WIDTH + transfer_rect.x; - for (int srcY = 0; srcY < transfer_rect.height; srcY++) - { - for (int srcX = 0; srcX < transfer_rect.width; srcX++) - { - *dst16++ = *src16++; - } - dst16 += HALSDL2__FRAME_BUFFER_WIDTH - transfer_rect.width; - } - - break; - } - case Bitmap::RGB888: - { - uint8_t* dst = (uint8_t*)tft + (transfer_rect.y * HALSDL2__FRAME_BUFFER_WIDTH + transfer_rect.x) * 3; - for (int srcY = 0; srcY < transfer_rect.height; srcY++) - { - for (int srcX = 0; srcX < transfer_rect.width; srcX++) - { - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - } - dst += (HALSDL2__FRAME_BUFFER_WIDTH - transfer_rect.width) * 3; - } - - break; - } - default: - assert(!"HALSDL2::REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER only supports 16bit or 24bit framebuffer"); - break; - } - fbAllocator->freeBlockAfterTransfer(); - } - - // Signal drawing part - if (SDL_SemValue(sem_transfer_done) == 0) - { - SDL_SemPost(sem_transfer_done); - } - } -} - -void FrameBufferAllocatorWaitOnTransfer() -{ - SDL_SemWait(sem_transfer_done); -} - -void FrameBufferAllocatorSignalBlockDrawn() -{ - // Signal transfer part - if (SDL_SemValue(sem_transfer_ready) == 0) - { - SDL_SemPost(sem_transfer_ready); - } -} - -void HALSDL2::flushFrameBuffer(const Rect& rect) -{ - if (flashInvalidatedRect) - { - SDL_Rect flashRect; - flashRect.x = rect.x + getCurrentSkinX(); - flashRect.y = rect.y + getCurrentSkinY(); - flashRect.w = rect.width; - flashRect.h = rect.height; - - SDL_SetRenderDrawBlendMode(simulatorRenderer, SDL_BLENDMODE_BLEND); - SDL_SetRenderDrawColor(simulatorRenderer, 0, 0, 0, 127); - SDL_RenderFillRect(simulatorRenderer, &flashRect); - SDL_RenderPresent(simulatorRenderer); - SDL_SetRenderDrawBlendMode(simulatorRenderer, SDL_BLENDMODE_BLEND); - SDL_SetRenderDrawColor(simulatorRenderer, 255, 255, 255, 127); - SDL_RenderFillRect(simulatorRenderer, &flashRect); - SDL_RenderPresent(simulatorRenderer); - } - - if (getFrameRefreshStrategy() != REFRESH_STRATEGY_PARTIAL_FRAMEBUFFER) - { - dirty.expandToFit(rect); - } - else - { - frameBufferAllocator->markBlockReadyForTransfer(); - // For testing during transfers. - // renderLCD_FrameBufferToMemory(dirty, doRotate(scaleTo24bpp(tft, lcd().framebufferFormat()))); - } - HAL::flushFrameBuffer(rect); -} - -void HALSDL2::setVsyncInterval(float ms) -{ - msBetweenTicks = ms; - msPassed = 0.0f; -} - -void HALSDL2::saveScreenshot(char* folder, char* filename) -{ - const char* dir = "screenshots"; -#if defined(WIN32) || defined(_WIN32) - CreateDirectory(dir, 0); -#elif defined(__GNUC__) - mkdir(dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); -#endif - - char fullPathAndName[500]; - if (folder) - { - sprintf_s(fullPathAndName, sizeof(fullPathAndName), "%s/%s", dir, folder); -#if defined(WIN32) || defined(_WIN32) - CreateDirectory(fullPathAndName, 0); -#elif defined(__GNUC__) - mkdir(fullPathAndName, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); -#endif - sprintf_s(fullPathAndName, sizeof(fullPathAndName), "%s/%s/%s", dir, folder, filename); - } - else - { - sprintf_s(fullPathAndName, sizeof(fullPathAndName), "%s/%s", dir, filename); - } - - int width; - int height; - if (SDL_GetRendererOutputSize(simulatorRenderer, &width, &height) == 0) - { - // Create an empty surface that will be used to create the screenshot bmp file - SDL_Surface* windowSurface = SDL_CreateRGBSurface(0, width, height, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); - if (windowSurface != 0) - { - // Read the pixels from the current render target and save them onto the surface - SDL_RenderReadPixels(simulatorRenderer, NULL, SDL_GetWindowPixelFormat(simulatorWindow), windowSurface->pixels, windowSurface->pitch); - - // Create the bmp screenshot file - SDL_SaveBMP(windowSurface, fullPathAndName); - - // Destroy the screenshot surface - SDL_FreeSurface(windowSurface); - } - } -} - -void HALSDL2::saveScreenshot() -{ - static char lastBaseName[20] = { 0 }; - static int counter = 0; - - // current date/time based on current system - time_t t = time(0); - tm localt; - localtime_s(&localt, &t); - - char baseName[20]; // "img_YYYYMMDD_HHMMSS" is 19 long - sprintf_s(baseName, 20, "img_%04d%02d%02d_%02d%02d%02d", - 1900 + localt.tm_year, localt.tm_mon + 1, localt.tm_mday, - localt.tm_hour, localt.tm_min, localt.tm_sec); - - char fileName[100]; - if (strncmp(baseName, lastBaseName, sizeof(baseName)) == 0) - { - // Same as previous time stamp. Add counter. - counter++; - sprintf_s(fileName, sizeof(fileName), "%s_%d.bmp", baseName, counter); - } - else - { - // New time stamp. Save it and clear counter. - strncpy_s(lastBaseName, sizeof(lastBaseName), baseName, sizeof(baseName)); - counter = 0; - sprintf_s(fileName, sizeof(fileName), "%s.bmp", baseName); - } - - saveScreenshot(0, fileName); -} - -void HALSDL2::saveNextScreenshots(int n) -{ - screenshotcount += n; -} - -void HALSDL2::copyScreenshotToClipboard() -{ -#ifdef __linux__ - touchgfx_printf("Copying to clipboard has not been implemented for Linux\n"); -#else - if (!OpenClipboard(NULL)) - { - touchgfx_printf("Unable to OpenClipboard\n"); - return; - } - - if (!EmptyClipboard()) - { - touchgfx_printf("Unable to EmptyClipboard\n"); - return; - } - - uint8_t* buffer24 = doRotate(scaleTo24bpp(getTFTFrameBuffer(), lcd().framebufferFormat())); - DWORD size_pixels = DISPLAY_WIDTH * DISPLAY_HEIGHT * 3; - - HGLOBAL hMem = GlobalAlloc(GHND, sizeof(BITMAPV5HEADER) + size_pixels); - if (!hMem) - { - touchgfx_printf("Error allocating memory for bitmap data"); - return; - } - - BITMAPV5HEADER* hdr = (BITMAPV5HEADER*)GlobalLock(hMem); - if (!hdr) - { - touchgfx_printf("Error locking memory for bitmap data"); - GlobalFree(hMem); - return; - } - - memset(hdr, 0, sizeof(BITMAPV5HEADER)); - - hdr->bV5Size = sizeof(BITMAPV5HEADER); - hdr->bV5Width = DISPLAY_WIDTH; - hdr->bV5Height = -DISPLAY_HEIGHT; - hdr->bV5Planes = 1; - hdr->bV5BitCount = 24; - hdr->bV5Compression = BI_RGB; - hdr->bV5SizeImage = size_pixels; - hdr->bV5Intent = LCS_GM_GRAPHICS; - hdr->bV5CSType = 0x57696E20; - - CopyMemory(hdr + 1, buffer24, size_pixels); - GlobalUnlock(hMem); - - if (!SetClipboardData(CF_DIBV5, hMem)) - { - touchgfx_printf("Unable to SetClipboardData\n"); - } - - CloseClipboard(); -#endif -} - -void HALSDL2::setFlashInvalidatedAreas(bool flash /*= true*/) -{ - flashInvalidatedRect = flash; - updateTitle(); -} - -void HALSDL2::setSingleStepping(bool singleStepping /*= true*/) -{ - singleSteppingEnabled = singleStepping; - singleSteppingSteps = 0; - updateTitle(); -} - -bool HALSDL2::isSingleStepping() -{ - return singleSteppingEnabled; -} - -void HALSDL2::singleStep(uint16_t steps /*= 1*/) -{ - if (singleSteppingEnabled) - { - singleSteppingSteps += steps; - } -} - -void HALSDL2::stopApplication() -{ - isAlive = false; -} - -#ifdef __linux__ -void simulator_enable_stdio() -{ -} - -void simulator_printf(const char* format, va_list pArg) -{ - vprintf(format, pArg); - HALSDL2* hal = static_cast(HAL::getInstance()); - if (hal->getPrintFile()) - { - vfprintf(hal->getPrintFile(), format, pArg); - } -} -#else -char** HALSDL2::getArgv(int* argc) -{ - LPWSTR cmdline = GetCommandLineW(); - LPWSTR* argvw = CommandLineToArgvW(cmdline, argc); - char** argv = new char*[*argc]; - for (int i = 0; i < *argc; i++) - { - char buffer[1000]; - size_t numChars = wcslen(argvw[0]) + 1; - wcstombs_s(&numChars, buffer, sizeof(buffer), argvw[i], numChars); - argv[i] = new char[numChars + 1]; - memcpy_s(argv[i], numChars, buffer, numChars); - argv[i][numChars] = '\0'; - } - return argv; -} - -void simulator_enable_stdio() -{ -#ifdef __GNUC__ -#define freopen_s(pFile, filename, mode, pStream) (((*(pFile)) = freopen((filename), (mode), (pStream))) == NULL) -#endif - HALSDL2* hal = static_cast(HAL::getInstance()); - if (hal->getConsoleVisible()) - { - HWND consoleHwnd = GetConsoleWindow(); // Get handle of console window - if (!consoleHwnd) // No console window yet? - { - HWND activeHwnd = GetActiveWindow(); // Remember which window is active - - AllocConsole(); // Allocate a new console - isConsoleAllocated = true; - consoleHwnd = GetConsoleWindow(); // Get handle of console window - - FILE* dummy; - freopen_s(&dummy, "CONIN$", "r", stdin); // Redirect stdin/stdout/stderr to the new console - freopen_s(&dummy, "CONOUT$", "w", stdout); - freopen_s(&dummy, "CONOUT$", "w", stderr); - - SwitchToThisWindow(activeHwnd, true); // Switch back to the originally active window - } - if (consoleHwnd) - { - ShowWindow(consoleHwnd, SW_SHOW); // Show/hide it! - } - } - else - { - HWND consoleHwnd = GetConsoleWindow(); // Get handle of console window - if (consoleHwnd && isConsoleAllocated) - { - ShowWindow(consoleHwnd, SW_HIDE); - } - } -} - -void simulator_printf(const char* format, va_list pArg) -{ - // Create a console window, if window is visible. - simulator_enable_stdio(); - if (GetConsoleWindow()) - { - vprintf(format, pArg); - } - HALSDL2* hal = static_cast(HAL::getInstance()); - if (hal && hal->getPrintFile()) - { - vfprintf(hal->getPrintFile(), format, pArg); - } -} -#endif - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp deleted file mode 100644 index 5d5a926..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -uint16_t HALSDL2::icon[] = { - 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, - 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x3dbd, - 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bc, 0x45bd, 0x3dbd, 0x45bc, - 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x45bd, - 0x3dbd, 0x45bc, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x3d9c, 0x3dbc, 0x3d9c, 0x459c, 0x3dbc, 0x3d9c, 0x459c, 0x3dbc, 0x45bd, 0x3dbd, - 0x3dbd, 0x45bd, 0x45bd, 0x461e, 0x461e, 0x461e, 0x4e1f, 0x461e, 0x461e, 0x4e1e, 0x461f, 0x461e, 0x4e1e, 0x461e, 0x461f, 0x4e1e, 0x461e, 0x461e, 0x4e1f, 0x461e, 0x461e, 0x4e1e, 0x461f, 0x461e, 0x461e, 0x461e, 0x461f, 0x461e, 0x461e, 0x45bd, 0x3dbd, 0x45bd, - 0x3dbd, 0x45bd, 0x3d7c, 0x2c16, 0x2394, 0x23b4, 0x23b5, 0x23b4, 0x23b4, 0x23b5, 0x23b4, 0x2394, 0x23b4, 0x23b4, 0x23b5, 0x23b4, 0x23b4, 0x23b5, 0x23b4, 0x23b4, 0x23b5, 0x23b4, 0x23b4, 0x23b5, 0x23b4, 0x23b4, 0x23b4, 0x2395, 0x3416, 0x3d7c, 0x3dbd, 0x45bc, - 0x3d9c, 0x461e, 0x2b93, 0x18e8, 0x52ae, 0x4a8e, 0x528e, 0x528e, 0x4a8e, 0x528e, 0x528e, 0x52ae, 0x52ae, 0x52ae, 0x4a8e, 0x528e, 0x528e, 0x4a8e, 0x528e, 0x528e, 0x528e, 0x4a8e, 0x528e, 0x528e, 0x528e, 0x528e, 0x4a8e, 0x52ae, 0x18e7, 0x2b93, 0x461e, 0x3d9c, - 0x3d9c, 0x461e, 0x1af1, 0x6b50, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6350, 0x1af1, 0x461f, 0x3d9c, - 0x3d9c, 0x463f, 0x1af2, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x5b71, 0x092a, 0x322d, 0xef9e, 0xffff, 0xffff, 0xf7df, 0x5e1d, 0x45bc, 0x765d, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af2, 0x463f, 0x459c, - 0x459c, 0x463f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xb5d8, 0x00c8, 0x0088, 0x7c54, 0xffff, 0xffff, 0x9ebe, 0x2d9c, 0x359d, 0xbf3f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af1, 0x463f, 0x3d9c, - 0x3d9c, 0x461f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x42cf, 0x0087, 0x326d, 0xffff, 0xefbf, 0x45dd, 0x359d, 0x6e3d, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af1, 0x461f, 0x459c, - 0x3d9c, 0x463f, 0x1af2, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xc65a, 0x0047, 0x9d57, 0xffff, 0x8e9e, 0x359c, 0x3d9d, 0xcf5f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af2, 0x463f, 0x3d9c, - 0x459c, 0x463f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x8495, 0xffdf, 0xe7bf, 0x45bd, 0x359c, 0x765e, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af1, 0x463f, 0x459c, - 0x3d9c, 0x461f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x7e7d, 0x359d, 0x45bd, 0xdf9f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af1, 0x461f, 0x3d9c, - 0x3d9c, 0x463f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x5e1d, 0x359d, 0x4ddd, 0xf7ff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af2, 0x463e, 0x459c, - 0x459c, 0x463f, 0x1af2, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xd6dc, 0xffff, 0xc73f, 0x3d9c, 0x359c, 0x96be, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af2, 0x461f, 0x3d9c, - 0x3d9c, 0x461f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xdefc, 0x0109, 0xd69b, 0xffff, 0x6e3d, 0x359d, 0x45bd, 0xe7bf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af1, 0x463f, 0x459c, - 0x3d9c, 0x4e3f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x5b71, 0x0047, 0x4b10, 0xffff, 0xd77f, 0x3dbd, 0x359d, 0x867e, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af1, 0x463f, 0x3d9c, - 0x3d9c, 0x463f, 0x1af1, 0x6b70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xc65a, 0x0109, 0x00c8, 0x6391, 0xffff, 0xffff, 0x869e, 0x359c, 0x3dbd, 0xd77f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x6b70, 0x1af2, 0x461e, 0x459c, - 0x3d9c, 0x461f, 0x1af2, 0x6b70, 0xffff, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x324d, 0x0047, 0x092a, 0xe73d, 0xffff, 0xffff, 0xe7bf, 0x459c, 0x2d5c, 0x661d, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffff, 0x6b50, 0x1af2, 0x463f, 0x3d9c, - 0x459c, 0x4e3f, 0x1af1, 0x7391, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xd69b, 0xc65a, 0xe73d, 0xffff, 0xffff, 0xffff, 0xffff, 0xefff, 0xd7df, 0xdfdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x7391, 0x1af1, 0x463e, 0x459d, - 0x3d9c, 0x461e, 0x2332, 0x31ab, 0x9d16, 0x9cf6, 0x9cf6, 0x9cf6, 0x9cf6, 0x9cf6, 0x9cf6, 0xa577, 0xad77, 0xa557, 0x94f6, 0x9cf6, 0x9cf6, 0x9cf6, 0xa516, 0xa536, 0xa516, 0x9cf6, 0x9cf6, 0x9cf6, 0x9cf6, 0x9cf6, 0x94f6, 0x9d16, 0x31cb, 0x2332, 0x461e, 0x3d9c, - 0x3d9c, 0x461e, 0x2b73, 0x08c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00a8, 0x00a8, 0x00a8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00a8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x00c8, 0x08c8, 0x00c8, 0x08a7, 0x2b73, 0x461e, 0x3d9d, - 0x3d9d, 0x45fe, 0x2b94, 0x10a7, 0x1909, 0x18e8, 0x1908, 0x10e8, 0x18e8, 0x1908, 0x10e8, 0x18e8, 0x1908, 0x18e8, 0x18e8, 0x1908, 0x1908, 0x10e8, 0x18e8, 0x1908, 0x10e8, 0x18e8, 0x1908, 0x10e8, 0x1908, 0x10e8, 0x1908, 0x1909, 0x10a7, 0x2b94, 0x45fe, 0x3d9c, - 0x45bd, 0x45dd, 0x3d7c, 0x3415, 0x2bf5, 0x3416, 0x2bf5, 0x3416, 0x33f5, 0x2c16, 0x3415, 0x2bf5, 0x2c15, 0x2c15, 0x2bf5, 0x33f5, 0x2c15, 0x33f5, 0x3415, 0x2c15, 0x2bf5, 0x3415, 0x33f5, 0x2c15, 0x33f5, 0x33f5, 0x2c16, 0x2bf5, 0x3416, 0x3d7c, 0x45dd, 0x45bd, - 0x3dbd, 0x3dbd, 0x45dd, 0x45fe, 0x461e, 0x45fe, 0x461e, 0x45fe, 0x461e, 0x45fe, 0x45fe, 0x461e, 0x45fe, 0x461e, 0x461e, 0x45fe, 0x461e, 0x45fe, 0x461e, 0x45ff, 0x461e, 0x45fe, 0x461e, 0x461e, 0x45fe, 0x461e, 0x461e, 0x45fe, 0x45fe, 0x45dd, 0x3dbd, 0x3dbd, - 0x3dbd, 0x45bc, 0x3dbd, 0x3d9c, 0x3dbd, 0x3dbd, 0x3d9d, 0x3dbc, 0x3d9d, 0x3dbd, 0x3dbd, 0x3d9d, 0x459d, 0x3dbd, 0x3d9d, 0x3dbd, 0x3d9d, 0x3dbd, 0x3d9d, 0x3d9d, 0x3dbd, 0x3d9d, 0x3d9d, 0x3dbd, 0x3d9d, 0x3d9d, 0x3dbd, 0x3dbc, 0x3d9c, 0x45bd, 0x3dbd, 0x45bc, - 0x45bd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, - 0x3dbd, 0x3dbd, 0x45bc, 0x3dbd, 0x45bc, 0x45bc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbc, 0x45bd, 0x3dbd, 0x3dbc, 0x45bd, 0x45bc, 0x3dbc, 0x45bd, 0x45bc, 0x3dbc, 0x45bd, 0x45bc, 0x3dbd, 0x45bc, 0x45bd, 0x3dbd, 0x3dbc, 0x45bd, 0x3dbd, 0x3dbc, - 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x3dbc, 0x3dbd, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbc, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbd, 0x3dbd, 0x3dbd, 0x3dbd, 0x3dbd, 0x45bd, 0x3dbc, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, - 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x45bc, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bc, 0x3dbd, 0x3dbd, 0x45bd, 0x45bd, 0x45bc, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbc, 0x45bd, 0x45bd, 0x45bc, 0x45bd, 0x3dbd, 0x45bd, 0x45bd, 0x3dbd, 0x45bd, 0x3dbd, 0x45bd, 0x3dbd -}; - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp deleted file mode 100644 index cf4751e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -static SDL_mutex* s_FrameBufferLock = NULL; -static bool framebufferLocked = false; - -void OSWrappers::initialize() -{ - atexit(deinitialize); - // Setup framebuffer lock - s_FrameBufferLock = SDL_CreateMutex(); - framebufferLocked = false; -} - -void OSWrappers::deinitialize() -{ - if (s_FrameBufferLock) - { - SDL_DestroyMutex(s_FrameBufferLock); - s_FrameBufferLock = NULL; - } -} - -void OSWrappers::takeFrameBufferSemaphore() -{ - assert(!framebufferLocked && "Framebuffers already locked"); - framebufferLocked = true; - SDL_LockMutex(s_FrameBufferLock); -} - -void OSWrappers::giveFrameBufferSemaphore() -{ - assert(framebufferLocked && "Framebuffers not previously locked"); - framebufferLocked = false; - SDL_UnlockMutex(s_FrameBufferLock); -} - -void OSWrappers::waitForVSync() -{ -} - -void OSWrappers::tryTakeFrameBufferSemaphore() -{ -} - -void OSWrappers::giveFrameBufferSemaphoreFromISR() -{ -} - -void OSWrappers::taskYield() -{ -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp deleted file mode 100644 index c0ced80..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/CacheableContainer.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -CacheableContainer::CacheableContainer() - : Container(), - cachedBitmapId(BITMAP_INVALID), - cachedImage(), - isCachedMode(false), - childWasInvalidated(false) -{ -} - -void CacheableContainer::setCacheBitmap(BitmapId bitmapId) -{ - Bitmap bitmap(bitmapId); - - cachedBitmapId = BITMAP_INVALID; - - /* Accept only dynamic bitmaps */ - if (!Bitmap::dynamicBitmapGetAddress(bitmapId)) - { - return; - } - - /* Retrieve the auxiliary LCD implementation attached to HA */ - LCD* auxLCD = HAL::getInstance()->getAuxiliaryLCD(); - - /* Dynamic bitmap and framebuffer should be of the same format */ - if (bitmap.getFormat() == HAL::lcd().framebufferFormat() || - (auxLCD && bitmap.getFormat() == auxLCD->framebufferFormat())) - { - cachedBitmapId = bitmapId; - cachedImage.setBitmap(Bitmap(cachedBitmapId)); - } -} - -BitmapId CacheableContainer::getCacheBitmap() const -{ - return cachedBitmapId; -} - -void CacheableContainer::updateCache() -{ - updateCache(Rect()); -} - -void CacheableContainer::updateCache(const Rect& invalidatedArea) -{ - if (isCachedMode && (cachedBitmapId != BITMAP_INVALID)) - { - /* will call Container::draw(invalidatedArea) to render all widgets into the dynamic bitmap */ - HAL::getInstance()->drawDrawableInDynamicBitmap(*this, cachedBitmapId, invalidatedArea); - childWasInvalidated = false; - } -} - -void CacheableContainer::enableCachedMode(bool enable) -{ - isCachedMode = enable; -} - -void CacheableContainer::invalidateRect(Rect& invalidatedArea) const -{ - Container::invalidateRect(invalidatedArea); - - if (isCachedMode && (cachedBitmapId != BITMAP_INVALID)) - { - const_cast(this)->childWasInvalidated = true; - } -} - -bool CacheableContainer::setSolidRect(const Rect& solidRect) const -{ - return Bitmap::dynamicBitmapSetSolidRect(cachedBitmapId, solidRect); -} - -bool CacheableContainer::isChildInvalidated() const -{ - return childWasInvalidated; -} - -void CacheableContainer::setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement) -{ - if (isCachedMode && (cachedBitmapId != BITMAP_INVALID) && isVisible()) - { - Rect r = getAbsoluteRect(); - cachedImage.setPosition(r.x, r.y, r.width, r.height); - cachedImage.setupDrawChain(invalidatedArea, nextPreviousElement); - } - else - { - Container::setupDrawChain(invalidatedArea, nextPreviousElement); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp deleted file mode 100644 index fd2e291..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Container.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -bool Container::contains(const Drawable& d) -{ - bool found = false; - Drawable* head = firstChild; - while (head && !found) - { - found = (head == &d); - head = head->nextSibling; - } - return found; -} - -void Container::add(Drawable& d) -{ - assert(&d != this && "Cannot add Drawable to self"); - assert(d.parent == 0 && "Cannot add Drawable multiple times"); - - // Initialize d to have this as parent and no sibling. - d.parent = this; - d.nextSibling = 0; - - // Check if d is the first child to be added (container is empty) - if (!firstChild) - { - firstChild = &d; - } - else - { - Drawable* head = firstChild; - // Skip to end of currently added children - while (head->nextSibling) - { - assert(head != &d && "Cannot add Drawable multiple times"); - head = head->nextSibling; - } - assert(head != &d && "Cannot add Drawable multiple times"); - // Make last child now point to d. - head->nextSibling = &d; - } -} - -void Container::remove(Drawable& d) -{ - if (!firstChild) - { - // No children - return; - } - - if (&d == firstChild) - { - // d is first child. - d.parent = 0; - if (!d.nextSibling) - { - // d was only child, so now this container is empty - firstChild = 0; - } - else - { - firstChild = d.nextSibling; - d.nextSibling = 0; - } - return; - } - Drawable* tmp = firstChild; - - while (tmp) - { - if (tmp->nextSibling == &d) - { - tmp->nextSibling = d.nextSibling; - d.parent = 0; - d.nextSibling = 0; - return; - } - else - { - tmp = tmp->nextSibling; - } - } -} - -void Container::removeAll() -{ - while (firstChild) - { - Drawable* d = firstChild; - firstChild = firstChild->nextSibling; - d->parent = 0; - d->nextSibling = 0; - } -} - -void Container::unlink() -{ - firstChild = 0; -} - -void Container::draw(const Rect& invalidatedArea) const -{ - // The draw function of Container is not normally used. Containers do not per default - // appear in the draw chain, since they are normally invisible themselves. However, - // if someone decides to call draw on a container, at least do something useful (draw children). - if (!isVisible() || !firstChild) - { - // Nothing to draw - return; - } - - Rect tmp = invalidatedArea; - Drawable* d = firstChild; - while (d) - { - if (d->isVisible()) - { - Rect drawableRegion = tmp & d->getRect(); - if (!drawableRegion.isEmpty()) - { - // This child has a non-empty intersection with the invalidated area. - // Convert region to the Drawable's coordinate system and draw. - drawableRegion.x -= d->getX(); - drawableRegion.y -= d->getY(); - d->draw(drawableRegion); - } - } - d = d->nextSibling; - } -} - -void Container::getLastChild(int16_t x, int16_t y, Drawable** last) -{ - // This function is used to obtain the drawable that should receive a click/drag/gesture event. - // Find the last child (ie. the last child that was added, ie. the "front-most" drawable) covering - // the specified coords. - if (isTouchable()) - { - // If the container itself is touchable, result so far is "this". Might be overridden by a child. - *last = this; - } - - Drawable* d = firstChild; - while (d) - { - // Iterate over children. - if (d->isVisible() && d->getRect().intersect(x, y)) - { - int16_t xadj = x - d->getX(); - int16_t yadj = y - d->getY(); - d->getLastChild(xadj, yadj, last); - } - d = d->nextSibling; - } -} - -void Container::getLastChildNear(int16_t x, int16_t y, Drawable** last, int16_t* fingerAdjustmentX, int16_t* fingerAdjustmentY) -{ - const int fingerSize = HAL::getInstance()->getFingerSize(); - *fingerAdjustmentX = 0; - *fingerAdjustmentY = 0; - - *last = 0; - Container::getLastChild(x, y, last); - - const int fingerSizeDistance = 3; // Up to this number is not multi-sampled - if (fingerSize > fingerSizeDistance) - { - const Rect meAbsRect = getAbsoluteRect(); - - uint32_t bestDistance = 0xFFFFFFFF; - Drawable* previous = 0; // Speed up calculations if we hit the same drawable on next sample - if (*last) - { - // Touched a drawable, but perhaps there is a better alternative - previous = *last; - Rect absRect = (*last)->getAbsoluteRect(); - int dx = (x + meAbsRect.x) - (absRect.x + (absRect.width / 2)); - int dy = (y + meAbsRect.y) - (absRect.y + (absRect.height / 2)); - bestDistance = dx * dx + dy * dy; - } - - const int samplePoints[2][4][2] = { { { 0, -1 }, { -1, 0 }, { 1, 0 }, { 0, 1 } }, // above, left, right, below - { { -1, -1 }, { 1, -1 }, { -1, 1 }, { 1, 1 } } }; // up-left, up-right, down-left and down-right - const int maxRings = 3; - const int numRings = MIN(maxRings, (fingerSize - 1) / fingerSizeDistance); - for (int ring = 0; ring < numRings; ring++) - { - // For each 'ring' "distance" increases up to "fingerSize": - int distance = fingerSize * (ring + 1) / numRings; - for (int sampleIndex = 0; sampleIndex < 4; sampleIndex++) - { - const int* xy = samplePoints[ring % 2][sampleIndex]; - int16_t deltaX = xy[0] * distance; - int16_t deltaY = xy[1] * distance; - if (rect.intersect(x + deltaX, y + deltaY)) - { - Drawable* drawable = 0; - Container::getLastChild(x + deltaX, y + deltaY, &drawable); - if (drawable && drawable != previous) - { - previous = drawable; - Rect absRect = drawable->getAbsoluteRect(); - // Find distance to center of drawable - int dx = (x + meAbsRect.x) - (absRect.x + (absRect.width / 2)); - int dy = (y + meAbsRect.y) - (absRect.y + (absRect.height / 2)); - uint32_t dist = dx * dx + dy * dy; - // Check if this drawable center is closer than the previous - if (dist < bestDistance) - { - bestDistance = dist; - *last = drawable; - *fingerAdjustmentX = deltaX; - *fingerAdjustmentY = deltaY; - } - } - } - } - } - } -} - -Rect Container::getSolidRect() const -{ - return Rect(); -} - -Rect Container::getContainedArea() const -{ - Drawable* d = firstChild; - Rect contained; - while (d) - { - contained.expandToFit(d->getRect()); - d = d->nextSibling; - } - return contained; -} - -void Container::moveChildrenRelative(int16_t deltaX, int16_t deltaY) -{ - Drawable* d = firstChild; - while (d) - { - d->moveRelative(deltaX, deltaY); - d = d->nextSibling; - } -} - -void Container::forEachChild(GenericCallback* function) -{ - Drawable* d = firstChild; - while (d) - { - function->execute(*d); - d = d->nextSibling; - } -} - -void Container::insert(Drawable* previous, Drawable& d) -{ - if (!firstChild) - { - // Insert as only element - add(d); - return; - } - else if (!previous) - { - // Insert as head element - d.nextSibling = firstChild; - firstChild = &d; - d.parent = this; - } - else - { - Drawable* tmp = firstChild; - while (tmp) - { - if (tmp == previous) - { - d.nextSibling = tmp->nextSibling; - tmp->nextSibling = &d; - d.parent = this; - return; - } - tmp = tmp->nextSibling; - } - } -} - -void Container::setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement) -{ - // This function adds the children of this container to the list of drawables to draw. - if (!isVisible()) - { - // If this container itself is not visible, do not add anyone to draw chain. - return; - } - - if (!firstChild) - { - // If this container is empty, do not add anyone. - return; - } - Drawable* d = firstChild; - while (d) - { - if (d->isVisible()) - { - // Only drawables intersecting with the specified invalidated area will be added. - Rect drawableRegion = invalidatedArea & d->getRect(); - if (!drawableRegion.isEmpty()) - { - drawableRegion.x -= d->getX(); - drawableRegion.y -= d->getY(); - d->setupDrawChain(drawableRegion, nextPreviousElement); - } - } - d = d->nextSibling; - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp deleted file mode 100644 index 8da7ab2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ListLayout.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -class AdjustElements -{ -public: - AdjustElements(Drawable* d = 0, Direction dir = SOUTH) - : insertedCoord(0), - newElementPassed(false), - newElement(d), - direction(dir) - { - } - - void handleInsert(Drawable& d) - { - if (!newElementPassed) - { - if (newElement == &d) - { - newElementPassed = true; - } - else - { - if (direction == SOUTH) - { - insertedCoord = d.getY() + d.getHeight(); - } - else if (direction == EAST) - { - insertedCoord = d.getX() + d.getWidth(); - } - } - } - else - { - if (direction == SOUTH) - { - d.setY(d.getY() + newElement->getHeight()); - } - else if (direction == EAST) - { - d.setX(d.getX() + newElement->getWidth()); - } - } - } - - void handleRemove(Drawable& d) - { - if (!newElementPassed) - { - if (newElement == &d) - { - newElementPassed = true; - } - } - else - { - if (direction == SOUTH) - { - d.setY(d.getY() - newElement->getHeight()); - } - else if (direction == EAST) - { - d.setX(d.getX() - newElement->getWidth()); - } - } - if (newElement != &d) - { - if (direction == SOUTH) - { - if (d.getWidth() > insertedCoord) - { - insertedCoord = d.getWidth(); - } - } - else if (direction == EAST) - { - if (d.getHeight() > insertedCoord) - { - insertedCoord = d.getHeight(); - } - } - } - } - - int16_t insertedCoord; - bool newElementPassed; - -private: - Drawable* newElement; - Direction direction; -}; - -void ListLayout::internalAddElementAt(Drawable& d, int16_t coord) -{ - switch (direction) - { - case SOUTH: - if (rect.width < d.getWidth()) - { - rect.width = d.getWidth(); - } - rect.height += d.getHeight(); - d.setXY(0, coord); - offset += d.getHeight(); - break; - case EAST: - if (rect.height < d.getHeight()) - { - rect.height = d.getHeight(); - } - rect.width += d.getWidth(); - d.setXY(coord, 0); - offset += d.getWidth(); - break; - case NORTH: - case WEST: - break; - } -} - -void ListLayout::internalAddElement(Drawable& d) -{ - internalAddElementAt(d, offset); -} - -void ListLayout::internalRemoveElement(Drawable& d, int16_t coord) -{ - switch (direction) - { - case SOUTH: - if (rect.width > coord) - { - rect.width = coord; - } - rect.height -= d.getHeight(); - d.setX(0); - d.setY(0); - offset -= d.getHeight(); - break; - case EAST: - if (rect.height > coord) - { - rect.height = coord; - } - rect.width -= d.getWidth(); - d.setX(0); - d.setY(0); - offset -= d.getWidth(); - break; - case NORTH: - case WEST: - break; - } -} - -void ListLayout::setDirection(const Direction d) -{ - assert((d == SOUTH || d == EAST) && "Chosen direction not supported"); - if (direction != d) - { - direction = d; - offset = 0; - setWidthHeight(0, 0); - Callback function(this, &ListLayout::internalAddElement); - forEachChild(&function); - if (parent) - { - parent->childGeometryChanged(); - } - } -} - -void ListLayout::add(Drawable& d) -{ - internalAddElement(d); - Container::add(d); - if (parent) - { - parent->childGeometryChanged(); - } -} - -void ListLayout::removeAll() -{ - offset = 0; - setWidthHeight(0, 0); - Container::removeAll(); - if (parent) - { - parent->childGeometryChanged(); - } -} - -void ListLayout::insert(Drawable* previous, Drawable& d) -{ - if (!firstChild) - { - // List is empty, just add the new entry - add(d); - return; - } - Container::insert(previous, d); - AdjustElements tmp(&d, direction); - Callback function(&tmp, &AdjustElements::handleInsert); - forEachChild(&function); - internalAddElementAt(d, tmp.insertedCoord); - if (parent) - { - parent->childGeometryChanged(); - } -} - -void ListLayout::remove(Drawable& d) -{ - AdjustElements tmp(&d, direction); - Callback function(&tmp, &AdjustElements::handleRemove); - forEachChild(&function); - if (tmp.newElementPassed) - { - internalRemoveElement(d, tmp.insertedCoord); - Container::remove(d); - } - if (parent) - { - parent->childGeometryChanged(); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp deleted file mode 100644 index b1d838d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ModalWindow.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -ModalWindow::ModalWindow() - : Container(), - backgroundShade(), - windowContainer(), - windowBackground() -{ - ModalWindow::setWidthHeight(HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT); - - int defaultShadeAlpha = 96; - colortype defaultShadeColor = Color::getColorFromRGB(0x0, 0x0, 0x0); - - backgroundShade.setPosition(0, 0, getWidth(), getHeight()); - backgroundShade.setColor(defaultShadeColor); - backgroundShade.setTouchable(true); - ModalWindow::setShadeAlpha(defaultShadeAlpha); - Container::add(backgroundShade); - - Container::add(windowContainer); - windowContainer.add(windowBackground); -} - -void ModalWindow::setBackground(const BitmapId& bmpId) -{ - windowBackground.setBitmap(Bitmap(bmpId)); - windowBackground.setXY(0, 0); - - windowContainer.setPosition((getWidth() - windowBackground.getWidth()) / 2, (getHeight() - windowBackground.getHeight()) / 2, windowBackground.getWidth(), windowBackground.getHeight()); - invalidate(); -} - -void ModalWindow::setBackground(const BitmapId& bmpId, int16_t backgroundX, int16_t backgroundY) -{ - setBackground(bmpId); - windowContainer.setXY(backgroundX, backgroundY); -} - -uint16_t ModalWindow::getBackgroundWidth() const -{ - return windowBackground.getWidth(); -} - -uint16_t ModalWindow::getBackgroundHeight() const -{ - return windowBackground.getHeight(); -} - -void ModalWindow::add(Drawable& d) -{ - windowContainer.add(d); -} - -void ModalWindow::remove(Drawable& d) -{ - windowContainer.remove(d); -} - -void ModalWindow::setShadeAlpha(uint8_t alpha) -{ - backgroundShade.setAlpha(alpha); - backgroundShade.invalidate(); -} - -uint8_t ModalWindow::getShadeAlpha() const -{ - return backgroundShade.getAlpha(); -} - -void ModalWindow::setShadeColor(colortype color) -{ - backgroundShade.setColor(color); - backgroundShade.invalidate(); -} - -colortype ModalWindow::getShadeColor() const -{ - return backgroundShade.getColor(); -} - -void ModalWindow::show() -{ - setVisible(true); - invalidate(); -} - -void ModalWindow::hide() -{ - invalidate(); - setVisible(false); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp deleted file mode 100644 index 8798b15..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ScrollableContainer.cpp +++ /dev/null @@ -1,686 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -ScrollableContainer::ScrollableContainer() - : Container(), - scrollbarPadding(0), - scrollbarWidth(2), - scrollbarAlpha(120), - scrollbarColor(Color::getColorFromRGB(0xFF, 0xFF, 0xFF)), - maxVelocity(SCROLLBAR_MAX_VELOCITY), - accelDirection(GestureEvent::SWIPE_HORIZONTAL), - xSlider(0, 0, scrollbarColor, scrollbarAlpha), - ySlider(0, 0, scrollbarColor, scrollbarAlpha), - pressedDrawable(0), - lastDraggableChild(0), - scrolledXDistance(0), - scrolledYDistance(0), - scrollThreshold(5), - pressedX(0), - pressedY(0), - isPressed(false), - isScrolling(false), - scrollableX(true), - scrollableY(true), - scrollbarsVisible(true), - scrollbarsPermanentlyVisible(false), - scrollDuration(0), - beginningValue(0), - targetValue(0), - animationCounter(0), - animate(false), - fingerAdjustmentX(0), - fingerAdjustmentY(0), - hasIssuedCancelEvent(false), - scrollDurationSpeedup(7), - scrollDurationSlowdown(1) -{ - xSlider.setVisible(false); - ySlider.setVisible(false); - setTouchable(true); -} - -void ScrollableContainer::handleClickEvent(const ClickEvent& event) -{ - if (event.getType() == ClickEvent::PRESSED) - { - isPressed = true; - - if (animate) - { - // Stop scroll animation - animate = false; - animationCounter = 0; - Application::getInstance()->unregisterTimerWidget(this); - } - - getLastChildNear(event.getX(), event.getY(), &pressedDrawable, &fingerAdjustmentX, &fingerAdjustmentY); - - if (pressedDrawable == this) - { - pressedDrawable = 0; - } - - if (pressedDrawable) - { - hasIssuedCancelEvent = false; - pressedX = event.getX(); - pressedY = event.getY(); - Rect r = pressedDrawable->getAbsoluteRect(); - Rect me = getAbsoluteRect(); - ClickEvent relative(event.getType(), event.getX() + fingerAdjustmentX - (r.x - me.x), event.getY() + fingerAdjustmentY - (r.y - me.y)); - pressedDrawable->handleClickEvent(relative); - lastDraggableChild = pressedDrawable; - } - } - else if (event.getType() == ClickEvent::CANCEL) - { - return; - } - else // if (event.getType() == ClickEvent::RELEASED) - { - if (pressedDrawable) - { - Rect r = pressedDrawable->getAbsoluteRect(); - Rect me = getAbsoluteRect(); - ClickEvent relative(event.getType(), event.getX() + fingerAdjustmentX - (r.x - me.x), event.getY() + fingerAdjustmentY - (r.y - me.y)); - pressedDrawable->handleClickEvent(relative); - } - - pressedDrawable = 0; - lastDraggableChild = 0; - isPressed = false; - } - - isScrolling = false; - - // Redraw scrollbars. - xSlider.setVisible((isPressed && scrollbarsVisible) || scrollbarsPermanentlyVisible); - ySlider.setVisible((isPressed && scrollbarsVisible) || scrollbarsPermanentlyVisible); - invalidateScrollbars(); -} - -void ScrollableContainer::handleDragEvent(const DragEvent& event) -{ - DragEvent actualDrag = event; - bool acceptInitialScroll = false; - - bool canScrollX = false; - bool canScrollY = false; - isScrollableXY(canScrollX, canScrollY); - - if ((pressedDrawable != 0) && (pressedDrawable != this)) - { - // Also send this drag event to the appropriate child widget - Rect r = pressedDrawable->getAbsoluteRect(); - Rect me = getAbsoluteRect(); - int16_t oldX = event.getOldX() + fingerAdjustmentX - (r.x - me.x); - int16_t oldY = event.getOldY() + fingerAdjustmentY - (r.y - me.y); - int16_t newX = canScrollX ? oldX : event.getNewX() + fingerAdjustmentX - (r.x - me.x); - int16_t newY = canScrollY ? oldY : event.getNewY() + fingerAdjustmentY - (r.y - me.y); - - // but only in the direction(s) where the scrollable container itself - // cannot scroll. - if ((!canScrollX && newX != oldX) || (!canScrollY && newY != oldY)) - { - DragEvent relative(DragEvent::DRAGGED, oldX, oldY, newX, newY); - pressedDrawable->handleDragEvent(relative); - } - } - - // If we are not currently scrolling, the drag event delta must - // be larger than the threshold value, otherwise the event is ignored. - if (!isScrolling) - { - // Only consider the delta in directions that are actually scrollable. - // Note: Do not use the delta from received event since that only reflects - // change since last drag. What we want to check here is if the total - // delta from the point of click has now exceeded the threshold. - actualDrag = DragEvent(DragEvent::DRAGGED, pressedX + fingerAdjustmentX, pressedY + fingerAdjustmentY, event.getNewX() + fingerAdjustmentX, event.getNewY() + fingerAdjustmentY); - if (canScrollX) - { - // Can scroll in X. - if (abs(actualDrag.getDeltaX()) > scrollThreshold) - { - acceptInitialScroll = true; - } - } - - if (canScrollY) - { - // Can scroll in Y. - if (abs(actualDrag.getDeltaY()) > scrollThreshold) - { - acceptInitialScroll = true; - } - } - - if (acceptInitialScroll) - { - isScrolling = true; - } - else - { - // Discard this drag event. However, if the new coordinates no longer matches the drawable which received the PRESSED click event - // issue a CANCEL event to that drawable. - if (pressedDrawable && !hasIssuedCancelEvent) - { - Drawable* child = 0; - Container::getLastChild(event.getNewX() + fingerAdjustmentX, event.getNewY() + fingerAdjustmentY, &child); - if (pressedDrawable != child) - { - ClickEvent ce(ClickEvent::CANCEL, 0, 0); - pressedDrawable->handleClickEvent(ce); - hasIssuedCancelEvent = true; - } - } - return; - } - } - - // Send cancel events to child in focus - if (pressedDrawable && !hasIssuedCancelEvent) - { - ClickEvent ce(ClickEvent::CANCEL, 0, 0); - pressedDrawable->handleClickEvent(ce); - hasIssuedCancelEvent = true; - } - - int16_t deltaX = 0; - int16_t deltaY = 0; - - if (scrollableX) - { - if (acceptInitialScroll) - { - // Initial drag which is past threshold, only scroll one pixel in initial event. - if (actualDrag.getDeltaX() > 0) - { - deltaX = 1; - } - else if (actualDrag.getDeltaX() < 0) - { - deltaX = -1; - } - } - else - { - // Scroll entire delta - deltaX = actualDrag.getDeltaX(); - } - } - else - { - // Not scrollable - deltaX = 0; - } - - if (scrollableY) - { - if (acceptInitialScroll) - { - // Initial drag which is past threshold, only scroll one pixel in initial event. - if (actualDrag.getDeltaY() > 0) - { - deltaY = 1; - } - else if (actualDrag.getDeltaY() < 0) - { - deltaY = -1; - } - } - else - { - // Scroll entire delta - deltaY = actualDrag.getDeltaY(); - } - } - else - { - // Not scrollable - deltaY = 0; - } - - doScroll(deltaX, deltaY); -} - -void ScrollableContainer::handleGestureEvent(const GestureEvent& event) -{ - bool canScrollX = false; - bool canScrollY = false; - isScrollableXY(canScrollX, canScrollY); - - if ((canScrollX && (event.getType() == GestureEvent::SWIPE_HORIZONTAL)) || - (canScrollY && (event.getType() == GestureEvent::SWIPE_VERTICAL))) - { - int16_t velocityAbsolute = abs(event.getVelocity()); - - // Ignore gestures with velocity lower than threshold - if (velocityAbsolute < scrollThreshold) - { - return; - } - - // Force velocity within limits - velocityAbsolute = MIN(velocityAbsolute, maxVelocity); - velocityAbsolute = MAX(velocityAbsolute, SCROLLBAR_MIN_VELOCITY); - - // Try to set some reasonable values for how long the resulting scroll should be, and how many ticks is should take - scrollDuration = velocityAbsolute * scrollDurationSpeedup / scrollDurationSlowdown; - targetValue = ((event.getVelocity() > 0) ? 1 : -1) * (velocityAbsolute - 4) * 72; - const int16_t distance = abs(targetValue); - scrollDuration = MIN(scrollDuration, distance); - - // Get ready to animate scroll: Initialize values - beginningValue = (event.getType() == GestureEvent::SWIPE_VERTICAL) ? getContainedArea().y : getContainedArea().x; - animate = true; - Application::getInstance()->registerTimerWidget(this); - accelDirection = event.getType(); - - if (pressedDrawable && !hasIssuedCancelEvent) - { - ClickEvent ce(ClickEvent::CANCEL, 0, 0); - pressedDrawable->handleClickEvent(ce); - hasIssuedCancelEvent = true; - } - } -} - -Rect ScrollableContainer::getXScrollbar() const -{ - Rect res; - if (scrollableX) - { - Rect contained = getContainedArea(); - const int scrollSpace = (scrollableY && (contained.height > rect.height)) ? (2 * scrollbarPadding + scrollbarWidth + SCROLLBAR_LINE) : 0; - - if (contained.width > rect.width) - { - int leftPadding = (-1 * contained.x * rect.width) / contained.width; - int rightPadding = ((contained.right() - rect.width) * rect.width) / contained.width; - const int startWidth = rect.width - (2 * scrollbarPadding + 2 * SCROLLBAR_LINE + scrollSpace); - int width = startWidth; - width -= (leftPadding + rightPadding); - if (width < scrollbarWidth * 2) - { - // If the contained area is very large, the scrollbar width may become zero or even negative. - int diff = scrollbarWidth * 2 - width; - width = scrollbarWidth * 2; // Force scrollbar width to a minimum - // Distribute the deviation error based on current scrollbar X position (the amount subtracted from scrollbar xpos increases gradually). - leftPadding -= (diff * leftPadding) / startWidth; - } - res = Rect(leftPadding + scrollbarPadding + SCROLLBAR_LINE, rect.height - (scrollbarWidth + scrollbarPadding + SCROLLBAR_LINE), width, scrollbarWidth); - } - } - return res; -} - -Rect ScrollableContainer::getYScrollbar() const -{ - Rect res; - if (scrollableY) - { - Rect contained = getContainedArea(); - const int scrollSpace = (scrollableX && (contained.width > rect.width)) ? (2 * scrollbarPadding + scrollbarWidth + SCROLLBAR_LINE) : 0; - - if (contained.height > rect.height) - { - int topPadding = (-1 * contained.y * rect.height) / contained.height; - int bottomPadding = ((contained.bottom() - rect.height) * rect.height) / contained.height; - const int startHeight = rect.height - (2 * scrollbarPadding + 2 * SCROLLBAR_LINE + scrollSpace); - int height = startHeight; - height -= (topPadding + bottomPadding); - if (height < scrollbarWidth * 2) - { - // If the contained area is very large, the scrollbar height may become zero or even negative. - int diff = scrollbarWidth * 2 - height; - height = scrollbarWidth * 2; // Force scrollbar height to a minimum - // Distribute the deviation error based on current scrollbar Y position (the amount subtracted from scrollbar ypos increases gradually). - topPadding -= (diff * topPadding) / startHeight; - } - res = Rect(rect.width - (scrollbarWidth + scrollbarPadding + 2 * SCROLLBAR_LINE), topPadding + scrollbarPadding + SCROLLBAR_LINE, scrollbarWidth, height); - } - } - return res; -} - -Rect ScrollableContainer::getXBorder(const Rect& xBar, const Rect& yBar) const -{ - Rect border; - if (!xBar.isEmpty()) - { - const int scrollSpace = (!yBar.isEmpty()) ? (2 * scrollbarPadding + scrollbarWidth + SCROLLBAR_LINE) : 0; - border = Rect(scrollbarPadding, xBar.y - SCROLLBAR_LINE, rect.width - (2 * scrollbarPadding + scrollSpace), scrollbarWidth + 2 * SCROLLBAR_LINE); - } - return border; -} - -Rect ScrollableContainer::getYBorder(const Rect& xBar, const Rect& yBar) const -{ - Rect border; - if (!yBar.isEmpty()) - { - const int scrollSpace = (!xBar.isEmpty()) ? (2 * scrollbarPadding + scrollbarWidth + SCROLLBAR_LINE) : 0; - border = Rect(yBar.x - SCROLLBAR_LINE, scrollbarPadding, scrollbarWidth + 2 * SCROLLBAR_LINE, rect.height - (2 * scrollbarPadding + scrollSpace)); - } - return border; -} - -void ScrollableContainer::invalidateScrollbars() -{ - Rect xBar = getXScrollbar(); - Rect yBar = getYScrollbar(); - - Rect xBorder = getXBorder(xBar, yBar); - Rect yBorder = getYBorder(xBar, yBar); - - // The two if statements ensure that the two sliders are invalidated thereby hides them, before they are set to size zero. - if (xSlider.getY() > xBorder.y) - { - xSlider.invalidate(); - } - if (ySlider.getX() > yBorder.x) - { - ySlider.invalidate(); - } - - xSlider.setPosition(xBar.x, xBar.y, xBar.width, xBar.height); - ySlider.setPosition(yBar.x, yBar.y, yBar.width, yBar.height); - - // x-/yBorder is given the coordinates zero and the witdh of the visiable area for the scrollable container, - // to ensure that the entire area where for the scrollable bars is and have been is invalidated correct. - xBorder.x = 0; - xBorder.width = rect.width; - yBorder.height = rect.height; - yBorder.y = 0; - - if (!xBorder.isEmpty()) - { - invalidateRect(xBorder); - } - - if (!yBorder.isEmpty()) - { - invalidateRect(yBorder); - } -} - -bool ScrollableContainer::doScroll(int16_t deltaX, int16_t deltaY) -{ - if (!deltaX && !deltaY) - { - return false; - } - bool couldScroll = false; - Rect contained = getContainedArea(); - if (contained.width > rect.width) - { - if (deltaX > 0) - { - if (contained.x + deltaX > 0) - { - deltaX = -contained.x; - } - } - else if (deltaX < 0) - { - if (contained.right() + deltaX < rect.width) - { - deltaX = rect.width - contained.right(); - } - } - } - else - { - deltaX = 0; - } - - if (contained.height > rect.height) - { - if (deltaY > 0) - { - if (contained.y + deltaY > 0) - { - deltaY = -contained.y; - } - } - else if (deltaY < 0) - { - if (contained.bottom() + deltaY < rect.height) - { - deltaY = rect.height - contained.bottom(); - } - } - } - else - { - deltaY = 0; - } - - if (deltaX || deltaY) - { - moveChildrenRelative(deltaX, deltaY); - - invalidateScrollbars(); - couldScroll = true; - } - return couldScroll; -} - -void ScrollableContainer::childGeometryChanged() -{ - int deltaX = 0; - int deltaY = 0; - Rect contained = getChildrenContainedArea(); - if (contained.y > 0) - { - // Make sure we haven't scrolled above the top - deltaY = contained.y; - } - else if (contained.bottom() < rect.height) - { - // Make sure we haven't scrolled below the bottom - deltaY = contained.bottom() - rect.height; - if (contained.y > deltaY) - { - deltaY = contained.y; - } - } - - if (contained.x > 0) - { - // Make sure we haven't scrolled too far to the left - deltaX = contained.x; - } - else if (contained.right() < rect.width) - { - // Make sure we haven't scrolled too far to the right - deltaX = contained.right() - rect.width; - if (contained.x > deltaX) - { - deltaX = contained.x; - } - } - - if (deltaX != 0 || deltaY != 0) - { - moveChildrenRelative(-deltaX, -deltaY); - invalidateScrollbars(); - } -} - -void ScrollableContainer::add(Drawable& d) -{ - remove(xSlider); - remove(ySlider); - - Container::add(d); - Container::add(xSlider); - Container::add(ySlider); -} - -Rect ScrollableContainer::getContainedArea() const -{ - Rect contained(0, 0, rect.width, rect.height); - contained.expandToFit(getChildrenContainedArea()); - return contained; -} - -Rect ScrollableContainer::getChildrenContainedArea() const -{ - Rect contained; - for (Drawable* d = firstChild; d; d = d->getNextSibling()) - { - if ((d != &xSlider) && (d != &ySlider) && (d->isVisible())) - { - contained.expandToFit(d->getRect()); - } - } - return contained; -} - -void ScrollableContainer::reset() -{ - moveChildrenRelative(-scrolledXDistance, -scrolledYDistance); - invalidateScrollbars(); -} - -void ScrollableContainer::moveChildrenRelative(int16_t deltaX, int16_t deltaY) -{ - for (Drawable* d = firstChild; d; d = d->getNextSibling()) - { - if ((d != &xSlider) && (d != &ySlider)) - { - d->moveRelative(deltaX, deltaY); - } - } - scrolledXDistance += deltaX; - scrolledYDistance += deltaY; -} - -void ScrollableContainer::handleTickEvent() -{ - if (!animate) - { - return; - } - // Calculate new position or stop animation - animationCounter++; - if (animationCounter <= scrollDuration) - { - // Calculate value in [beginningValue ; (beginningValue+targetValue)] - int16_t calculatedValue = EasingEquations::cubicEaseOut(animationCounter, beginningValue, targetValue, scrollDuration); - - // Note: Result of "calculatedValue & 1" is compiler dependent for negative values of calculatedValue - if (calculatedValue % 2) - { - // Optimization: calculatedValue is odd, add 1/-1 to move drawables modulo 32 bits in framebuffer - calculatedValue += (calculatedValue > 0) ? 1 : -1; - } - - // Convert to delta value relative to current X or Y - int16_t scrollX = (accelDirection == GestureEvent::SWIPE_VERTICAL) ? 0 : (calculatedValue - getContainedArea().x); - int16_t scrollY = (accelDirection == GestureEvent::SWIPE_HORIZONTAL) ? 0 : (calculatedValue - getContainedArea().y); - - // Perform the actual animation step, stop animation if - // scrolling was not possible (doScroll invalidates children) - animate = doScroll(scrollX, scrollY); - } - else - { - animate = false; - } - - if (!animate) - { - Application::getInstance()->unregisterTimerWidget(this); - animationCounter = 0; - } -} - -void ScrollableContainer::setScrollbarsColor(colortype color) -{ - scrollbarColor = color; - xSlider.setColor(scrollbarColor); - ySlider.setColor(scrollbarColor); -} - -void ScrollableContainer::setScrollbarsAlpha(uint8_t alpha) -{ - scrollbarAlpha = alpha; - xSlider.setAlpha(scrollbarAlpha); - ySlider.setAlpha(scrollbarAlpha); -} - -void ScrollableContainer::setScrollbarPadding(uint8_t padding) -{ - scrollbarPadding = padding; -} - -void ScrollableContainer::setScrollbarWidth(uint8_t width) -{ - scrollbarWidth = width; -} - -void ScrollableContainer::setScrollbarsVisible(bool newVisible) -{ - scrollbarsVisible = newVisible; -} - -void ScrollableContainer::setScrollbarsPermanentlyVisible(bool permanentlyVisible /*= true*/) -{ - scrollbarsPermanentlyVisible = permanentlyVisible; - xSlider.setVisible(true); - ySlider.setVisible(true); - invalidateScrollbars(); -} - -int16_t ScrollableContainer::getScrolledX() const -{ - return scrolledXDistance; -} - -int16_t ScrollableContainer::getScrolledY() const -{ - return scrolledYDistance; -} - -void ScrollableContainer::setScrollDurationSpeedup(uint16_t speedup) -{ - scrollDurationSpeedup = MAX(1, speedup); -} - -uint16_t ScrollableContainer::getScrollDurationSpeedup() const -{ - return scrollDurationSpeedup; -} - -void ScrollableContainer::setScrollDurationSlowdown(uint16_t slowdown) -{ - scrollDurationSlowdown = MAX(1, slowdown); -} - -uint16_t ScrollableContainer::getScrollDurationSlowdown() const -{ - return scrollDurationSlowdown; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp deleted file mode 100644 index 6b96f7e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SlideMenu.cpp +++ /dev/null @@ -1,401 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -SlideMenu::SlideMenu() - : Container(), - menuContainer(), - stateChangeButton(), - background(), - onStateChangeButtonClicked(this, &SlideMenu::stateChangeButtonClickedHandler), - animationEndedCallback(this, &SlideMenu::animationEndedHandler), - stateChangedCallback(0), - stateChangedAnimationEndedCallback(0), - currentState(COLLAPSED), - expandDirection(EAST), - animationEquation(EasingEquations::cubicEaseInOut), - visiblePixelsWhenCollapsed(0), - hiddenPixelsWhenExpanded(0), - expandedStateTimeout(200), - expandedStateTimer(0), - animationDuration(10) -{ - Application::getInstance()->registerTimerWidget(this); - - stateChangeButton.setAction(onStateChangeButtonClicked); - menuContainer.setMoveAnimationEndedAction(animationEndedCallback); - - Container::add(menuContainer); - menuContainer.add(background); - menuContainer.add(stateChangeButton); -} - -SlideMenu::~SlideMenu() -{ - Application::getInstance()->unregisterTimerWidget(this); -} - -void SlideMenu::setup(ExpandDirection newExpandDirection, const Bitmap& backgroundBMP, const Bitmap& stateChangeButtonBMP, const Bitmap& stateChangeButtonPressedBMP) -{ - int16_t backgroundX = 0; - int16_t backgroundY = 0; - int16_t buttonX = 0; - int16_t buttonY = 0; - - switch (newExpandDirection) - { - case SOUTH: - backgroundX = 0; - backgroundY = 0; - buttonX = (backgroundBMP.getWidth() - stateChangeButtonBMP.getWidth()) / 2; - buttonY = backgroundBMP.getHeight(); - - setVisiblePixelsWhenCollapsed(stateChangeButtonBMP.getHeight()); - break; - case NORTH: - backgroundX = 0; - backgroundY = stateChangeButtonBMP.getHeight(); - buttonX = (backgroundBMP.getWidth() - stateChangeButtonBMP.getWidth()) / 2; - buttonY = 0; - - setVisiblePixelsWhenCollapsed(stateChangeButtonBMP.getHeight()); - break; - case EAST: - backgroundX = 0; - backgroundY = 0; - buttonX = backgroundBMP.getWidth(); - buttonY = (backgroundBMP.getHeight() - stateChangeButtonBMP.getHeight()) / 2; - - setVisiblePixelsWhenCollapsed(stateChangeButtonBMP.getWidth()); - break; - case WEST: - backgroundX = stateChangeButtonBMP.getWidth(); - backgroundY = 0; - buttonX = 0; - buttonY = (backgroundBMP.getHeight() - stateChangeButtonBMP.getHeight()) / 2; - - setVisiblePixelsWhenCollapsed(stateChangeButtonBMP.getWidth()); - break; - } - - setup(newExpandDirection, backgroundBMP, stateChangeButtonBMP, stateChangeButtonPressedBMP, backgroundX, backgroundY, buttonX, buttonY); -} - -void SlideMenu::setup(ExpandDirection newExpandDirection, const Bitmap& backgroundBMP, int16_t backgroundX, int16_t backgroundY) -{ - setExpandDirection(newExpandDirection); - - background.setBitmap(backgroundBMP); - background.setXY(backgroundX, backgroundY); - - Rect boundingRect = background.getRect(); - // boundingRect.expandToFit(background.getRect()); - - menuContainer.setWidth(boundingRect.right()); - menuContainer.setHeight(boundingRect.bottom()); - - setWidthHeight(menuContainer); - - setExpandDirection(expandDirection); - setState(currentState); - - invalidate(); -} - -void SlideMenu::setup(ExpandDirection newExpandDirection, const Bitmap& backgroundBMP, const Bitmap& stateChangeButtonBMP, const Bitmap& stateChangeButtonPressedBMP, int16_t backgroundX, int16_t backgroundY, int16_t stateChangeButtonX, int16_t stateChangeButtonY) -{ - setExpandDirection(newExpandDirection); - - background.setBitmap(backgroundBMP); - background.setXY(backgroundX, backgroundY); - - stateChangeButton.setBitmaps(stateChangeButtonBMP, stateChangeButtonPressedBMP); - stateChangeButton.setXY(stateChangeButtonX, stateChangeButtonY); - - Rect boundingRect; - boundingRect.expandToFit(background.getRect()); - boundingRect.expandToFit(stateChangeButton.getRect()); - - menuContainer.setWidth(boundingRect.right()); - menuContainer.setHeight(boundingRect.bottom()); - - setWidthHeight(menuContainer); - - setExpandDirection(expandDirection); - setState(currentState); - - invalidate(); -} - -void SlideMenu::setExpandDirection(ExpandDirection newExpandDirection) -{ - expandDirection = newExpandDirection; - - setState(currentState); -} - -SlideMenu::ExpandDirection SlideMenu::getExpandDirection() const -{ - return expandDirection; -} - -void SlideMenu::setVisiblePixelsWhenCollapsed(int16_t visiblePixels) -{ - visiblePixelsWhenCollapsed = visiblePixels; - - setState(currentState); -} - -int16_t SlideMenu::getVisiblePixelsWhenCollapsed() const -{ - return visiblePixelsWhenCollapsed; -} - -void SlideMenu::setHiddenPixelsWhenExpanded(int16_t hiddenPixels) -{ - hiddenPixelsWhenExpanded = hiddenPixels; - - setState(currentState); -} - -int16_t SlideMenu::getHiddenPixelsWhenExpanded() const -{ - return hiddenPixelsWhenExpanded; -} - -void SlideMenu::setExpandedStateTimeout(uint16_t timeout) -{ - expandedStateTimeout = timeout; -} - -uint16_t SlideMenu::getExpandedStateTimeout() const -{ - return expandedStateTimeout; -} - -void SlideMenu::setAnimationDuration(uint16_t duration) -{ - animationDuration = duration; -} - -uint16_t SlideMenu::getAnimationDuration() const -{ - return animationDuration; -} - -void SlideMenu::setAnimationEasingEquation(EasingEquation animationEasingEquation) -{ - animationEquation = animationEasingEquation; -} - -EasingEquation SlideMenu::getAnimationEasingEquation() const -{ - return animationEquation; -} - -void SlideMenu::setState(State newState) -{ - if (newState == COLLAPSED) - { - menuContainer.moveTo(getCollapsedXCoordinate(), getCollapsedYCoordinate()); - } - else - { - menuContainer.moveTo(getExpandedXCoordinate(), getExpandedYCoordinate()); - } - currentState = newState; -} - -void SlideMenu::animateToState(State newState) -{ - if (animationDuration == 0) - { - setState(newState); - } - else if (newState != currentState) - { - if (currentState == COLLAPSED) - { - menuContainer.startMoveAnimation(getExpandedXCoordinate(), getExpandedYCoordinate(), animationDuration, animationEquation, animationEquation); - currentState = EXPANDED; - } - else - { - menuContainer.startMoveAnimation(getCollapsedXCoordinate(), getCollapsedYCoordinate(), animationDuration, animationEquation, animationEquation); - currentState = COLLAPSED; - } - - // Disable stateChangeButton while animating - stateChangeButton.setTouchable(false); - } -} - -SlideMenu::State SlideMenu::getState() -{ - return currentState; -} - -void SlideMenu::resetExpandedStateTimer() -{ - expandedStateTimer = 0; -} - -uint16_t SlideMenu::getExpandedStateTimer() const -{ - return expandedStateTimer; -} - -int16_t SlideMenu::getBackgroundX() const -{ - return background.getX(); -} - -int16_t SlideMenu::getBackgroundY() const -{ - return background.getY(); -} - -int16_t SlideMenu::getStateChangeButtonX() const -{ - return stateChangeButton.getX(); -} - -int16_t SlideMenu::getStateChangeButtonY() const -{ - return stateChangeButton.getY(); -} - -void SlideMenu::setStateChangedCallback(GenericCallback& callback) -{ - stateChangedCallback = &callback; -} - -void SlideMenu::setStateChangedAnimationEndedCallback(GenericCallback& callback) -{ - stateChangedAnimationEndedCallback = &callback; -} - -void SlideMenu::handleTickEvent() -{ - if ((expandedStateTimeout != 0) && (currentState == EXPANDED) && !menuContainer.isMoveAnimationRunning()) - { - expandedStateTimer++; - - if (expandedStateTimer > expandedStateTimeout) - { - animateToState(COLLAPSED); - } - } -} - -void SlideMenu::add(Drawable& d) -{ - menuContainer.add(d); -} - -void SlideMenu::remove(Drawable& d) -{ - menuContainer.remove(d); -} - -void SlideMenu::stateChangeButtonClickedHandler(const AbstractButton& /*button*/) -{ - if (currentState == COLLAPSED) - { - animateToState(EXPANDED); - } - else - { - animateToState(COLLAPSED); - } - - if ((stateChangedCallback != 0) && stateChangedCallback->isValid()) - { - stateChangedCallback->execute(*this); - } -} - -void SlideMenu::animationEndedHandler(const MoveAnimator& /*container*/) -{ - resetExpandedStateTimer(); - stateChangeButton.setTouchable(true); - - if ((stateChangedAnimationEndedCallback != 0) && stateChangedAnimationEndedCallback->isValid()) - { - stateChangedAnimationEndedCallback->execute(*this); - } -} - -int16_t SlideMenu::getCollapsedXCoordinate() -{ - switch (expandDirection) - { - case EAST: - return -menuContainer.getWidth() + visiblePixelsWhenCollapsed; - case WEST: - return getWidth() - visiblePixelsWhenCollapsed; - case SOUTH: - case NORTH: - break; - } - return 0; -} - -int16_t SlideMenu::getCollapsedYCoordinate() -{ - switch (expandDirection) - { - case SOUTH: - return -menuContainer.getHeight() + visiblePixelsWhenCollapsed; - case NORTH: - return getHeight() - visiblePixelsWhenCollapsed; - case EAST: - case WEST: - break; - } - return 0; -} - -int16_t SlideMenu::getExpandedXCoordinate() -{ - switch (expandDirection) - { - case EAST: - return -hiddenPixelsWhenExpanded; - case WEST: - return hiddenPixelsWhenExpanded; - case SOUTH: - case NORTH: - break; - } - return 0; -} - -int16_t SlideMenu::getExpandedYCoordinate() -{ - switch (expandDirection) - { - case SOUTH: - return -hiddenPixelsWhenExpanded; - case NORTH: - return hiddenPixelsWhenExpanded; - case EAST: - case WEST: - break; - } - return 0; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp deleted file mode 100644 index 9ae659c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/Slider.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -Slider::Slider() - : Container(), - sliderOrientation(HORIZONTAL), - currentValue(0), - valueRangeMin(0), - valueRangeMax(1), - background(), - backgroundSelected(), - indicator(), - backgroundSelectedViewPort(), - indicatorMinPosition(0), - indicatorMaxPosition(1), - startValueCallback(0), - stopValueCallback(0), - newValueCallback(0) -{ - setTouchable(true); - - // The backgroundSelectedViewPort is a container into which the bitmap for the "filled" background - // is placed. Containers are viewports, so the dimensions of this container controls how - // much of the filled background is visible. - backgroundSelectedViewPort.add(backgroundSelected); - - Container::add(background); - Container::add(backgroundSelectedViewPort); - Container::add(indicator); - - // Default value range - Slider::setValueRange(0, 100); -} - -void Slider::setBitmaps(const Bitmap& sliderBackground, const Bitmap& sliderBackgroundSelected, const Bitmap& indicatorBitmap) -{ - assert(sliderBackground.getWidth() == sliderBackgroundSelected.getWidth() && - sliderBackground.getHeight() == sliderBackgroundSelected.getHeight() && - "Slider::setBitmaps - background and backgroundFilled must have same dimensions"); - - background.setBitmap(sliderBackground); - backgroundSelected.setBitmap(sliderBackgroundSelected); - indicator.setBitmap(indicatorBitmap); - backgroundSelectedViewPort.setWidthHeight(backgroundSelected); -} - -void Slider::setBitmaps(const BitmapId sliderBackground, const BitmapId sliderBackgroundSelected, const BitmapId indicatorBitmap) -{ - setBitmaps(Bitmap(sliderBackground), Bitmap(sliderBackgroundSelected), Bitmap(indicatorBitmap)); -} - -void Slider::setupHorizontalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorY, uint16_t indicatorMinX, uint16_t indicatorMaxX) -{ - assert(indicatorMinX < indicatorMaxX && "Slider::setupHorizontalSlider - indicatorMinX must be smaller than indicatorMaxX"); - - sliderOrientation = HORIZONTAL; - - background.setXY(backgroundX, backgroundY); - backgroundSelectedViewPort.setXY(backgroundX, backgroundY); - backgroundSelected.setXY(0, 0); - indicator.setY(indicatorY); - - uint16_t backgroundWidth = backgroundX + static_cast(background.getWidth()); - uint16_t indicatorWidth = indicatorMaxX + static_cast(indicator.getWidth()); - int16_t newWidth = static_cast(MAX(backgroundWidth, indicatorWidth)); - - uint16_t backgroundHeight = backgroundY + static_cast(background.getHeight()); - uint16_t indicatorHeight = indicatorY + static_cast(indicator.getHeight()); - int16_t newHeight = static_cast(MAX(backgroundHeight, indicatorHeight)); - - indicatorMinPosition = indicatorMinX; - indicatorMaxPosition = indicatorMaxX; - - setWidthHeight(newWidth, newHeight); - - setValue(currentValue); -} - -void Slider::setupVerticalSlider(uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorX, uint16_t indicatorMinY, uint16_t indicatorMaxY) -{ - assert(indicatorMinY < indicatorMaxY && "Slider::setupVerticalSlider - indicatorMinY must be smaller than indicatorMaxY"); - - sliderOrientation = VERTICAL; - - background.setXY(backgroundX, backgroundY); - backgroundSelectedViewPort.setXY(backgroundX, backgroundY); - indicator.setX(indicatorX); - - uint16_t backgroundWidth = backgroundX + static_cast(background.getWidth()); - uint16_t indicatorWidth = indicatorX + static_cast(indicator.getWidth()); - int16_t newWidth = static_cast(MAX(backgroundWidth, indicatorWidth)); - - uint16_t backgroundHeight = backgroundY + static_cast(background.getHeight()); - uint16_t indicatorHeight = indicatorMaxY + static_cast(indicator.getHeight()); - int16_t newHeight = static_cast(MAX(backgroundHeight, indicatorHeight)); - - indicatorMinPosition = indicatorMinY; - indicatorMaxPosition = indicatorMaxY; - - setWidthHeight(newWidth, newHeight); - - setValue(currentValue); -} - -void Slider::setValue(int value) -{ - updateIndicatorPosition(valueToPosition(value)); -} - -void Slider::handleClickEvent(const ClickEvent& event) -{ - if ((event.getType() == ClickEvent::PRESSED) || (event.getType() == ClickEvent::RELEASED)) - { - // Communicate the start value if a listener is registered - if ((event.getType() == ClickEvent::PRESSED) && (startValueCallback != 0) && startValueCallback->isValid()) - { - startValueCallback->execute(*this, currentValue); - } - - if (sliderOrientation == HORIZONTAL) - { - updateIndicatorPosition(event.getX() - getIndicatorRadius()); - } - else - { - updateIndicatorPosition(event.getY() - getIndicatorRadius()); - } - - // Communicate the stop value if a listener is registered - if ((event.getType() == ClickEvent::RELEASED) && (stopValueCallback != 0) && stopValueCallback->isValid()) - { - stopValueCallback->execute(*this, currentValue); - } - } -} - -void Slider::handleDragEvent(const DragEvent& event) -{ - if (sliderOrientation == HORIZONTAL) - { - updateIndicatorPosition(event.getNewX() - getIndicatorRadius()); - } - else - { - updateIndicatorPosition(event.getNewY() - getIndicatorRadius()); - } -} - -int16_t Slider::valueToPosition(int value) const -{ - value = MIN(valueRangeMax, value); - value = MAX(value, valueRangeMin); - - int coordinateOffset = ((value - valueRangeMin) * (getIndicatorPositionRangeSize() + 1)) / getValueRangeSize(); - - int result = indicatorMinPosition + coordinateOffset; - - if (sliderOrientation == VERTICAL) - { - // Vertical slider grows as the position decreases so invert the coordinate - result = indicatorMinPosition + (indicatorMaxPosition - result); - } - - return result; -} - -int Slider::positionToValue(int16_t position) const -{ - int result; - - if (position == indicatorMinPosition) - { - // Ensure that min coordinate always results in min value - result = valueRangeMin; - } - else if (position == indicatorMaxPosition) - { - // Ensure that max coordinate always results in max value - result = valueRangeMax; - } - else - { - int rounding = getIndicatorPositionRangeSize() / 2; - int valueOffset = (((position - indicatorMinPosition) * getValueRangeSize()) + rounding) / getIndicatorPositionRangeSize(); - - result = valueRangeMin + valueOffset; - } - - if (sliderOrientation == VERTICAL) - { - // Vertical slider grows as the position decreases so invert the value - result = valueRangeMin + (valueRangeMax - result); - } - - return result; -} - -void Slider::updateIndicatorPosition(int16_t position) -{ - // Cut off positions outside the slider area - position = MAX(position, indicatorMinPosition); - position = MIN(position, indicatorMaxPosition); - - if (sliderOrientation == HORIZONTAL) - { - indicator.moveTo(position, indicator.getY()); - - backgroundSelectedViewPort.invalidate(); - backgroundSelectedViewPort.setWidth((position - backgroundSelectedViewPort.getX()) + getIndicatorRadius()); - backgroundSelectedViewPort.invalidate(); - } - else - { - indicator.moveTo(indicator.getX(), position); - - backgroundSelectedViewPort.invalidate(); - int16_t newViewPortHeight = background.getRect().bottom() - (position + getIndicatorRadius()); - backgroundSelectedViewPort.setPosition(backgroundSelectedViewPort.getX(), position + getIndicatorRadius(), backgroundSelectedViewPort.getWidth(), newViewPortHeight); - backgroundSelected.setY(-(backgroundSelected.getHeight() - newViewPortHeight)); - backgroundSelectedViewPort.invalidate(); - } - - currentValue = positionToValue(position); - - // Communicate the new value if a listener is registered - if ((newValueCallback != 0) && newValueCallback->isValid()) - { - newValueCallback->execute(*this, currentValue); - } -} - -uint16_t Slider::getIndicatorRadius() const -{ - uint16_t result; - - if (sliderOrientation == HORIZONTAL) - { - result = indicator.getWidth() / 2; - } - else - { - result = indicator.getHeight() / 2; - } - - return result; -} - -void Slider::setValueRange(int minValue, int maxValue, int newValue) -{ - assert(minValue < maxValue && "Slider::setValueRange - minValue must be smaller than maxValue"); - - valueRangeMin = minValue; - valueRangeMax = maxValue; - - setValue(newValue); -} - -void Slider::setValueRange(int minValue, int maxValue) -{ - int newValue = currentValue; - - if (currentValue < minValue) - { - newValue = minValue; - } - else if (currentValue > maxValue) - { - newValue = maxValue; - } - - setValueRange(minValue, maxValue, newValue); -} - -int Slider::getIndicatorPositionRangeSize() const -{ - return indicatorMaxPosition - indicatorMinPosition; -} - -int Slider::getValueRangeSize() const -{ - return valueRangeMax - valueRangeMin; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp deleted file mode 100644 index 78b7485..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/SwipeContainer.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -SwipeContainer::SwipeContainer() - : Container(), - currentState(NO_ANIMATION), - animationCounter(0), - swipeCutoff(80), - dragX(0), - animateDistance(0), - startX(0), - endElasticWidth(30), - pages(EAST), - pageIndicator() -{ - Application::getInstance()->registerTimerWidget(this); - - setTouchable(true); - - Container::add(pages); - Container::add(pageIndicator); -} - -SwipeContainer::~SwipeContainer() -{ - Application::getInstance()->unregisterTimerWidget(this); -} - -void SwipeContainer::add(Drawable& page) -{ - pages.add(page); - - pageIndicator.setNumberOfPages(getNumberOfPages() + 1); - setSelectedPage(getSelectedPage()); - - setWidthHeight(page); -} - -void SwipeContainer::remove(Drawable& page) -{ - Drawable* tmp = pages.getFirstChild(); - - if (pageIndicator.getNumberOfPages() == 0) - { - return; - } - - // looks for the child matching page - // to ensure that the page indicator only counts down if a page is removed - while (tmp) - { - if (tmp == &page) - { - pages.remove(page); - pageIndicator.setNumberOfPages(getNumberOfPages() - 1); - - const uint8_t numPages = getNumberOfPages(); - if (numPages == 0) - { - setWidthHeight(0, 0); - } - else - { - pageIndicator.invalidateContent(); - const uint8_t curPage = getSelectedPage(); - setSelectedPage(MIN(curPage, numPages - 1)); - pageIndicator.invalidateContent(); - } - return; - } - else - { - tmp = tmp->getNextSibling(); - } - } -} - -void SwipeContainer::setEndSwipeElasticWidth(uint16_t width) -{ - endElasticWidth = width; -} - -void SwipeContainer::setSwipeCutoff(uint16_t cutoff) -{ - swipeCutoff = cutoff; -} - -void SwipeContainer::setPageIndicatorBitmaps(const Bitmap& normalPage, const Bitmap& highlightedPage) -{ - pageIndicator.setBitmaps(normalPage, highlightedPage); -} - -void SwipeContainer::setPageIndicatorXY(int16_t x, int16_t y) -{ - pageIndicator.setXY(x, y); -} - -void SwipeContainer::setPageIndicatorXYWithCenteredX(int16_t x, int16_t y) -{ - setPageIndicatorCenteredX(x); - pageIndicator.setY(y); -} - -void SwipeContainer::setPageIndicatorCenteredX() -{ - setPageIndicatorCenteredX(getWidth() / 2); -} - -void SwipeContainer::setPageIndicatorCenteredX(int16_t x) -{ - pageIndicator.setX(x - pageIndicator.getWidth() / 2); -} - -void SwipeContainer::setSelectedPage(uint8_t pageIndex) -{ - if (pageIndex < getNumberOfPages()) - { - pageIndicator.setCurrentPage(pageIndex); - adjustPages(); - } -} - -uint8_t SwipeContainer::getSelectedPage() const -{ - return pageIndicator.getCurrentPage(); -} - -void SwipeContainer::handleTickEvent() -{ - if (currentState == ANIMATE_SWIPE_CANCELLED_LEFT) - { - animateSwipeCancelledLeft(); - } - else if (currentState == ANIMATE_SWIPE_CANCELLED_RIGHT) - { - animateSwipeCancelledRight(); - } - else if (currentState == ANIMATE_LEFT) - { - animateLeft(); - } - else if (currentState == ANIMATE_RIGHT) - { - animateRight(); - } -} - -void SwipeContainer::handleClickEvent(const ClickEvent& event) -{ - // If an animation is already in progress do not - // react to clicks - if (currentState != NO_ANIMATION) - { - return; - } - - if (event.getType() == ClickEvent::RELEASED) - { - // Save current position for use during animation - animateDistance = dragX; - startX = pages.getX(); - const uint8_t curPage = getSelectedPage(); - if (dragX < 0) - { - if (curPage == getNumberOfPages() - 1 || dragX > -swipeCutoff) - { - currentState = ANIMATE_SWIPE_CANCELLED_LEFT; - } - else - { - currentState = ANIMATE_LEFT; - } - } - else if (dragX > 0) - { - if (curPage == 0 || dragX < swipeCutoff) - { - currentState = ANIMATE_SWIPE_CANCELLED_RIGHT; - } - else - { - currentState = ANIMATE_RIGHT; - } - } - } -} - -void SwipeContainer::handleDragEvent(const DragEvent& event) -{ - // If an animation is already in progress do not - // react to drags - if (currentState != NO_ANIMATION) - { - return; - } - - dragX += event.getDeltaX(); - - // Do not show too much background next to end pages - const uint8_t curPage = getSelectedPage(); - if (curPage == 0 && dragX > endElasticWidth) - { - dragX = static_cast(endElasticWidth); - } - else if (curPage == getNumberOfPages() - 1 && dragX < -endElasticWidth) - { - dragX = -static_cast(endElasticWidth); - } - - adjustPages(); -} - -void SwipeContainer::handleGestureEvent(const GestureEvent& event) -{ - // Do not accept gestures while animating - if (currentState != NO_ANIMATION) - { - return; - } - - if (event.getType() == GestureEvent::SWIPE_HORIZONTAL) - { - // Save current position for use during animation - animateDistance = dragX; - startX = pages.getX(); - - const uint8_t curPage = getSelectedPage(); - if (event.getVelocity() < 0 && curPage < getNumberOfPages() - 1) - { - currentState = ANIMATE_LEFT; - } - else if (event.getVelocity() > 0 && curPage > 0) - { - currentState = ANIMATE_RIGHT; - } - } -} - -void SwipeContainer::adjustPages() -{ - pages.moveTo(-static_cast(getSelectedPage() * getWidth()) + dragX, 0); -} - -void SwipeContainer::animateSwipeCancelledLeft() -{ - uint8_t duration = 14; - - if (animationCounter <= duration) - { - int16_t delta = EasingEquations::backEaseOut(animationCounter, 0, -animateDistance, duration); - dragX = animateDistance + delta; - - adjustPages(); - } - else - { - // Final step: stop the animation - currentState = NO_ANIMATION; - animationCounter = 0; - dragX = 0; - adjustPages(); - } - animationCounter++; -} - -void SwipeContainer::animateSwipeCancelledRight() -{ - uint8_t duration = 14; - - if (animationCounter <= duration) - { - int16_t delta = EasingEquations::backEaseOut(animationCounter, 0, animateDistance, duration); - dragX = animateDistance - delta; - - adjustPages(); - } - else - { - // Final step: stop the animation - currentState = NO_ANIMATION; - animationCounter = 0; - dragX = 0; - adjustPages(); - } - animationCounter++; -} - -void SwipeContainer::animateLeft() -{ - uint8_t duration = 10; - - if (animationCounter <= duration) - { - int16_t delta = EasingEquations::cubicEaseOut(animationCounter, 0, getWidth() + animateDistance, duration); - dragX = animateDistance - delta; - } - else - { - // Final step: stop the animation - currentState = NO_ANIMATION; - animationCounter = 0; - dragX = 0; - pageIndicator.goRight(); - } - adjustPages(); - animationCounter++; -} - -void SwipeContainer::animateRight() -{ - uint8_t duration = 10; - - if (animationCounter <= duration) - { - int16_t delta = EasingEquations::cubicEaseOut(animationCounter, 0, getWidth() - animateDistance, duration); - dragX = animateDistance + delta; - } - else - { - // Final step: stop the animation - currentState = NO_ANIMATION; - animationCounter = 0; - dragX = 0; - pageIndicator.goLeft(); - } - adjustPages(); - animationCounter++; -} - -SwipeContainer::PageIndicator::PageIndicator() - : Container(), - unselectedPages(), - selectedPage(), - numberOfPages(0), - currentPage(0) -{ - unselectedPages.setXY(0, 0); - selectedPage.setXY(0, 0); - - Container::add(unselectedPages); - Container::add(selectedPage); -} - -void SwipeContainer::PageIndicator::setNumberOfPages(uint8_t size) -{ - numberOfPages = size; - - assert(numberOfPages > 0 && "At least one dot is needed"); - - if (unselectedPages.getBitmapId() != BITMAP_INVALID) - { - int dotWidth = Bitmap(unselectedPages.getBitmap()).getWidth(); - unselectedPages.setWidth(dotWidth * size); - - // adjust size of container according to the actual bitmaps - setWidthHeight(unselectedPages); - setCurrentPage(MIN(size, currentPage)); - - invalidateContent(); - } -} - -void SwipeContainer::PageIndicator::setBitmaps(const Bitmap& normalPage, const Bitmap& highlightedPage) -{ - selectedPage.setBitmap(highlightedPage); - unselectedPages.setBitmap(normalPage); - if (numberOfPages > 0) - { - setNumberOfPages(numberOfPages); - } -} - -void SwipeContainer::PageIndicator::goRight() -{ - setCurrentPage((currentPage + 1) % numberOfPages); -} - -void SwipeContainer::PageIndicator::goLeft() -{ - setCurrentPage((currentPage + numberOfPages - 1) % numberOfPages); -} - -void SwipeContainer::PageIndicator::setCurrentPage(uint8_t page) -{ - if (page < numberOfPages && page != currentPage) - { - currentPage = page; - int dotWidth = Bitmap(unselectedPages.getBitmap()).getWidth(); - selectedPage.moveTo(page * dotWidth, selectedPage.getY()); - } -} - -uint8_t SwipeContainer::PageIndicator::getNumberOfPages() const -{ - return numberOfPages; -} - -uint8_t SwipeContainer::PageIndicator::getCurrentPage() const -{ - return currentPage; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp deleted file mode 100644 index d8a3179..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/ZoomAnimationImage.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -ZoomAnimationImage::ZoomAnimationImage() - : Container(), - currentState(NO_ANIMATION), - animationCounter(0), - zoomAnimationDelay(0), - smallBmp(), - largeBmp(), - image(), - scalableImage(), - currentZoomMode(FIXED_LEFT_AND_TOP), - zoomAnimationStartWidth(0), - zoomAnimationStartHeight(0), - zoomAnimationEndWidth(0), - zoomAnimationEndHeight(0), - zoomAnimationStartX(0), - zoomAnimationStartY(0), - zoomAnimationDeltaX(0), - zoomAnimationDeltaY(0), - moveAnimationEndX(0), - moveAnimationEndY(0), - animationDuration(0), - zoomAnimationWidthEquation(EasingEquations::linearEaseNone), - zoomAnimationHeightEquation(EasingEquations::linearEaseNone), - moveAnimationXEquation(EasingEquations::linearEaseNone), - moveAnimationYEquation(EasingEquations::linearEaseNone), - animationEndedAction(0) -{ - image.setXY(0, 0); - image.setVisible(false); - - scalableImage.setScalingAlgorithm(ScalableImage::NEAREST_NEIGHBOR); - scalableImage.setXY(0, 0); - scalableImage.setVisible(false); - - Container::add(image); - Container::add(scalableImage); -} - -void ZoomAnimationImage::startZoomAnimation(int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoomMode, EasingEquation widthProgressionEquation, EasingEquation heightProgressionEquation) -{ - setCurrentState(ANIMATE_ZOOM); - - startTimerAndSetParameters(endWidth, endHeight, duration, zoomMode, widthProgressionEquation, heightProgressionEquation); -} - -void ZoomAnimationImage::startZoomAndMoveAnimation(int16_t endX, int16_t endY, int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoomMode, EasingEquation xProgressionEquation, EasingEquation yProgressionEquation, EasingEquation widthProgressionEquation, EasingEquation heightProgressionEquation) -{ - moveAnimationEndX = endX; - moveAnimationEndY = endY; - - moveAnimationXEquation = xProgressionEquation; - moveAnimationYEquation = yProgressionEquation; - - setCurrentState(ANIMATE_ZOOM_AND_MOVE); - - startTimerAndSetParameters(endWidth, endHeight, duration, zoomMode, widthProgressionEquation, heightProgressionEquation); -} - -void ZoomAnimationImage::cancelZoomAnimation() -{ - Application::getInstance()->unregisterTimerWidget(this); - setCurrentState(NO_ANIMATION); -} - -void ZoomAnimationImage::handleTickEvent() -{ - if ((currentState == ANIMATE_ZOOM) || (currentState == ANIMATE_ZOOM_AND_MOVE)) - { - animationCounter++; - if (animationCounter >= zoomAnimationDelay) - { - // Adjust the used animationCounter for the startup delay - uint16_t actualAnimationCounter = animationCounter - zoomAnimationDelay; - - int16_t deltaWidth = zoomAnimationWidthEquation(actualAnimationCounter, 0, zoomAnimationEndWidth - zoomAnimationStartWidth, animationDuration); - int16_t deltaHeight = zoomAnimationHeightEquation(actualAnimationCounter, 0, zoomAnimationEndHeight - zoomAnimationStartHeight, animationDuration); - - setWidthHeight(zoomAnimationStartWidth + deltaWidth, zoomAnimationStartHeight + deltaHeight); - - int16_t deltaX; - int16_t deltaY; - - if (currentState == ANIMATE_ZOOM_AND_MOVE) - { - deltaX = moveAnimationXEquation(actualAnimationCounter, 0, (moveAnimationEndX - zoomAnimationStartX) + zoomAnimationDeltaX, animationDuration); - deltaY = moveAnimationYEquation(actualAnimationCounter, 0, (moveAnimationEndY - zoomAnimationStartY) + zoomAnimationDeltaY, animationDuration); - } - else - { - deltaX = zoomAnimationWidthEquation(actualAnimationCounter, 0, zoomAnimationDeltaX, animationDuration); - deltaY = zoomAnimationHeightEquation(actualAnimationCounter, 0, zoomAnimationDeltaY, animationDuration); - } - moveTo(zoomAnimationStartX + deltaX, zoomAnimationStartY + deltaY); - - if (animationCounter >= zoomAnimationDelay + animationDuration) - { - cancelZoomAnimation(); - - if (animationEndedAction && animationEndedAction->isValid()) - { - animationEndedAction->execute(*this); - } - } - } - } -} - -void ZoomAnimationImage::setBitmaps(const Bitmap& smallBitmap, const Bitmap& largeBitmap) -{ - smallBmp = smallBitmap; - largeBmp = largeBitmap; - - scalableImage.setBitmap(largeBmp); - - ZoomAnimationImage::setWidthHeight(largeBmp); -} - -void ZoomAnimationImage::setWidth(int16_t width) -{ - invalidate(); - Container::setWidth(width); - updateRenderingMethod(); -} - -void ZoomAnimationImage::setHeight(int16_t height) -{ - invalidate(); - Container::setHeight(height); - updateRenderingMethod(); -} - -void ZoomAnimationImage::setScalingMode(ScalableImage::ScalingAlgorithm mode) -{ - scalableImage.setScalingAlgorithm(mode); -} - -ScalableImage::ScalingAlgorithm ZoomAnimationImage::getScalingMode() -{ - return scalableImage.getScalingAlgorithm(); -} - -void ZoomAnimationImage::setAlpha(const uint8_t newAlpha) -{ - image.setAlpha(newAlpha); - scalableImage.setAlpha(newAlpha); -} - -uint8_t ZoomAnimationImage::getAlpha() const -{ - return image.getAlpha(); -} - -void ZoomAnimationImage::setAnimationDelay(uint16_t delay) -{ - zoomAnimationDelay = delay; -} - -uint16_t ZoomAnimationImage::getAnimationDelay() const -{ - return zoomAnimationDelay; -} - -bool ZoomAnimationImage::isZoomAnimationRunning() const -{ - return currentState != NO_ANIMATION; -} - -void ZoomAnimationImage::updateRenderingMethod() -{ - if ((smallBmp.getWidth() == getWidth()) && (smallBmp.getHeight() == getHeight())) - { - image.setBitmap(smallBmp); // Updates width and height - image.setVisible(true); - scalableImage.setVisible(false); - } - else if ((largeBmp.getWidth() == getWidth()) && (largeBmp.getHeight() == getHeight())) - { - image.setBitmap(largeBmp); // Updates width and height - image.setVisible(true); - scalableImage.setVisible(false); - } - else - { - image.setVisible(false); - scalableImage.setVisible(true); - scalableImage.setWidthHeight(*this); - } - Container::invalidate(); -} - -void ZoomAnimationImage::setCurrentState(States state) -{ - currentState = state; - animationCounter = 0; -} - -void ZoomAnimationImage::startTimerAndSetParameters(int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoomMode, EasingEquation widthProgressionEquation, EasingEquation heightProgressionEquation) -{ - Application::getInstance()->registerTimerWidget(this); - - currentZoomMode = zoomMode; - - zoomAnimationStartX = getX(); - zoomAnimationStartY = getY(); - zoomAnimationStartWidth = getWidth(); - zoomAnimationStartHeight = getHeight(); - zoomAnimationEndWidth = endWidth; - zoomAnimationEndHeight = endHeight; - animationDuration = duration; - - zoomAnimationWidthEquation = widthProgressionEquation; - zoomAnimationHeightEquation = heightProgressionEquation; - - updateZoomAnimationDeltaXY(); - - if (zoomAnimationDelay == 0 && animationDuration == 0) - { - handleTickEvent(); // Finish the zoom and move operation immediately - } -} - -void ZoomAnimationImage::updateZoomAnimationDeltaXY() -{ - zoomAnimationDeltaX = zoomAnimationStartWidth - zoomAnimationEndWidth; - zoomAnimationDeltaY = zoomAnimationStartHeight - zoomAnimationEndHeight; - - switch (currentZoomMode) - { - case FIXED_CENTER: - zoomAnimationDeltaX /= 2; - zoomAnimationDeltaY /= 2; - break; - case FIXED_LEFT: - zoomAnimationDeltaX = 0; - zoomAnimationDeltaY /= 2; - break; - case FIXED_RIGHT: - zoomAnimationDeltaY /= 2; - break; - case FIXED_TOP: - zoomAnimationDeltaX /= 2; - zoomAnimationDeltaY = 0; - break; - case FIXED_BOTTOM: - zoomAnimationDeltaX /= 2; - break; - case FIXED_LEFT_AND_TOP: - zoomAnimationDeltaX = 0; - zoomAnimationDeltaY = 0; - break; - case FIXED_RIGHT_AND_TOP: - zoomAnimationDeltaY = 0; - break; - case FIXED_LEFT_AND_BOTTOM: - zoomAnimationDeltaX = 0; - break; - case FIXED_RIGHT_AND_BOTTOM: - break; - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp deleted file mode 100644 index 4305b79..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AbstractClock.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -AbstractClock::AbstractClock() - : Container(), - currentHour(0), - currentMinute(0), - currentSecond(0) -{ -} - -void AbstractClock::setTime24Hour(uint8_t hour, uint8_t minute, uint8_t second) -{ - currentHour = hour % 24; - currentMinute = minute % 60; - currentSecond = second % 60; - - updateClock(); -} - -void AbstractClock::setTime12Hour(uint8_t hour, uint8_t minute, uint8_t second, bool am) -{ - setTime24Hour((hour % 12) + (am ? 0 : 12), minute, second); -} - -uint8_t AbstractClock::getCurrentHour() const -{ - return currentHour; -} - -uint8_t AbstractClock::getCurrentHour24() const -{ - return currentHour; -} - -uint8_t AbstractClock::getCurrentHour12() const -{ - return ((currentHour + 11) % 12) + 1; -} - -bool AbstractClock::getCurrentAM() const -{ - return currentHour < 12; -} - -uint8_t AbstractClock::getCurrentMinute() const -{ - return currentMinute; -} - -uint8_t AbstractClock::getCurrentSecond() const -{ - return currentSecond; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp deleted file mode 100644 index c13f41c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/AnalogClock.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -AnalogClock::AnalogClock() - : AbstractClock(), - background(), - hourHand(), - minuteHand(), - secondHand(), - animationEquation(EasingEquations::linearEaseNone), - animationDuration(0), - clockRotationCenterX(0), - clockRotationCenterY(0), - lastHour(0), - lastMinute(0), - lastSecond(0), - hourHandMinuteCorrectionActive(false), - minuteHandSecondCorrectionActive(false) -{ - AnalogClock::add(background); - - hourHand.updateZAngle(0.f); - minuteHand.updateZAngle(0.f); - secondHand.updateZAngle(0.f); - - hourHand.setVisible(false); - minuteHand.setVisible(false); - secondHand.setVisible(false); -} - -void AnalogClock::setBackground(const BitmapId backgroundBitmapId) -{ - setBackground(backgroundBitmapId, Bitmap(backgroundBitmapId).getWidth() / 2, Bitmap(backgroundBitmapId).getHeight() / 2); -} - -void AnalogClock::setBackground(const BitmapId backgroundBitmapId, const int16_t rotationCenterX, const int16_t rotationCenterY) -{ - background.setBitmap(Bitmap(backgroundBitmapId)); - setWidthHeight(background); - - setRotationCenter(rotationCenterX, rotationCenterY); -} - -void AnalogClock::setRotationCenter(int16_t rotationCenterX, int16_t rotationCenterY) -{ - clockRotationCenterX = rotationCenterX; - clockRotationCenterY = rotationCenterY; -} - -void AnalogClock::setupHourHand(const BitmapId hourHandBitmapId, int16_t rotationCenterX, int16_t rotationCenterY) -{ - setupHand(hourHand, hourHandBitmapId, rotationCenterX, rotationCenterY); -} - -void AnalogClock::setupMinuteHand(const BitmapId minuteHandBitmapId, int16_t rotationCenterX, int16_t rotationCenterY) -{ - setupHand(minuteHand, minuteHandBitmapId, rotationCenterX, rotationCenterY); -} - -void AnalogClock::setupSecondHand(const BitmapId secondHandBitmapId, int16_t rotationCenterX, int16_t rotationCenterY) -{ - setupHand(secondHand, secondHandBitmapId, rotationCenterX, rotationCenterY); -} - -void AnalogClock::setupHand(TextureMapper& hand, const BitmapId bitmapId, int16_t rotationCenterX, int16_t rotationCenterY) -{ - remove(hand); - - hand.setBitmap(Bitmap(bitmapId)); - hand.setWidthHeight(*this); - hand.setXY(0, 0); - hand.setBitmapPosition(clockRotationCenterX - rotationCenterX, clockRotationCenterY - rotationCenterY); - hand.setCameraDistance(300.0f); - hand.setOrigo((float)clockRotationCenterX, (float)clockRotationCenterY, hand.getCameraDistance()); - hand.setCamera(hand.getOrigoX(), hand.getOrigoY()); - hand.setRenderingAlgorithm(TextureMapper::BILINEAR_INTERPOLATION); - - add(hand); - hand.setVisible(true); -} - -void AnalogClock::initializeTime24Hour(uint8_t hour, uint8_t minute, uint8_t second) -{ - lastHour = 255; - lastMinute = 255; - lastSecond = 255; - - // Disable animation and set time - uint16_t tempAnimationDuration = animationDuration; - animationDuration = 1; - setTime24Hour(hour, minute, second); - - animationDuration = tempAnimationDuration; -} - -void AnalogClock::initializeTime12Hour(uint8_t hour, uint8_t minute, uint8_t second, bool am) -{ - initializeTime24Hour((hour % 12) + (am ? 0 : 12), minute, second); -} - -void AnalogClock::setAlpha(uint8_t newAlpha) -{ - background.setAlpha(newAlpha); - hourHand.setAlpha(newAlpha); - minuteHand.setAlpha(newAlpha); - secondHand.setAlpha(newAlpha); -} - -uint8_t AnalogClock::getAlpha() const -{ - return background.getAlpha(); -} - -void AnalogClock::updateClock() -{ - // Make sure that animating to 0 will move from left to right - if (lastHour != 0 && currentHour == 0) - { - hourHand.updateZAngle(hourHand.getZAngle() - (2 * PI)); - } - if (lastMinute != 0 && currentMinute == 0) - { - minuteHand.updateZAngle(minuteHand.getZAngle() - (2 * PI)); - } - if (lastSecond != 0 && currentSecond == 0) - { - secondHand.updateZAngle(secondHand.getZAngle() - (2 * PI)); - } - - float newHandAngle; - - // Move hour hand - if (hourHand.isVisible() && ((currentHour != lastHour) || (hourHandMinuteCorrectionActive && (currentMinute != lastMinute)))) - { - newHandAngle = convertHandValueToAngle(12, currentHour, hourHandMinuteCorrectionActive ? currentMinute : 0); - if (animationEnabled() && !hourHand.isTextureMapperAnimationRunning()) - { - hourHand.setupAnimation(AnimationTextureMapper::Z_ROTATION, newHandAngle, animationDuration, 0, animationEquation); - hourHand.startAnimation(); - } - else - { - if (animationEnabled()) - { - hourHand.cancelAnimationTextureMapperAnimation(); - } - hourHand.updateZAngle(newHandAngle); - } - } - - // Move minute hand - if (minuteHand.isVisible() && ((currentMinute != lastMinute) || (minuteHandSecondCorrectionActive && (currentSecond != lastSecond)))) - { - newHandAngle = convertHandValueToAngle(60, currentMinute, minuteHandSecondCorrectionActive ? currentSecond : 0); - if (animationEnabled() && !minuteHand.isTextureMapperAnimationRunning()) - { - minuteHand.setupAnimation(AnimationTextureMapper::Z_ROTATION, newHandAngle, animationDuration, 0, animationEquation); - minuteHand.startAnimation(); - } - else - { - if (animationEnabled()) - { - minuteHand.cancelAnimationTextureMapperAnimation(); - } - minuteHand.updateZAngle(newHandAngle); - } - } - - // Move second hand - if (secondHand.isVisible() && (currentSecond != lastSecond)) - { - newHandAngle = convertHandValueToAngle(60, currentSecond); - if (animationEnabled() && !secondHand.isTextureMapperAnimationRunning()) - { - secondHand.setupAnimation(AnimationTextureMapper::Z_ROTATION, newHandAngle, animationDuration, 0, animationEquation); - secondHand.startAnimation(); - } - else - { - if (animationEnabled()) - { - secondHand.cancelAnimationTextureMapperAnimation(); - } - secondHand.updateZAngle(newHandAngle); - } - } - - lastHour = currentHour; - lastMinute = currentMinute; - lastSecond = currentSecond; -} - -float AnalogClock::convertHandValueToAngle(uint8_t steps, uint8_t handValue, uint8_t secondHandValue /*= 0*/) const -{ - return ((handValue / (float)steps) + (secondHandValue / (steps * 60.f))) * 2 * PI; -} - -void AnalogClock::setHourHandMinuteCorrection(bool active) -{ - hourHandMinuteCorrectionActive = active; - setTime24Hour(getCurrentHour(), getCurrentMinute(), getCurrentSecond()); -} - -bool AnalogClock::getHourHandMinuteCorrection() const -{ - return hourHandMinuteCorrectionActive; -} - -void AnalogClock::setMinuteHandSecondCorrection(bool active) -{ - minuteHandSecondCorrectionActive = active; - setTime24Hour(getCurrentHour(), getCurrentMinute(), getCurrentSecond()); -} - -bool AnalogClock::getMinuteHandSecondCorrection() const -{ - return minuteHandSecondCorrectionActive; -} - -bool AnalogClock::animationEnabled() const -{ - return animationDuration > 1; -} - -void AnalogClock::setAnimation(uint16_t duration, EasingEquation animationProgressionEquation) -{ - animationDuration = duration; - animationEquation = animationProgressionEquation; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp deleted file mode 100644 index 7a27bf5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/clock/DigitalClock.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -DigitalClock::DigitalClock() - : AbstractClock(), - displayMode(DISPLAY_24_HOUR), - useLeadingZeroForHourIndicator(false), - text() -{ - buffer[0] = '\0'; - text.setXY(0, 0); - text.setWildcard(buffer); - AbstractClock::add(text); -} - -void DigitalClock::setWidth(int16_t width) -{ - AbstractClock::setWidth(width); - text.setWidth(width); -} - -void DigitalClock::setHeight(int16_t height) -{ - AbstractClock::setHeight(height); - text.setHeight(height); -} - -void DigitalClock::setBaselineY(int16_t baselineY) -{ - if (text.getTypedText().hasValidId()) - { - moveTo(getX(), baselineY - text.getTypedText().getFont()->getBaseline()); - } -} - -void DigitalClock::displayLeadingZeroForHourIndicator(bool displayLeadingZero) -{ - useLeadingZeroForHourIndicator = displayLeadingZero; -} - -void DigitalClock::setAlpha(uint8_t newAlpha) -{ - text.setAlpha(newAlpha); -} - -uint8_t DigitalClock::getAlpha() const -{ - return text.getAlpha(); -} - -void DigitalClock::setTypedText(TypedText typedText) -{ - // Do invalidateContent before and after in case the size of the text changes - text.invalidateContent(); - text.setTypedText(typedText); - text.invalidateContent(); -} - -void DigitalClock::setColor(colortype color) -{ - // Do invlidateContent only once since the size does not change - text.setColor(color); - text.invalidateContent(); -} - -colortype DigitalClock::getColor() const -{ - return text.getColor(); -} - -void DigitalClock::updateClock() -{ - text.invalidateContent(); - if (displayMode == DISPLAY_12_HOUR_NO_SECONDS) - { - const char* format = useLeadingZeroForHourIndicator ? "%02d:%02d %cM" : "%d:%02d %cM"; - Unicode::snprintf(buffer, BUFFER_SIZE, format, getCurrentHour12(), getCurrentMinute(), getCurrentAM() ? 'A' : 'P'); - } - else if (displayMode == DISPLAY_24_HOUR_NO_SECONDS) - { - const char* format = useLeadingZeroForHourIndicator ? "%02d:%02d" : "%d:%02d"; - Unicode::snprintf(buffer, BUFFER_SIZE, format, getCurrentHour24(), getCurrentMinute()); - } - else if (displayMode == DISPLAY_12_HOUR) - { - const char* format = useLeadingZeroForHourIndicator ? "%02d:%02d:%02d %cM" : "%d:%02d:%02d %cM"; - Unicode::snprintf(buffer, BUFFER_SIZE, format, getCurrentHour12(), getCurrentMinute(), getCurrentSecond(), getCurrentAM() ? 'A' : 'P'); - } - else if (displayMode == DISPLAY_24_HOUR) - { - const char* format = useLeadingZeroForHourIndicator ? "%02d:%02d:%02d" : "%d:%02d:%02d"; - Unicode::snprintf(buffer, BUFFER_SIZE, format, getCurrentHour24(), getCurrentMinute(), getCurrentSecond()); - } - text.invalidateContent(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp deleted file mode 100644 index 9548b80..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractDirectionProgress.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -AbstractDirectionProgress::AbstractDirectionProgress() - : AbstractProgressIndicator(), progressDirection(RIGHT) -{ - AbstractDirectionProgress::setDirection(RIGHT); -} - -void AbstractDirectionProgress::setDirection(DirectionType direction) -{ - if (direction != progressDirection) - { - progressDirection = direction; - progressIndicatorContainer.invalidate(); - setValue(getValue()); - } -} - -AbstractDirectionProgress::DirectionType AbstractDirectionProgress::getDirection() const -{ - return progressDirection; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp deleted file mode 100644 index 74be65f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/AbstractProgressIndicator.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -AbstractProgressIndicator::AbstractProgressIndicator() - : Container(), background(), progressIndicatorContainer(), rangeMin(0), rangeMax(100), currentValue(0), rangeSteps(100), rangeStepsMin(0), - equation(&EasingEquations::linearEaseNone), animationRunning(false), animationStartValue(0), animationEndValue(0), animationDuration(0), animationStep(0), - valueSetCallback(0), valueUpdatedCallback(0) -{ - background.setXY(0, 0); - AbstractProgressIndicator::add(background); - AbstractProgressIndicator::add(progressIndicatorContainer); -} - -void AbstractProgressIndicator::setBackground(const Bitmap& bitmapBackground) -{ - background.setBitmap(bitmapBackground); - setWidthHeight(background); -} - -void AbstractProgressIndicator::setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - progressIndicatorContainer.setPosition(x, y, width, height); - - if (getWidth() < x + width) - { - AbstractProgressIndicator::setWidth(x + width); - } - - if (getHeight() < y + height) - { - AbstractProgressIndicator::setHeight(y + height); - } -} - -int16_t AbstractProgressIndicator::getProgressIndicatorX() const -{ - return progressIndicatorContainer.getX(); -} - -int16_t AbstractProgressIndicator::getProgressIndicatorY() const -{ - return progressIndicatorContainer.getY(); -} - -int16_t AbstractProgressIndicator::getProgressIndicatorWidth() const -{ - return progressIndicatorContainer.getWidth(); -} - -int16_t AbstractProgressIndicator::getProgressIndicatorHeight() const -{ - return progressIndicatorContainer.getHeight(); -} - -void AbstractProgressIndicator::setRange(int min, int max, uint16_t steps /*= 0*/, uint16_t minStep /*= 0*/) -{ - assert(min < max); - rangeMin = min; - rangeMax = max; - setValue(currentValue); - if (steps == 0) - { - rangeSteps = max - min; - } - else - { - rangeSteps = steps; - } - rangeStepsMin = minStep; - assert(rangeStepsMin < rangeSteps); -} - -void AbstractProgressIndicator::getRange(int& min, int& max, uint16_t& steps, uint16_t& minStep) const -{ - min = rangeMin; - max = rangeMax; - steps = rangeSteps; - minStep = rangeStepsMin; -} - -void AbstractProgressIndicator::getRange(int& min, int& max, uint16_t& steps) const -{ - min = rangeMin; - max = rangeMax; - steps = rangeSteps; -} - -void AbstractProgressIndicator::getRange(int& min, int& max) const -{ - min = rangeMin; - max = rangeMax; -} - -void AbstractProgressIndicator::setValue(int value) -{ - value = MAX(value, rangeMin); - value = MIN(value, rangeMax); - if (value != currentValue) - { - currentValue = value; - if (valueSetCallback && valueSetCallback->isValid()) - { - valueSetCallback->execute(*this); - } - } -} - -void AbstractProgressIndicator::setEasingEquation(EasingEquation easingEquation) -{ - equation = easingEquation; -} - -void AbstractProgressIndicator::updateValue(int value, uint16_t duration) -{ - value = MAX(value, rangeMin); - value = MIN(value, rangeMax); - if (duration == 0) - { - setValue(value); - if (valueUpdatedCallback && valueUpdatedCallback->isValid()) - { - valueUpdatedCallback->execute(*this); - } - return; - } - if (animationDuration > 0) - { - // Old animation is running, stop it first - Application::getInstance()->unregisterTimerWidget(this); - animationRunning = false; - } - animationStartValue = getValue(); - animationEndValue = value; - animationDuration = duration; - animationStep = 0; - Application::getInstance()->registerTimerWidget(this); - animationRunning = true; -} - -int AbstractProgressIndicator::getValue() const -{ - return currentValue; -} - -uint16_t AbstractProgressIndicator::getProgress(uint16_t range /*= 100*/) const -{ - if (range == 0) - { - return 0; - } - int32_t remainder; // Not used here - // Find out at what step the current value is. - int32_t step = rangeStepsMin + muldiv(currentValue - rangeMin, rangeSteps - rangeStepsMin, rangeMax - rangeMin, remainder); - // Scale the step up to [0..range] - int32_t prog = muldiv(step, range, rangeSteps, remainder); - return (uint16_t)prog; -} - -void AbstractProgressIndicator::setValueSetAction(GenericCallback& callback) -{ - valueSetCallback = &callback; -} - -void AbstractProgressIndicator::handleTickEvent() -{ - if (!animationRunning) - { - return; - } - animationStep++; - int16_t delta = (int16_t)equation(animationStep, 0, animationEndValue - animationStartValue, animationDuration); - setValue(animationStartValue + delta); - if (animationStep >= animationDuration) - { - animationDuration = 0; - animationStep = 0; - Application::getInstance()->unregisterTimerWidget(this); - animationRunning = false; - if (valueUpdatedCallback && valueUpdatedCallback->isValid()) - { - valueUpdatedCallback->execute(*this); - } - } -} - -void AbstractProgressIndicator::setValueUpdatedAction(GenericCallback& callback) -{ - valueUpdatedCallback = &callback; -} - -void AbstractProgressIndicator::setAlpha(uint8_t newAlpha) -{ - background.setAlpha(newAlpha); -} - -uint8_t AbstractProgressIndicator::getAlpha() const -{ - return background.getAlpha(); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp deleted file mode 100644 index df2fc86..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/BoxProgress.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -BoxProgress::BoxProgress() - : AbstractDirectionProgress(), box() -{ - progressIndicatorContainer.add(box); -} - -void BoxProgress::setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - box.setPosition(0, 0, width, height); - - AbstractDirectionProgress::setProgressIndicatorPosition(x, y, width, height); -} - -void BoxProgress::setColor(colortype color) -{ - box.setColor(color); -} - -colortype BoxProgress::getColor() const -{ - return box.getColor(); -} - -void BoxProgress::setAlpha(uint8_t newAlpha) -{ - AbstractDirectionProgress::setAlpha(newAlpha); - box.setAlpha(newAlpha); -} - -void BoxProgress::setValue(int value) -{ - AbstractDirectionProgress::setValue(value); - int16_t progress = 0; - switch (progressDirection) - { - case RIGHT: - case LEFT: - progress = AbstractDirectionProgress::getProgress(progressIndicatorContainer.getWidth()); - break; - case DOWN: - case UP: - progress = AbstractDirectionProgress::getProgress(progressIndicatorContainer.getHeight()); - break; - } - switch (progressDirection) - { - case RIGHT: - { - int16_t oldWidth = box.getWidth(); - box.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); - int16_t newWidth = box.getWidth(); - Rect r(MIN(oldWidth, newWidth), 0, abs(oldWidth - newWidth), box.getHeight()); - progressIndicatorContainer.invalidateRect(r); - break; - } - case LEFT: - { - int16_t oldX = box.getX(); - box.setPosition(getWidth() - progress, 0, progress, progressIndicatorContainer.getHeight()); - int16_t newX = box.getX(); - Rect r(MIN(oldX, newX), 0, abs(oldX - newX), box.getHeight()); - progressIndicatorContainer.invalidateRect(r); - break; - } - case DOWN: - { - int16_t oldHeight = box.getHeight(); - box.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - int16_t newHeight = box.getHeight(); - Rect r(0, MIN(oldHeight, newHeight), box.getWidth(), abs(oldHeight - newHeight)); - progressIndicatorContainer.invalidateRect(r); - break; - } - case UP: - { - int16_t oldY = box.getY(); - box.setPosition(0, progressIndicatorContainer.getHeight() - progress, progressIndicatorContainer.getWidth(), progress); - int16_t newY = box.getY(); - Rect r(0, MIN(oldY, newY), box.getWidth(), abs(oldY - newY)); - progressIndicatorContainer.invalidateRect(r); - break; - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp deleted file mode 100644 index a4f54e5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/CircleProgress.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -CircleProgress::CircleProgress() - : AbstractProgressIndicator(), circle(), circleEndAngle(360) -{ - progressIndicatorContainer.add(circle); - circle.setPosition(0, 0, getWidth(), getHeight()); - CircleProgress::setStartEndAngle(0, 360); -} - -void CircleProgress::setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - circle.setPosition(0, 0, width, height); - - AbstractProgressIndicator::setProgressIndicatorPosition(x, y, width, height); -} - -void CircleProgress::setPainter(AbstractPainter& painter) -{ - circle.setPainter(painter); -} - -void CircleProgress::setCenter(int x, int y) -{ - circle.setCenter(x, y); -} - -void CircleProgress::getCenter(int& x, int& y) const -{ - circle.getCenter(x, y); -} - -void CircleProgress::setRadius(int r) -{ - circle.setRadius(r); -} - -int CircleProgress::getRadius() const -{ - int radius; - circle.getRadius(radius); - return radius; -} - -void CircleProgress::setLineWidth(int width) -{ - circle.setLineWidth(width); -} - -int CircleProgress::getLineWidth() const -{ - int width; - circle.getLineWidth(width); - return width; -} - -void CircleProgress::setCapPrecision(int precision) -{ - circle.setCapPrecision(precision); -} - -void CircleProgress::setStartEndAngle(int startAngle, int endAngle) -{ - assert(startAngle != endAngle); - circle.setArc(startAngle, endAngle); - circleEndAngle = endAngle; - CircleProgress::setValue(CircleProgress::getValue()); -} - -int CircleProgress::getStartAngle() const -{ - return circle.getArcStart(); -} - -int CircleProgress::getEndAngle() const -{ - return circleEndAngle; -} - -void CircleProgress::setAlpha(uint8_t newAlpha) -{ - AbstractProgressIndicator::setAlpha(newAlpha); - circle.setAlpha(newAlpha); -} - -void CircleProgress::setValue(int value) -{ - AbstractProgressIndicator::setValue(value); - CWRUtil::Q5 startAngle; - CWRUtil::Q5 endAngle = CWRUtil::toQ5(circleEndAngle); - circle.getArcStart(startAngle); - uint16_t rangeAngleSteps = endAngle < startAngle ? (int)(startAngle - endAngle) : (int)(endAngle - startAngle); - CWRUtil::Q5 progress = CWRUtil::Q5(AbstractProgressIndicator::getProgress(rangeAngleSteps)); - if (endAngle < startAngle) - { - circle.updateArcEnd(startAngle - progress); - } - else - { - circle.updateArcEnd(startAngle + progress); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp deleted file mode 100644 index 457a481..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/ImageProgress.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -ImageProgress::ImageProgress() - : AbstractDirectionProgress(), container(), image(), fixedPosition(true) -{ - container.add(image); - progressIndicatorContainer.add(container); -} - -void ImageProgress::setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - container.setPosition(0, 0, width, height); - - AbstractProgressIndicator::setProgressIndicatorPosition(x, y, width, height); -} - -void ImageProgress::setAnchorAtZero(bool anchorAtZero) -{ - fixedPosition = anchorAtZero; - setValue(getValue()); -} - -bool ImageProgress::getAnchorAtZero() const -{ - return fixedPosition; -} - -void ImageProgress::setBitmap(BitmapId bitmapId) -{ - image.setBitmap(Bitmap(bitmapId)); -} - -BitmapId ImageProgress::getBitmap() const -{ - return image.getBitmapId(); -} - -void ImageProgress::setAlpha(uint8_t newAlpha) -{ - AbstractDirectionProgress::setAlpha(newAlpha); - image.setAlpha(newAlpha); -} - -void ImageProgress::setValue(int value) -{ - AbstractDirectionProgress::setValue(value); - const uint16_t maxProgress = (progressDirection == RIGHT || progressDirection == LEFT) ? progressIndicatorContainer.getWidth() : progressIndicatorContainer.getHeight(); - int16_t progress = AbstractDirectionProgress::getProgress(maxProgress); - if (fixedPosition) - { - switch (progressDirection) - { - case RIGHT: - { - int16_t oldWidth = container.getWidth(); - container.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); - image.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); - int16_t newWidth = container.getWidth(); - Rect r(MIN(oldWidth, newWidth), 0, abs(oldWidth - newWidth), container.getHeight()); - progressIndicatorContainer.invalidateRect(r); - break; - } - case LEFT: - { - int16_t oldX = container.getX(); - container.setPosition(getWidth() - progress, 0, progress, progressIndicatorContainer.getHeight()); - image.setPosition(-container.getX(), 0, progressIndicatorContainer.getWidth(), progressIndicatorContainer.getHeight()); - int16_t newX = container.getX(); - Rect r(MIN(oldX, newX), 0, abs(oldX - newX), container.getHeight()); - progressIndicatorContainer.invalidateRect(r); - break; - } - case DOWN: - { - int16_t oldHeight = container.getHeight(); - container.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - image.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - int16_t newHeight = container.getHeight(); - Rect r(0, MIN(oldHeight, newHeight), container.getWidth(), abs(oldHeight - newHeight)); - progressIndicatorContainer.invalidateRect(r); - break; - } - case UP: - { - int16_t oldY = container.getY(); - container.setPosition(0, progressIndicatorContainer.getHeight() - progress, progressIndicatorContainer.getWidth(), progress); - image.setPosition(0, -container.getY(), progressIndicatorContainer.getWidth(), progressIndicatorContainer.getHeight()); - int16_t newY = container.getY(); - Rect r(0, MIN(oldY, newY), container.getWidth(), abs(oldY - newY)); - progressIndicatorContainer.invalidateRect(r); - break; - } - } - } - else - { - container.invalidate(); - switch (progressDirection) - { - case RIGHT: - container.setPosition(0, 0, progress, getHeight()); - image.setPosition(progress - progressIndicatorContainer.getWidth(), 0, progressIndicatorContainer.getWidth(), getHeight()); - break; - case LEFT: - container.setPosition(progressIndicatorContainer.getWidth() - progress, 0, progress, progressIndicatorContainer.getHeight()); - image.setPosition(0, 0, progress, progressIndicatorContainer.getHeight()); - break; - case DOWN: - container.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - image.setPosition(0, progress - progressIndicatorContainer.getHeight(), progressIndicatorContainer.getWidth(), progressIndicatorContainer.getHeight()); - break; - case UP: - container.setPosition(0, progressIndicatorContainer.getHeight() - progress, progressIndicatorContainer.getWidth(), progress); - image.setPosition(0, 0, progressIndicatorContainer.getWidth(), progress); - break; - } - container.invalidate(); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp deleted file mode 100644 index 37f00bc..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/LineProgress.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -LineProgress::LineProgress() - : AbstractProgressIndicator(), line(), startX(0), startY(0), endX(0), endY(0) -{ - progressIndicatorContainer.add(line); - line.setPosition(0, 0, getWidth(), getHeight()); -} - -void LineProgress::setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - line.setPosition(0, 0, width, height); - - AbstractProgressIndicator::setProgressIndicatorPosition(x, y, width, height); -} - -void LineProgress::setPainter(AbstractPainter& painter) -{ - line.setPainter(painter); -} - -void LineProgress::setStart(int x, int y) -{ - startX = CWRUtil::toQ5(x); - startY = CWRUtil::toQ5(y); - line.setStart(x, y); -} - -void LineProgress::getStart(int& x, int& y) const -{ - x = startX.to(); - y = startY.to(); -} - -void LineProgress::setEnd(int x, int y) -{ - endX = CWRUtil::toQ5(x); - endY = CWRUtil::toQ5(y); -} - -void LineProgress::getEnd(int& x, int& y) const -{ - x = endX.to(); - y = endY.to(); -} - -void LineProgress::setLineWidth(int width) -{ - line.setLineWidth(width); -} - -int LineProgress::getLineWidth() const -{ - int width; - line.getLineWidth(width); - return width; -} - -void LineProgress::setLineEndingStyle(Line::LINE_ENDING_STYLE lineEndingStyle) -{ - line.setLineEndingStyle(lineEndingStyle); -} - -Line::LINE_ENDING_STYLE LineProgress::getLineEndingStyle() const -{ - return line.getLineEndingStyle(); -} - -void LineProgress::setAlpha(uint8_t newAlpha) -{ - AbstractProgressIndicator::setAlpha(newAlpha); - line.setAlpha(newAlpha); -} - -void LineProgress::setValue(int value) -{ - if (rangeSteps > 0) - { - AbstractProgressIndicator::setValue(value); - int progress = (int)AbstractProgressIndicator::getProgress(rangeSteps); - CWRUtil::Q5 r(rangeSteps); - CWRUtil::Q5 p(progress); - CWRUtil::Q5 x = startX + ((endX - startX) / r) * p; - CWRUtil::Q5 y = startY + ((endY - startY) / r) * p; - line.updateEnd(x, y); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp deleted file mode 100644 index bdd81bc..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/progress_indicators/TextProgress.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -TextProgress::TextProgress() - : AbstractProgressIndicator(), - textArea(), - decimals(0) -{ - textBuffer[0] = 0; - progressIndicatorContainer.add(textArea); -} - -void TextProgress::setProgressIndicatorPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - textArea.setPosition(0, 0, width, height); - - AbstractProgressIndicator::setProgressIndicatorPosition(x, y, width, height); -} - -void TextProgress::setTypedText(const TypedText& t) -{ - textArea.setTypedText(t); -} - -const TypedText& TextProgress::getTypedText() const -{ - return textArea.getTypedText(); -} - -void TextProgress::setColor(colortype color) -{ - textArea.setColor(color); -} - -colortype TextProgress::getColor() const -{ - return textArea.getColor(); -} - -void TextProgress::setAlpha(uint8_t newAlpha) -{ - AbstractProgressIndicator::setAlpha(newAlpha); - textArea.setAlpha(newAlpha); -} - -void TextProgress::setValue(int value) -{ - textArea.invalidateContent(); - AbstractProgressIndicator::setValue(value); - int range[3] = { 1, 10, 100 }; - uint16_t progress = AbstractProgressIndicator::getProgress(100 * range[decimals]); - if (decimals > 0) - { - Unicode::snprintf(textBuffer, 8, "%d.%0*d", progress / range[decimals], decimals, progress % range[decimals]); - } - else - { - Unicode::snprintf(textBuffer, 8, "%d", progress); - } - textArea.setWildcard(textBuffer); - textArea.invalidateContent(); -} - -void TextProgress::setNumberOfDecimals(uint16_t numberOfDecimals) -{ - decimals = MIN(2, numberOfDecimals); - setValue(getValue()); -} - -uint16_t TextProgress::getNumberOfDecimals() const -{ - return decimals; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp deleted file mode 100644 index fb31dfb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/DrawableList.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -DrawableList::DrawableList() - : Container(), - isHorizontal(false), - isCircular(false), - offset(0), - itemSize(0), - itemMargin(0), - numItems(0), - numDrawables(0), - firstItem(0), - firstDrawable(0), - drawablesInitialized(false), - firstDrawableIndex(0), - drawableItems(0), - updateDrawable(0) -{ -} - -void DrawableList::setWidth(int16_t width) -{ - Container::setWidth(width); - refreshDrawables(); -} - -void DrawableList::setHeight(int16_t height) -{ - Container::setHeight(height); - refreshDrawables(); -} - -void DrawableList::setHorizontal(bool horizontal) -{ - if ((horizontal && !isHorizontal) || (!horizontal && isHorizontal)) - { - isHorizontal = horizontal; - refreshDrawables(); - } -} - -bool DrawableList::getHorizontal() const -{ - return isHorizontal; -} - -void DrawableList::setCircular(bool circular) -{ - if ((circular && !isCircular) || (!circular && isCircular)) - { - isCircular = circular; - refreshDrawables(); - } -} - -bool DrawableList::getCircular() const -{ - return isCircular; -} - -void DrawableList::setDrawableSize(int16_t drawableSize, int16_t drawableMargin) -{ - itemSize = drawableSize + 2 * drawableMargin; - itemMargin = drawableMargin; -} - -void DrawableList::setDrawables(DrawableListItemsInterface& drawableListItems, - int16_t drawableItemIndexOffset, - GenericCallback& updateDrawableCallback) -{ - drawableItems = &drawableListItems; - firstDrawableIndex = drawableItemIndexOffset; - updateDrawable = &updateDrawableCallback; - - refreshDrawables(); -} - -int16_t DrawableList::getNumberOfDrawables() const -{ - return numDrawables; -} - -int16_t DrawableList::getItemSize() const -{ - return itemSize; -} - -int16_t DrawableList::getDrawableSize() const -{ - return itemSize - 2 * itemMargin; -} - -int16_t DrawableList::getDrawableMargin() const -{ - return itemMargin; -} - -void DrawableList::setNumberOfItems(int16_t numberOfItems) -{ - numItems = numberOfItems; - refreshDrawables(); -} - -int16_t DrawableList::getNumberOfItems() const -{ - return numItems; -} - -int16_t DrawableList::getRequiredNumberOfDrawables() const -{ - if (drawableItems == 0 || itemSize <= 0) - { - return 0; - } - - // Calculate number of required drawables. Worst case is one pixel visible of drawable at top and rest stacked tightly - int16_t requiredDrawables = 1 + (((isHorizontal ? getWidth() : getHeight()) - 1) + (itemSize - 1)) / itemSize; - if (!isCircular) - { - // We never require more drawables than the number of elements on non-circular list. - if (requiredDrawables > numItems) - { - requiredDrawables = numItems; - } - } - - int16_t numberOfDrawables = drawableItems->getNumberOfDrawables(); - return MIN((numberOfDrawables - firstDrawableIndex), requiredDrawables); -} - -void DrawableList::setOffset(int32_t ofs) -{ - offset = ofs; - - if (numDrawables == 0 || numItems == 0 || itemSize == 0) - { - return; - } - if (!updateDrawable || !updateDrawable->isValid()) - { - return; - } - - // ofs is the offset of item[0] - // 0 => item[0] is perfectly selected, -itemSize => item[1] is perfectly selected, itemSize => item[N-1] is perfectly selected etc. - int16_t newFirstItem = 0; - if (ofs > 0) - { - int numberOfItems = ofs / itemSize + 1; - newFirstItem -= numberOfItems; - ofs -= numberOfItems * itemSize; - } - if (ofs <= -itemSize) - { - int numberOfItems = ofs / itemSize; - newFirstItem -= numberOfItems; - ofs -= numberOfItems * itemSize; - } - if (isCircular) - { - // Make sure that firstIndex is "in range" - newFirstItem %= numItems; - if (newFirstItem < 0) - { - newFirstItem += numItems; - } - } - else - { - if (newFirstItem < 0) - { - ofs -= newFirstItem * itemSize; - newFirstItem = 0; - } - else if (newFirstItem + numDrawables > numItems) - { - int x = numItems - (newFirstItem + numDrawables); - ofs += x * itemSize; - newFirstItem += x; - } - } - - int drawableDelta = 0; - if (drawablesInitialized && firstItem != newFirstItem) - { - drawableDelta = numDrawables; - for (int i = 1; i < numDrawables; i++) - { - int fi = (firstItem + i); - int nfi = (newFirstItem + i); - if (isCircular) - { - fi %= numItems; - nfi %= numItems; - } - if (fi == newFirstItem) - { - drawableDelta = -i; - break; - } - if (nfi == firstItem) - { - drawableDelta = i; - break; - } - } - } - firstDrawable = ((firstDrawable - drawableDelta) + numDrawables) % numDrawables; - firstItem = newFirstItem; - - for (int i = 0; i < numDrawables; i++) - { - int drawableIndex = (firstDrawable + i) % numDrawables; - Drawable* drawable = drawableItems->getDrawable(drawableIndex + firstDrawableIndex); - if (isHorizontal) - { - drawable->moveTo(ofs + i * itemSize + itemMargin, 0); - } - else - { - drawable->moveTo(0, ofs + i * itemSize + itemMargin); - } - - int itemIndex = i + firstItem; - if (isCircular) - { - itemIndex %= numItems; - } - else - { - if (itemIndex < 0 || itemIndex >= numItems) - { - itemIndex = -1; - } - } - if (itemIndex < 0) - { - drawable->setVisible(false); - } - else - { - drawable->setVisible(true); - // Only fill if first time or outside old range - if (!drawablesInitialized || (i < drawableDelta || i >= numDrawables + drawableDelta)) - { - if (updateDrawable->isValid()) - { - updateDrawable->execute(drawableItems, drawableIndex + firstDrawableIndex, itemIndex); - drawable->invalidateContent(); - } - } - } - } - drawablesInitialized = true; -} - -int32_t DrawableList::getOffset() const -{ - return offset; -} - -int16_t DrawableList::getItemIndex(int16_t drawableIndex) const -{ - if (drawableIndex < 0 || drawableIndex >= numDrawables || numDrawables == 0 || numItems == 0) - { - return -1; - } - int16_t itemNumber = ((drawableIndex + numDrawables - firstDrawable) % numDrawables) + firstItem; - if (isCircular) - { - itemNumber %= numItems; - } - if (itemNumber < 0 || itemNumber >= numItems) - { - return -1; - } - return itemNumber; -} - -int16_t DrawableList::getDrawableIndices(int16_t itemIndex, int16_t* drawableIndexArray, int16_t arraySize) const -{ - int16_t numFound = 0; - int16_t drawableIndex = -1; - while ((drawableIndex = getDrawableIndex(itemIndex, drawableIndex)) >= 0) - { - if (numFound < arraySize) - { - drawableIndexArray[numFound] = drawableIndex; - numFound++; - } - } - return numFound; -} - -int16_t DrawableList::getDrawableIndex(int16_t itemIndex, int16_t prevDrawableIndex /*= -1*/) const -{ - if (prevDrawableIndex < -1 || prevDrawableIndex >= numDrawables || numDrawables == 0 || numItems == 0) - { - return -1; - } - if (prevDrawableIndex >= 0) - { - prevDrawableIndex = ((prevDrawableIndex - firstDrawable) + numDrawables) % numDrawables; - } - for (int16_t i = prevDrawableIndex + 1; i < numDrawables; i++) - { - int16_t currentItemIndex = firstItem + i; - if (isCircular) - { - currentItemIndex %= numItems; - } - if (itemIndex == currentItemIndex) - { - int16_t drawableIndex = (firstDrawable + i) % numDrawables; - return drawableIndex; - } - } - return -1; -} - -void DrawableList::refreshDrawables() -{ - if (drawableItems == 0) - { - numDrawables = 0; - return; - } - numDrawables = getRequiredNumberOfDrawables(); - // Remove everything - Container::removeAll(); - // Add the itemDrawables - for (int drawableIndex = 0; drawableIndex < numDrawables; drawableIndex++) - { - Drawable* drawable = drawableItems->getDrawable(drawableIndex + firstDrawableIndex); - // Resize the drawables, X/Y ignored for now. - if (isHorizontal) - { - drawable->setPosition(0, 0, itemSize - 2 * itemMargin, getHeight()); - } - else - { - drawable->setPosition(0, 0, getWidth(), itemSize - 2 * itemMargin); - } - // Add each drawable for later positioning - if (drawable->getParent() != 0) - { - // Remove drawable from the current parent - static_cast(drawable->getParent())->remove(*drawable); - } - Container::add(*drawable); - } - - drawablesInitialized = false; - firstItem = 0; - firstDrawable = 0; - setOffset(offset); -} - -void DrawableList::itemChanged(int16_t itemIndex) -{ - if (updateDrawable && updateDrawable->isValid()) - { - int16_t drawableIndex = -1; - while ((drawableIndex = getDrawableIndex(itemIndex, drawableIndex)) != -1) - { - updateDrawable->execute(drawableItems, drawableIndex + firstDrawableIndex, itemIndex); - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp deleted file mode 100644 index 589c1ab..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollBase.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -ScrollBase::ScrollBase() - : Container(), - list(), - numberOfDrawables(0), - distanceBeforeAlignedItem(0), - itemSize(0), - swipeAcceleration(10), - dragAcceleration(10), - maxSwipeItems(0), - easingEquation(&EasingEquations::backEaseOut), - defaultAnimationSteps(30), - overshootPercentage(75), - itemSelectedCallback(0), - itemLockedInCallback(0), - animationEndedCallback(0), - itemPressedCallback(0), - currentAnimationState(NO_ANIMATION), - gestureStep(0), - gestureStepsTotal(0), - gestureStart(0), - gestureEnd(0), - xClick(0), - yClick(0), - initialSwipeOffset(0), - draggableX(false), - draggableY(false) -{ - Container::add(list); - list.setXY(0, 0); - list.setHorizontal(false); - list.setCircular(false); - setTouchable(true); -} - -void ScrollBase::setWidth(int16_t width) -{ - Container::setWidth(width); - list.setWidth(width); -} - -void ScrollBase::setHeight(int16_t height) -{ - Container::setHeight(height); - list.setHeight(height); -} - -void ScrollBase::setHorizontal(bool horizontal) -{ - allowVerticalDrag(horizontal); - allowHorizontalDrag(!horizontal); - list.setHorizontal(horizontal); -} - -bool ScrollBase::getHorizontal() const -{ - return list.getHorizontal(); -} - -void ScrollBase::setCircular(bool circular) -{ - list.setCircular(circular); -} - -bool ScrollBase::getCircular() const -{ - return list.getCircular(); -} - -void ScrollBase::setDrawableSize(int16_t drawableSize, int16_t drawableMargin) -{ - itemSize = drawableSize + drawableMargin * 2; - list.setDrawableSize(drawableSize, drawableMargin); -} - -int16_t ScrollBase::getDrawableSize() const -{ - return list.getDrawableSize(); -} - -int16_t ScrollBase::getDrawableMargin() const -{ - return list.getDrawableMargin(); -} - -void ScrollBase::setNumberOfItems(int16_t numberOfItems) -{ - if (numberOfItems != getNumberOfItems()) - { - list.setNumberOfItems(numberOfItems); - if (!getCircular()) - { - animateToPosition(keepOffsetInsideLimits(getOffset(), 0)); - } - } -} - -int16_t ScrollBase::getNumberOfItems() const -{ - return list.getNumberOfItems(); -} - -void ScrollBase::setEasingEquation(EasingEquation equation) -{ - easingEquation = equation; -} - -void ScrollBase::setAnimationSteps(int16_t steps) -{ - defaultAnimationSteps = steps; -} - -uint16_t ScrollBase::getAnimationSteps() const -{ - return defaultAnimationSteps; -} - -void ScrollBase::setSwipeAcceleration(uint16_t acceleration) -{ - swipeAcceleration = acceleration; -} - -uint16_t ScrollBase::getSwipeAcceleration() const -{ - return swipeAcceleration; -} - -void ScrollBase::setMaxSwipeItems(uint16_t maxItems) -{ - maxSwipeItems = maxItems; -} - -uint16_t ScrollBase::getMaxSwipeItems() const -{ - return maxSwipeItems; -} - -void ScrollBase::setDragAcceleration(uint16_t acceleration) -{ - dragAcceleration = acceleration; -} - -uint16_t ScrollBase::getDragAcceleration() const -{ - return dragAcceleration; -} - -void ScrollBase::allowHorizontalDrag(bool enable) -{ - draggableX = enable; -} - -void ScrollBase::allowVerticalDrag(bool enable) -{ - draggableY = enable; -} - -void ScrollBase::animateToItem(int16_t itemIndex, int16_t animationSteps /*= -1*/) -{ - int32_t position = getPositionForItem(itemIndex); - animateToPosition(position, animationSteps); -} - -void ScrollBase::setItemSelectedCallback(GenericCallback& callback) -{ - itemSelectedCallback = &callback; -} - -void ScrollBase::setAnimationEndedCallback(GenericCallback<>& callback) -{ - animationEndedCallback = &callback; -} - -void ScrollBase::setItemPressedCallback(GenericCallback& callback) -{ - itemPressedCallback = &callback; -} - -bool ScrollBase::isAnimating() const -{ - return currentAnimationState != NO_ANIMATION; -} - -void ScrollBase::stopAnimation() -{ - if (currentAnimationState == ANIMATING_GESTURE) - { - Application::getInstance()->unregisterTimerWidget(this); - setOffset(gestureEnd); - } - currentAnimationState = NO_ANIMATION; -} - -void ScrollBase::handleDragEvent(const DragEvent& event) -{ - stopAnimation(); - currentAnimationState = ANIMATING_DRAG; - int32_t newOffset = getOffset() + (getHorizontal() ? event.getDeltaX() : event.getDeltaY()) * dragAcceleration / 10; - newOffset = keepOffsetInsideLimits(newOffset, muldiv(itemSize, overshootPercentage, 100)); - setOffset(newOffset); -} - -void ScrollBase::handleGestureEvent(const GestureEvent& event) -{ - if (event.getType() == (getHorizontal() ? GestureEvent::SWIPE_HORIZONTAL : GestureEvent::SWIPE_VERTICAL)) - { - int16_t velocity = abs(event.getVelocity()); - int16_t direction = event.getVelocity() < 0 ? -1 : 1; - int16_t steps = MAX(1, velocity - 4) * 7; - int32_t newOffset = getOffset() + direction * steps * swipeAcceleration / 10; - if (maxSwipeItems > 0) - { - int32_t maxDistance = maxSwipeItems * itemSize; - newOffset = MIN(newOffset, initialSwipeOffset + maxDistance); - newOffset = MAX(newOffset, initialSwipeOffset - maxDistance); - } - newOffset = keepOffsetInsideLimits(newOffset, 0); - steps = MIN(steps, defaultAnimationSteps); - animateToPosition(newOffset, steps); - } -} - -void ScrollBase::handleTickEvent() -{ - if (currentAnimationState == ANIMATING_GESTURE) - { - gestureStep++; - int newPosition = gestureStart + easingEquation(gestureStep, 0, gestureEnd - gestureStart, gestureStepsTotal); - setOffset(newPosition); - if (gestureStep > gestureStepsTotal) - { - currentAnimationState = NO_ANIMATION; - gestureStep = 0; - Application::getInstance()->unregisterTimerWidget(this); - setOffset(getNormalizedOffset(gestureEnd)); - // Also adjust initialSwipeOffset in case it is being used. - initialSwipeOffset += getOffset() - gestureEnd; - - // Item has settled, call back - if (animationEndedCallback && animationEndedCallback->isValid()) - { - animationEndedCallback->execute(); - } - } - } -} - -void ScrollBase::itemChanged(int itemIndex) -{ - list.itemChanged(itemIndex); -} - -void ScrollBase::setOffset(int32_t offset) -{ - list.setOffset(offset + distanceBeforeAlignedItem); -} - -int32_t ScrollBase::getOffset() const -{ - return list.getOffset() - distanceBeforeAlignedItem; -} - -int ScrollBase::getNormalizedOffset(int offset) const -{ - int16_t numItems = getNumberOfItems(); - if (numItems == 0 || itemSize == 0) - { - return offset; - } - int32_t listSize = numItems * itemSize; - offset %= listSize; - return offset > 0 ? offset - listSize : offset; -} - -int32_t ScrollBase::getNearestAlignedOffset(int32_t offset) const -{ - if (itemSize == 0) - { - return offset; - } - if (getCircular()) - { - if (offset < 0) - { - return (((offset - (itemSize / 2)) / itemSize) * itemSize); - } - return ((offset + (itemSize / 2)) / itemSize) * itemSize; - } - offset = keepOffsetInsideLimits(offset, 0); - return ((offset - (itemSize / 2)) / itemSize) * itemSize; -} - -void ScrollBase::animateToPosition(int32_t position, int16_t steps) -{ - int32_t currentPosition = getOffset(); - position = getNearestAlignedOffset(position); - if (steps < 0) - { - steps = defaultAnimationSteps; - } - const int32_t distance = abs(position - currentPosition); - steps = MIN(steps, distance); - if (steps < 1) - { - setOffset(position); - currentAnimationState = NO_ANIMATION; - } - else - { - gestureStart = currentPosition; - gestureEnd = position; - gestureStep = 0; - gestureStepsTotal = steps; - if (currentAnimationState != ANIMATING_GESTURE) - { - Application::getInstance()->registerTimerWidget(this); - currentAnimationState = ANIMATING_GESTURE; - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp deleted file mode 100644 index d035118..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollList.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -ScrollList::ScrollList() - : ScrollBase(), - paddingAfterLastItem(0), - snapping(false), - windowSize(1) -{ -} - -void ScrollList::setWidth(int16_t width) -{ - ScrollBase::setWidth(width); - if (getHorizontal()) - { - setWindowSize(windowSize); - } -} - -void ScrollList::setHeight(int16_t height) -{ - ScrollBase::setHeight(height); - if (!getHorizontal()) - { - setWindowSize(windowSize); - } -} - -void ScrollList::setDrawableSize(int16_t drawableSize, int16_t drawableMargin) -{ - ScrollBase::setDrawableSize(drawableSize, drawableMargin); - setWindowSize(windowSize); -} - -void ScrollList::setDrawables(DrawableListItemsInterface& drawableListItems, GenericCallback& updateDrawableCallback) -{ - stopAnimation(); - numberOfDrawables = drawableListItems.getNumberOfDrawables(); - list.setDrawables(drawableListItems, 0, updateDrawableCallback); - setOffset(0); -} - -void ScrollList::setWindowSize(int16_t items) -{ - if (itemSize > 0) - { - const int16_t widgetSize = getHorizontal() ? getWidth() : getHeight(); - const int16_t activeWidgetSize = widgetSize - (distanceBeforeAlignedItem + paddingAfterLastItem); - const int16_t numberOfVisibleItems = (activeWidgetSize + itemSize / 2) / itemSize; // Round up - items = MIN(items, numberOfVisibleItems); // No more than numberOfVisibleItems - } - windowSize = MAX(1, items); // No less than 1 - animateToPosition(keepOffsetInsideLimits(getOffset(), 0)); -} - -void ScrollList::setPadding(int16_t paddingBefore, int16_t paddingAfter) -{ - int32_t currentOffset = getOffset(); - distanceBeforeAlignedItem = paddingBefore; - paddingAfterLastItem = paddingAfter; - setOffset(currentOffset); - list.refreshDrawables(); -} - -int16_t ScrollList::getPaddingBefore() const -{ - return distanceBeforeAlignedItem; -} - -int16_t ScrollList::getPaddingAfter() const -{ - return paddingAfterLastItem; -} - -void ScrollList::setSnapping(bool snap) -{ - snapping = snap; - if (snapping) - { - setOffset(getNearestAlignedOffset(getOffset())); - } -} - -bool ScrollList::getSnapping() const -{ - return snapping; -} - -int32_t ScrollList::getPositionForItem(int16_t itemIndex) -{ - int32_t currentOffset = getNormalizedOffset(getOffset()); - if (itemIndex < 0 || itemIndex >= list.getNumberOfItems() || itemSize == 0) - { - return currentOffset; - } - int32_t itemOffset = -itemIndex * itemSize; - // Get the visible size - const int16_t widgetSize = getHorizontal() ? getWidth() : getHeight(); - const int16_t activeWidgetSize = widgetSize - (distanceBeforeAlignedItem + paddingAfterLastItem); - if (list.getCircular()) - { - int32_t offset = currentOffset; - // Important this is a do-while of visibleSize < itemSize in which case we need to check at least one time - do - { - int16_t i = (-getNormalizedOffset(offset)) / itemSize; // Item index of first - if (itemIndex == i) - { - return currentOffset; - } - offset -= itemSize; - } while (offset >= currentOffset - (activeWidgetSize - itemSize)); - int32_t allItemsSize = list.getNumberOfItems() * itemSize; - // Either scroll left from the first item or right from the last item. Find out which is closest - int32_t leftScrollDistance = itemOffset - currentOffset; - int32_t leftScrollDistance2 = (itemOffset + allItemsSize) - currentOffset; - int32_t rightItemOffset = getNormalizedOffset(currentOffset - (activeWidgetSize - itemSize)); - int32_t rightScrollDistance = rightItemOffset - itemOffset; - int32_t rightScrollDistance2 = rightItemOffset - (itemOffset - allItemsSize); - if (abs(leftScrollDistance2) < abs(leftScrollDistance)) - { - leftScrollDistance = leftScrollDistance2; - } - if (abs(rightScrollDistance2) < abs(rightScrollDistance)) - { - rightScrollDistance = rightScrollDistance2; - } - if (abs(rightScrollDistance) < abs(leftScrollDistance)) - { - return currentOffset - rightScrollDistance; - } - return currentOffset + leftScrollDistance; - } - - if (itemOffset > currentOffset) // First item on screen is higher than the itemIndex. Scroll itemIndex to top position - { - return itemOffset; - } - const int16_t numberOfVisibleItems = activeWidgetSize / itemSize; - int32_t itemOffsetAtEnd = itemOffset; - if (numberOfVisibleItems > 0) - { - if (snapping) - { - itemOffsetAtEnd = itemOffset + (numberOfVisibleItems - 1) * itemSize; - } - else - { - itemOffsetAtEnd = itemOffset + activeWidgetSize - itemSize; - } - } - if (itemOffsetAtEnd < currentOffset) - { - return itemOffsetAtEnd; - } - return currentOffset; -} - -void ScrollList::handleClickEvent(const ClickEvent& event) -{ - ScrollBase::handleClickEvent(event); - if (event.getType() == ClickEvent::PRESSED) - { - xClick = event.getX(); - yClick = event.getY(); - initialSwipeOffset = getOffset(); - - setOffset(getNearestAlignedOffset(initialSwipeOffset)); - if (itemPressedCallback && itemPressedCallback->isValid()) - { - int16_t click = (getHorizontal() ? xClick : yClick); - int32_t offset = click - getOffset(); - int32_t listSize = getNumberOfItems() * itemSize; - if (getCircular()) - { - offset += listSize; - offset %= listSize; - } - if (offset >= 0 && offset < listSize) - { - int16_t item = offset / itemSize; - itemPressedCallback->execute(item); - } - } - } - else if (event.getType() == ClickEvent::RELEASED) - { - if (currentAnimationState == NO_ANIMATION) - { - // For a tiny drag, start by re-aligning (no animation(!)) - setOffset(getNearestAlignedOffset(getOffset())); - if (itemSelectedCallback && itemSelectedCallback->isValid()) - { - int16_t click = (getHorizontal() ? xClick : yClick); - int32_t offset = click - getOffset(); - int32_t listSize = getNumberOfItems() * itemSize; - if (getCircular()) - { - offset += listSize; - offset %= listSize; - } - else - { - offset -= distanceBeforeAlignedItem; - } - if (offset >= 0 && offset < listSize) - { - int16_t item = offset / itemSize; - itemSelectedCallback->execute(item); - } - } - } - else if (currentAnimationState == ANIMATING_DRAG) - { - // click + drag + release. Find best Y to scroll to - animateToPosition(getNearestAlignedOffset(getOffset())); - } - } -} - -int32_t ScrollList::getNearestAlignedOffset(int32_t offset) const -{ - if (snapping) - { - // ScrollBase implementation will snap - return ScrollBase::getNearestAlignedOffset(offset); - } - - return keepOffsetInsideLimits(offset, 0); -} - -int32_t ScrollList::keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) const -{ - if (!getCircular()) - { - newOffset = MIN(newOffset, overShoot); - int maxOffToTheStart = windowSize < getNumberOfItems() ? getNumberOfItems() - windowSize : 0; - newOffset = MAX(newOffset, -(itemSize * maxOffToTheStart) - overShoot); - } - return newOffset; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp deleted file mode 100644 index 1bd17da..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheel.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void ScrollWheel::setDrawables(DrawableListItemsInterface& drawableListItems, GenericCallback& updateDrawableCallback) -{ - stopAnimation(); - numberOfDrawables = drawableListItems.getNumberOfDrawables(); - - list.setDrawables(drawableListItems, 0, updateDrawableCallback); - - setOffset(0); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp deleted file mode 100644 index 90ec82a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelBase.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -ScrollWheelBase::ScrollWheelBase() - : ScrollBase(), - animateToCallback(0) -{ - ScrollWheelBase::setHorizontal(false); - setTouchable(true); -} - -void ScrollWheelBase::setSelectedItemOffset(int16_t offset) -{ - int32_t currentOffset = getOffset(); - distanceBeforeAlignedItem = offset; - setOffset(currentOffset); -} - -int16_t ScrollWheelBase::getSelectedItemOffset() const -{ - return distanceBeforeAlignedItem; -} - -int32_t ScrollWheelBase::getPositionForItem(int16_t itemIndex) -{ - int32_t newOffset = -itemIndex * itemSize; - if (getCircular()) - { - // Check if it is closer to scroll backwards - int32_t otherOffset = newOffset + getNumberOfItems() * itemSize; - int32_t offset = getOffset(); - if (abs(otherOffset - offset) < abs(newOffset - offset)) - { - newOffset = otherOffset; - } - } - return newOffset; -} - -void ScrollWheelBase::animateToPosition(int32_t position, int16_t steps) -{ - if (itemSize == 0) - { - return; - } - if (animateToCallback && animateToCallback->isValid() && itemSize > 0) - { - position = getNearestAlignedOffset(position); - int16_t itemIndex = (-position) / itemSize; - animateToCallback->execute(itemIndex); - } - ScrollBase::animateToPosition(position, steps); -} - -int ScrollWheelBase::getSelectedItem() const -{ - if (itemSize == 0) - { - return 0; - } - if (currentAnimationState == ANIMATING_GESTURE) - { - // Scroll in progress, get the destination value - return (-getNormalizedOffset(gestureEnd)) / itemSize; - } - return (-getNormalizedOffset(getOffset())) / itemSize; -} - -int32_t ScrollWheelBase::keepOffsetInsideLimits(int32_t newOffset, int16_t overShoot) const -{ - if (!getCircular()) - { - newOffset = MIN(newOffset, overShoot); - int16_t numberOfItems = getNumberOfItems(); - newOffset = MAX(newOffset, -(itemSize * (numberOfItems - 1)) - overShoot); - } - return newOffset; -} - -void ScrollWheelBase::handleClickEvent(const ClickEvent& event) -{ - if (itemSize == 0) - { - return; - } - int32_t offset = getOffset(); - if (event.getType() == ClickEvent::PRESSED) - { - xClick = event.getX(); - yClick = event.getY(); - initialSwipeOffset = offset; - - if (itemPressedCallback && itemPressedCallback->isValid()) - { - itemPressedCallback->execute(getSelectedItem()); - } - } - else if (event.getType() == ClickEvent::RELEASED) - { - if (currentAnimationState == NO_ANIMATION) - { - int16_t click = getHorizontal() ? xClick : yClick; - // Click => move to clicked position - if (click < distanceBeforeAlignedItem) - { - animateToPosition(offset + ((distanceBeforeAlignedItem - click) / itemSize + 1) * itemSize); - } - else if (click > distanceBeforeAlignedItem + itemSize) - { - animateToPosition(offset - ((click - distanceBeforeAlignedItem) / itemSize) * itemSize); - } - else - { - animateToPosition(offset); - } - } - else if (currentAnimationState == ANIMATING_DRAG) - { - // click + drag + release. Find best Y to scroll to - animateToPosition(offset); - } - - if (itemSelectedCallback && itemSelectedCallback->isValid()) - { - itemSelectedCallback->execute(getSelectedItem()); - } - } -} - -void ScrollWheelBase::handleDragEvent(const DragEvent& event) -{ - currentAnimationState = ANIMATING_DRAG; - int newOffset = getOffset() + (getHorizontal() ? event.getDeltaX() : event.getDeltaY()) * dragAcceleration / 10; - if (!getCircular()) - { - newOffset = MIN(newOffset, itemSize * 3 / 4); - int16_t numberOfItems = getNumberOfItems(); - newOffset = MAX(newOffset, -(itemSize * (numberOfItems - 1)) - itemSize * 3 / 4); - } - setOffset(newOffset); -} - -void ScrollWheelBase::handleGestureEvent(const GestureEvent& event) -{ - if (event.getType() == (getHorizontal() ? GestureEvent::SWIPE_HORIZONTAL : GestureEvent::SWIPE_VERTICAL)) - { - int32_t newOffset = getOffset() + event.getVelocity() * swipeAcceleration / 10; - if (maxSwipeItems > 0) - { - int32_t maxDistance = maxSwipeItems * itemSize; - newOffset = MIN(newOffset, initialSwipeOffset + maxDistance); - newOffset = MAX(newOffset, initialSwipeOffset - maxDistance); - } - animateToPosition(newOffset); - } -} - -void ScrollWheelBase::setAnimateToCallback(GenericCallback& callback) -{ - animateToCallback = &callback; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp deleted file mode 100644 index 07c720e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/containers/scrollers/ScrollWheelWithSelectionStyle.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -ScrollWheelWithSelectionStyle::ScrollWheelWithSelectionStyle() - : ScrollWheelBase(), - drawablesInFirstList(0), - list1(), - list2(), - extraSizeBeforeSelectedItem(0), - extraSizeAfterSelectedItem(0), - marginBeforeSelectedItem(0), - marginAfterSelectedItem(0), - drawables(0), - centerDrawables(0), - originalUpdateDrawableCallback(0), - originalUpdateCenterDrawableCallback(0) -{ - ScrollWheelBase::add(list2); - ScrollWheelBase::add(list1); // Put center list at top of the first/last list. -} - -void ScrollWheelWithSelectionStyle::setWidth(int16_t width) -{ - ScrollWheelBase::setWidth(width); - if (getHorizontal()) - { - refreshDrawableListsLayout(); - } -} - -void ScrollWheelWithSelectionStyle::setHeight(int16_t height) -{ - ScrollWheelBase::setHeight(height); - if (!getHorizontal()) - { - refreshDrawableListsLayout(); - } -} - -void ScrollWheelWithSelectionStyle::setHorizontal(bool horizontal) -{ - ScrollWheelBase::setHorizontal(horizontal); - list1.setHorizontal(horizontal); - list2.setHorizontal(horizontal); - refreshDrawableListsLayout(); -} - -void ScrollWheelWithSelectionStyle::setCircular(bool circular) -{ - ScrollWheelBase::setCircular(circular); - list1.setCircular(circular); - list2.setCircular(circular); -} - -void ScrollWheelWithSelectionStyle::setNumberOfItems(int16_t numberOfItems) -{ - if (numberOfItems != getNumberOfItems()) - { - ScrollWheelBase::setNumberOfItems(numberOfItems); - list1.setNumberOfItems(numberOfItems); - list2.setNumberOfItems(numberOfItems); - } -} - -void ScrollWheelWithSelectionStyle::setSelectedItemOffset(int16_t offset) -{ - ScrollWheelBase::setSelectedItemOffset(offset); - refreshDrawableListsLayout(); -} - -void ScrollWheelWithSelectionStyle::setSelectedItemExtraSize(int16_t extraSizeBefore, int16_t extraSizeAfter) -{ - extraSizeBeforeSelectedItem = extraSizeBefore; - extraSizeAfterSelectedItem = extraSizeAfter; - refreshDrawableListsLayout(); -} - -int16_t ScrollWheelWithSelectionStyle::getSelectedItemExtraSizeBefore() const -{ - return extraSizeBeforeSelectedItem; -} - -int16_t ScrollWheelWithSelectionStyle::getSelectedItemExtraSizeAfter() const -{ - return extraSizeAfterSelectedItem; -} - -void ScrollWheelWithSelectionStyle::setSelectedItemMargin(int16_t marginBefore, int16_t marginAfter) -{ - marginBeforeSelectedItem = marginBefore; - marginAfterSelectedItem = marginAfter; - refreshDrawableListsLayout(); -} - -int16_t ScrollWheelWithSelectionStyle::getSelectedItemMarginBefore() const -{ - return marginBeforeSelectedItem; -} - -int16_t ScrollWheelWithSelectionStyle::getSelectedItemMarginAfter() const -{ - return marginAfterSelectedItem; -} - -void ScrollWheelWithSelectionStyle::setSelectedItemPosition(int16_t offset, int16_t extraSizeBefore, int16_t extraSizeAfter, int16_t marginBefore, int16_t marginAfter) -{ - setSelectedItemOffset(offset); - setSelectedItemExtraSize(extraSizeBefore, extraSizeAfter); - setSelectedItemMargin(marginBefore, marginAfter); -} - -void ScrollWheelWithSelectionStyle::setDrawableSize(int16_t drawableSize, int16_t drawableMargin) -{ - ScrollWheelBase::setDrawableSize(drawableSize, drawableMargin); - list1.setDrawableSize(drawableSize, drawableMargin); - list2.setDrawableSize(drawableSize, drawableMargin); - - // Resize the three lists - setSelectedItemOffset(distanceBeforeAlignedItem); - - // Changing the drawable size alters number of required drawables, so refresh this - refreshDrawableListsLayout(); -} - -void ScrollWheelWithSelectionStyle::setDrawables(DrawableListItemsInterface& drawableListItems, GenericCallback& updateDrawableCallback, - DrawableListItemsInterface& centerDrawableListItems, GenericCallback& updateCenterDrawableCallback) -{ - drawables = &drawableListItems; - centerDrawables = ¢erDrawableListItems; - - currentAnimationState = NO_ANIMATION; - - originalUpdateDrawableCallback = &updateDrawableCallback; - originalUpdateCenterDrawableCallback = &updateCenterDrawableCallback; - - refreshDrawableListsLayout(); - - setOffset(0); -} - -void ScrollWheelWithSelectionStyle::setOffset(int32_t offset) -{ - ScrollWheelBase::setOffset(offset); - list1.setOffset((distanceBeforeAlignedItem - (distanceBeforeAlignedItem - extraSizeBeforeSelectedItem)) + offset); - list2.setOffset((distanceBeforeAlignedItem - (distanceBeforeAlignedItem + itemSize + extraSizeAfterSelectedItem + marginAfterSelectedItem)) + offset); -} - -void ScrollWheelWithSelectionStyle::itemChanged(int itemIndex) -{ - ScrollWheelBase::itemChanged(itemIndex); - list1.itemChanged(itemIndex); - list2.itemChanged(itemIndex); -} - -void ScrollWheelWithSelectionStyle::refreshDrawableListsLayout() -{ - if (drawables != 0 && centerDrawables != 0) - { - int32_t currentOffset = getOffset(); - - int16_t list1Pos = distanceBeforeAlignedItem - extraSizeBeforeSelectedItem; - int16_t list2Pos = distanceBeforeAlignedItem + itemSize + (extraSizeAfterSelectedItem + marginAfterSelectedItem); - int16_t list0Size = list1Pos - marginBeforeSelectedItem; - int16_t list1Size = itemSize + extraSizeBeforeSelectedItem + extraSizeAfterSelectedItem; - - if (getHorizontal()) - { - int16_t list2Size = getWidth() - list2Pos; - list.setPosition(0, 0, list0Size, getHeight()); - list1.setPosition(list1Pos, 0, list1Size, getHeight()); - list2.setPosition(list2Pos, 0, list2Size, getHeight()); - } - else - { - int16_t list2Size = getHeight() - list2Pos; - list.setPosition(0, 0, getWidth(), list0Size); - list1.setPosition(0, list1Pos, getWidth(), list1Size); - list2.setPosition(0, list2Pos, getWidth(), list2Size); - } - - list.setDrawables(*drawables, 0, *originalUpdateDrawableCallback); - drawablesInFirstList = list.getNumberOfDrawables(); - list1.setDrawables(*centerDrawables, 0, *originalUpdateCenterDrawableCallback); - list2.setDrawables(*drawables, drawablesInFirstList, *originalUpdateDrawableCallback); - - setOffset(keepOffsetInsideLimits(currentOffset, 0)); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp deleted file mode 100644 index 139ca70..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AbstractButton.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void AbstractButton::handleClickEvent(const ClickEvent& event) -{ - bool wasPressed = pressed; - pressed = (event.getType() == ClickEvent::PRESSED); - if ((pressed && !wasPressed) || (!pressed && wasPressed)) - { - // Pressed state changed, so invalidate - invalidate(); - } - if (wasPressed && (event.getType() == ClickEvent::RELEASED)) - { - // This is a click. Fire callback. - executeAction(); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp deleted file mode 100644 index c553f2f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimatedImage.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void AnimatedImage::handleTickEvent() -{ - if (!running) - { - return; - } - ++ticksSinceUpdate; - if (ticksSinceUpdate != updateTicksInterval) - { - return; - } - - ticksSinceUpdate = 0; - BitmapId currentId = getBitmap(); - - if (((currentId == endId) && !reverse) || ((currentId == startId) && reverse)) - { - if (!loopAnimation) - { - Application::getInstance()->unregisterTimerWidget(this); - running = false; - } - - if (animationDoneAction && animationDoneAction->isValid()) - { - animationDoneAction->execute(*this); - } - - if (running && loopAnimation) - { - if (reverse) - { - Image::setBitmap(Bitmap(endId)); - } - else - { - Image::setBitmap(Bitmap(startId)); - } - invalidate(); - } - } - else - { - if (reverse) - { - --currentId; - } - else - { - ++currentId; - } - Image::setBitmap(Bitmap(currentId)); - invalidate(); - } -} - -void AnimatedImage::startAnimation(const bool rev, const bool reset /*= false*/, const bool loop /*= false*/) -{ - if ((startId != BITMAP_INVALID) && (endId != BITMAP_INVALID)) - { - reverse = rev; - loopAnimation = loop; - if (reverse && reset) - { - Image::setBitmap(Bitmap(endId)); - invalidate(); - } - else if (!reverse && reset) - { - Image::setBitmap(Bitmap(startId)); - invalidate(); - } - Application::getInstance()->registerTimerWidget(this); - running = true; - } -} - -void AnimatedImage::stopAnimation() -{ - if (running) - { - Application::getInstance()->unregisterTimerWidget(this); - running = false; - } - if (reverse) - { - Image::setBitmap(Bitmap(endId)); - } - else - { - Image::setBitmap(Bitmap(startId)); - } - invalidate(); -} - -void AnimatedImage::pauseAnimation() -{ - if (running) - { - Application::getInstance()->unregisterTimerWidget(this); - running = false; - } - else - { - Application::getInstance()->registerTimerWidget(this); - running = true; - } -} - -void AnimatedImage::setBitmap(const Bitmap& bmp) -{ - startId = bmp.getId(); - Image::setBitmap(bmp); -} - -void AnimatedImage::setBitmapEnd(const Bitmap& bmp) -{ - endId = bmp.getId(); -} - -void AnimatedImage::setBitmaps(BitmapId start, BitmapId end) -{ - setBitmap(start); - setBitmapEnd(end); -} - -void AnimatedImage::setUpdateTicksInterval(uint8_t updateInterval) -{ - updateTicksInterval = updateInterval; - ticksSinceUpdate = 0; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp deleted file mode 100644 index 653e1bf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/AnimationTextureMapper.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -AnimationTextureMapper::AnimationTextureMapper() - : TextureMapper(), - textureMapperAnimationStepCallback(0), - textureMapperAnimationEndedCallback(0), - animationCounter(0), - animationRunning(false) -{ - for (int i = 0; i < NUMBER_OF_ANIMATION_PARAMETERS; i++) - { - animations[i].animationActive = false; - } -} - -void AnimationTextureMapper::setTextureMapperAnimationStepAction(GenericCallback& callback) -{ - textureMapperAnimationStepCallback = &callback; -} - -void AnimationTextureMapper::setTextureMapperAnimationEndedAction(GenericCallback& callback) -{ - textureMapperAnimationEndedCallback = &callback; -} - -bool AnimationTextureMapper::isTextureMapperAnimationRunning() const -{ - return animationRunning; -} - -void AnimationTextureMapper::setupAnimation(AnimationParameter parameter, float endValue, uint16_t duration, uint16_t delay, EasingEquation progressionEquation /*= &EasingEquations::linearEaseNone*/) -{ - animations[parameter].animationActive = true; - animations[parameter].animationEnd = endValue; - animations[parameter].animationDuration = duration; - animations[parameter].animationDelay = delay; - animations[parameter].animationProgressionEquation = progressionEquation; -} - -void AnimationTextureMapper::startAnimation() -{ - Application::getInstance()->registerTimerWidget(this); - - animationCounter = 0; - - animations[X_ROTATION].animationStart = xAngle; - animations[Y_ROTATION].animationStart = yAngle; - animations[Z_ROTATION].animationStart = zAngle; - animations[SCALE].animationStart = scale; - - animationRunning = true; - - for (int i = 0; i < NUMBER_OF_ANIMATION_PARAMETERS; i++) - { - if (animations[i].animationActive && animations[i].animationDelay + animations[i].animationDuration > 0) - { - return; // Animation needs to run, return - } - } - // No active animations or all active animations have zero steps, execute now! - handleTickEvent(); -} - -void AnimationTextureMapper::cancelAnimationTextureMapperAnimation() -{ - Application::getInstance()->unregisterTimerWidget(this); - animationRunning = false; - - for (int i = 0; i < NUMBER_OF_ANIMATION_PARAMETERS; i++) - { - animations[i].animationActive = false; - } -} - -uint16_t AnimationTextureMapper::getAnimationStep() -{ - return animationCounter; -} - -void AnimationTextureMapper::handleTickEvent() -{ - if (!animationRunning) - { - return; - } - bool newAngleAssigned = false; - bool newScaleAssigned = false; - bool activeAnimationExists = false; - - animationCounter++; - - float newXAngle = xAngle; - float newYAngle = yAngle; - float newZAngle = zAngle; - float newScale = scale; - - for (int i = 0; i < NUMBER_OF_ANIMATION_PARAMETERS; i++) - { - if (!(animations[i].animationActive)) - { - continue; - } - - if (animationCounter >= animations[i].animationDelay) - { - // Adjust the used animationCounter for the startup delay - uint32_t actualAnimationCounter = animationCounter - animations[i].animationDelay; - - int directionModifier; - int16_t distance; - - if (animations[i].animationEnd > animations[i].animationStart) - { - directionModifier = 1; - distance = (int16_t)((animations[i].animationEnd - animations[i].animationStart) * 1000); - } - else - { - directionModifier = -1; - distance = (int16_t)((animations[i].animationStart - animations[i].animationEnd) * 1000); - } - - float delta = (float)directionModifier * (animations[i].animationProgressionEquation(actualAnimationCounter, 0, distance, animations[i].animationDuration) / 1000.f); - - switch ((AnimationParameter)i) - { - case X_ROTATION: - newXAngle = animations[X_ROTATION].animationStart + delta; - newAngleAssigned = true; - break; - case Y_ROTATION: - newYAngle = animations[Y_ROTATION].animationStart + delta; - newAngleAssigned = true; - break; - case Z_ROTATION: - newZAngle = animations[Z_ROTATION].animationStart + delta; - newAngleAssigned = true; - break; - case SCALE: - newScale = animations[SCALE].animationStart + delta; - newScaleAssigned = true; - break; - } - } - if (animationCounter >= (uint32_t)(animations[i].animationDelay + animations[i].animationDuration)) - { - animations[i].animationActive = false; - } - else - { - activeAnimationExists = true; - } - } - - if (newAngleAssigned || newScaleAssigned) - { - if (newAngleAssigned) - { - updateAngles(newXAngle, newYAngle, newZAngle); - } - if (newScaleAssigned) - { - updateScale(newScale); - } - - if (textureMapperAnimationStepCallback && textureMapperAnimationStepCallback->isValid()) - { - textureMapperAnimationStepCallback->execute(*this); - } - } - if (!activeAnimationExists) - { - // End of animation - cancelAnimationTextureMapperAnimation(); - - if (textureMapperAnimationEndedCallback && textureMapperAnimationEndedCallback->isValid()) - { - textureMapperAnimationEndedCallback->execute(*this); - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp deleted file mode 100644 index 21665e7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Box.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -Rect Box::getSolidRect() const -{ - Rect solidRect; - if (alpha == 255) - { - solidRect.width = rect.width; - solidRect.height = rect.height; - } - return solidRect; -} - -void Box::draw(const Rect& area) const -{ - Rect dirty = area; - translateRectToAbsolute(dirty); - HAL::lcd().fillRect(dirty, color, alpha); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp deleted file mode 100644 index 808f0fa..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/BoxWithBorder.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void BoxWithBorder::draw(const Rect& area) const -{ - const Rect centerRect = Rect(borderSize, borderSize, getWidth() - (2 * borderSize), getHeight() - (2 * borderSize)); - if (centerRect.isEmpty()) - { - Rect dirty = area; - translateRectToAbsolute(dirty); - HAL::lcd().fillRect(dirty, borderColor, alpha); - return; - } - - Rect dirty = area & centerRect; - Box::draw(dirty); - - if (borderSize == 0) - { - return; - } - - Rect borders[4] = { - Rect(0, 0, getWidth(), borderSize), // Upper - Rect(0, getHeight() - borderSize, getWidth(), borderSize), // lower - Rect(0, borderSize, borderSize, getHeight() - (2 * borderSize)), // left - Rect(getWidth() - borderSize, borderSize, borderSize, getHeight() - (2 * borderSize)) // right - }; - for (int i = 0; i < 4; i++) - { - Rect borderDirty = borders[i] & area; - if (!borderDirty.isEmpty()) - { - translateRectToAbsolute(borderDirty); - HAL::lcd().fillRect(borderDirty, borderColor, alpha); - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp deleted file mode 100644 index e7e5262..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Button.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void Button::draw(const Rect& invalidatedArea) const -{ - Bitmap bmp(pressed ? down : up); - Rect dirty(0, 0, bmp.getWidth(), bmp.getHeight()); - dirty &= invalidatedArea; - if ((bmp.getId() != BITMAP_INVALID) && !dirty.isEmpty()) - { - Rect r; - translateRectToAbsolute(r); - HAL::lcd().drawPartialBitmap(bmp, r.x, r.y, dirty, alpha); - } -} - -void Button::setBitmaps(const Bitmap& bitmapReleased, const Bitmap& bitmapPressed) -{ - up = bitmapReleased; - down = bitmapPressed; - // Adjust width and height of this widget to match bitmap. It is assumed - // that the two bitmaps have same dimensions. - Button::setWidthHeight(down); -} - -Rect Button::getSolidRect() const -{ - if (alpha < 255) - { - return Rect(); - } - - return (pressed ? down.getSolidRect() : up.getSolidRect()); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp deleted file mode 100644 index 35effd8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithIcon.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -ButtonWithIcon::ButtonWithIcon() - : Button(), - iconReleased(), - iconPressed(), - iconX(0), - iconY(0) -{ -} - -void ButtonWithIcon::setBitmaps(const Bitmap& newBackgroundReleased, const Bitmap& newBackgroundPressed, - const Bitmap& newIconReleased, const Bitmap& newIconPressed) -{ - Button::setBitmaps(newBackgroundReleased, newBackgroundPressed); - - iconReleased = newIconReleased; - iconPressed = newIconPressed; - - iconX = (getWidth() / 2) - (newIconPressed.getWidth() / 2); - iconY = (getHeight() / 2) - (newIconPressed.getHeight() / 2); -} - -void ButtonWithIcon::draw(const Rect& invalidatedArea) const -{ - Button::draw(invalidatedArea); - - Bitmap bmp(pressed ? iconPressed : iconReleased); - Rect iconRect(iconX, iconY, bmp.getWidth(), bmp.getHeight()); - Rect dirty = invalidatedArea & iconRect; - if ((bmp.getId() != BITMAP_INVALID) && !dirty.isEmpty()) - { - Rect r; - translateRectToAbsolute(r); - dirty.x -= iconX; - dirty.y -= iconY; - HAL::lcd().drawPartialBitmap(bmp, r.x + iconX, r.y + iconY, dirty, alpha); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp deleted file mode 100644 index 302e328..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ButtonWithLabel.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -ButtonWithLabel::ButtonWithLabel() - : Button(), typedText(), color(0), colorPressed(0), rotation(TEXT_ROTATE_0), textHeightIncludingSpacing(0) -{ -} - -void ButtonWithLabel::draw(const Rect& area) const -{ - Button::draw(area); - - if (typedText.hasValidId()) - { - const Font* fontToDraw = typedText.getFont(); // Never return 0 - int16_t height = textHeightIncludingSpacing; - int16_t offset; - Rect labelRect; - switch (rotation) - { - case TEXT_ROTATE_0: - offset = (this->getHeight() - height) / 2; // Prefer round down - labelRect = Rect(0, offset, this->getWidth(), height); - break; - case TEXT_ROTATE_180: - offset = ((this->getHeight() - height) + 1) / 2; // Prefer round up - labelRect = Rect(0, offset, this->getWidth(), height); - break; - case TEXT_ROTATE_90: - offset = ((this->getWidth() - height) + 1) / 2; // Prefer round up - labelRect = Rect(offset, 0, height, this->getHeight()); - break; - case TEXT_ROTATE_270: - offset = (this->getWidth() - height) / 2; // Prefer round down - labelRect = Rect(offset, 0, height, this->getHeight()); - break; - } - Rect dirty = labelRect & area; - - if (!dirty.isEmpty()) - { - dirty.x -= labelRect.x; - dirty.y -= labelRect.y; - translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, pressed ? colorPressed : color, alpha, typedText.getAlignment(), 0, rotation, typedText.getTextDirection(), 0, WIDE_TEXT_NONE); - HAL::lcd().drawString(labelRect, dirty, visuals, typedText.getText()); - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp deleted file mode 100644 index 17c9608..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Gauge.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -Gauge::Gauge() - : AbstractProgressIndicator(), - needle(), - algorithmMoving(TextureMapper::BILINEAR_INTERPOLATION), - algorithmSteady(TextureMapper::BILINEAR_INTERPOLATION), - needleStartAngle(0), - needleEndAngle(0), - gaugeCenterX(0), - gaugeCenterY(0), - needleCenterX(0), - needleCenterY(0), - arc() -{ - Gauge::remove(progressIndicatorContainer); - Gauge::add(arc); - Gauge::add(needle); - arc.setVisible(false); -} - -void Gauge::setWidth(int16_t width) -{ - AbstractProgressIndicator::setWidth(width); - needle.setWidth(width); - arc.setWidth(width); -} - -void Gauge::setHeight(int16_t height) -{ - AbstractProgressIndicator::setHeight(height); - needle.setHeight(height); - arc.setHeight(height); -} - -void Gauge::setBackgroundOffset(int16_t offsetX, int16_t offsetY) -{ - background.setXY(offsetX, offsetY); -} - -void Gauge::setCenter(int x, int y) -{ - gaugeCenterX = x; - gaugeCenterY = y; - setupNeedleTextureMapper(); - arc.setPixelCenter(x - arc.getX(), y - arc.getY()); -} - -void Gauge::setArcPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - arc.setPosition(x, y, width, height); - arc.setPixelCenter(gaugeCenterX - x, gaugeCenterY - y); -} - -void Gauge::setNeedle(const BitmapId bitmapId, int16_t rotationCenterX, int16_t rotationCenterY) -{ - needle.setBitmap(Bitmap(bitmapId)); - needleCenterX = rotationCenterX; - needleCenterY = rotationCenterY; - setupNeedleTextureMapper(); -} - -void Gauge::setMovingNeedleRenderingAlgorithm(TextureMapper::RenderingAlgorithm algorithm) -{ - algorithmMoving = algorithm; -} - -void Gauge::setSteadyNeedleRenderingAlgorithm(TextureMapper::RenderingAlgorithm algorithm) -{ - algorithmSteady = algorithm; -} - -void Gauge::setStartEndAngle(int startAngle, int endAngle) -{ - assert(startAngle != endAngle); - needleStartAngle = startAngle; - needleEndAngle = endAngle; - arc.setArc(startAngle, endAngle); - Gauge::setValue(Gauge::getValue()); -} - -int Gauge::getStartAngle() const -{ - return needleStartAngle; -} - -int Gauge::getEndAngle() const -{ - return needleEndAngle; -} - -void Gauge::setArcVisible(bool show /*= true*/) -{ - arc.setVisible(show); -} - -void Gauge::putArcOnTop(bool onTop /*= true*/) -{ - if (onTop) - { - remove(arc); - add(arc); - } - else - { - remove(needle); - add(needle); - } -} - -Circle& Gauge::getArc() -{ - return arc; //lint !e1536 -} - -void Gauge::setValue(int value) -{ - AbstractProgressIndicator::setValue(value); - if (animationStep >= animationDuration) - { - needle.setRenderingAlgorithm(algorithmSteady); - } - else - { - needle.setRenderingAlgorithm(algorithmMoving); - } - uint16_t progress = AbstractProgressIndicator::getProgress(abs(needleEndAngle - needleStartAngle)); - if (needleEndAngle < needleStartAngle) - { - needle.updateZAngle(((float)(needleStartAngle - progress) / 180.0f) * PI); - arc.updateArcEnd(needleStartAngle - progress); - } - else - { - needle.updateZAngle(((float)(needleStartAngle + progress) / 180.0f) * PI); - arc.updateArcEnd(needleStartAngle + progress); - } -} - -void Gauge::setAlpha(uint8_t newAlpha) -{ - AbstractProgressIndicator::setAlpha(newAlpha); - needle.setAlpha(newAlpha); - arc.setAlpha(newAlpha); -} - -void Gauge::setupNeedleTextureMapper() -{ - needle.setWidthHeight(*this); - needle.setXY(0, 0); - needle.setBitmapPosition(gaugeCenterX - needleCenterX, gaugeCenterY - needleCenterY); - needle.setCameraDistance(300.0f); - needle.setOrigo((float)gaugeCenterX, (float)gaugeCenterY, needle.getCameraDistance()); - needle.setCamera(needle.getOrigoX(), needle.getOrigoY()); - needle.setRenderingAlgorithm(TextureMapper::BILINEAR_INTERPOLATION); -} - -void Gauge::setProgressIndicatorPosition(int16_t /*x*/, int16_t /*y*/, int16_t /*width*/, int16_t /*height*/) -{ -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp deleted file mode 100644 index eebc6a8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Image.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void Image::setBitmap(const Bitmap& bmp) -{ - bitmap = bmp; - // When setting bitmap, adjust size of this widget to match. - setWidthHeight(bmp); -} - -void Image::draw(const Rect& invalidatedArea) const -{ - Rect meAbs; - translateRectToAbsolute(meAbs); // To find our x and y coords in absolute. - - // Calculate intersection between bitmap rect and invalidated area. - Rect dirtyBitmapArea = bitmap.getRect() & invalidatedArea; - - if (!dirtyBitmapArea.isEmpty()) - { - HAL::lcd().drawPartialBitmap(bitmap, meAbs.x, meAbs.y, dirtyBitmapArea, alpha); - } -} - -Rect Image::getSolidRect() const -{ - // If alpha is less than solid, we have an empty solid rect. - if (alpha < 255) - { - return Rect(); - } - // Return solid rect from bitmap (precalculated). - return bitmap.getSolidRect(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp deleted file mode 100644 index bf0dfdf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/Keyboard.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -Keyboard::Keyboard() - : Container(), keyListener(0), buffer(0), bufferSize(0), bufferPosition(0), image(), enteredText(), layout(0), keyMappingList(0), highlightImage(), cancelIsEmitted(false) -{ - setTouchable(true); - - image.setXY(0, 0); - Keyboard::add(image); - - highlightImage.setVisible(false); - Keyboard::add(highlightImage); - - enteredText.setColor(Color::getColorFromRGB(0, 0, 0)); - Keyboard::add(enteredText); -} - -void Keyboard::setBuffer(Unicode::UnicodeChar* newBuffer, uint16_t newBufferSize) -{ - buffer = newBuffer; - bufferSize = newBufferSize; - - enteredText.setWildcard(buffer); - - // Place cursor at end of string if we already have something - // in the edit buffer. - bufferPosition = Unicode::strlen(buffer); -} - -void Keyboard::setLayout(const Layout* newLayout) -{ - layout = newLayout; - if (newLayout != 0) - { - image.setBitmap(Bitmap(newLayout->bitmap)); - - enteredText.setTypedText(newLayout->textAreaFont); - enteredText.setColor(newLayout->textAreaFontColor); - enteredText.setPosition(newLayout->textAreaPosition.x, newLayout->textAreaPosition.y, - newLayout->textAreaPosition.width, newLayout->textAreaPosition.height); - } - invalidate(); -} - -void Keyboard::setTextIndentation() -{ - if (layout != 0) - { - uint8_t indentation = layout->textAreaFont.getFont()->getMaxPixelsLeft(); - enteredText.setPosition(layout->textAreaPosition.x - indentation, layout->textAreaPosition.y, - layout->textAreaPosition.width + indentation * 2, layout->textAreaPosition.height); - enteredText.setIndentation(indentation); - } -} - -Keyboard::Key Keyboard::getKeyForCoordinates(int16_t x, int16_t y) const -{ - Key key; - key.keyId = 0; // No key - if (layout != 0) - { - for (uint8_t i = 0; i < layout->numberOfKeys; i++) - { - if (layout->keyArray[i].keyArea.intersect(x, y)) - { - key = layout->keyArray[i]; - break; - } - } - } - return key; -} - -Keyboard::CallbackArea Keyboard::getCallbackAreaForCoordinates(int16_t x, int16_t y) const -{ - CallbackArea area; - area.callback = reinterpret_cast*>(0); - if (layout != 0) - { - for (uint8_t i = 0; i < layout->numberOfCallbackAreas; i++) - { - if (layout->callbackAreaArray[i].keyArea.intersect(x, y)) - { - area = layout->callbackAreaArray[i]; - break; - } - } - } - return area; -} - -void Keyboard::draw(const Rect& invalidatedArea) const -{ - assert(layout && "No layout configured for Keyboard"); - if (layout != 0) - { - Font* font = FontManager::getFont(layout->keyFont); - assert(font && "Keyboard::draw: Unable to find font, is font db initialized?"); - if (font != 0) - { - // Setup visuals for h-center of "string" - LCD::StringVisuals visuals; - visuals.font = font; - visuals.alignment = CENTER; - visuals.color = layout->keyFontColor; - // String with room for a single character - Unicode::UnicodeChar character[2] = { 0, 0 }; // The last is important as string terminator. - - uint16_t fontHeight = font->getHeight(); - - for (uint8_t i = 0; i < layout->numberOfKeys; i++) - { - const Key& key = layout->keyArray[i]; - if (key.keyArea.intersect(invalidatedArea)) - { - uint8_t keyId = key.keyId; - Unicode::UnicodeChar c = getCharForKey(keyId); - if (c != 0) - { - // Get a copy of the keyArea and v-center the area for the character - Rect keyArea = key.keyArea; - uint16_t offset = (keyArea.height - fontHeight) / 2; - keyArea.y += offset; - keyArea.height -= offset; - // Calculate the invalidated area relative to the key - Rect invalidatedAreaRelative = key.keyArea & invalidatedArea; - invalidatedAreaRelative.x -= keyArea.x; - invalidatedAreaRelative.y -= keyArea.y; - // Set up string with one character - character[0] = c; - translateRectToAbsolute(keyArea); - HAL::lcd().drawString(keyArea, invalidatedAreaRelative, visuals, character); - } - } - } - } - } -} - -void Keyboard::handleClickEvent(const ClickEvent& event) -{ - ClickEvent::ClickEventType type = event.getType(); - if (type == ClickEvent::RELEASED && cancelIsEmitted) - { - cancelIsEmitted = false; - return; - } - int16_t x = event.getX(); - int16_t y = event.getY(); - Rect toDraw; - - Keyboard::CallbackArea callbackArea = getCallbackAreaForCoordinates(x, y); - if (callbackArea.callback != 0) - { - if (type == ClickEvent::PRESSED) - { - highlightImage.setXY(callbackArea.keyArea.x, callbackArea.keyArea.y); - highlightImage.setBitmap(Bitmap(callbackArea.highlightBitmapId)); - highlightImage.setVisible(true); - toDraw = highlightImage.getRect(); - invalidateRect(toDraw); - } - - if ((type == ClickEvent::RELEASED) && callbackArea.callback->isValid()) - { - callbackArea.callback->execute(); - if (keyListener) - { - keyListener->execute(0); - } - } - } - else - { - Keyboard::Key key = getKeyForCoordinates(x, y); - - if (type == ClickEvent::PRESSED) - { - if (key.keyId != 0) - { - highlightImage.setXY(key.keyArea.x, key.keyArea.y); - highlightImage.setBitmap(Bitmap(key.highlightBitmapId)); - highlightImage.setVisible(true); - toDraw = highlightImage.getRect(); - invalidateRect(toDraw); - } - } - - if (type == ClickEvent::RELEASED) - { - if (key.keyId != 0 && buffer) - { - Unicode::UnicodeChar c = getCharForKey(key.keyId); - if (c != 0 && bufferPosition < (bufferSize - 1)) - { - enteredText.invalidateContent(); - buffer[bufferPosition++] = c; - buffer[bufferPosition] = 0; - enteredText.invalidateContent(); - if (keyListener) - { - keyListener->execute(c); - } - } - } - } - } - - if (type == ClickEvent::RELEASED || type == ClickEvent::CANCEL) - { - toDraw = highlightImage.getRect(); - highlightImage.setVisible(false); - invalidateRect(toDraw); - - if (type == ClickEvent::CANCEL) - { - cancelIsEmitted = true; - } - } -} - -void Keyboard::handleDragEvent(const DragEvent& event) -{ - if (highlightImage.isVisible() && (!highlightImage.getRect().intersect(static_cast(event.getNewX()), static_cast(event.getNewY()))) && (!cancelIsEmitted)) - { - // Send a CANCEL click event, if user has dragged out of currently pressed/highlighted key. - ClickEvent cancelEvent(ClickEvent::CANCEL, static_cast(event.getOldX()), static_cast(event.getOldY())); - handleClickEvent(cancelEvent); - } -} - -Unicode::UnicodeChar Keyboard::getCharForKey(uint8_t keyId) const -{ - Unicode::UnicodeChar ch = 0; - if (keyMappingList != 0) - { - for (uint8_t i = 0; i < keyMappingList->numberOfKeys; i++) - { - if (keyMappingList->keyMappingArray[i].keyId == keyId) - { - ch = keyMappingList->keyMappingArray[i].keyValue; - break; - } - } - } - return ch; -} - -void Keyboard::setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement) -{ - // Keyboard is a Container, and they do not normally appear in the draw chain (they just draw children). - // But this particular container actually has a draw() function implementation, so we must change default - // behavior. - // First, add children - Container::setupDrawChain(invalidatedArea, nextPreviousElement); - // Then add yourself - Drawable::setupDrawChain(invalidatedArea, nextPreviousElement); -} - -void Keyboard::setBufferPosition(uint16_t newPos) -{ - bufferPosition = newPos; - enteredText.invalidate(); -} - -void Keyboard::setKeymappingList(const KeyMappingList* newKeyMappingList) -{ - keyMappingList = newKeyMappingList; - invalidate(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp deleted file mode 100644 index 5eb12de..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/PixelDataWidget.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -void PixelDataWidget::draw(const Rect& invalidatedArea) const -{ - if (!buffer) - { - return; - } - - // Convert to lcd coordinates. - const Rect absolute = getAbsoluteRect(); - // Copy to LCD - HAL::lcd().blitCopy(buffer, format, absolute, invalidatedArea, alpha, false); -} - -Rect PixelDataWidget::getSolidRect() const -{ - if (buffer && alpha == 255) - { - // There are at least some solid pixels - switch (format) - { - case Bitmap::BW: - case Bitmap::BW_RLE: - case Bitmap::GRAY2: - case Bitmap::GRAY4: - case Bitmap::RGB565: - case Bitmap::RGB888: - // All solid pixels - return Rect(0, 0, getWidth(), getHeight()); - case Bitmap::ARGB8888: - case Bitmap::ARGB2222: - case Bitmap::ABGR2222: - case Bitmap::RGBA2222: - case Bitmap::BGRA2222: - case Bitmap::L8: - case Bitmap::A4: - case Bitmap::CUSTOM: - // No knowledge about solid pixels - break; - } - } - // Empty rectangle - return Rect(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp deleted file mode 100644 index 5e3070a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RadioButton.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void RadioButton::draw(const Rect& invalidatedArea) const -{ - Bitmap bitmap = getCurrentlyDisplayedBitmap(); - if (bitmap.getId() != BITMAP_INVALID) - { - Rect meAbs; - translateRectToAbsolute(meAbs); // To find our x and y coords in absolute. - - // Calculate intersection between bitmap rect and invalidated area. - Rect dirtyBitmapArea = bitmap.getRect() & invalidatedArea; - - if (!dirtyBitmapArea.isEmpty()) - { - HAL::lcd().drawPartialBitmap(bitmap, meAbs.x, meAbs.y, dirtyBitmapArea, alpha); - } - } -} - -void RadioButton::handleClickEvent(const ClickEvent& event) -{ - bool wasPressed = pressed; - pressed = (event.getType() == ClickEvent::PRESSED); - if ((pressed && !wasPressed) || (!pressed && wasPressed)) - { - invalidate(); - } - if (wasPressed && (event.getType() == ClickEvent::RELEASED)) - { - if (deselectionEnabled) - { - setSelected(!getSelected()); - } - else if (!getSelected()) - { - setSelected(true); - } - } -} - -void RadioButton::setBitmaps(const Bitmap& bmpUnselected, const Bitmap& bmpUnselectedPressed, const Bitmap& bmpSelected, const Bitmap& bmpSelectedPressed) -{ - bitmapUnselected = bmpUnselected; - bitmapUnselectedPressed = bmpUnselectedPressed; - bitmapSelected = bmpSelected; - bitmapSelectedPressed = bmpSelectedPressed; - - RadioButton::setWidthHeight(bitmapUnselected); -} - -Rect RadioButton::getSolidRect() const -{ - if (alpha < 255) - { - return Rect(); - } - - return getCurrentlyDisplayedBitmap().getSolidRect(); -} - -void RadioButton::setSelected(bool newSelected) -{ - bool wasSelected = selected; - selected = newSelected; - - if (wasSelected && !newSelected) - { - executeDeselectedAction(); - } - - if (!wasSelected && newSelected) - { - executeAction(); - } - - invalidate(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp deleted file mode 100644 index 5c9961f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/RepeatButton.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -RepeatButton::RepeatButton() - : Button(), ticksDelay(30), ticksInterval(15), ticks(0), ticksBeforeContinuous(0) -{ -} - -void RepeatButton::setDelay(int delay) -{ - ticksDelay = delay; -} - -int RepeatButton::getDelay() -{ - return ticksDelay; -} - -void RepeatButton::setInterval(int interval) -{ - ticksInterval = interval; -} - -int RepeatButton::getInterval() -{ - return ticksInterval; -} - -void RepeatButton::handleClickEvent(const ClickEvent& event) -{ - pressed = false; // To prevent AbstractButton from calling action->execute(). - invalidate(); // Force redraw after forced state change - Button::handleClickEvent(event); - if (event.getType() == ClickEvent::PRESSED) - { - executeAction(); - - ticks = 0; - ticksBeforeContinuous = ticksDelay; - Application::getInstance()->registerTimerWidget(this); - } - else - { - Application::getInstance()->unregisterTimerWidget(this); - } -} - -void RepeatButton::handleTickEvent() -{ - Button::handleTickEvent(); - - if (!pressed) - { - return; - } - if (ticks == ticksBeforeContinuous) - { - executeAction(); - - ticks = 0; - ticksBeforeContinuous = ticksInterval; - } - else - { - ticks++; - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp deleted file mode 100644 index 9a0e0a5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SVGImage.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -// Declarations, defined in SVGDatabase.cpp -namespace SVGDatabase -{ -const touchgfx::VGObject* getInstance(); -uint16_t getInstanceSize(); -} // namespace SVGDatabase - -namespace touchgfx -{ -void SVGImage::setSVG(uint16_t id) -{ - if (id >= SVGDatabase::getInstanceSize()) - { - svgId = SVG_INVALID; - return; - } - - svgId = id; - reset(); - - // If the widget is empty, resize it to the size of the SVG - if (rect.isEmpty()) - { - resizeToCurrentSVG(); - } -} - -void SVGImage::resizeToCurrentSVG() -{ - if (svgId == SVG_INVALID) - { - return; - } - const VGObject* const table = SVGDatabase::getInstance(); - const VGObject& image = table[svgId]; - const Matrix3x3 matrix = getTransformationMatrix(); - // Transform bounding box corners - const Matrix3x3::Point p1 = matrix.affineTransform(0.0f, 0.0f); - const Matrix3x3::Point p2 = matrix.affineTransform(0.0f, image.imageHeight); - const Matrix3x3::Point p3 = matrix.affineTransform(image.imageWidth, 0.0f); - const Matrix3x3::Point p4 = matrix.affineTransform(image.imageWidth, image.imageHeight); - // Find limits of transformed box - const float x_max = MAX(MAX(p1.x, p2.x), MAX(p3.x, p4.x)); - const float y_max = MAX(MAX(p1.y, p2.y), MAX(p3.y, p4.y)); - setWidthHeight(static_cast(ceilf(x_max)), static_cast(ceilf(y_max))); -} - -void SVGImage::reset() -{ - scaleX = 1.0f; - scaleY = 1.0f; - rotation = 0.0f; - rotationCenterX = 0.0f; - rotationCenterY = 0.0f; - imagePositionX = 0.0f; - imagePositionY = 0.0f; -} - -float SVGImage::getImageWidth() const -{ - if (svgId == SVG_INVALID) - { - return 0.0f; - } - const VGObject* const table = SVGDatabase::getInstance(); - const VGObject& image = table[svgId]; - return image.imageWidth; -} - -float SVGImage::getImageHeight() const -{ - if (svgId == SVG_INVALID) - { - return 0.0f; - } - const VGObject* const table = SVGDatabase::getInstance(); - const VGObject& image = table[svgId]; - return image.imageHeight; -} - -void SVGImage::draw(const Rect& invalidatedArea) const -{ - if (svgId == SVG_INVALID) - { - return; - } - - const VGObject* const table = SVGDatabase::getInstance(); - const VGObject& image = table[svgId]; - - VectorRenderer* renderer = VectorRenderer::getInstance(); - assert(renderer && "No VectorRenderer instance found!"); - - renderer->setup(*this, invalidatedArea); - - Matrix3x3 matrix = getTransformationMatrix(); - for (const VGShape* shape = image.shape; shape != 0; shape = shape->next) - { - Matrix3x3 shapeMatrix; - shapeMatrix.setAffineTransformation(shape->transformation); - shapeMatrix = matrix.multiply(shapeMatrix); - - // Skip entire shape if bounding box does not cover invalidatedArea - // Find bounding box including stroke width - const float strokeWidthHalf = shape->strokeWidth / 2.0f; - const float bb_xMin = shape->boundingbox[0] - strokeWidthHalf; - const float bb_yMin = shape->boundingbox[1] - strokeWidthHalf; - const float bb_xMax = shape->boundingbox[2] + strokeWidthHalf; - const float bb_yMax = shape->boundingbox[3] + strokeWidthHalf; - // Transform bounding box corners - const Matrix3x3::Point p1 = shapeMatrix.affineTransform(bb_xMin, bb_yMin); - const Matrix3x3::Point p2 = shapeMatrix.affineTransform(bb_xMin, bb_yMax); - const Matrix3x3::Point p3 = shapeMatrix.affineTransform(bb_xMax, bb_yMin); - const Matrix3x3::Point p4 = shapeMatrix.affineTransform(bb_xMax, bb_yMax); - // Find limits of transformed box - const int16_t x_min = static_cast(floorf(MIN(MIN(p1.x, p2.x), MIN(p3.x, p4.x)))); - const int16_t x_max = static_cast(ceilf(MAX(MAX(p1.x, p2.x), MAX(p3.x, p4.x)))); - const int16_t y_min = static_cast(floorf(MIN(MIN(p1.y, p2.y), MIN(p3.y, p4.y)))); - const int16_t y_max = static_cast(ceilf(MAX(MAX(p1.y, p2.y), MAX(p3.y, p4.y)))); - Rect shapeBox(x_min, y_min, (x_max - x_min) + 1, (y_max - y_min) + 1); - if (shapeBox.intersect(invalidatedArea)) - { - renderer->setTransformationMatrix(shapeMatrix); - - // First fill - if (shape->fillMode != VG_NONE) - { - // Set drawing mode and color for this shape - renderer->setMode((shape->drawingMode == VG_FILL_EVEN_ODD) ? VectorRenderer::FILL_EVEN_ODD : VectorRenderer::FILL_NON_ZERO); - renderer->setAlpha(shape->fillAlpha); - - // Set the fill color - switch (shape->fillMode) - { - case VG_NONE: - break; // Guarded above - case VG_FIXED_COLOR: - { - const VGFixedColor* color = reinterpret_cast(shape->fillPaint); - renderer->setColor(color->argb); - break; - } - case VG_LINEAR_GRADIENT: - { - //Set shape box size on linear (and radial) gradient - const float width = shape->boundingbox[2] - shape->boundingbox[0]; - const float height = shape->boundingbox[3] - shape->boundingbox[1]; - - const VGLinearGradient* linear = reinterpret_cast(shape->fillPaint); - renderer->setLinearGradient(linear->x0, linear->y0, linear->x1, linear->y1, - linear->stops, linear->stopPositions, linear->colors, - width, height, - linear->isSolid, linear->palette); - break; - } - } - - // Draw this Shape - renderer->drawPath(shape->commands, shape->numCommands, shape->points, shape->numPoints, shape->boundingbox); - } - - // Then stroke - if (shape->strokeMode != VG_NONE) - { - // Stroking is nonzero - renderer->setMode(VectorRenderer::STROKE); - renderer->setStrokeWidth(shape->strokeWidth); - renderer->setStrokeLineCap(shape->strokeLineCap); - renderer->setStrokeLineJoin(shape->strokeLineJoin); - renderer->setStrokeMiterLimit(shape->strokeMiterLimit); - renderer->setAlpha(shape->strokeAlpha); - - // Set the fill color - switch (shape->strokeMode) - { - case VG_NONE: - break; // Guarded above - case VG_FIXED_COLOR: - { - const VGFixedColor* color = reinterpret_cast(shape->strokePaint); - renderer->setColor(color->argb); - break; - } - case VG_LINEAR_GRADIENT: - { - //Set shape box size on linear (and radial) gradient - const float width = shape->boundingbox[2] - shape->boundingbox[0] + shape->strokeWidth; - const float height = shape->boundingbox[3] - shape->boundingbox[1] + shape->strokeWidth; - - const VGLinearGradient* linear = reinterpret_cast(shape->strokePaint); - renderer->setLinearGradient(linear->x0, linear->y0, linear->x1, linear->y1, - linear->stops, linear->stopPositions, linear->colors, - width, height, - linear->isSolid, linear->palette); - break; - } - } - - // Draw this Shape - const float boundingbox[4] = { shape->boundingbox[0] - strokeWidthHalf, shape->boundingbox[1] - strokeWidthHalf, - shape->boundingbox[2] + strokeWidthHalf, shape->boundingbox[3] + strokeWidthHalf }; - renderer->drawPath(shape->commands, shape->numCommands, shape->points, shape->numPoints, boundingbox); - } - } - } - - // Finalize rendering - renderer->tearDown(); -} - -void SVGImage::invalidateContent() const -{ - if (!visible || svgId == SVG_INVALID) - { - return; - } - const VGObject* const table = SVGDatabase::getInstance(); - const VGObject& image = table[svgId]; - const Matrix3x3 matrix = getTransformationMatrix(); - // Transform bounding box corners - const Matrix3x3::Point p1 = matrix.affineTransform(image.x, image.y); - const Matrix3x3::Point p2 = matrix.affineTransform(image.x, image.y + image.height); - const Matrix3x3::Point p3 = matrix.affineTransform(image.x + image.width, image.y); - const Matrix3x3::Point p4 = matrix.affineTransform(image.x + image.width, image.y + image.height); - // Find limits of transformed box - const int16_t x_min = static_cast(floorf(MIN(MIN(p1.x, p2.x), MIN(p3.x, p4.x)))); - const int16_t x_max = static_cast(ceilf(MAX(MAX(p1.x, p2.x), MAX(p3.x, p4.x)))); - const int16_t y_min = static_cast(floorf(MIN(MIN(p1.y, p2.y), MIN(p3.y, p4.y)))); - const int16_t y_max = static_cast(ceilf(MAX(MAX(p1.y, p2.y), MAX(p3.y, p4.y)))); - Rect r(x_min, y_min, (x_max - x_min) + 1, (y_max - y_min) + 1); - invalidateRect(r); -} - -touchgfx::Matrix3x3 SVGImage::getTransformationMatrix() const -{ - Matrix3x3 matrix; // Implicit reset to identity matrix - if (svgId != SVG_INVALID) - { - matrix.scale(scaleX, scaleY); - matrix.translate(imagePositionX - rotationCenterX, imagePositionY - rotationCenterY); - matrix.rotate(rotation); - matrix.translate(rotationCenterX, rotationCenterY); - } - return matrix; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp deleted file mode 100644 index 28a5e2a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ScalableImage.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -ScalableImage::ScalableImage(const Bitmap& bmp /*= Bitmap() */) - : Image(bmp), - currentScalingAlgorithm(BILINEAR_INTERPOLATION) -{ -} - -void ScalableImage::setScalingAlgorithm(ScalingAlgorithm algorithm) -{ - currentScalingAlgorithm = algorithm; -} - -ScalableImage::ScalingAlgorithm ScalableImage::getScalingAlgorithm() -{ - return currentScalingAlgorithm; -} - -void ScalableImage::drawQuad(const Rect& invalidatedArea, uint16_t* fb, const float* triangleXs, const float* triangleYs, const float* triangleZs, const float* triangleUs, const float* triangleVs) const -{ - // Area to redraw. Relative to the scalableImage. - Rect dirtyArea = Rect(0, 0, getWidth(), getHeight()) & invalidatedArea; - - // Absolute position of the scalableImage. - Rect dirtyAreaAbsolute = dirtyArea; - translateRectToAbsolute(dirtyAreaAbsolute); - - Rect absoluteRect = getAbsoluteRect(); - DisplayTransformation::transformDisplayToFrameBuffer(absoluteRect); - - // Transform rects to match framebuffer coordinates - // This is needed if the display is rotated compared to the framebuffer - DisplayTransformation::transformDisplayToFrameBuffer(dirtyArea, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(dirtyAreaAbsolute); - - // Get a pointer to the bitmap data, return if no bitmap found - const uint16_t* textmap = (const uint16_t*)bitmap.getData(); - if (!textmap) - { - return; - } - - float x0 = triangleXs[0]; - float x1 = triangleXs[1]; - float x2 = triangleXs[2]; - float x3 = triangleXs[3]; - float y0 = triangleYs[0]; - float y1 = triangleYs[1]; - float y2 = triangleYs[2]; - float y3 = triangleYs[3]; - - DisplayTransformation::transformDisplayToFrameBuffer(x0, y0, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(x1, y1, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(x2, y2, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(x3, y3, this->getRect()); - - Point3D vertices[4]; - Point3D point0 = { floatToFixed28_4(x0), floatToFixed28_4(y0), (float)(triangleZs[0]), (float)(triangleUs[0]), (float)(triangleVs[0]) }; - Point3D point1 = { floatToFixed28_4(x1), floatToFixed28_4(y1), (float)(triangleZs[1]), (float)(triangleUs[1]), (float)(triangleVs[1]) }; - Point3D point2 = { floatToFixed28_4(x2), floatToFixed28_4(y2), (float)(triangleZs[2]), (float)(triangleUs[2]), (float)(triangleVs[2]) }; - Point3D point3 = { floatToFixed28_4(x3), floatToFixed28_4(y3), (float)(triangleZs[3]), (float)(triangleUs[3]), (float)(triangleVs[3]) }; - - vertices[0] = point0; - vertices[1] = point1; - vertices[2] = point2; - vertices[3] = point3; - - DrawingSurface dest = { fb, HAL::FRAME_BUFFER_WIDTH }; - TextureSurface src = { textmap, bitmap.getExtraData(), bitmap.getWidth(), bitmap.getHeight(), bitmap.getWidth() }; - - HAL::lcd().drawTextureMapQuad(dest, vertices, src, absoluteRect, dirtyAreaAbsolute, lookupRenderVariant(), alpha, 0xFFFF); -} - -RenderingVariant ScalableImage::lookupRenderVariant() const -{ - RenderingVariant renderVariant; - if (currentScalingAlgorithm == NEAREST_NEIGHBOR) - { - renderVariant = lookupNearestNeighborRenderVariant(bitmap); - } - else - { - renderVariant = lookupBilinearRenderVariant(bitmap); - } - return renderVariant; -} - -void ScalableImage::draw(const Rect& invalidatedArea) const -{ - if (!alpha) - { - return; - } - uint16_t* fb = 0; - - float triangleXs[4]; - float triangleYs[4]; - float triangleZs[4]; - float triangleUs[4]; - float triangleVs[4]; - - float imageX0 = 0; - float imageY0 = 0; - float imageX1 = imageX0 + getWidth(); - float imageY1 = imageY0; - float imageX2 = imageX1; - float imageY2 = imageY0 + getHeight(); - float imageX3 = imageX0; - float imageY3 = imageY2; - - triangleZs[0] = 100.f; - triangleZs[1] = 100.f; - triangleZs[2] = 100.f; - triangleZs[3] = 100.f; - - // Setup texture coordinates - float right = (float)(bitmap.getWidth()); - float bottom = (float)(bitmap.getHeight()); - float textureU0 = 0.0f; - float textureV0 = 0.0f; - float textureU1 = right; - float textureV1 = 0.0f; - float textureU2 = right; - float textureV2 = bottom; - float textureU3 = 0.0f; - float textureV3 = bottom; - if (HAL::DISPLAY_ROTATION == rotate90) - { - textureU0 = 0.0f; - textureV0 = right; - textureU1 = 0.0f; - textureV1 = 0.0f; - textureU2 = bottom; - textureV2 = 0.0f; - textureU3 = bottom; - textureV3 = right; - } - - triangleXs[0] = imageX0; - triangleXs[1] = imageX1; - triangleXs[2] = imageX2; - triangleXs[3] = imageX3; - triangleYs[0] = imageY0; - triangleYs[1] = imageY1; - triangleYs[2] = imageY2; - triangleYs[3] = imageY3; - - triangleUs[0] = textureU0; - triangleUs[1] = textureU1; - triangleUs[2] = textureU2; - triangleUs[3] = textureU3; - triangleVs[0] = textureV0; - triangleVs[1] = textureV1; - triangleVs[2] = textureV2; - triangleVs[3] = textureV3; - - drawQuad(invalidatedArea, fb, triangleXs, triangleYs, triangleZs, triangleUs, triangleVs); -} - -Rect ScalableImage::getSolidRect() const -{ - // If original image is completely solid the scaled image will also be - if (alpha == 255 && bitmap.getSolidRect().width == bitmap.getWidth() && bitmap.getSolidRect().height == bitmap.getHeight()) - { - return bitmap.getSolidRect(); - } - return Rect(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp deleted file mode 100644 index de5cd0c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/SnapshotWidget.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -SnapshotWidget::SnapshotWidget() - : Widget(), bitmapId(BITMAP_INVALID), alpha(255) -{ -} - -void SnapshotWidget::draw(const Rect& invalidatedArea) const -{ - if (alpha == 0 || bitmapId == BITMAP_INVALID) - { - return; - } - - Rect absRect(0, 0, Bitmap(bitmapId).getWidth(), rect.height); - translateRectToAbsolute(absRect); - HAL::lcd().blitCopy((const uint16_t*)Bitmap(bitmapId).getData(), absRect, invalidatedArea, alpha, false); -} - -Rect SnapshotWidget::getSolidRect() const -{ - if (alpha < 255 || bitmapId == BITMAP_INVALID) - { - return Rect(); - } - return Rect(0, 0, getWidth(), getHeight()); -} - -void SnapshotWidget::makeSnapshot() -{ - makeSnapshot(BITMAP_ANIMATION_STORAGE); -} - -void SnapshotWidget::makeSnapshot(const BitmapId bmp) -{ - Rect visRect(0, 0, rect.width, rect.height); - getVisibleRect(visRect); - Rect absRect = getAbsoluteRect(); - bitmapId = (HAL::lcd().copyFrameBufferRegionToMemory(visRect, absRect, bmp)) ? bmp : BITMAP_INVALID; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp deleted file mode 100644 index 352bad1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextArea.cpp +++ /dev/null @@ -1,324 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ - -Alignment TextArea::getAlignment() const -{ - if (typedText.hasValidId()) - { - return typedText.getAlignment(); - } - return LEFT; -} - -int16_t TextArea::getTextHeight() const -{ - return typedText.hasValidId() ? calculateTextHeight(typedText.getText(), getWildcard1(), getWildcard2()) : 0; -} - -uint16_t TextArea::getTextWidth() const -{ - return typedText.hasValidId() ? typedText.getFont()->getStringWidth(typedText.getTextDirection(), typedText.getText(), getWildcard1(), getWildcard2()) : 0; -} - -void TextArea::draw(const Rect& area) const -{ - if (typedText.hasValidId()) - { - Rect rectToDraw = area; - if (typedText.hasValidId() && boundingArea.isValid(typedText.getText())) - { - rectToDraw &= boundingArea.getRect(); - } - if (!rectToDraw.isEmpty()) - { - const Font* fontToDraw = typedText.getFont(); - if (fontToDraw != 0) - { - LCD::StringVisuals visuals(fontToDraw, color, alpha, getAlignment(), linespace, rotation, typedText.getTextDirection(), indentation, wideTextAction); - HAL::lcd().drawString(getAbsoluteRect(), rectToDraw, visuals, typedText.getText(), getWildcard1(), getWildcard2()); - } - } - } -} - -void TextArea::setTypedText(const TypedText& t) -{ - typedText = t; - // If this TextArea does not yet have a width and height, - // just assign the smallest possible size to fit current text. - if (getWidth() == 0 && getHeight() == 0) - { - resizeToCurrentText(); - } - boundingArea = calculateBoundingArea(); -} - -void TextArea::resizeToCurrentText() -{ - if (typedText.hasValidId()) - { - uint16_t w = getTextWidth(); - uint16_t h = getTextHeight(); - if (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) - { - setWidthHeight(w, h); - } - else - { - setWidthHeight(h, w); - } - } -} - -void TextArea::resizeToCurrentTextWithAlignment() -{ - if (typedText.hasValidId()) - { - Alignment alignment = getAlignment(); - uint16_t text_width = getTextWidth(); - uint16_t text_height = getTextHeight(); - if (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) - { - // (rotate-0 && left-align) or (rotate-180 && right-align) places text to the left - if (!((rotation == TEXT_ROTATE_0 && alignment == LEFT) || (rotation == TEXT_ROTATE_180 && alignment == RIGHT))) - { - uint16_t old_width = getWidth(); - uint16_t old_x = getX(); - if (alignment == CENTER) - { - setX(old_x + (old_width - text_width) / 2); - } - else - { - setX(old_x + (old_width - text_width)); - } - } - if (rotation == TEXT_ROTATE_180) - { - uint16_t old_height = getHeight(); - uint16_t old_y = getY(); - setY(old_y + (old_height - text_height)); - } - setWidthHeight(text_width, text_height); - } - else - { - // 90+left or 270+right places text at the same y coordinate - if (!((rotation == TEXT_ROTATE_90 && alignment == LEFT) || (rotation == TEXT_ROTATE_270 && alignment == RIGHT))) - { - uint16_t old_height = getHeight(); - uint16_t old_y = getY(); - if (alignment == CENTER) - { - setY(old_y + (old_height - text_width) / 2); - } - else - { - setY(old_y + (old_height - text_width)); - } - } - if (rotation == TEXT_ROTATE_90) - { - uint16_t old_width = getWidth(); - uint16_t old_x = getX(); - setX(old_x + (old_width - text_height)); - } - setWidthHeight(text_height, text_width); - } - } -} - -void TextArea::resizeHeightToCurrentText() -{ - if (typedText.hasValidId()) - { - uint16_t h = getTextHeight(); - if (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) - { - setHeight(h); - } - else - { - setWidth(h); - } - } -} - -void TextArea::resizeHeightToCurrentTextWithRotation() -{ - if (typedText.hasValidId()) - { - uint16_t h = getTextHeight(); - switch (rotation) - { - case TEXT_ROTATE_0: - setHeight(h); - break; - case TEXT_ROTATE_90: - setX(rect.right() - h); - setWidth(h); - break; - case TEXT_ROTATE_180: - setY(rect.bottom() - h); - setHeight(h); - break; - case TEXT_ROTATE_270: - setWidth(h); - break; - } - } -} - -int16_t TextArea::calculateTextHeight(const Unicode::UnicodeChar* format, ...) const -{ - if (!typedText.hasValidId()) - { - return 0; - } - - va_list pArg; - va_start(pArg, format); - - const Font* fontToDraw = typedText.getFont(); - int16_t textHeight = fontToDraw->getHeight(); - - TextProvider textProvider; - textProvider.initialize(format, pArg, fontToDraw->getGSUBTable(), fontToDraw->getContextualFormsTable()); - - int16_t numLines = LCD::getNumLines(textProvider, wideTextAction, typedText.getTextDirection(), typedText.getFont(), getWidth() - indentation); - - va_end(pArg); - return (textHeight + linespace > 0) ? (numLines * textHeight + (numLines - 1) * linespace) : (numLines > 0) ? (textHeight) - : 0; -} - -void TextArea::invalidateContent() const -{ - if (alpha == 0 || !typedText.hasValidId() || rect.isEmpty()) - { - return; - } - if (boundingArea.isValid(typedText.getText())) - { - Rect boundingRect = boundingArea.getRect(); - invalidateRect(boundingRect); - return; - } - invalidate(); -} - -TextArea::BoundingArea TextArea::calculateBoundingArea() const -{ - if (!typedText.hasValidId()) - { - return TextArea::BoundingArea(); // Return Invalid BoundingArea - } - - const Font* fontToDraw = typedText.getFont(); - const Unicode::UnicodeChar* textToDraw = typedText.getText(); - const int16_t fontHeight = fontToDraw->getHeight(); - const int16_t lineHeight = fontHeight + linespace; - int16_t width = 0; - uint16_t numberOfLines = 0; - - if (wideTextAction == WIDE_TEXT_NONE) - { - TextProvider textProvider; - textProvider.initialize(textToDraw, fontToDraw->getGSUBTable(), fontToDraw->getContextualFormsTable(), getWildcard1(), getWildcard2()); - - int16_t widgetRectHeight = (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) ? getHeight() : getWidth(); - - // Iterate through each line, find the longest line width and sum up the total height of the bounding rectangle - do - { - const uint16_t lineWidth = LCD::stringWidth(textProvider, *(fontToDraw), 0x7FFF, typedText.getTextDirection()); - width = MAX(width, lineWidth); - numberOfLines++; - widgetRectHeight -= lineHeight; - // Keep reading until end of string or next line completely invisible. - } while (!textProvider.endOfString() && widgetRectHeight + fontToDraw->getPixelsAboveTop() > 0); - } - else - { - TextProvider wideTextProvider; - wideTextProvider.initialize(textToDraw, fontToDraw->getGSUBTable(), fontToDraw->getContextualFormsTable(), getWildcard1(), getWildcard2()); - - const int16_t widgetRectWidth = (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) ? getWidth() : getHeight(); - int16_t widgetRectHeight = (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) ? getHeight() : getWidth(); - LCD::WideTextInternalStruct wtis(wideTextProvider, widgetRectWidth - indentation, widgetRectHeight, typedText.getTextDirection(), fontToDraw, linespace, wideTextAction); - - // Iterate through each line, find the longest line width and sum up the total height of the bounding rectangle - do - { - wtis.scanStringLengthForLine(); - const uint16_t lineWidth = wtis.getLineWidth(); - width = MAX(width, lineWidth); - numberOfLines++; - widgetRectHeight -= lineHeight; - // Keep reading until end of string, ellipsis inserted or next line completely invisible. - } while (wtis.getCurrChar() != 0 && !wtis.ellipsisAtEndOfLine() && widgetRectHeight + fontToDraw->getPixelsAboveTop() > 0); - } - int16_t height = (numberOfLines * lineHeight) - linespace; - height = MAX(height, fontHeight) + fontToDraw->getPixelsBelowBottom(); - - Rect boundingRect(0, 0, width, height); - - // Adjust for alignment - const int16_t areaWidth = (rotation == TEXT_ROTATE_0 || rotation == TEXT_ROTATE_180) ? getWidth() : getHeight(); - switch (getAlignment()) - { - default: - case LEFT: - boundingRect.x = indentation; - break; - case CENTER: - boundingRect.x = ((areaWidth - boundingRect.width) / 2); - break; - case RIGHT: - boundingRect.x = areaWidth - (boundingRect.width + indentation); - break; - } - - // Adjust for left and right pixels offsets - const uint8_t maxPixelsLeft = fontToDraw->getMaxPixelsLeft(); - const uint8_t maxPixelsRight = fontToDraw->getMaxPixelsRight(); - boundingRect.x -= maxPixelsLeft; - boundingRect.width += (maxPixelsLeft + maxPixelsRight); - - // Adjust for rotation - switch (rotation) - { - case TEXT_ROTATE_0: - break; - case TEXT_ROTATE_90: - boundingRect = Rect(getWidth() - boundingRect.bottom(), boundingRect.x, boundingRect.height, boundingRect.width); - break; - case TEXT_ROTATE_180: - boundingRect = Rect(getWidth() - boundingRect.right(), getHeight() - boundingRect.bottom(), boundingRect.width, boundingRect.height); - break; - case TEXT_ROTATE_270: - boundingRect = Rect(boundingRect.y, getHeight() - boundingRect.right(), boundingRect.height, boundingRect.width); - break; - } - - return TextArea::BoundingArea(boundingRect, typedText.getText()); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp deleted file mode 100644 index 126df70..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextAreaWithWildcard.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void TextAreaWithWildcardBase::draw(const Rect& area) const -{ - if (typedText.hasValidId()) - { - const Font* fontToDraw = typedText.getFont(); - if (fontToDraw != 0) - { - LCD::StringVisuals visuals(fontToDraw, color, alpha, typedText.getAlignment(), linespace, rotation, typedText.getTextDirection(), indentation, wideTextAction); - HAL::lcd().drawString(getAbsoluteRect(), area, visuals, typedText.getText(), getWildcard1(), getWildcard2()); - } - } -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp deleted file mode 100644 index d176f8d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TextureMapper.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -TextureMapper::TextureMapper(const Bitmap& bmp /*= Bitmap()*/) - : Image(bmp), - currentRenderingAlgorithm(NEAREST_NEIGHBOR), - xBitmapPosition(0.0f), - yBitmapPosition(0.0f), - xAngle(0.0f), - yAngle(0.0f), - zAngle(0.0f), - scale(1.0f), - xOrigo(0.0f), - yOrigo(0.0f), - zOrigo(1000.0f), - xCamera(0.0f), - yCamera(0.0f), - cameraDistance(1000.0f), - imageX0(0.0f), - imageY0(0.0f), - imageZ0(1.0f), - imageX1(0.0f), - imageY1(0.0f), - imageZ1(1.0f), - imageX2(0.0f), - imageY2(0.0f), - imageZ2(1.0f), - imageX3(0.0f), - imageY3(0.0f), - imageZ3(1.0f), - subDivisionSize(12) -{ -} - -void TextureMapper::setBitmap(const Bitmap& bmp) -{ - Image::setBitmap(bmp); - applyTransformation(); -} - -void TextureMapper::applyTransformation() -{ - const uint8_t n = 4; - - int imgWidth = Bitmap(bitmap).getWidth() + 1; - int imgHeight = Bitmap(bitmap).getHeight() + 1; - - Point4 vertices[n] = { - Point4(xBitmapPosition - 1, yBitmapPosition - 1, cameraDistance), - Point4((xBitmapPosition - 1) + imgWidth, yBitmapPosition - 1, cameraDistance), - Point4((xBitmapPosition - 1) + imgWidth, (yBitmapPosition - 1) + imgHeight, cameraDistance), - Point4(xBitmapPosition - 1, (yBitmapPosition - 1) + imgHeight, cameraDistance), - }; - Point4 transformed[n]; - - Vector4 tm_center(xOrigo, yOrigo, zOrigo); - - Matrix4x4 translateToCenter; - translateToCenter.concatenateXTranslation(-tm_center.getX()).concatenateYTranslation(-tm_center.getY()).concatenateZTranslation(-tm_center.getZ()); - - Matrix4x4 rotateAroundCenter; - rotateAroundCenter.concatenateXRotation(xAngle).concatenateYRotation(yAngle).concatenateZRotation(zAngle); - - Matrix4x4 scaleAroundCenter; - scaleAroundCenter.concatenateXScale(scale).concatenateYScale(scale).concatenateZScale(scale); - - Matrix4x4 translateFromCenter; - translateFromCenter.concatenateXTranslation(tm_center.getX()).concatenateYTranslation(tm_center.getY()).concatenateZTranslation(tm_center.getZ()); - - Matrix4x4 transform = translateFromCenter * scaleAroundCenter * rotateAroundCenter * translateToCenter; - - Matrix4x4 translateToCamera; - translateToCamera.concatenateXTranslation(-xCamera); - translateToCamera.concatenateYTranslation(-yCamera); - - Matrix4x4 perspectiveProject; - perspectiveProject.setViewDistance(cameraDistance); - - Matrix4x4 translateFromCamera; - translateFromCamera.concatenateXTranslation(xCamera).concatenateYTranslation(yCamera); - - transform = translateFromCamera * perspectiveProject * translateToCamera * transform; - - for (int i = 0; i < n; i++) - { - transformed[i] = transform * vertices[i]; - } - - imageX0 = ((float)transformed[0].getX() * cameraDistance / (float)transformed[0].getZ()); - imageY0 = ((float)transformed[0].getY() * cameraDistance / (float)transformed[0].getZ()); - imageZ0 = ((float)transformed[0].getZ()); - - imageX1 = ((float)transformed[1].getX() * cameraDistance / (float)transformed[1].getZ()); - imageY1 = ((float)transformed[1].getY() * cameraDistance / (float)transformed[1].getZ()); - imageZ1 = ((float)transformed[1].getZ()); - - imageX2 = ((float)transformed[2].getX() * cameraDistance / (float)transformed[2].getZ()); - imageY2 = ((float)transformed[2].getY() * cameraDistance / (float)transformed[2].getZ()); - imageZ2 = ((float)transformed[2].getZ()); - - imageX3 = ((float)transformed[3].getX() * cameraDistance / (float)transformed[3].getZ()); - imageY3 = ((float)transformed[3].getY() * cameraDistance / (float)transformed[3].getZ()); - imageZ3 = ((float)transformed[3].getZ()); -} - -Rect TextureMapper::getBoundingRect() const -{ - // MIN and MAX are macros so do not insert them into each other - float minXf = MIN(imageX0, imageX1); - minXf = MIN(minXf, imageX2); - minXf = floorf(MIN(minXf, imageX3)); - int16_t minX = (int16_t)(MAX(0, minXf)); - - float maxXf = MAX(imageX0, imageX1); - maxXf = MAX(maxXf, imageX2); - maxXf = ceilf(MAX(maxXf, imageX3)); - int16_t maxX = getWidth(); - maxX = (int16_t)(MIN(maxX, maxXf)); - - float minYf = MIN(imageY0, imageY1); - minYf = MIN(minYf, imageY2); - minYf = floorf(MIN(minYf, imageY3)); - int16_t minY = (int16_t)(MAX(0, minYf)); - - float maxYf = MAX(imageY0, imageY1); - maxYf = MAX(maxYf, imageY2); - maxYf = ceilf(MAX(maxYf, imageY3)); - int16_t maxY = getHeight(); - maxY = (int16_t)(MIN(maxY, maxYf)); - - return Rect(minX, minY, maxX - minX, maxY - minY); -} - -void TextureMapper::setAngles(float newXAngle, float newYAngle, float newZAngle) -{ - xAngle = newXAngle; - yAngle = newYAngle; - zAngle = newZAngle; - - applyTransformation(); -} - -void TextureMapper::updateAngles(float newXAngle, float newYAngle, float newZAngle) -{ - invalidateContent(); - setAngles(newXAngle, newYAngle, newZAngle); - invalidateContent(); -} - -void TextureMapper::setScale(float newScale) -{ - scale = newScale; - - applyTransformation(); -} - -void TextureMapper::updateScale(float newScale) -{ - invalidateContent(); - setScale(newScale); - invalidateContent(); -} - -void TextureMapper::invalidateBoundingRect() const -{ - Rect r = getBoundingRect(); - invalidateRect(r); -} - -void TextureMapper::draw(const Rect& invalidatedArea) const -{ - if (!alpha) - { - return; - } - uint16_t* fb = 0; - - // Setup texture coordinates - float right = (float)(bitmap.getWidth()); - float bottom = (float)(bitmap.getHeight()); - float textureU0 = -1.0f; - float textureV0 = -1.0f; - float textureU1 = right; - float textureV1 = -1.0f; - float textureU2 = right; - float textureV2 = bottom; - float textureU3 = -1.0f; - float textureV3 = bottom; - if (HAL::DISPLAY_ROTATION == rotate90) - { - textureU0 = -1.0f; - textureV0 = right; - textureU1 = -1.0f; - textureV1 = -1.0f; - textureU2 = bottom; - textureV2 = -1.0f; - textureU3 = bottom; - textureV3 = right; - } - - float triangleXs[4]; - float triangleYs[4]; - float triangleZs[4]; - float triangleUs[4]; - float triangleVs[4]; - - // Determine winding order - Vector4 zeroToOne(imageX1 - imageX0, imageY1 - imageY0, imageZ1 - imageZ0); - Vector4 zeroToTwo(imageX2 - imageX0, imageY2 - imageY0, imageZ2 - imageZ0); - Vector4 normal = zeroToOne.crossProduct(zeroToTwo); - - if (normal.getZ() > 0) - { - triangleXs[0] = imageX0; - triangleXs[1] = imageX1; - triangleXs[2] = imageX2; - triangleXs[3] = imageX3; - triangleYs[0] = imageY0; - triangleYs[1] = imageY1; - triangleYs[2] = imageY2; - triangleYs[3] = imageY3; - triangleZs[0] = imageZ0; - triangleZs[1] = imageZ1; - triangleZs[2] = imageZ2; - triangleZs[3] = imageZ3; - - triangleUs[0] = textureU0; - triangleUs[1] = textureU1; - triangleUs[2] = textureU2; - triangleUs[3] = textureU3; - triangleVs[0] = textureV0; - triangleVs[1] = textureV1; - triangleVs[2] = textureV2; - triangleVs[3] = textureV3; - } - else - { - // invert due to the triangles winding order (showing backface of the triangle) - triangleXs[1] = imageX0; - triangleXs[0] = imageX1; - triangleXs[2] = imageX3; - triangleXs[3] = imageX2; - triangleYs[1] = imageY0; - triangleYs[0] = imageY1; - triangleYs[2] = imageY3; - triangleYs[3] = imageY2; - triangleZs[1] = imageZ0; - triangleZs[0] = imageZ1; - triangleZs[2] = imageZ3; - triangleZs[3] = imageZ2; - - triangleUs[1] = textureU0; - triangleUs[0] = textureU1; - triangleUs[2] = textureU3; - triangleUs[3] = textureU2; - triangleVs[1] = textureV0; - triangleVs[0] = textureV1; - triangleVs[2] = textureV3; - triangleVs[3] = textureV2; - } - - drawQuad(invalidatedArea, fb, triangleXs, triangleYs, triangleZs, triangleUs, triangleVs); -} - -void TextureMapper::drawQuad(const Rect& invalidatedArea, uint16_t* fb, const float* triangleXs, const float* triangleYs, const float* triangleZs, const float* triangleUs, const float* triangleVs) const -{ - // Area to redraw. Relative to the TextureMapper. - Rect dirtyArea = Rect(0, 0, getWidth(), getHeight()) & invalidatedArea; - - // Absolute position of the TextureMapper. - Rect dirtyAreaAbsolute = dirtyArea; - translateRectToAbsolute(dirtyAreaAbsolute); - - Rect absoluteRect = getAbsoluteRect(); - DisplayTransformation::transformDisplayToFrameBuffer(absoluteRect); - - // Transform rects to match framebuffer coordinates - // This is needed if the display is rotated compared to the framebuffer - DisplayTransformation::transformDisplayToFrameBuffer(dirtyArea, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(dirtyAreaAbsolute); - - // Get a pointer to the bitmap data, return if no bitmap found - const uint16_t* textmap = (const uint16_t*)bitmap.getData(); - if (!textmap) - { - return; - } - - float x0 = triangleXs[0]; - float x1 = triangleXs[1]; - float x2 = triangleXs[2]; - float x3 = triangleXs[3]; - float y0 = triangleYs[0]; - float y1 = triangleYs[1]; - float y2 = triangleYs[2]; - float y3 = triangleYs[3]; - - DisplayTransformation::transformDisplayToFrameBuffer(x0, y0, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(x1, y1, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(x2, y2, this->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(x3, y3, this->getRect()); - - const Point3D point0 = { floatToFixed28_4(x0), floatToFixed28_4(y0), triangleZs[0], triangleUs[0], triangleVs[0] }; - const Point3D point1 = { floatToFixed28_4(x1), floatToFixed28_4(y1), triangleZs[1], triangleUs[1], triangleVs[1] }; - const Point3D point2 = { floatToFixed28_4(x2), floatToFixed28_4(y2), triangleZs[2], triangleUs[2], triangleVs[2] }; - const Point3D point3 = { floatToFixed28_4(x3), floatToFixed28_4(y3), triangleZs[3], triangleUs[3], triangleVs[3] }; - - const Point3D vertices[4] = { point0, point1, point2, point3 }; - - DrawingSurface dest = { fb, HAL::FRAME_BUFFER_WIDTH }; - TextureSurface src = { textmap, bitmap.getExtraData(), bitmap.getWidth(), bitmap.getHeight(), bitmap.getWidth() }; - - uint16_t subDivs = subDivisionSize; - if (point0.Z == point1.Z && point1.Z == point2.Z) //lint !e777 - { - subDivs = 0xFFFF; // Max: One sweep - } - HAL::lcd().drawTextureMapQuad(dest, vertices, src, absoluteRect, dirtyAreaAbsolute, lookupRenderVariant(), alpha, subDivs); -} - -RenderingVariant TextureMapper::lookupRenderVariant() const -{ - RenderingVariant renderVariant; - if (currentRenderingAlgorithm == NEAREST_NEIGHBOR) - { - renderVariant = lookupNearestNeighborRenderVariant(bitmap); - } - else - { - renderVariant = lookupBilinearRenderVariant(bitmap); - } - return renderVariant; -} - -Rect TextureMapper::getSolidRect() const -{ - return Rect(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp deleted file mode 100644 index e76ff76..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TiledImage.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void TiledImage::setBitmap(const Bitmap& bmp) -{ - Image::setBitmap(bmp); - // Make sure the xOffset and yOffset are correct (in range) - setOffset(xOffset, yOffset); -} - -void TiledImage::setOffset(int16_t x, int16_t y) -{ - setXOffset(x); - setYOffset(y); -} - -void TiledImage::setXOffset(int16_t x) -{ - xOffset = x; - if (bitmap.getWidth() != 0) - { - xOffset %= bitmap.getWidth(); - if (xOffset < 0) - { - xOffset += bitmap.getWidth(); - } - } -} - -void TiledImage::setYOffset(int16_t y) -{ - yOffset = y; - if (bitmap.getHeight() != 0) - { - yOffset %= bitmap.getHeight(); - if (yOffset < 0) - { - yOffset += bitmap.getHeight(); - } - } -} - -void TiledImage::getOffset(int16_t& x, int16_t& y) -{ - x = getXOffset(); - y = getYOffset(); -} - -int16_t TiledImage::getXOffset() -{ - return xOffset; -} - -int16_t TiledImage::getYOffset() -{ - return yOffset; -} - -void TiledImage::draw(const Rect& invalidatedArea) const -{ - int16_t bitmapWidth = bitmap.getWidth(); - int16_t bitmapHeight = bitmap.getHeight(); - - if (bitmapWidth == 0 || bitmapHeight == 0) - { - return; - } - - Rect meAbs; - translateRectToAbsolute(meAbs); - - const int16_t minX = ((invalidatedArea.x + xOffset) / bitmapWidth) * bitmapWidth - xOffset; - const int16_t maxX = (((invalidatedArea.right() + xOffset) - 1) / bitmapWidth) * bitmapWidth; - const int16_t minY = ((invalidatedArea.y + yOffset) / bitmapHeight) * bitmapHeight - yOffset; - const int16_t maxY = (((invalidatedArea.bottom() + yOffset) - 1) / bitmapHeight) * bitmapHeight; - for (int16_t x = minX; x <= maxX; x += bitmapWidth) - { - for (int16_t y = minY; y <= maxY; y += bitmapHeight) - { - Rect dirty = Rect(x, y, bitmapWidth, bitmapHeight) & invalidatedArea; - dirty.x -= x; - dirty.y -= y; - HAL::lcd().drawPartialBitmap(bitmap, meAbs.x + x, meAbs.y + y, dirty, alpha); - } - } -} - -Rect TiledImage::getSolidRect() const -{ - if (alpha < 255) - { - return Rect(); - } - - Rect solidRect = bitmap.getSolidRect(); - if (solidRect.width == bitmap.getWidth()) - { - solidRect.width = getWidth(); - } - else - { - solidRect.x -= xOffset; - Rect solidRect2 = solidRect; - solidRect2.x += bitmap.getWidth(); - if (solidRect.x < 0) - { - int16_t right = solidRect.right(); - solidRect.width = MAX(right, 0); - solidRect.x = 0; - } - if (solidRect2.right() > getWidth()) - { - solidRect2.width = solidRect2.right() - getWidth(); - } - if (solidRect2.width > solidRect.width) - { - solidRect = solidRect2; - } - } - if (solidRect.height == bitmap.getHeight()) - { - solidRect.height = getHeight(); - } - else - { - solidRect.y -= yOffset; - Rect solidRect2 = solidRect; - solidRect2.y += bitmap.getHeight(); - if (solidRect.y < 0) - { - int16_t bottom = solidRect.bottom(); - solidRect.height = MAX(bottom, 0); - solidRect.y = 0; - } - if (solidRect2.bottom() > getHeight()) - { - solidRect2.height = solidRect2.bottom() - getHeight(); - } - if (solidRect2.height > solidRect.height) - { - solidRect = solidRect2; - } - } - return solidRect; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp deleted file mode 100644 index bb03006..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/ToggleButton.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void ToggleButton::forceState(bool activeState) -{ - if (activeState) - { - // up should equal originalPressed - if (up.getId() != originalPressed.getId()) - { - down = up; - up = originalPressed; - } - } - else - { - // down should equal originalPressed - if (down.getId() != originalPressed.getId()) - { - up = down; - down = originalPressed; - } - } -} - -void ToggleButton::handleClickEvent(const ClickEvent& event) -{ - if (pressed && (event.getType() == ClickEvent::RELEASED)) - { - Bitmap tmp = up; - up = down; - down = tmp; - } - Button::handleClickEvent(event); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp deleted file mode 100644 index 32bc4cf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/TouchArea.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -class ClickEvent; - -void TouchArea::handleClickEvent(const ClickEvent& event) -{ - AbstractButton::handleClickEvent(event); - if (pressedAction && pressedAction->isValid() && pressed) - { - pressedAction->execute(*this); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp deleted file mode 100644 index 4a182d9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/VideoWidget.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -VideoWidget::VideoWidget() - : Widget(), - movieEndedAction(0), buffer(0), format(Bitmap::RGB888), - bufferWidth(0), bufferHeight(0), videoWidth(0), videoHeight(0) -{ - handle = VideoController::getInstance().registerVideoWidget(*this); - Application::getInstance()->registerTimerWidget(this); -} - -VideoWidget::~VideoWidget() -{ - VideoController::getInstance().unregisterVideoWidget(handle); - Application::getInstance()->unregisterTimerWidget(this); -} - -void VideoWidget::play() const -{ - VideoController::getInstance().setCommand(handle, VideoController::PLAY, 0); -} - -void VideoWidget::pause() const -{ - VideoController::getInstance().setCommand(handle, VideoController::PAUSE, 0); -} - -void VideoWidget::stop() const -{ - VideoController::getInstance().setCommand(handle, VideoController::STOP, 0); -} - -bool VideoWidget::isPlaying() const -{ - return VideoController::getInstance().getIsPlaying(handle); -} - -void VideoWidget::seek(uint32_t frameNumber) const -{ - VideoController::getInstance().setCommand(handle, VideoController::SEEK, frameNumber); -} - -void VideoWidget::showFrame(uint32_t frameNumber) const -{ - if (isPlaying()) - { - seek(frameNumber); - } - else - { - VideoController::getInstance().setCommand(handle, VideoController::SHOW, frameNumber); - } -} - -void VideoWidget::setRepeat(bool repeat) const -{ - VideoController::getInstance().setCommand(handle, VideoController::SET_REPEAT, repeat ? 1 : 0); -} - -void VideoWidget::handleTickEvent() -{ - const bool hasMoreFrames = VideoController::getInstance().updateFrame(handle, *this); - if (!hasMoreFrames) - { - // Now showing last frame - if (movieEndedAction && movieEndedAction->isValid()) - { - movieEndedAction->execute(*this); - } - } -} - -Rect VideoWidget::getSolidRect() const -{ - // For Dedicated or DoubleBuffered video we have a bufferWidth > 0 - // But maybe no buffer yet (only after decoding first frame) - if (bufferWidth > 0) - { - // Solid inside video area if we have a buffer, otherwise transparent - if (buffer != 0) - { - return Rect(0, 0, MIN(videoWidth, bufferWidth), MIN(videoHeight, bufferHeight)); - } - return Rect(); - } - - //Direct to framebuffer, solid inside the video area - return Rect(0, 0, videoWidth, videoHeight); -} - -void VideoWidget::draw(const Rect& invalidatedArea) const -{ - // Only draw the invalidated area inside the video x buffer - Rect invVideoRect(0, 0, videoWidth, videoHeight); - invVideoRect &= invalidatedArea; - - // Inform controller that we are drawing - VideoController::getInstance().draw(handle, invVideoRect, *this); - - // If we have a buffer, draw that - if (buffer != 0) - { - // Limit to buffer size - invVideoRect &= Rect(0, 0, bufferWidth, bufferHeight); - - // Convert to lcd coordinates. Width is buffer stride. - Rect absolute = getAbsoluteRect(); - absolute.width = bufferWidth; - // Copy to LCD, always solid - HAL::lcd().blitCopy(buffer, format, absolute, invVideoRect, 255, false); - } -} - -uint32_t VideoWidget::getCurrentFrameNumber() const -{ - return VideoController::getInstance().getCurrentFrameNumber(handle); -} - -void VideoWidget::setFrameRate(uint32_t ui_frames, uint32_t video_frames) const -{ - VideoController::getInstance().setFrameRate(handle, ui_frames, video_frames); -} - -void VideoWidget::setVideoData(const uint8_t* movie, const uint32_t length) -{ - VideoController::getInstance().setVideoData(handle, movie, length); - - readVideoInformation(); -} - -void VideoWidget::setVideoData(VideoDataReader& reader) -{ - VideoController::getInstance().setVideoData(handle, reader); - - readVideoInformation(); -} - -void VideoWidget::getVideoInformation(VideoInformation* data) const -{ - VideoController::getInstance().getVideoInformation(handle, data); -} - -void VideoWidget::readVideoInformation() -{ - // Set frame rate to movie speed (assuming 60 ui frames in a second) - VideoInformation videoInformation; - VideoController::getInstance().getVideoInformation(handle, &videoInformation); - videoWidth = (int16_t)videoInformation.frame_width; - videoHeight = (int16_t)videoInformation.frame_height; - uint32_t videoFramesIn1000ms = 1000 / videoInformation.ms_between_frames; - setFrameRate(60, videoFramesIn1000ms); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp deleted file mode 100644 index d864236..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/AbstractShape.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -AbstractShape::AbstractShape() - : CanvasWidget(), - fillingRule(Rasterizer::FILL_NON_ZERO), - dx(0), dy(0), shapeAngle(0), - xScale(CWRUtil::toQ10(1)), yScale(CWRUtil::toQ10(1)), - minimalRect() -{ - Drawable::setWidthHeight(0, 0); -} - -bool AbstractShape::drawCanvasWidget(const Rect& invalidatedArea) const -{ - int numPoints = getNumPoints(); - if (numPoints == 0) - { - return true; - } - - Canvas canvas(this, invalidatedArea); - canvas.setFillingRule(fillingRule); - - canvas.moveTo(getCacheX(0), getCacheY(0)); - for (int i = 1; i < numPoints; i++) - { - canvas.lineTo(getCacheX(i), getCacheY(i)); - if (canvas.wasOutlineTooComplex()) - { - return false; - } - } - return canvas.render(); -} - -void AbstractShape::updateAbstractShapeCache() -{ - int numPoints = getNumPoints(); - - int xMin = 0; - int xMax = 0; - int yMin = 0; - int yMax = 0; - - for (int i = 0; i < numPoints; i++) - { - CWRUtil::Q5 xCorner = getCornerX(i); - CWRUtil::Q5 yCorner = getCornerY(i); - - CWRUtil::Q5 xCache = dx + ((CWRUtil::mulQ5(xCorner, xScale) * CWRUtil::cosine(shapeAngle))) - ((CWRUtil::mulQ5(yCorner, yScale) * CWRUtil::sine(shapeAngle))); - if (i == 0 || xCache.to() > xMax) - { - xMax = xCache.to(); - } - if (i == 0 || xCache.to() < xMin) - { - xMin = xCache.to(); - } - CWRUtil::Q5 yCache = dy + ((CWRUtil::mulQ5(yCorner, yScale) * CWRUtil::cosine(shapeAngle))) + ((CWRUtil::mulQ5(xCorner, xScale) * CWRUtil::sine(shapeAngle))); - if (i == 0 || yCache.to() > yMax) - { - yMax = yCache.to(); - } - if (i == 0 || yCache.to() < yMin) - { - yMin = yCache.to(); - } - setCache(i, xCache, yCache); - } - minimalRect = Rect(xMin, yMin, (xMax - xMin) + 1, (yMax - yMin) + 1); -} - -Rect AbstractShape::getMinimalRect() const -{ - return minimalRect; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp deleted file mode 100644 index 5c7e19b..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CWRVectorRenderer.cpp +++ /dev/null @@ -1,647 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void CWRVectorRenderer::setup(const Widget& renderer, const Rect& drawingArea) -{ - drawArea = drawingArea; - proxyWidget.setPosition(renderer); - proxyWidget.setParent(renderer.getParent()); - - // Clear transformation matrix - matrix.reset(); - - // Alpha reset - alpha = 255; - colorAlpha = 255; - - // Stroke reset - strokeWidth = 1.0f; - strokeLineJoin = VG_STROKE_LINEJOIN_MITER; - strokeLineCap = VG_STROKE_LINECAP_BUTT; -} - -void CWRVectorRenderer::tearDown() -{ - // Clear drawing area to avoid drawing any paths until next setup - drawArea = Rect(); - // Wait for the painter to finish - if (proxyWidget.getPainter()) - { - proxyWidget.getPainter()->tearDown(); - } -} - -void CWRVectorRenderer::drawPath(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const float* /* bbox */) -{ - // Draw the path. Try reduced areas until success - Rect area = drawArea; - if (area.isEmpty()) - { - return; - } - - const int16_t bottom = area.bottom(); - while (area.y < bottom) - { - while (!drawPathArea(cmds, nCmds, points, nPoints, area)) - { - if (area.height == 1) - { - // Failed on a single line - break; - } - area.height = (area.height + 1) >> 1; // Cannot become 0 as (2+1)>>1=1 - } - area.y += area.height; - if (area.bottom() > bottom) - { - area.height = bottom - area.y; - } - } -} - -bool CWRVectorRenderer::drawPathArea(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const Rect& area) const -{ - assert(cmds); - assert(points); - - if (drawMode != STROKE) - { - return drawFill(cmds, nCmds, points, nPoints, area); - } - return drawStroke(cmds, nCmds, points, nPoints, area); -} - -bool CWRVectorRenderer::drawFill(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const Rect& area) const -{ - (void)nPoints; - uint32_t cmdInx = 0; - uint32_t pointInx = 0; - - Canvas canvas(&proxyWidget, area); - canvas.setFillingRule((drawMode == FILL_EVEN_ODD) ? Rasterizer::FILL_EVEN_ODD : Rasterizer::FILL_NON_ZERO); - - float positionX = 0.0f; - float positionY = 0.0f; - Matrix3x3::Point transformedPosition = matrix.affineTransform(positionX, positionY); - while (cmdInx < nCmds) - { - switch (static_cast(cmds[cmdInx])) - { - case VECTOR_PRIM_CLOSE: - assert(pointInx <= nPoints); - canvas.close(); - break; - case VECTOR_PRIM_MOVE: - assert(pointInx + 2 <= nPoints); - positionX = points[pointInx]; - positionY = points[pointInx + 1]; - transformedPosition = matrix.affineTransform(positionX, positionY); - canvas.moveTo(transformedPosition.x, transformedPosition.y); - pointInx += 2; - break; - case VECTOR_PRIM_LINE: - assert(pointInx + 1 <= nPoints); - positionX = points[pointInx]; - positionY = points[pointInx + 1]; - transformedPosition = matrix.affineTransform(positionX, positionY); - canvas.lineTo(transformedPosition.x, transformedPosition.y); - pointInx += 2; - break; - case VECTOR_PRIM_HLINE: - assert(pointInx + 1 <= nPoints); - positionX = points[pointInx]; - transformedPosition = matrix.affineTransform(positionX, positionY); - canvas.lineTo(transformedPosition.x, transformedPosition.y); - pointInx += 1; - break; - case VECTOR_PRIM_VLINE: - assert(pointInx + 1 <= nPoints); - positionY = points[pointInx]; - transformedPosition = matrix.affineTransform(positionX, positionY); - canvas.lineTo(transformedPosition.x, transformedPosition.y); - pointInx += 1; - break; - case VECTOR_PRIM_BEZIER_QUAD: - assert(pointInx + 4 <= nPoints); - positionX = points[pointInx + 2]; - positionY = points[pointInx + 3]; - { - const Matrix3x3::Point p1 = matrix.affineTransform(points[pointInx], points[pointInx + 1]); - const Matrix3x3::Point p2 = matrix.affineTransform(positionX, positionY); - canvas.quadraticBezierTo(transformedPosition.x, transformedPosition.y, p1.x, p1.y, p2.x, p2.y); - transformedPosition = p2; - } - pointInx += 4; - break; - case VECTOR_PRIM_BEZIER_CUBIC: - assert(pointInx + 6 <= nPoints); - positionX = points[pointInx + 4]; - positionY = points[pointInx + 5]; - { - const Matrix3x3::Point p1 = matrix.affineTransform(points[pointInx], points[pointInx + 1]); - const Matrix3x3::Point p2 = matrix.affineTransform(points[pointInx + 2], points[pointInx + 3]); - const Matrix3x3::Point p3 = matrix.affineTransform(positionX, positionY); - canvas.cubicBezierTo(transformedPosition.x, transformedPosition.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); - transformedPosition = p3; - } - pointInx += 6; - break; - } - cmdInx++; - } - - return canvas.render(LCD::div255(colorAlpha * alpha)); -} - -bool CWRVectorRenderer::drawStroke(const uint8_t* cmds, uint32_t nCmds, const float* points, uint32_t nPoints, const Rect& area) const -{ - (void)nPoints; - uint32_t cmdInx = 0; - uint32_t pointInx = 0; - - if (strokeWidth <= 0.0f) - { - return true; - } - - StrokeCanvas canvas(&proxyWidget, area, matrix); - canvas.setStroke(strokeWidth, strokeMiterLimit, strokeLineJoin, strokeLineCap, LCD::div255(colorAlpha * alpha)); - - float positionX = 0.0f; - float positionY = 0.0f; - float initialShapeX = 0.0f; - float initialShapeY = 0.0f; - uint32_t cmdInxPathStart = 0; - while (cmdInx < nCmds) - { - assert(static_cast(cmds[cmdInx]) == VECTOR_PRIM_CLOSE || pointInx < nPoints); - switch (static_cast(cmds[cmdInx])) - { - case VECTOR_PRIM_CLOSE: - positionX = initialShapeX; - positionY = initialShapeY; - if (cmdInxPathStart < cmdInx) // A single "CLOSE" on it's own does nothing - { - // In case we are not back at the beginning, draw a line to that point - canvas.strokeLineTo(positionX, positionY); - // Check if it a zero-length closed line and draw a double linecap - if (!canvas.strokeDrawDoubleLineCap()) - { - // The line has some extend - close the outside - canvas.strokeClose(positionX, positionY); - // Move back to the start - canvas.strokeMoveTo(positionX, positionY); - // Draw inside backwards without linecaps(false) - drawStrokeBackwards(cmdInxPathStart, cmdInx + 1, pointInx, cmds, points, false, canvas); - // Close the inside of the stroke - canvas.strokeClose(positionX, positionY); - } - } - // Next path starts after the CLOSE command - cmdInxPathStart = cmdInx + 1; - break; - case VECTOR_PRIM_MOVE: - assert(pointInx + 2 <= nPoints); - if (cmdInxPathStart < cmdInx) // More than a singe "MOVE" - { - // Check if it a zero-length line and draw a double linecap - if (!canvas.strokeDrawDoubleLineCap()) - { - // The line has some extend, follow the commands backwards and draw linecaps(true) - drawStrokeBackwards(cmdInxPathStart, cmdInx, pointInx, cmds, points, true, canvas); - } - } - cmdInxPathStart = cmdInx; - initialShapeX = positionX = points[pointInx]; - initialShapeY = positionY = points[pointInx + 1]; - canvas.strokeMoveTo(positionX, positionY); - pointInx += 2; - break; - case VECTOR_PRIM_LINE: - assert(pointInx + 2 <= nPoints); - positionX = points[pointInx]; - positionY = points[pointInx + 1]; - canvas.strokeLineTo(positionX, positionY); - pointInx += 2; - break; - case VECTOR_PRIM_HLINE: - assert(pointInx + 1 <= nPoints); - positionX = points[pointInx]; - canvas.strokeLineTo(positionX, positionY); - pointInx += 1; - break; - case VECTOR_PRIM_VLINE: - assert(pointInx + 1 <= nPoints); - positionY = points[pointInx]; - canvas.strokeLineTo(positionX, positionY); - pointInx += 1; - break; - case VECTOR_PRIM_BEZIER_QUAD: - assert(pointInx + 4 <= nPoints); - canvas.strokeBezierQuad(positionX, positionY, points[pointInx], points[pointInx + 1], points[pointInx + 2], points[pointInx + 3]); - positionX = points[pointInx + 2]; - positionY = points[pointInx + 3]; - pointInx += 4; - break; - case VECTOR_PRIM_BEZIER_CUBIC: - assert(pointInx + 6 <= nPoints); - canvas.strokeBezierCubic(positionX, positionY, points[pointInx], points[pointInx + 1], points[pointInx + 2], points[pointInx + 3], points[pointInx + 4], points[pointInx + 5]); - positionX = points[pointInx + 4]; - positionY = points[pointInx + 5]; - pointInx += 6; - break; - } - cmdInx++; - } - if (cmdInxPathStart < cmdInx) // More than a singe "MOVE" - { - // Check if it a zero-length line and draw a double linecap - if (!canvas.strokeDrawDoubleLineCap()) - { - // The line has some extend, follow the commands backwards and draw linecaps(true) - drawStrokeBackwards(cmdInxPathStart, cmdInx, pointInx, cmds, points, true, canvas); - } - } - return canvas.strokeRender(); -} - -void CWRVectorRenderer::drawStrokeBackwards(uint32_t cmdInxPathStart, uint32_t cmdInx, uint32_t pointInx, const uint8_t* cmds, const float* points, bool drawLineCaps, StrokeCanvas& canvas) const -{ - float positionX = 0.0f; - float positionY = 0.0f; - canvas.lineCapInsteadOfLineJoin(drawLineCaps); - while (cmdInx > cmdInxPathStart) - { - assert(cmdInx > 0); - cmdInx--; - switch (static_cast(cmds[cmdInx])) - { - case VECTOR_PRIM_CLOSE: - getPreviousDestination(positionX, positionY, cmdInx, pointInx, cmds, points); - canvas.strokeLineTo(positionX, positionY); - break; - case VECTOR_PRIM_MOVE: - assert(cmdInx == cmdInxPathStart); - break; - case VECTOR_PRIM_LINE: - assert(pointInx >= 2); - pointInx -= 2; - getPreviousDestination(positionX, positionY, cmdInx, pointInx, cmds, points); - canvas.strokeLineTo(positionX, positionY); - break; - case VECTOR_PRIM_HLINE: - case VECTOR_PRIM_VLINE: - assert(pointInx >= 1); - pointInx -= 1; - getPreviousDestination(positionX, positionY, cmdInx, pointInx, cmds, points); - canvas.strokeLineTo(positionX, positionY); - break; - case VECTOR_PRIM_BEZIER_QUAD: - assert(pointInx >= 4); - pointInx -= 4; - getPreviousDestination(positionX, positionY, cmdInx, pointInx, cmds, points); - canvas.strokeBezierQuad(points[pointInx + 2], points[pointInx + 3], - points[pointInx], points[pointInx + 1], - positionX, positionY); - break; - case VECTOR_PRIM_BEZIER_CUBIC: - assert(pointInx >= 6); - pointInx -= 6; - getPreviousDestination(positionX, positionY, cmdInx, pointInx, cmds, points); - canvas.strokeBezierCubic(points[pointInx + 4], points[pointInx + 5], - points[pointInx + 2], points[pointInx + 3], - points[pointInx], points[pointInx + 1], - positionX, positionY); - break; - } - } - if (drawLineCaps) - { - canvas.drawFinalLineCap(); - } -} - -void CWRVectorRenderer::getPreviousDestination(float& positionX, float& positionY, uint32_t cmdInx, uint32_t pointInx, const uint8_t* cmds, const float* points) const -{ - bool foundX = false; - bool foundY = false; - while (cmdInx > 0) - { - cmdInx--; - switch (static_cast(cmds[cmdInx])) - { - case VECTOR_PRIM_CLOSE: - break; - case VECTOR_PRIM_MOVE: - case VECTOR_PRIM_LINE: - case VECTOR_PRIM_BEZIER_QUAD: - case VECTOR_PRIM_BEZIER_CUBIC: - assert(pointInx >= 2); - pointInx -= 2; - if (!foundX) - { - positionX = points[pointInx]; - } - if (!foundY) - { - positionY = points[pointInx + 1]; - } - return; - case VECTOR_PRIM_HLINE: - assert(pointInx >= 1); - pointInx -= 1; - if (!foundX) - { - positionX = points[pointInx]; - } - if (foundY) - { - return; - } - foundX = true; - break; - case VECTOR_PRIM_VLINE: - assert(pointInx >= 1); - pointInx -= 1; - if (!foundY) - { - positionY = points[pointInx]; - } - if (foundX) - { - return; - } - foundY = true; - break; - } - } - if (!foundX) - { - positionX = 0.0f; - } - if (!foundY) - { - positionY = 0.0f; - } -} - -void CWRVectorRenderer::setStrokeWidth(float w) -{ - strokeWidth = w; -} - -void CWRVectorRenderer::setColor(colortype c) -{ - // Save color alpha for rendering - colorAlpha = c >> 24; - - getColorPainterColor().setColor(c); - proxyWidget.setPainter(getColorPainter()); -} - -void CWRVectorRenderer::setAlpha(uint8_t a) -{ - alpha = a; -} - -void CWRVectorRenderer::setLinearGradient(float x0, float y0, float x1, float y1, - uint32_t stops, - const float* /* stopPositions */, - const uint32_t* stopColors, - float width, - float height, - bool isSolid, - const uint32_t* palette) -{ - // If 'x1' = 'x2' and 'y1' = 'y2', then the area to be painted shall be painted - // as a single color using the color and opacity of the last gradient stop. - if ((x0 - x1) == 0.0f && (y0 - y1) == 0.0f) - { - setColor(stopColors[stops - 1]); - return; - } - - // Make colorAlpha neutral - colorAlpha = 255; - - AbstractPainterLinearGradient& linearPainter = getLinearPainter(); - linearPainter.setGradientEndPoints(x0, y0, x1, y1, width, height, matrix); - assert(palette && "A gradient palette is required by CWRVectorRenderer"); - linearPainter.setGradientTexture(palette, isSolid); - proxyWidget.setPainter(linearPainter); -} - -void CWRVectorRenderer::setRadialGradient(float /* cx */, float /* cy */, float /* radius */, - uint32_t /* stops */, - const float* /* stopPositions */, - const colortype* /* stopColors */) -{ - assert(!"CWRVectorRenderer does not support radial gradient!"); -} - -void CWRVectorRenderer::setTransformationMatrix(const Matrix3x3& m) -{ - matrix = m; -} - -void CWRVectorRenderer::StrokeCanvas::strokeMoveTo(float x, float y) -{ - lastX = x; - lastY = y; - firstLineTo = true; - noLineHasBeenDrawn = true; -} - -void CWRVectorRenderer::StrokeCanvas::strokeLineTo(float x, float y) -{ - float dx = x - lastX; - float dy = y - lastY; - float len = sqrtf(dx * dx + dy * dy); - if (len > 0.0f) - { - noLineHasBeenDrawn = false; - len /= strokeWidthHalf; - const float thisStrokeStartX = lastX + dy / len; - const float thisStrokeStartY = lastY - dx / len; - const float thisStrokeEndX = x + dy / len; - const float thisStrokeEndY = y - dx / len; - if (firstLineTo) - { - initialStrokeStartX = thisStrokeStartX; - initialStrokeStartY = thisStrokeStartY; - initialStrokeEndX = thisStrokeEndX; - initialStrokeEndY = thisStrokeEndY; - moveToWithTransform(thisStrokeStartX, thisStrokeStartY); - firstLineTo = false; - } - else if (drawLineCapInsteadOfLineJoin) - { - strokeDrawLineCap(lastStrokeEndX, lastStrokeEndY, thisStrokeStartX, thisStrokeStartY); - drawLineCapInsteadOfLineJoin = false; - } - else - { - strokeDrawLineJoin(lastX, lastY, lastStrokeStartX, lastStrokeStartY, - lastStrokeEndX, lastStrokeEndY, thisStrokeStartX, thisStrokeStartY, thisStrokeEndX, thisStrokeEndY); - } - lastStrokeStartX = thisStrokeStartX; - lastStrokeStartY = thisStrokeStartY; - lastStrokeEndX = thisStrokeEndX; - lastStrokeEndY = thisStrokeEndY; - lastX = x; - lastY = y; - } -} - -bool CWRVectorRenderer::StrokeCanvas::strokeClose(float x, float y) -{ - if (strokeDrawDoubleLineCap()) - { - return false; // Created two line-caps, stop drawing, we are done - } - strokeDrawLineJoin(x, y, lastStrokeStartX, lastStrokeStartY, - lastStrokeEndX, lastStrokeEndY, initialStrokeStartX, initialStrokeStartY, initialStrokeEndX, initialStrokeEndY); - return true; // Closed as with a line-join, continue drawing on inside -} - -bool CWRVectorRenderer::StrokeCanvas::strokeDrawDoubleLineCap() -{ - if (noLineHasBeenDrawn) - { - const float y1 = lastY - strokeWidthHalf; - const float y2 = lastY + strokeWidthHalf; - moveToWithTransform(lastX, y1); - strokeDrawLineCap(lastX, y1, lastX, y2); - strokeDrawLineCap(lastX, y2, lastX, y1); - return true; - } - return false; -} - -void CWRVectorRenderer::StrokeCanvas::lineCapInsteadOfLineJoin(bool drawLineCaps) -{ - drawLineCapInsteadOfLineJoin = drawLineCaps; -} - -void CWRVectorRenderer::StrokeCanvas::drawFinalLineCap() -{ - strokeDrawLineCap(lastStrokeEndX, lastStrokeEndY, initialStrokeStartX, initialStrokeStartY); -} - -void CWRVectorRenderer::StrokeCanvas::strokeDrawLineJoin(float x, float y, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) -{ - if (strokeLineJoin == VG_STROKE_LINEJOIN_ROUND) - { - lineToWithTransform(x2, y2); - // Same formula as used below for MITER - if ((x1 - x2) * (y3 - y4) >= (y1 - y2) * (x3 - x4)) - { - strokeDrawLineJoinRound(x, y, x2, y2, x3, y3, 1); - } - lineToWithTransform(x3, y3); - return; - } - - if (strokeLineJoin == VG_STROKE_LINEJOIN_MITER) - { - // https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line - const float divisor = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); - // If divisor>0, we are on the "outside" of the angle - // If divisor<0, we are on the "inside" of the angle - if (divisor != 0.0f) - { - const float miterX = ((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / divisor; - const float miterY = ((x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)) / divisor; - const float distSquared = (x - miterX) * (x - miterX) + (y - miterY) * (y - miterY); - if (distSquared <= miterLimitSquared) - { - lineToWithTransform(miterX, miterY); - return; - } - } - } - - // VG_STROKE_LINEJOIN_BEVEL (and fallback for VG_STROKE_LINEJOIN_MITER) - lineToWithTransform(x2, y2); - lineToWithTransform(x3, y3); -} - -void CWRVectorRenderer::StrokeCanvas::strokeDrawLineJoinRound(float x, float y, float x2, float y2, float x3, float y3, int level) -{ - assert(level >= 1 && level <= 3); - float midX = (x2 + x3) / 2.0f; - float midY = (y2 + y3) / 2.0f; - const float midLen = sqrtf((x - midX) * (x - midX) + (y - midY) * (y - midY)); - if (midLen == 0.0f) - { - const float dx = (x3 - x2) / 2.0f; - const float dy = (y3 - y2) / 2.0f; - midX = x2 + dx + dy; - midY = y2 + dy - dx; - } - else - { - midX = x + (midX - x) * strokeWidthHalf / midLen; - midY = y + (midY - y) * strokeWidthHalf / midLen; - } - if (level < 3) - { - strokeDrawLineJoinRound(x, y, x2, y2, midX, midY, level + 1); - lineToWithTransform(midX, midY); - strokeDrawLineJoinRound(x, y, midX, midY, x3, y3, level + 1); - } - else - { - lineToWithTransform(midX, midY); - } -} - -void CWRVectorRenderer::StrokeCanvas::strokeDrawLineCap(float x2, float y2, float x3, float y3) -{ - if (strokeLineCap == VG_STROKE_LINECAP_BUTT) - { - lineToWithTransform(x2, y2); - lineToWithTransform(x3, y3); - return; - } - const float dx = (x3 - x2) / 2.0f; - const float dy = (y3 - y2) / 2.0f; - // dx,dy is from (x2,y2) to the midpoint between (x2,y2) and (x3,y3) - // +dy,-dx is orthogonal and points in the direction of where the cap should be drawn - if (strokeLineCap == VG_STROKE_LINECAP_SQUARE) - { - lineToWithTransform(x2 + dy, y2 - dx); - lineToWithTransform(x3 + dy, y3 - dx); - return; - } - // VG_STROKE_LINECAP_ROUND: - // Using 3^2 + 4^2 = 5^2 as well as 7^2 + 24^2 = 25^2 - lineToWithTransform(x2, y2); - lineToWithTransform(x2 + dx * 0.04f + dy * 0.28f, y2 + dy * 0.04f - dx * 0.28f); - lineToWithTransform(x2 + dx * 0.2f + dy * 0.6f, y2 + dy * 0.2f - dx * 0.6f); - lineToWithTransform(x2 + dx * 0.4f + dy * 0.8f, y2 + dy * 0.4f - dx * 0.8f); - lineToWithTransform(x2 + dx * 0.72f + dy * 0.96f, y2 + dy * 0.72f - dx * 0.96f); - lineToWithTransform(x2 + dx + dy, y2 + dy - dx); - lineToWithTransform(x2 + dx * 1.28f + dy * 0.96f, y2 + dy * 1.28f - dx * 0.96f); - lineToWithTransform(x2 + dx * 1.6f + dy * 0.8f, y2 + dy * 1.6f - dx * 0.8f); - lineToWithTransform(x2 + dx * 1.8f + dy * 0.6f, y2 + dy * 1.8f - dx * 0.6f); - lineToWithTransform(x2 + dx * 1.96f + dy * 0.28f, y2 + dy * 1.96f - dx * 0.28f); - lineToWithTransform(x3, y3); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp deleted file mode 100644 index 8296313..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Canvas.cpp +++ /dev/null @@ -1,510 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -Canvas::Canvas(const CanvasWidget* _widget, const Rect& invalidatedArea) - : widget(_widget), - invalidatedAreaX(0), - invalidatedAreaY(0), - invalidatedAreaWidth(0), - invalidatedAreaHeight(0), - rasterizer(), - isPenDown(false), - wasPenDown(false), - previousX(0), - previousY(0), - previousOutside(0), - penDownOutside(0), - initialMoveToX(0), - initialMoveToY(0) -{ - assert(CanvasWidgetRenderer::hasBuffer() && "No buffer allocated for CanvasWidgetRenderer drawing"); - assert(Rasterizer::POLY_BASE_SHIFT == 5 && "CanvasWidget assumes Q5 but Rasterizer uses a different setting"); - - // Area to redraw (relative coordinates) - Rect dirtyArea = Rect(0, 0, widget->getWidth(), widget->getHeight()) & invalidatedArea; - - // Absolute position of the scalableImage. - dirtyAreaAbsolute = dirtyArea; - widget->translateRectToAbsolute(dirtyAreaAbsolute); - - // Transform rects to match framebuffer coordinates - // This is needed if the display is rotated compared to the framebuffer - DisplayTransformation::transformDisplayToFrameBuffer(dirtyArea, widget->getRect()); - DisplayTransformation::transformDisplayToFrameBuffer(dirtyAreaAbsolute); - - // Re-size buffers for optimum memory buffer layout. - rasterizer.reset(dirtyArea.x, dirtyArea.y); - - invalidatedAreaX = CWRUtil::toQ5(dirtyArea.x); - invalidatedAreaY = CWRUtil::toQ5(dirtyArea.y); - invalidatedAreaWidth = CWRUtil::toQ5(dirtyArea.width); - invalidatedAreaHeight = CWRUtil::toQ5(dirtyArea.height); - - rasterizer.setMaxRender(dirtyAreaAbsolute.width, dirtyAreaAbsolute.height); -} - -void Canvas::moveTo(CWRUtil::Q5 x, CWRUtil::Q5 y) -{ - if (isPenDown) - { - if (!close()) - { - return; - } - } - - transformFrameBufferToDisplay(x, y); - x -= invalidatedAreaX; - y -= invalidatedAreaY; - - const uint8_t outside = isOutside(x, y, invalidatedAreaWidth, invalidatedAreaHeight); - - if (outside) - { - isPenDown = false; - } - else - { - penDownOutside = outside; - rasterizer.moveTo(x, y); - isPenDown = true; - wasPenDown = true; - } - - initialMoveToX = x; - initialMoveToY = y; - - previousX = x; - previousY = y; - previousOutside = outside; -} - -void Canvas::lineTo(CWRUtil::Q5 x, CWRUtil::Q5 y) -{ - transformFrameBufferToDisplay(x, y); - x -= invalidatedAreaX; - y -= invalidatedAreaY; - - uint8_t outside = isOutside(x, y, invalidatedAreaWidth, invalidatedAreaHeight); - - if (!previousOutside) - { - rasterizer.lineTo(x, y); - } - else - { - if (!outside || !(previousOutside & outside)) - { - // x,y is inside, or on another side compared to previous - if (!isPenDown) - { - penDownOutside = previousOutside; - rasterizer.moveTo(previousX, previousY); - isPenDown = true; - wasPenDown = true; - } - else - { - rasterizer.lineTo(previousX, previousY); - } - rasterizer.lineTo(x, y); - } - else - { - // Restrict "outside" to the same side as previous point. - outside &= previousOutside; - } - } - previousX = x; - previousY = y; - previousOutside = outside; -} - -bool Canvas::close() -{ - if (isPenDown) - { - if (previousOutside & penDownOutside) - { - // We are outside on the same side as we started. No need - // to close the path, CWR will do this for us. - // lineTo(penDownX, penDownY); - } - else - { - if (previousOutside) - { - rasterizer.lineTo(previousX, previousY); - } - rasterizer.lineTo(initialMoveToX, initialMoveToY); - } - } - isPenDown = false; - return !rasterizer.wasOutlineTooComplex(); -} - -bool Canvas::render(uint8_t customAlpha) -{ - const uint8_t alpha = LCD::div255(widget->getAlpha() * customAlpha); - if (alpha == 0 || !wasPenDown) - { - return true; // Nothing. Done - } - - // If the invalidated rect is too wide compared to the allocated buffer for CWR, - // redrawing will not help. The CanvasWidget needs to know about this situation - // and maybe try to divide the area vertically instead, but this has not been - // implemented. And probably should not. - if (!close()) - { - return false; - } - - // Create the rendering buffer - uint8_t* RESTRICT framebuffer = reinterpret_cast(HAL::getInstance()->lockFrameBufferForRenderingMethod(widget->getPainter()->getRenderingMethod())); - int stride = HAL::lcd().framebufferStride(); - uint8_t xAdjust = 0; - switch (HAL::lcd().framebufferFormat()) - { - case Bitmap::BW: - framebuffer += (dirtyAreaAbsolute.x / 8) + dirtyAreaAbsolute.y * stride; - xAdjust = dirtyAreaAbsolute.x % 8; - break; - case Bitmap::GRAY2: - framebuffer += (dirtyAreaAbsolute.x / 4) + dirtyAreaAbsolute.y * stride; - xAdjust = dirtyAreaAbsolute.x % 4; - break; - case Bitmap::GRAY4: - framebuffer += (dirtyAreaAbsolute.x / 2) + dirtyAreaAbsolute.y * stride; - xAdjust = dirtyAreaAbsolute.x % 2; - break; - case Bitmap::RGB565: - framebuffer += dirtyAreaAbsolute.x * 2 + dirtyAreaAbsolute.y * stride; - break; - case Bitmap::RGB888: - framebuffer += dirtyAreaAbsolute.x * 3 + dirtyAreaAbsolute.y * stride; - break; - case Bitmap::RGBA2222: - case Bitmap::BGRA2222: - case Bitmap::ARGB2222: - case Bitmap::ABGR2222: - case Bitmap::L8: - framebuffer += dirtyAreaAbsolute.x + dirtyAreaAbsolute.y * stride; - break; - case Bitmap::ARGB8888: - framebuffer += dirtyAreaAbsolute.x * 4 + dirtyAreaAbsolute.y * stride; - break; - case Bitmap::BW_RLE: - case Bitmap::A4: - case Bitmap::CUSTOM: - assert(false && "Unsupported bit depth"); - } - const bool result = rasterizer.render(widget->getPainter(), framebuffer, stride, xAdjust, alpha); - HAL::getInstance()->unlockFrameBuffer(); - return result; -} - -void Canvas::transformFrameBufferToDisplay(CWRUtil::Q5& x, CWRUtil::Q5& y) const -{ - if (HAL::DISPLAY_ROTATION == rotate90) - { - CWRUtil::Q5 tmpY = y; - y = CWRUtil::toQ5(widget->getWidth()) - x; - x = tmpY; - } -} - -// Note: if you change these values, check the commented usage below -//#define curve_angle_tolerance_epsilon 0.01f -#define curve_collinearity_epsilon 1e-10f -#define curve_recursion_limit 8 - -#define m_distance_tolerance 0.25f -#define m_angle_tolerance 0.1f - -void Canvas::recursiveQuadraticBezier(const float x1, const float y1, const float x2, const float y2, const float x3, const float y3, const unsigned level) -{ - if (level > curve_recursion_limit) - { - return; - } - - // Calculate all the mid-points of the line segments - //---------------------- - float x12 = (x1 + x2) / 2; - float y12 = (y1 + y2) / 2; - float x23 = (x2 + x3) / 2; - float y23 = (y2 + y3) / 2; - float x123 = (x12 + x23) / 2; - float y123 = (y12 + y23) / 2; - - float dx = x3 - x1; - float dy = y3 - y1; - float d = abs(((x2 - x3) * dy - (y2 - y3) * dx)); - - if (d > curve_collinearity_epsilon) - { - // Regular care - //----------------- - if (d * d <= m_distance_tolerance * (dx * dx + dy * dy)) - { - // If the curvature doesn't exceed the distance_tolerance value - // we tend to finish subdivisions. - //---------------------- - // FGC: lint does not like this - // if (m_angle_tolerance < curve_angle_tolerance_epsilon) - // { - // lineTo(x123, y123); - // return; - // } - - // Angle & Cusp Condition - //---------------------- - float da = abs(atan2f(y3 - y2, x3 - x2) - atan2f(y2 - y1, x2 - x1)); - if (da >= PI) - { - da = 2 * PI - da; - } - - if (da < m_angle_tolerance) - { - // Finally we can stop the recursion - //---------------------- - lineTo(x123, y123); - return; - } - } - } - else - { - // Collinear case - //----------------- - dx = x123 - (x1 + x3) / 2; - dy = y123 - (y1 + y3) / 2; - if (dx * dx + dy * dy <= m_distance_tolerance) - { - lineTo(x123, y123); - return; - } - } - - // Continue subdivision - //---------------------- - recursiveQuadraticBezier(x1, y1, x12, y12, x123, y123, level + 1); - recursiveQuadraticBezier(x123, y123, x23, y23, x3, y3, level + 1); -} - -//#define m_cusp_limit 0.0f - -void Canvas::recursiveCubicBezier(const float x1, const float y1, const float x2, const float y2, const float x3, const float y3, const float x4, const float y4, const unsigned level) -{ - if (level > curve_recursion_limit) - { - return; - } - - // Calculate all the mid-points of the line segments - //---------------------- - float x12 = (x1 + x2) / 2; - float y12 = (y1 + y2) / 2; - float x23 = (x2 + x3) / 2; - float y23 = (y2 + y3) / 2; - float x34 = (x3 + x4) / 2; - float y34 = (y3 + y4) / 2; - float x123 = (x12 + x23) / 2; - float y123 = (y12 + y23) / 2; - float x234 = (x23 + x34) / 2; - float y234 = (y23 + y34) / 2; - float x1234 = (x123 + x234) / 2; - float y1234 = (y123 + y234) / 2; - - if (level > 0) // Enforce subdivision first time - { - // Try to approximate the full cubic curve by a single straight line - //------------------ - float dx = x4 - x1; - float dy = y4 - y1; - - float d2 = abs(((x2 - x4) * dy - (y2 - y4) * dx)); - float d3 = abs(((x3 - x4) * dy - (y3 - y4) * dx)); - - float da1, da2; - - if (d2 > curve_collinearity_epsilon && d3 > curve_collinearity_epsilon) - { - // Regular care - //----------------- - if ((d2 + d3) * (d2 + d3) <= m_distance_tolerance * (dx * dx + dy * dy)) - { - // If the curvature doesn't exceed the distance_tolerance value - // we tend to finish subdivisions. - //---------------------- - - // FGC: lint does not like this - // if (m_angle_tolerance < curve_angle_tolerance_epsilon) - // { - // lineTo(x1234, y1234); - // return; - // } - - // Angle & Cusp Condition - //---------------------- - float a23 = atan2f(y3 - y2, x3 - x2); - da1 = abs(a23 - atan2f(y2 - y1, x2 - x1)); - da2 = abs(atan2f(y4 - y3, x4 - x3) - a23); - if (da1 >= PI) - { - da1 = 2 * PI - da1; - } - if (da2 >= PI) - { - da2 = 2 * PI - da2; - } - - if (da1 + da2 < m_angle_tolerance) - { - // Finally we can stop the recursion - //---------------------- - lineTo(x1234, y1234); - return; - } - - // FGC: lint does not like this - // if (m_cusp_limit != 0.0f) - // { - // if (da1 > m_cusp_limit) - // { - // lineTo(x2, y2); - // return; - // } - - // if (da2 > m_cusp_limit) - // { - // lineTo(x3, y3); - // return; - // } - // } - } - } - else - { - if (d2 > curve_collinearity_epsilon) - { - // p1,p3,p4 are collinear, p2 is considerable - //---------------------- - if (d2 * d2 <= m_distance_tolerance * (dx * dx + dy * dy)) - { - // FGC: lint does not like this - // if (m_angle_tolerance < curve_angle_tolerance_epsilon) - // { - // lineTo(x1234, y1234); - // return; - // } - - // Angle Condition - //---------------------- - da1 = abs(atan2f(y3 - y2, x3 - x2) - atan2f(y2 - y1, x2 - x1)); - if (da1 >= PI) - { - da1 = 2 * PI - da1; - } - - if (da1 < m_angle_tolerance) - { - lineTo(x2, y2); - lineTo(x3, y3); - return; - } - - // FGC: lint does not like this - // if (m_cusp_limit != 0.0f) - // { - // if (da1 > m_cusp_limit) - // { - // lineTo(x2, y2); - // return; - // } - // } - } - } - else if (d3 > curve_collinearity_epsilon) - { - // p1,p2,p4 are collinear, p3 is considerable - //---------------------- - if (d3 * d3 <= m_distance_tolerance * (dx * dx + dy * dy)) - { - // FGC: lint does not like this - // if (m_angle_tolerance < curve_angle_tolerance_epsilon) - // { - // lineTo(x1234, y1234); - // return; - // } - - // Angle Condition - //---------------------- - da1 = abs(atan2f(y4 - y3, x4 - x3) - atan2f(y3 - y2, x3 - x2)); - if (da1 >= PI) - { - da1 = 2 * PI - da1; - } - - if (da1 < m_angle_tolerance) - { - lineTo(x2, y2); - lineTo(x3, y3); - return; - } - - // FGC: lint does not like this - // if (m_cusp_limit != 0.0f) - // { - // if (da1 > m_cusp_limit) - // { - // lineTo(x3, y3); - // return; - // } - // } - } - } - else - { - // Collinear case - //----------------- - dx = x1234 - (x1 + x4) / 2; - dy = y1234 - (y1 + y4) / 2; - if (dx * dx + dy * dy <= m_distance_tolerance) - { - lineTo(x1234, y1234); - return; - } - } - } - } - - // Continue subdivision - //---------------------- - recursiveCubicBezier(x1, y1, x12, y12, x123, y123, x1234, y1234, level + 1); - recursiveCubicBezier(x1234, y1234, x234, y234, x34, y34, x4, y4, level + 1); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp deleted file mode 100644 index 9571059..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/CanvasWidget.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -CanvasWidget::CanvasWidget() - : Widget(), - alpha(255), - canvasPainter(0) -{ -} - -void CanvasWidget::draw(const Rect& invalidatedArea) const -{ - Rect area = invalidatedArea & getMinimalRect(); - if (!canvasPainter || !canvasPainter->setup(getRect()) || area.isEmpty()) - { - // Painter not ready to paint or nothing to paint => done - return; - } - - switch (HAL::DISPLAY_ROTATION) - { - case rotate0: - { - const int16_t bottom = area.bottom(); - while (area.y < bottom) - { - while (!drawCanvasWidget(area)) - { - if (area.height == 1) - { - // Failed on a single line - break; - } - area.height = (area.height + 1) >> 1; // Cannot become 0 as (2+1)>>1=1 -#ifdef SIMULATOR - if (CanvasWidgetRenderer::getWriteMemoryUsageReport()) - { - if (area.height > 1) - { - touchgfx_printf("CWR will split draw into multiple draws due to limited memory.\n"); - } - else - { - touchgfx_printf("CWR was unable to complete a draw operation due to limited memory.\n"); - } - } -#endif - } - area.y += area.height; - if (area.bottom() > bottom) - { - area.height = bottom - area.y; - } - } - } - break; - case rotate90: - { - const int16_t right = area.right(); - while (area.x < right) - { - while (!drawCanvasWidget(area)) - { - if (area.width == 1) - { - break; - } - area.width = (area.width + 1) >> 1; -#ifdef SIMULATOR - if (CanvasWidgetRenderer::getWriteMemoryUsageReport()) - { - if (area.width > 1) - { - touchgfx_printf("CWR will split draw into multiple draws due to limited memory.\n"); - } - else - { - touchgfx_printf("CWR was unable to complete a draw operation due to limited memory.\n"); - } - } -#endif - } - area.x += area.width; - if (area.right() > right) - { - area.width = right - area.x; - } - } - } - break; - } - canvasPainter->tearDown(); -} - -void CanvasWidget::invalidate() const -{ - Rect minimalRect = getMinimalRect(); - minimalRect &= Rect(0, 0, getWidth(), getHeight()); - invalidateRect(minimalRect); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp deleted file mode 100644 index 89adcf6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Circle.cpp +++ /dev/null @@ -1,510 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -Circle::Circle() - : CanvasWidget(), - circleCenterX(0), circleCenterY(0), circleRadius(0), - circleArcAngleStart(CWRUtil::toQ5(0)), circleArcAngleEnd(CWRUtil::toQ5(360)), - circleLineWidth(0), circleArcIncrement(5), - circleCapArcIncrement(180) -{ - Drawable::setWidthHeight(0, 0); -} - -void Circle::setPrecision(int precision) -{ - if (precision < 1) - { - precision = 1; - } - if (precision > 120) - { - precision = 120; - } - circleArcIncrement = precision; -} - -int Circle::getPrecision() const -{ - return circleArcIncrement; -} - -void Circle::setCapPrecision(int precision) -{ - if (precision < 1) - { - precision = 1; - } - if (precision > 180) - { - precision = 180; - } - circleCapArcIncrement = precision; -} - -int Circle::getCapPrecision() const -{ - return circleCapArcIncrement; -} - -bool Circle::drawCanvasWidget(const Rect& invalidatedArea) const -{ - CWRUtil::Q5 arcStart = circleArcAngleStart; - CWRUtil::Q5 arcEnd = circleArcAngleEnd; - - CWRUtil::Q5 _360 = CWRUtil::toQ5(360); - - // Put start before end by swapping - if (arcStart > arcEnd) - { - CWRUtil::Q5 tmp = arcStart; - arcStart = arcEnd; - arcEnd = tmp; - } - - if ((arcEnd - arcStart) >= _360) - { - // The entire circle has to be drawn - arcStart = CWRUtil::toQ5(0); - arcEnd = _360; - } - - const int16_t circleCenterX16 = circleCenterX.to(); - const int16_t circleCenterY16 = circleCenterY.to(); - int32_t routside = 0; - if (circleLineWidth != 0) - { - // Check if invalidated area is completely inside the circle - const int32_t dx1 = abs((int)circleCenterX16 - invalidatedArea.x); // Find distances between each corner and circle center - const int32_t dx2 = abs((int)circleCenterX16 - invalidatedArea.right()); - const int32_t dy1 = abs((int)circleCenterY16 - invalidatedArea.y); - const int32_t dy2 = abs((int)circleCenterY16 - invalidatedArea.bottom()); - const int32_t dx = MAX(dx1, dx2) + 1; // Largest horz/vert distance (round up) - const int32_t dy = MAX(dy1, dy2) + 1; - // From https://www.mathopenref.com/polygonincircle.html - const int32_t rmin = ((circleRadius - (circleLineWidth / 2)) * CWRUtil::cosine((circleArcIncrement + 1) / 2)).to(); - // Check if invalidatedArea is completely inside circle - if ((dx * dx) + (dy * dy) < rmin * rmin) - { - return true; - } - routside = (circleRadius + (circleLineWidth / 2)).to() + 1; - } - else - { - routside = circleRadius.to() + 1; - } - // From https://yal.cc/rectangle-circle-intersection-test/ - const int32_t invalidatedRight = invalidatedArea.right(); - const int32_t minimumX = MIN(circleCenterX16, invalidatedRight); - const int32_t nearestX = circleCenterX16 - MAX(invalidatedArea.x, minimumX); - const int32_t invalidatedBottom = invalidatedArea.bottom(); - const int32_t minimumY = MIN(circleCenterY16, invalidatedBottom); - const int32_t nearestY = circleCenterY16 - MAX(invalidatedArea.y, minimumY); - // Check if invalidatedArea is completely outside circle - if ((nearestX * nearestX) + (nearestY * nearestY) > routside * routside) - { - return true; - } - - Canvas canvas(this, invalidatedArea); - - CWRUtil::Q5 radius = circleRadius; - CWRUtil::Q5 lineWidth = circleLineWidth; - if (circleLineWidth > circleRadius * 2) - { - lineWidth = (circleRadius + circleLineWidth / 2); - radius = lineWidth / 2; - } - - CWRUtil::Q5 arc = arcStart; - CWRUtil::Q5 circleArcIncrementQ5 = CWRUtil::toQ5(circleArcIncrement); - moveToAngleRadius2(canvas, arc, (radius * 2) + lineWidth); - CWRUtil::Q5 nextArc = CWRUtil::Q5(ROUNDUP((int)(arc + CWRUtil::toQ5(1)), (int)circleArcIncrementQ5)); - while (nextArc <= arcEnd) - { - arc = nextArc; - lineToAngleRadius2(canvas, arc, (radius * 2) + lineWidth); - nextArc += circleArcIncrementQ5; - } - if (arc < arcEnd) - { - // "arc" is not updated. It is the last arc in steps of "circleArcIncrement" - lineToAngleRadius2(canvas, arcEnd, (radius * 2) + lineWidth); - } - - if (lineWidth == CWRUtil::toQ5(0)) - { - // Draw a filled circle / pie / pacman - if (arcEnd - arcStart < _360) - { - // Not a complete circle, line to center - canvas.lineTo(circleCenterX, circleCenterY); - } - } - else - { - if (canvas.wasOutlineTooComplex()) - { - return false; - } - - CWRUtil::Q5 circleCapArcIncrementQ5 = CWRUtil::toQ5(circleCapArcIncrement); - CWRUtil::Q5 _180 = CWRUtil::toQ5(180); - if (arcEnd - arcStart < _360) - { - // Draw the circle cap - CWRUtil::Q5 capX = circleCenterX + (radius * CWRUtil::sine(arcEnd)); - CWRUtil::Q5 capY = circleCenterY - (radius * CWRUtil::cosine(arcEnd)); - for (CWRUtil::Q5 capAngle = arcEnd + circleCapArcIncrementQ5; capAngle < arcEnd + _180; capAngle += circleCapArcIncrementQ5) - { - lineToXYAngleRadius2(canvas, capX, capY, capAngle, lineWidth); - } - } - - // Not a filled circle, draw the path on the inside of the circle - if (arc < arcEnd) - { - lineToAngleRadius2(canvas, arcEnd, (radius * 2) - lineWidth); - } - - nextArc = arc; - while (nextArc >= arcStart) - { - arc = nextArc; - lineToAngleRadius2(canvas, arc, (radius * 2) - lineWidth); - nextArc -= circleArcIncrementQ5; - } - - if (arc > arcStart) - { - lineToAngleRadius2(canvas, arcStart, (radius * 2) - lineWidth); - } - - if (arcEnd - arcStart < _360) - { - // Draw the circle cap - CWRUtil::Q5 capX = circleCenterX + (radius * CWRUtil::sine(arcStart)); - CWRUtil::Q5 capY = circleCenterY - (radius * CWRUtil::cosine(arcStart)); - for (CWRUtil::Q5 capAngle = (arcStart - _180) + circleCapArcIncrementQ5; capAngle < arcStart; capAngle += circleCapArcIncrementQ5) - { - lineToXYAngleRadius2(canvas, capX, capY, capAngle, lineWidth); - } - } - } - - return canvas.render(); -} - -Rect Circle::getMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd) const -{ - CWRUtil::Q5 xMin = CWRUtil::toQ5(getWidth()); - CWRUtil::Q5 xMax = CWRUtil::toQ5(0); - CWRUtil::Q5 yMin = CWRUtil::toQ5(getHeight()); - CWRUtil::Q5 yMax = CWRUtil::toQ5(0); - calculateMinimalRect(arcStart, arcEnd, xMin, xMax, yMin, yMax); - return Rect(xMin.to() - 1, yMin.to() - 1, - (xMax.to() - xMin.to()) + 2, (yMax.to() - yMin.to()) + 2); -} - -void Circle::updateArc(CWRUtil::Q5 setStartAngleQ5, CWRUtil::Q5 setEndAngleQ5) -{ - CWRUtil::Q5 startAngleQ5 = setStartAngleQ5; - CWRUtil::Q5 endAngleQ5 = setEndAngleQ5; - if (circleArcAngleStart == startAngleQ5 && circleArcAngleEnd == endAngleQ5) - { - return; - } - - // Make sure old start < end - if (circleArcAngleStart > circleArcAngleEnd) - { - CWRUtil::Q5 tmp = circleArcAngleStart; - circleArcAngleStart = circleArcAngleEnd; - circleArcAngleEnd = tmp; - } - // Make sure new start < end - if (startAngleQ5 > endAngleQ5) - { - CWRUtil::Q5 tmp = startAngleQ5; - startAngleQ5 = endAngleQ5; - endAngleQ5 = tmp; - } - - // Nice constant - const CWRUtil::Q5 _360 = CWRUtil::toQ5(360); - - // Get old circle range start in [0..360[ - if (circleArcAngleStart >= _360) - { - int x = (circleArcAngleStart / _360).to(); - circleArcAngleStart -= _360 * x; - circleArcAngleEnd -= _360 * x; - } - else if (circleArcAngleStart < 0) - { - int x = 1 + ((-circleArcAngleStart) / _360).to(); - circleArcAngleStart += _360 * x; - circleArcAngleEnd += _360 * x; - } - // Detect full circle - if ((circleArcAngleEnd - circleArcAngleStart) > _360) - { - circleArcAngleEnd = circleArcAngleStart + _360; - } - - // Get new circle range start in [0..360[ - if (startAngleQ5 >= _360) - { - int x = (startAngleQ5 / _360).to(); - startAngleQ5 -= _360 * x; - endAngleQ5 -= _360 * x; - } - else if (startAngleQ5 < 0) - { - int x = 1 + (-startAngleQ5 / _360).to(); - startAngleQ5 += _360 * x; - endAngleQ5 += _360 * x; - } - // Detect full circle - if ((endAngleQ5 - startAngleQ5) >= _360) - { - // Align full new circle with old start. - // So old[90..270] -> new[0..360] becomes new[90..450] for smaller invalidated area - startAngleQ5 = circleArcAngleStart; - endAngleQ5 = startAngleQ5 + _360; - } - else if ((circleArcAngleEnd - circleArcAngleStart) >= _360) - { - // New circle is not full, but old is. Align old circle with new. - // So old[0..360] -> new[90..270] becomes old[90..450] for smaller invalidated area - circleArcAngleStart = startAngleQ5; - circleArcAngleEnd = circleArcAngleStart + _360; - } - - // New start is after old end. Could be overlap - // if old[10..30]->new[350..380] becomes new[-10..20] - if (startAngleQ5 > circleArcAngleEnd && endAngleQ5 - _360 >= circleArcAngleStart) - { - startAngleQ5 -= _360; - endAngleQ5 -= _360; - } - // Same as above but for old instead of new - if (circleArcAngleStart > endAngleQ5 && circleArcAngleEnd - _360 >= startAngleQ5) - { - circleArcAngleStart -= _360; - circleArcAngleEnd -= _360; - } - - Rect r; - if (startAngleQ5 > circleArcAngleEnd || endAngleQ5 < circleArcAngleStart) - { - // Arcs do not overlap. Invalidate both arcs. - r = getMinimalRect(circleArcAngleStart, circleArcAngleEnd); - invalidateRect(r); - - r = getMinimalRect(startAngleQ5, endAngleQ5); - invalidateRect(r); - } - else - { - // Arcs overlap. Invalidate both ends. - if (circleArcAngleStart != startAngleQ5) - { - r = getMinimalRectForUpdatedStartAngle(startAngleQ5); - invalidateRect(r); - } - if (circleArcAngleEnd != endAngleQ5) - { - r = getMinimalRectForUpdatedEndAngle(endAngleQ5); - invalidateRect(r); - } - } - - circleArcAngleStart = setStartAngleQ5; - circleArcAngleEnd = setEndAngleQ5; -} - -void Circle::calculateMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const -{ - // Put start before end by swapping - if (arcStart > arcEnd) - { - CWRUtil::Q5 tmp = arcStart; - arcStart = arcEnd; - arcEnd = tmp; - } - - CWRUtil::Q5 _90 = CWRUtil::toQ5(90); - CWRUtil::Q5 _360 = CWRUtil::toQ5(360); - - if ((arcEnd - arcStart) >= _360) - { - // The entire circle has to be drawn - arcStart = CWRUtil::toQ5(0); - arcEnd = _360; - } - - if (circleLineWidth == 0) - { - // Check start angle - updateMinMaxAngleSolid(arcStart, xMin, xMax, yMin, yMax); - // Here we have a up to 4 approximation steps on angles divisible by 90 - CWRUtil::Q5 i; - for (i = CWRUtil::Q5(ROUNDUP((int)(arcStart + (CWRUtil::Q5)1), (int)_90)); i <= arcEnd; i += _90) - { - updateMinMaxAngleSolid(i, xMin, xMax, yMin, yMax); - } - // Check end angle - if ((i - _90) < arcEnd) - { - updateMinMaxAngleSolid(arcEnd, xMin, xMax, yMin, yMax); - } - updateMinMaxX(circleCenterX, xMin, xMax); - updateMinMaxY(circleCenterY, yMin, yMax); - } - else - { - const CWRUtil::Q5 halfLineWidth = (circleLineWidth + (CWRUtil::Q5)1) / 2; - // Check start angle - updateMinMaxAngleLine(arcStart, halfLineWidth, xMin, xMax, yMin, yMax); - // Here we have a up to 4 approximation steps on angles divisible by 90 - CWRUtil::Q5 i; - for (i = CWRUtil::Q5(ROUNDUP((int)(arcStart + (CWRUtil::Q5)1), (int)_90)); i <= arcEnd; i += _90) - { - updateMinMaxAngleLine(i, halfLineWidth, xMin, xMax, yMin, yMax); - } - // Check end angle - if ((i - _90) < arcEnd) - { - updateMinMaxAngleLine(arcEnd, halfLineWidth, xMin, xMax, yMin, yMax); - } - } -} - -Rect Circle::getMinimalRectForUpdatedStartAngle(const CWRUtil::Q5& startAngleQ5) const -{ - CWRUtil::Q5 minAngle = CWRUtil::Q5(0); // Unused default value - CWRUtil::Q5 maxAngle = CWRUtil::Q5(0); // Unused default value - int circleArcIncrementQ5int = (int)CWRUtil::toQ5(circleArcIncrement); - if (circleArcAngleStart < circleArcAngleEnd) - { - // start is smaller than end - if (startAngleQ5 < circleArcAngleStart) - { - // start moved even lower - minAngle = startAngleQ5; - maxAngle = CWRUtil::Q5(ROUNDUP((int)circleArcAngleStart, circleArcIncrementQ5int)); - maxAngle = MIN(maxAngle, circleArcAngleEnd); // No need to go higher than end - } - else if (startAngleQ5 < circleArcAngleEnd) - { - // start moved higher, but not higher than end - minAngle = circleArcAngleStart; - maxAngle = CWRUtil::Q5(ROUNDUP((int)startAngleQ5, circleArcIncrementQ5int)); - maxAngle = MIN(maxAngle, circleArcAngleEnd); // No need to go higher than end - } - else - { - // start moved past end - minAngle = circleArcAngleStart; - maxAngle = startAngleQ5; - } - } - else - { - // start is higher than end - if (startAngleQ5 > circleArcAngleStart) - { - // start moved even higher - minAngle = CWRUtil::Q5(ROUNDDOWN((int)circleArcAngleStart, circleArcIncrementQ5int)); - minAngle = MAX(minAngle, circleArcAngleEnd); // No need to go lower then end - maxAngle = startAngleQ5; - } - else if (startAngleQ5 > circleArcAngleEnd) - { - // start moved lower, but not lower than end - minAngle = CWRUtil::Q5(ROUNDDOWN((int)startAngleQ5, circleArcIncrementQ5int)); - minAngle = MAX(minAngle, circleArcAngleEnd); // No need to go lower than end - maxAngle = circleArcAngleStart; - } - else - { - // start moved lower past end - minAngle = startAngleQ5; - maxAngle = circleArcAngleStart; - } - } - return getMinimalRect(minAngle, maxAngle); -} - -Rect Circle::getMinimalRectForUpdatedEndAngle(const CWRUtil::Q5& endAngleQ5) const -{ - CWRUtil::Q5 minAngle = CWRUtil::Q5(0); // Unused default value - CWRUtil::Q5 maxAngle = CWRUtil::Q5(0); // Unused default value - int circleArcIncrementQ5int = (int)CWRUtil::toQ5(circleArcIncrement); - if (circleArcAngleStart < circleArcAngleEnd) - { - // start is smaller than end - if (endAngleQ5 > circleArcAngleEnd) - { - // end moved even higher - minAngle = CWRUtil::Q5(ROUNDDOWN((int)circleArcAngleEnd, circleArcIncrementQ5int)); - minAngle = MAX(minAngle, circleArcAngleStart); - maxAngle = endAngleQ5; - } - else if (endAngleQ5 > circleArcAngleStart) - { - // end moved lower, but not past start - minAngle = CWRUtil::Q5(ROUNDDOWN((int)endAngleQ5, circleArcIncrementQ5int)); - minAngle = MAX(minAngle, circleArcAngleStart); // No need to go lower than start - maxAngle = circleArcAngleEnd; - } - else - { - // end move past start - minAngle = endAngleQ5; - maxAngle = circleArcAngleEnd; - } - } - else - { - // start is higher than end - if (endAngleQ5 < circleArcAngleEnd) - { - // end moved even lower - minAngle = endAngleQ5; - maxAngle = CWRUtil::Q5(ROUNDUP((int)circleArcAngleEnd, circleArcIncrementQ5int)); - maxAngle = MIN(maxAngle, circleArcAngleStart); // No need to go higher than start - } - else if (endAngleQ5 < circleArcAngleStart) - { - // end moved higher, but not higher than start - minAngle = circleArcAngleEnd; - maxAngle = CWRUtil::Q5(ROUNDUP((int)endAngleQ5, circleArcIncrementQ5int)); - maxAngle = MIN(maxAngle, circleArcAngleStart); - } - else - { - // end moved past start - minAngle = circleArcAngleEnd; - maxAngle = endAngleQ5; - } - } - return getMinimalRect(minAngle, maxAngle); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp deleted file mode 100644 index fbb5845..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/Line.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -Line::Line() - : CanvasWidget(), - startXQ5(0), startYQ5(0), endXQ5(0), endYQ5(0), - lineWidthQ5(CWRUtil::toQ5(1)), - lineEnding(BUTT_CAP_ENDING), - minimalRect(), - lineCapArcIncrement(18) -{ - Drawable::setWidthHeight(0, 0); -} - -void Line::setStart(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5) -{ - if (startXQ5 == xQ5 && startYQ5 == yQ5) - { - return; - } - - startXQ5 = xQ5; - startYQ5 = yQ5; - - updateCachedShape(); -} - -void Line::updateStart(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5) -{ - if (startXQ5 == xQ5 && startYQ5 == yQ5) - { - return; - } - - invalidateContent(); - - startXQ5 = xQ5; - startYQ5 = yQ5; - - updateCachedShape(); - - invalidateContent(); -} - -void Line::setEnd(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5) -{ - if (endXQ5 == xQ5 && endYQ5 == yQ5) - { - return; - } - - endXQ5 = xQ5; - endYQ5 = yQ5; - - updateCachedShape(); -} - -void Line::updateEnd(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5) -{ - if (endXQ5 == xQ5 && endYQ5 == yQ5) - { - return; - } - - invalidateContent(); - - endXQ5 = xQ5; - endYQ5 = yQ5; - - updateCachedShape(); - - invalidateContent(); -} - -void Line::setLineEndingStyle(Line::LINE_ENDING_STYLE lineEndingStyle) -{ - lineEnding = lineEndingStyle; - updateCachedShape(); -} - -Line::LINE_ENDING_STYLE Line::getLineEndingStyle() const -{ - return lineEnding; -} - -void Line::setCapPrecision(int precision) -{ - if (precision < 1) - { - precision = 1; - } - if (precision > 180) - { - precision = 180; - } - lineCapArcIncrement = precision; -} - -bool Line::drawCanvasWidget(const Rect& invalidatedArea) const -{ - Canvas canvas(this, invalidatedArea); - - CWRUtil::Q5 radiusQ5; - if (lineEnding == ROUND_CAP_ENDING) - { - const int angleInDegrees = CWRUtil::angle(cornerXQ5[0] - startXQ5, cornerYQ5[0] - startYQ5, radiusQ5); - canvas.moveTo(cornerXQ5[0], cornerYQ5[0]); - canvas.lineTo(cornerXQ5[1], cornerYQ5[1]); - for (int i = lineCapArcIncrement; i < 180; i += lineCapArcIncrement) - { - canvas.lineTo(endXQ5 + radiusQ5 * CWRUtil::sine(angleInDegrees - i), endYQ5 - radiusQ5 * CWRUtil::cosine(angleInDegrees - i)); - } - canvas.lineTo(cornerXQ5[2], cornerYQ5[2]); - canvas.lineTo(cornerXQ5[3], cornerYQ5[3]); - for (int i = 180 - lineCapArcIncrement; i > 0; i -= lineCapArcIncrement) - { - canvas.lineTo(startXQ5 + radiusQ5 * CWRUtil::sine(angleInDegrees + i), startYQ5 - radiusQ5 * CWRUtil::cosine(angleInDegrees + i)); - } - } - else - { - canvas.moveTo(cornerXQ5[0], cornerYQ5[0]); - canvas.lineTo(cornerXQ5[1], cornerYQ5[1]); - canvas.lineTo(cornerXQ5[2], cornerYQ5[2]); - canvas.lineTo(cornerXQ5[3], cornerYQ5[3]); - } - return canvas.render(); -} - -void Line::updateCachedShape() -{ - CWRUtil::Q5 dxQ5 = endXQ5 - startXQ5; - CWRUtil::Q5 dyQ5 = endYQ5 - startYQ5; - CWRUtil::Q5 dQ5 = CWRUtil::toQ5(0); - // Look for horizontal, vertical or no-line - if (dxQ5 == 0) - { - if (dyQ5 == 0) - { - cornerXQ5[0] = cornerXQ5[1] = cornerXQ5[2] = cornerXQ5[3] = startXQ5; - cornerYQ5[0] = cornerYQ5[1] = cornerYQ5[2] = cornerYQ5[3] = startYQ5; - return; - } - dQ5 = abs(dyQ5); - } - else if (dyQ5 == 0) - { - dQ5 = abs(dxQ5); - } - else - { - // We want to hit as close to the limit inside 32bits. - // sqrt(0x7FFFFFFF / 2) = 46340, which is roughly toQ5(1448) - static const int32_t MAXVAL = 46340; - int32_t common_divisor = gcd(abs((int32_t)dxQ5), abs((int32_t)dyQ5)); - // First try to scale down - if (common_divisor != 1) - { - dxQ5 = CWRUtil::Q5((int32_t)dxQ5 / common_divisor); - dyQ5 = CWRUtil::Q5((int32_t)dyQ5 / common_divisor); - } - // Neither dx or dy is zero, find the largest multiplier / smallest divisor to stay within limit - if (abs((int32_t)dxQ5) <= MAXVAL || abs((int32_t)dyQ5) <= MAXVAL) - { - // Look for largest multiplier - const int32_t mulx = MAXVAL / abs((int32_t)dxQ5); - const int32_t muly = MAXVAL / abs((int32_t)dyQ5); - const int32_t mult = MIN(mulx, muly); - dxQ5 = CWRUtil::Q5(mult * (int32_t)dxQ5); - dyQ5 = CWRUtil::Q5(mult * (int32_t)dyQ5); - } - else - { - // Look for smallest divisor - const int32_t divx = abs((int32_t)dxQ5) / MAXVAL; - const int32_t divy = abs((int32_t)dyQ5) / MAXVAL; - const int32_t divi = MAX(divx, divy) + 1; - dxQ5 = CWRUtil::Q5((int32_t)dxQ5 / divi); - dyQ5 = CWRUtil::Q5((int32_t)dyQ5 / divi); - } - dQ5 = CWRUtil::length(dxQ5, dyQ5); - } - - dyQ5 = CWRUtil::muldivQ5(lineWidthQ5, dyQ5, dQ5) / 2; - dxQ5 = CWRUtil::muldivQ5(lineWidthQ5, dxQ5, dQ5) / 2; - - switch (lineEnding) - { - case BUTT_CAP_ENDING: - cornerXQ5[0] = startXQ5 - dyQ5; - cornerYQ5[0] = startYQ5 + dxQ5; - cornerXQ5[1] = endXQ5 - dyQ5; - cornerYQ5[1] = endYQ5 + dxQ5; - cornerXQ5[2] = endXQ5 + dyQ5; - cornerYQ5[2] = endYQ5 - dxQ5; - cornerXQ5[3] = startXQ5 + dyQ5; - cornerYQ5[3] = startYQ5 - dxQ5; - break; - case ROUND_CAP_ENDING: - // Nothing cached, calculated on each draw, but extremes are same as SQUARE_CAP_ENDING, so - // Fall Through (for calculations) - case SQUARE_CAP_ENDING: - cornerXQ5[0] = (startXQ5 - dyQ5) - dxQ5; - cornerYQ5[0] = (startYQ5 + dxQ5) - dyQ5; - cornerXQ5[1] = (endXQ5 - dyQ5) + dxQ5; - cornerYQ5[1] = (endYQ5 + dxQ5) + dyQ5; - cornerXQ5[2] = (endXQ5 + dyQ5) + dxQ5; - cornerYQ5[2] = (endYQ5 - dxQ5) + dyQ5; - cornerXQ5[3] = (startXQ5 + dyQ5) - dxQ5; - cornerYQ5[3] = (startYQ5 - dxQ5) - dyQ5; - break; - } - - CWRUtil::Q5 xMinQ5 = cornerXQ5[0]; - CWRUtil::Q5 xMaxQ5 = cornerXQ5[0]; - CWRUtil::Q5 yMinQ5 = cornerYQ5[0]; - CWRUtil::Q5 yMaxQ5 = cornerYQ5[0]; - for (int i = 1; i < 4; i++) - { - if (cornerXQ5[i] < xMinQ5) - { - xMinQ5 = cornerXQ5[i]; - } - if (cornerXQ5[i] > xMaxQ5) - { - xMaxQ5 = cornerXQ5[i]; - } - if (cornerYQ5[i] < yMinQ5) - { - yMinQ5 = cornerYQ5[i]; - } - if (cornerYQ5[i] > yMaxQ5) - { - yMaxQ5 = cornerYQ5[i]; - } - } - const int16_t xMin = xMinQ5.floor(); - const int16_t yMin = yMinQ5.floor(); - const int16_t xMax = xMaxQ5.ceil(); - const int16_t yMax = yMaxQ5.ceil(); - minimalRect = Rect(xMin, yMin, xMax - xMin, yMax - yMin); - - if (lineEnding == ROUND_CAP_ENDING) - { - cornerXQ5[0] = startXQ5 - dyQ5; - cornerYQ5[0] = startYQ5 + dxQ5; - cornerXQ5[1] = endXQ5 - dyQ5; - cornerYQ5[1] = endYQ5 + dxQ5; - cornerXQ5[2] = endXQ5 + dyQ5; - cornerYQ5[2] = endYQ5 - dxQ5; - cornerXQ5[3] = startXQ5 + dyQ5; - cornerYQ5[3] = startYQ5 - dxQ5; - } -} - -touchgfx::Rect Line::rectContainingPoints(const Rect& fullRect, CWRUtil::Q5 x0, CWRUtil::Q5 y0, CWRUtil::Q5 x1, CWRUtil::Q5 y1, CWRUtil::Q5 x2, CWRUtil::Q5 y2) const -{ - const int16_t xMin = MIN(MIN(x0, x1), x2).floor(); - const int16_t yMin = MIN(MIN(y0, y1), y2).floor(); - const int16_t xMax = MAX(MAX(x0, x1), x2).ceil(); - const int16_t yMax = MAX(MAX(y0, y1), y2).ceil(); - Rect r(xMin, yMin, xMax - xMin, yMax - yMin); - r &= fullRect; - return r; -} - -Rect Line::getMinimalRect() const -{ - return minimalRect; -} - -void Line::updateLengthAndAngle(CWRUtil::Q5 length, CWRUtil::Q5 angle) -{ - updateEnd(startXQ5 + length * CWRUtil::sine(angle), startYQ5 - length * CWRUtil::cosine(angle)); -} - -void Line::invalidateContent() const -{ - if (alpha == 0) - { - return; - } - Rect smallRect = getMinimalRect(); - if (abs(startXQ5.to() - endXQ5.to()) < lineWidthQ5.to() * 2 || - abs(startYQ5.to() - endYQ5.to()) < lineWidthQ5.to() * 2) - { - invalidateRect(smallRect); - return; - } - - int16_t center_x = ((startXQ5 + endXQ5) / 2).to(); - int16_t center_y = ((startYQ5 + endYQ5) / 2).to(); - // The following should be "lineWidth/sqrt(2)" but to speed up we take the slightly larger "lineWidth/1.3333"="(lineWidth*3)/4" - int16_t extra_width = ((CWRUtil::Q5)(((int)(lineWidthQ5)*3 + 3) >> 2)).ceil(); -#define same_sign(x, y) (((x) < 0 && (y) < 0) || ((x) > 0 && (y) > 0)) - if (smallRect.width < smallRect.height) - { - const int16_t left_x = center_x - extra_width; - const int16_t right_x = center_x + extra_width; - // "vertical" line - if (same_sign(endXQ5 - startXQ5, endYQ5 - startYQ5)) - { - // From top-left to bottom-right - Rect topLeftRect(smallRect.x, smallRect.y, right_x - smallRect.x, center_y - smallRect.y); - Rect bottomRightRect(left_x, center_y, smallRect.right() - left_x, smallRect.bottom() - center_y); - invalidateRect(topLeftRect); - invalidateRect(bottomRightRect); - } - else - { - // From top-right to bottom-left - Rect topRightRect(left_x, smallRect.y, smallRect.right() - left_x, center_y - smallRect.y); - Rect bottomLeftRect(smallRect.x, center_y, right_x - smallRect.x, smallRect.bottom() - center_y); - invalidateRect(topRightRect); - invalidateRect(bottomLeftRect); - } - } - else - { - const int16_t top_y = center_y - extra_width; - const int16_t bottom_y = center_y + extra_width; - // "horizontal" line - if (same_sign(endXQ5 - startXQ5, endYQ5 - startYQ5)) - { - // From top-left to bottom-right - Rect topLeftRect(smallRect.x, smallRect.y, center_x - smallRect.x, bottom_y - smallRect.y); - Rect bottomRightRect(center_x, top_y, smallRect.right() - center_x, smallRect.bottom() - top_y); - invalidateRect(topLeftRect); - invalidateRect(bottomRightRect); - } - else - { - // From top-right to bottom-left - Rect bottomLeftRect(smallRect.x, top_y, center_x - smallRect.x, smallRect.bottom() - top_y); - Rect topRightRect(center_x, smallRect.y, smallRect.right() - center_x, bottom_y - smallRect.y); - invalidateRect(bottomLeftRect); - invalidateRect(topRightRect); - } - } -#undef same_sign -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp deleted file mode 100644 index 4fb22e7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void PainterABGR2222::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - - if (alpha == 0xFF) - { - do - { - *framebuffer = color8; - } while (++framebuffer < lineEnd); - } - else - { - do - { - *framebuffer = alphaBlend(painterRed, painterGreen, painterBlue, *framebuffer, alpha); - } while (++framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp deleted file mode 100644 index c393a94..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterABGR2222Bitmap.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterABGR2222Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::ABGR2222) && "PainterABGR2222Bitmap only works with ABGR2222 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -void PainterABGR2222Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t abgr = *bitmapPointer++; - const uint8_t srcAlpha = (abgr >> 6) * 0x55; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = abgr; - } - else if (a) - { - *framebuffer = alphaBlend(abgr, *framebuffer, a); - } - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp deleted file mode 100644 index eb2824f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void PainterARGB2222::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - - if (alpha == 0xFF) - { - do - { - *framebuffer = color8; - } while (++framebuffer < lineEnd); - } - else - { - do - { - *framebuffer = alphaBlend(painterRed, painterGreen, painterBlue, *framebuffer, alpha); - } while (++framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp deleted file mode 100644 index ef9ca4c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB2222Bitmap.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterARGB2222Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::ARGB2222) && "PainterARGB2222Bitmap only works with ARGB2222 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -void PainterARGB2222Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t argb = *bitmapPointer++; - const uint8_t srcAlpha = (argb >> 6) * 0x55; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = argb; - } - else if (a) - { - *framebuffer = alphaBlend(argb, *framebuffer, a); - } - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp deleted file mode 100644 index 6b598c9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void PainterARGB8888::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint32_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; - const uint32_t* const lineEnd = framebuffer + count; - uint32_t color = (painterColor & 0x00FFFFFF) | (alpha << 24); - - if (alpha == 0xFF) - { - do - { - *framebuffer = color; - } while (++framebuffer < lineEnd); - } - else - { - do - { - const uint32_t argbBg = *framebuffer; - const uint8_t alphaBg = argbBg >> 24; - if (alphaBg == 0) - { - *framebuffer = color; - } - else if (alpha > 0) - { - const uint8_t alphaMult = LCD::div255(alpha * alphaBg); - const uint8_t alphaOut = alpha + alphaBg - alphaMult; - const uint8_t blueBg = (argbBg & 0xFF); - const uint8_t greenBg = ((argbBg >> 8) & 0xFF); - const uint8_t redBg = ((argbBg >> 16) & 0xFF); - *framebuffer = ((painterBlue * alpha + blueBg * alphaBg - blueBg * alphaMult) / alphaOut) | - (((painterGreen * alpha + greenBg * alphaBg - greenBg * alphaMult) / alphaOut) << 8) | - (((painterRed * alpha + redBg * alphaBg - redBg * alphaMult) / alphaOut) << 16) | - (alphaOut << 24); - } - } while (++framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp deleted file mode 100644 index c2aeff5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888Bitmap.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterARGB8888Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::RGB565 || bitmapFormat == Bitmap::RGB888 || bitmapFormat == Bitmap::ARGB8888) && "PainterARGB8888Bitmap only works with RGB565, RGB888 and ARGB8888 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); - bitmapExtraData = bitmap.getExtraData(); -} - -void PainterARGB8888Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset * 4; - const uint8_t* const lineEnd = framebuffer + count * 4; - const int32_t rowSkip = widgetY * bitmapRect.width; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (bitmapFormat == Bitmap::ARGB8888) - { - const uint32_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip; - const uint32_t* bitmapPointer = bitmapLineStart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - do - { - const uint8_t srcAlpha = (*bitmapPointer) >> 24; - const uint8_t alphaFg = LCD::div255(alpha * srcAlpha); - const uint8_t alphaBg = framebuffer[3]; - if (alphaFg == 255 || alphaBg == 0) - { - const uint8_t blueFg = *bitmapPointer; - *framebuffer++ = blueFg; - const uint8_t greenFg = (*bitmapPointer) >> 8; - *framebuffer++ = greenFg; - const uint8_t redFg = (*bitmapPointer) >> 16; - *framebuffer++ = redFg; - *framebuffer++ = alphaFg; - } - else if (alphaFg) - { - const uint8_t alphaMult = LCD::div255(alphaFg * alphaBg); - const uint8_t alphaOut = alphaFg + alphaBg - alphaMult; - - const uint8_t blueBg = *framebuffer; - const uint8_t blueFg = *bitmapPointer; - *framebuffer++ = (blueFg * alphaFg + blueBg * (alphaBg - alphaMult)) / alphaOut; - const uint8_t greenBg = *framebuffer; - const uint8_t greenFg = (*bitmapPointer) >> 8; - *framebuffer++ = (greenFg * alphaFg + greenBg * (alphaBg - alphaMult)) / alphaOut; - const uint8_t redBg = *framebuffer; - const uint8_t redFg = (*bitmapPointer) >> 16; - *framebuffer++ = (redFg * alphaFg + redBg * (alphaBg - alphaMult)) / alphaOut; - *framebuffer++ = alphaOut; - } - else - { - framebuffer += 4; - } - bitmapPointer++; - } while (framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else if (bitmapFormat == Bitmap::RGB888) - { - const uint8_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip * 3; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX * 3; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - do - { - const uint8_t alphaBg = framebuffer[3]; - const uint8_t alphaMult = LCD::div255(alpha * alphaBg); - const uint8_t alphaOut = alpha + alphaBg - alphaMult; - - const uint8_t blueBg = *framebuffer; - const uint8_t blueFg = *bitmapPointer++; - *framebuffer++ = (blueFg * alpha + blueBg * alphaBg - blueBg * alphaMult) / alphaOut; - const uint8_t greenBg = *framebuffer; - const uint8_t greenFg = *bitmapPointer++; - *framebuffer++ = (greenFg * alpha + greenBg * alphaBg - greenBg * alphaMult) / alphaOut; - const uint8_t redBg = *framebuffer; - const uint8_t redFg = *bitmapPointer++; - *framebuffer++ = (redFg * alpha + redBg * alphaBg - redBg * alphaMult) / alphaOut; - *framebuffer++ = alphaOut; - } while (framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else - { - const uint16_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip; - const uint16_t* bitmapPointer = bitmapLineStart + widgetX; - if (bitmapExtraData == 0) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - do - { - const uint8_t alphaBg = framebuffer[3]; - const uint8_t alphaMult = LCD::div255(alpha * alphaBg); - const uint8_t alphaOut = alpha + alphaBg - alphaMult; - - const uint8_t blueBg = *framebuffer; - const uint8_t blueFg = Color::getBlueFromRGB565(*bitmapPointer); - *framebuffer++ = (blueFg * alpha + blueBg * alphaBg - blueBg * alphaMult) / alphaOut; - const uint8_t greenBg = *framebuffer; - const uint8_t greenFg = Color::getGreenFromRGB565(*bitmapPointer); - *framebuffer++ = (greenFg * alpha + greenBg * alphaBg - greenBg * alphaMult) / alphaOut; - const uint8_t redBg = *framebuffer; - const uint8_t redFg = Color::getRedFromRGB565(*bitmapPointer); - *framebuffer++ = (redFg * alpha + redBg * alphaBg - redBg * alphaMult) / alphaOut; - *framebuffer++ = alphaOut; - bitmapPointer++; - } while (framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else - { - const uint8_t* const alpha_linestart = bitmapExtraData + rowSkip; - const uint8_t* alphaPointer = alpha_linestart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - do - { - const uint8_t srcAlpha = *alphaPointer++; - const uint8_t alphaFg = LCD::div255(alpha * srcAlpha); - if (alphaFg) - { - const uint8_t alphaBg = framebuffer[3]; - const uint8_t alphaMult = LCD::div255(alphaFg * alphaBg); - const uint8_t alphaOut = alphaFg + alphaBg - alphaMult; - - const uint8_t blueBg = *framebuffer; - const uint8_t blueFg = Color::getBlueFromRGB565(*bitmapPointer); - *framebuffer++ = (blueFg * alphaFg + blueBg * alphaBg - blueBg * alphaMult) / alphaOut; - const uint8_t greenBg = *framebuffer; - const uint8_t greenFg = Color::getGreenFromRGB565(*bitmapPointer); - *framebuffer++ = (greenFg * alphaFg + greenBg * alphaBg - greenBg * alphaMult) / alphaOut; - const uint8_t redBg = *framebuffer; - const uint8_t redFg = Color::getRedFromRGB565(*bitmapPointer); - *framebuffer++ = (redFg * alphaFg + redBg * alphaBg - redBg * alphaMult) / alphaOut; - *framebuffer++ = alphaOut; - } - else - { - framebuffer += 4; - } - bitmapPointer++; - } while (framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - alphaPointer = alpha_linestart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp deleted file mode 100644 index 9e2371c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterARGB8888L8Bitmap.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterARGB8888L8Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::L8) && "PainterARGB8888L8Bitmap only works with L8 bitmaps"); - if (bitmap.getId() != BITMAP_INVALID) - { - bitmapCLUT = bitmap.getExtraData(); - assert(bitmapData && bitmapCLUT && "The bitmap does not have any data or any CLUT"); - l8format = static_cast(*reinterpret_cast(bitmapCLUT)); - assert((l8format == Bitmap::CLUT_FORMAT_L8_RGB565 || l8format == Bitmap::CLUT_FORMAT_L8_ARGB8888 || l8format == Bitmap::CLUT_FORMAT_L8_RGB888) && "The palette is not in the right format"); - bitmapCLUT += 4; // Skip header - } -} - -void PainterARGB8888L8Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset * 4; - const uint8_t* const lineEnd = framebuffer + count * 4; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (l8format == Bitmap::CLUT_FORMAT_L8_RGB565) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - if (alpha == 0xFF) - { - do - { - const uint16_t srcpix = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - *framebuffer++ = Color::getBlueFromRGB565(srcpix); - *framebuffer++ = Color::getGreenFromRGB565(srcpix); - *framebuffer++ = Color::getRedFromRGB565(srcpix); - *framebuffer++ = 0xFF; - } while (framebuffer < chunkend); - } - else - { - do - { - const uint16_t srcpix = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - const uint8_t ialpha = 0xFF - alpha; - *framebuffer = LCD::div255(Color::getBlueFromRGB565(srcpix) * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(Color::getGreenFromRGB565(srcpix) * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(Color::getRedFromRGB565(srcpix) * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = *framebuffer + alpha - LCD::div255(*framebuffer * alpha); - framebuffer++; - } while (framebuffer < chunkend); - } - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else if (l8format == Bitmap::CLUT_FORMAT_L8_RGB888) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - if (alpha == 0xFF) - { - do - { - const uint8_t* src = bitmapCLUT + *bitmapPointer++ * 3; - *framebuffer++ = *src++; - *framebuffer++ = *src++; - *framebuffer++ = *src; - *framebuffer++ = 0xFF; - } while (framebuffer < chunkend); - } - else - { - do - { - const uint8_t* src = bitmapCLUT + *bitmapPointer++ * 3; - const uint8_t ialpha = 0xFF - alpha; - *framebuffer = LCD::div255(*src++ * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(*src++ * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(*src * alpha + *framebuffer * ialpha); - framebuffer++; - *framebuffer = *framebuffer + alpha - LCD::div255(*framebuffer * alpha); - framebuffer++; - } while (framebuffer < chunkend); - } - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else // if (l8format == Bitmap::CLUT_FORMAT_L8_ARGB8888) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length * 4; - count -= length; - do - { - uint32_t src = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - const uint8_t srcAlpha = src >> 24; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer++ = src; // Blue - *framebuffer++ = src >> 8; // Green - *framebuffer++ = src >> 16; // Red - *framebuffer++ = 0xFF; // Alpha - } - else - { - const uint8_t ialpha = 0xFF - a; - *framebuffer = LCD::div255((src & 0xFF) * a + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(((src >> 8) & 0xFF) * a + *framebuffer * ialpha); - framebuffer++; - *framebuffer = LCD::div255(((src >> 16) & 0xFF) * a + *framebuffer * ialpha); - framebuffer++; - *framebuffer = *framebuffer + a - LCD::div255(*framebuffer * a); - framebuffer++; - } - } while (framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp deleted file mode 100644 index 1a1e9eb..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void PainterBGRA2222::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - - if (alpha == 0xFF) - { - do - { - *framebuffer = color8; - } while (++framebuffer < lineEnd); - } - else - { - do - { - *framebuffer = alphaBlend(painterRed, painterGreen, painterBlue, *framebuffer, alpha); - } while (++framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp deleted file mode 100644 index f004c24..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBGRA2222Bitmap.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterBGRA2222Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::BGRA2222) && "PainterBGRA2222Bitmap only works with BGRA2222 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -void PainterBGRA2222Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t bgra = *bitmapPointer++; - const uint8_t srcAlpha = (bgra & 0x03) * 0x55; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = bgra; - } - else if (a) - { - *framebuffer = alphaBlend(bgra, *framebuffer, a); - } - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp deleted file mode 100644 index fa99f42..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBW.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void PainterBW::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint8_t* RESTRICT framebuffer = destination + (offset / 8); - - if (alpha >= 0x80) - { - do - { - unsigned pixel = 1 << (7 - (offset % 8)); - if (painterBW) - { - *framebuffer |= pixel; - } - else - { - *framebuffer &= ~pixel; - } - if (((++offset) % 8) == 0) - { - framebuffer++; - } - } while (--count); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp deleted file mode 100644 index 1b91e2f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterBWBitmap.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -void PainterBWBitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::BW || bitmapFormat == Bitmap::BW_RLE) && "PainterBWBitmap only works with BW and BW_RLE bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -// Found in LCD1bpp -void fillBits(uint8_t* fb, int16_t startX, int16_t startY, int16_t stride, int32_t count, uint8_t color); - -void PainterBWBitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t /*alpha*/) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (bitmapFormat == Bitmap::BW_RLE) - { - const uint32_t rowSkip = widgetY * bitmapRect.width; - LCD1bpp::bwRLEdata bw_rle(bitmapData); - bw_rle.skipNext(widgetX + rowSkip); - do - { - unsigned int length = MIN(bitmapAvailable, count); - count -= length; - do - { - uint32_t bw_length = bw_rle.getLength(); - uint32_t bitsToDraw = MIN(bw_length, length); - - fillBits(destination, offset, 0, 0 /* not used */, bitsToDraw, bw_rle.getColor()); - offset += bitsToDraw; - length -= bitsToDraw; - bw_rle.skipNext(bitsToDraw); - } while (length); - bw_rle.init(bitmapData); - bw_rle.skipNext(rowSkip); - bitmapAvailable = bitmapRect.width; - } while (count); - } - else - { - const int32_t rowSkip = widgetY * ((bitmapRect.width + 7) / 8); - const uint8_t* bitmapPointer = bitmapData + rowSkip; - do - { - const int16_t length = MIN(bitmapAvailable, count); - - const uint8_t* src = bitmapPointer + widgetX / 8; - uint8_t* RESTRICT dst = destination + (offset / 8); - uint16_t srcBitX = widgetX % 8; // & 7 - uint16_t dstBitX = offset % 8; // & 7 - - uint16_t remainingBits = length; - - if (dstBitX > 0) - { - // Start by getting (dst-)aligned for faster transfer - uint16_t neededBits = 8 - dstBitX; - if (neededBits > remainingBits) - { - neededBits = remainingBits; // Very narrow src inside same word - } - const uint16_t bitmapAvailableBits = 8 - srcBitX; - uint8_t mask = (1u << neededBits) - 1u; - const uint8_t dstShift = static_cast(8u - (dstBitX + neededBits)); - mask <<= dstShift; - - uint8_t word = *src; - - if (bitmapAvailableBits > neededBits) - { - word >>= bitmapAvailableBits - neededBits; - } - else if (bitmapAvailableBits < neededBits) - { - // Get the last required bits from src[1] - word <<= neededBits - bitmapAvailableBits; - word |= src[1] >> (8u - (neededBits - bitmapAvailableBits)); - } - - word <<= dstShift; - *dst = (*dst & ~mask) | (word & mask); - - srcBitX = (srcBitX + neededBits) % 8; // & 7 - - if (bitmapAvailableBits <= neededBits) - { - src++; - } - dst++; - remainingBits -= neededBits; - } - - // dstX is now word aligned (or we have transferred everything of a narrow image and remainingBits==0) - if (remainingBits >= 8) - { - uint16_t bytesPerLine = remainingBits / 8; - if (srcBitX == 0) - { - HAL::getInstance()->blockCopy(dst, src, bytesPerLine); - src += bytesPerLine; - dst += bytesPerLine; - } - else - { - uint16_t _remainingBits = remainingBits; - - remainingBits = _remainingBits; - while (remainingBits >= 8) - { - uint8_t word = *src++; - word <<= srcBitX; - word |= (*src) >> (8 - srcBitX); - *dst++ = word; - remainingBits -= 8; - } - } - remainingBits %= 8; // &= 7 - } - - // Take the last bits, again we need to mask dst - if (remainingBits > 0) - { - uint8_t word = *src; - if (srcBitX != 0) - { - word <<= srcBitX; - word |= src[1] >> (8u - srcBitX); - } - const uint8_t mask = ((1u << remainingBits) - 1u) << (8u - remainingBits); - *dst = (*dst & ~mask) | (word & mask); - } - - offset += length; - count -= length; - widgetX = 0; - bitmapAvailable = bitmapRect.width; - } while (count); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp deleted file mode 100644 index 128ff14..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void PainterGRAY2::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - if (alpha == 0xFF) - { - do - { - LCD2bpp::setPixel(destination, offset, painterGray); - offset++; - } while (--count != 0); - } - else - { - do - { - const uint8_t framebufferGray = LCD2bpp::getPixel(destination, offset); - LCD2bpp::setPixel(destination, offset, LCD::div255((painterGray * alpha + framebufferGray * (0xFF - alpha)) * 0x55) >> 6); - offset++; - } while (--count != 0); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp deleted file mode 100644 index a717a36..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY2Bitmap.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterGRAY2Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::GRAY2) && "PainterGRAY2Bitmap only works with GRAY2 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); - bitmapExtraData = bitmap.getExtraData(); -} - -void PainterGRAY2Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - const int32_t rowSkip = widgetY * ((bitmapRect.width + 3) / 4); - const uint8_t* bitmapPointer = bitmapData + rowSkip; - if (bitmapExtraData) - { - const uint8_t* alphaPointer = bitmapExtraData + rowSkip; - do - { - const uint8_t bitmapGray = LCD2bpp::getPixel(bitmapPointer, widgetX); - const uint8_t a = LCD::div255(alpha * (LCD2bpp::getPixel(alphaPointer, widgetX) * 0x55)); - - if (a == 0xFF) - { - LCD2bpp::setPixel(destination, offset, bitmapGray); - } - else - { - const uint8_t framebufferGray = LCD2bpp::getPixel(destination, offset); - LCD2bpp::setPixel(destination, offset, LCD::div255((bitmapGray * a + framebufferGray * (0xFF - a)) * 0x55) >> 6); - } - widgetX++; - widgetX %= bitmapRect.width; - offset++; - } while (--count != 0); - } - else if (alpha == 0xFF) - { - do - { - const uint8_t bitmapGray = LCD2bpp::getPixel(bitmapPointer, widgetX); - LCD2bpp::setPixel(destination, offset, bitmapGray); - widgetX++; - widgetX %= bitmapRect.width; - offset++; - } while (--count != 0); - } - else - { - do - { - const uint8_t bitmapGray = LCD2bpp::getPixel(bitmapPointer, widgetX); - const uint8_t framebufferGray = LCD2bpp::getPixel(destination, offset); - LCD2bpp::setPixel(destination, offset, LCD::div255((bitmapGray * alpha + framebufferGray * (0xFF - alpha)) * 0x55) >> 6); - widgetX++; - widgetX %= bitmapRect.width; - offset++; - } while (--count != 0); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp deleted file mode 100644 index e3a7bb4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void PainterGRAY4::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - if (alpha == 0xFF) - { - do - { - LCD4bpp::setPixel(destination, offset, painterGray); - offset++; - } while (--count != 0); - } - else - { - do - { - const uint8_t framebufferGray = LCD4bpp::getPixel(destination, offset); - LCD4bpp::setPixel(destination, offset, LCD::div255((painterGray * alpha + framebufferGray * (0xFF - alpha)) * 0x11) >> 4); - offset++; - } while (--count != 0); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp deleted file mode 100644 index f654eb7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterGRAY4Bitmap.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterGRAY4Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::GRAY4) && "PainterGRAY4Bitmap only works with GRAY4 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); - bitmapExtraData = bitmap.getExtraData(); -} - -void PainterGRAY4Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - const int32_t rowSkip = widgetY * ((bitmapRect.width + 1) / 2); - const uint8_t* bitmapPointer = bitmapData + rowSkip; - if (bitmapExtraData) - { - const uint8_t* alphaPointer = bitmapExtraData + rowSkip; - do - { - const uint8_t bitmapGray = LCD4bpp::getPixel(bitmapPointer, widgetX); - const uint8_t a = LCD::div255(alpha * (LCD4bpp::getPixel(alphaPointer, widgetX) * 0x11)); - if (a == 0xFF) - { - LCD4bpp::setPixel(destination, offset, bitmapGray); - } - else - { - const uint8_t framebufferGray = LCD4bpp::getPixel(destination, offset); - LCD4bpp::setPixel(destination, offset, LCD::div255((bitmapGray * a + framebufferGray * (0xFF - a)) * 0x11) >> 4); - } - widgetX++; - widgetX %= bitmapRect.width; - offset++; - } while (--count != 0); - } - else if (alpha == 0xFF) - { - do - { - const uint8_t bitmapGray = LCD4bpp::getPixel(bitmapPointer, widgetX); - LCD4bpp::setPixel(destination, offset, bitmapGray); - widgetX++; - widgetX %= bitmapRect.width; - offset++; - } while (--count != 0); - } - else - { - do - { - const uint8_t bitmapGray = LCD4bpp::getPixel(bitmapPointer, widgetX); - const uint8_t framebufferGray = LCD4bpp::getPixel(destination, offset); - LCD4bpp::setPixel(destination, offset, LCD::div255((bitmapGray * alpha + framebufferGray * (0xFF - alpha)) * 0x11) >> 4); - widgetX++; - widgetX %= bitmapRect.width; - offset++; - } while (--count != 0); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp deleted file mode 100644 index 2eaaaee..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void PainterRGB565::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint16_t* const framebuffer = reinterpret_cast(destination) + offset; - paint::rgb565::lineFromColor(framebuffer, count, painterColor, alpha, color565); -} - -void PainterRGB565::tearDown() const -{ - paint::tearDown(); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp deleted file mode 100644 index 0cb9be4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565Bitmap.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterRGB565Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::RGB565 || bitmapFormat == Bitmap::ARGB8888) && "PainterRGB565Bitmap only works with RGB565 and ARGB8888 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); - bitmapExtraData = bitmap.getExtraData(); -} - -void PainterRGB565Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint16_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; - const uint16_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (bitmapFormat == Bitmap::RGB565) - { - const uint16_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip; - const uint16_t* bitmapPointer = bitmapLineStart + widgetX; - if (bitmapExtraData) - { - const uint8_t* const alpha_linestart = bitmapExtraData + rowSkip; - const uint8_t* alphaPointer = alpha_linestart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint16_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t a = LCD::div255(alpha * (*alphaPointer++)); - if (a == 0xFF) - { - *framebuffer = *bitmapPointer; - } - else if (a) - { - *framebuffer = alphaBlend(*bitmapPointer, *framebuffer, a); - } - bitmapPointer++; - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - alphaPointer = alpha_linestart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - - // Call external (DMA) painter function - paint::rgb565::lineFromRGB565(framebuffer, bitmapPointer, length, alpha); - - framebuffer += length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - } - else // if (bitmapFormat == Bitmap::ARGB8888) - { - const uint32_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip; - const uint32_t* bitmapPointer = bitmapLineStart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - - //Call external (DMA) painter function - paint::rgb565::lineFromARGB8888(framebuffer, bitmapPointer, length, alpha); - - framebuffer += length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} - -void PainterRGB565Bitmap::tearDown() const -{ - paint::tearDown(); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp deleted file mode 100644 index 44e2fa9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565L8Bitmap.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterRGB565L8Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::L8) && "PainterRGB565L8Bitmap only works with appropriate L8 bitmaps"); - if (bitmap.getId() != BITMAP_INVALID) - { - bitmapCLUT = bitmap.getExtraData(); - assert(bitmapData && bitmapCLUT && "The bitmap does not have any data or any CLUT"); - l8format = static_cast(*reinterpret_cast(bitmapCLUT)); - assert((l8format == Bitmap::CLUT_FORMAT_L8_RGB565 || l8format == Bitmap::CLUT_FORMAT_L8_ARGB8888 || l8format == Bitmap::CLUT_FORMAT_L8_RGB888) && "The palette is not in the right format"); - bitmapCLUT += 4; // Skip header - } -} - -void PainterRGB565L8Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint16_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; - const uint16_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - // Max number of pixels before we reach end of bitmap row - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (l8format == Bitmap::CLUT_FORMAT_L8_RGB565) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint16_t* const chunkend = framebuffer + length; - count -= length; - if (alpha == 0xFF) - { - do - { - *framebuffer = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - } while (++framebuffer < chunkend); - } - else - { - do - { - *framebuffer = alphaBlend(reinterpret_cast(bitmapCLUT)[*bitmapPointer++], *framebuffer, alpha); - } while (++framebuffer < chunkend); - } - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else if (l8format == Bitmap::CLUT_FORMAT_L8_RGB888) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - paint::rgb565::lineFromL8RGB888(framebuffer, bitmapPointer, length, alpha); - framebuffer += length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else // Bitmap::CLUT_FORMAT_L8_ARGB8888 - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - paint::rgb565::lineFromL8ARGB8888(framebuffer, bitmapPointer, length, alpha); - framebuffer += length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} - -bool PainterRGB565L8Bitmap::setup(const Rect& widgetRect) const -{ - if (!AbstractPainterRGB565::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - if (bitmap.getId() != BITMAP_INVALID) - { - paint::setL8Pallette(bitmapCLUT); - return true; - } - return false; -} - -void PainterRGB565L8Bitmap::tearDown() const -{ - paint::tearDown(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp deleted file mode 100644 index 1f62005..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB565LinearGradient.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -const uint16_t RMASK = 0xF800; // Mask for red (1111100000000000) -const uint16_t GMASK = 0x07E0; // Mask for green (0000011111100000) -const uint16_t BMASK = 0x001F; // Mask for blue (0000000000011111) - -FORCE_INLINE_FUNCTION static uint16_t getNativeColor(colortype color) -{ - return ((color >> 8) & 0xF800) | ((color >> 5) & 0x07E0) | ((color >> 3) & 0x001F); -} - -FORCE_INLINE_FUNCTION static uint16_t getNativeColorFromRGB(uint8_t red, uint8_t green, uint8_t blue) -{ - return ((red << 8) & 0xF800) | ((green << 3) & 0x07E0) | ((blue >> 3) & 0x001F); -} - -FORCE_INLINE_FUNCTION static uint16_t alphaBlend(uint16_t R, uint16_t G, uint16_t B, uint16_t bufpix, uint8_t alpha) -{ - const uint8_t ialpha = 0xFF - alpha; - return (((R * alpha + (bufpix & RMASK) * ialpha) / 255) & RMASK) | - (((G * alpha + (bufpix & GMASK) * ialpha) / 255) & GMASK) | - (((B * alpha + (bufpix & BMASK) * ialpha) / 255) & BMASK); -} - -static uint16_t random(int x, int y) -{ - const long long int a = 15485863LL * (static_cast(x) * static_cast(y)); - return (a * a * a % 2038074743LL) & 0xFFFF; -} - -static uint16_t applyNoise(int x, int y, uint8_t r, uint8_t g, uint8_t b) -{ - const uint16_t rounding = random(x, y); - if (r < 0xF8) - { - r += rounding & 7; - } - if (g < 0xFC) - { - g += (rounding >> 3) & 3; - } - if (b < 0xF8) - { - b += (rounding >> 5) & 7; - } - return getNativeColorFromRGB(r, g, b); -} - -void PainterRGB565LinearGradient::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - uint16_t* p = reinterpret_cast(destination) + offset; - - if (isVertical) - { - // The whole line is the same color - uint32_t color; - bool noise = false; - if (widgetY <= coord0) - { - color = texture[deltaColor > 0 ? 0 : 1023]; - } - else if (widgetY >= coord1) - { - color = texture[deltaColor > 0 ? 1023 : 0]; - } - else - { - const int32_t colorOffset = (int)((widgetY - coord0) * deltaColor); - color = texture[deltaColor > 0 ? colorOffset : 1023 + colorOffset]; - noise = true; - } - - const uint16_t color565 = getNativeColor(color); - uint16_t* const p_end = p + count; - - if (isSolid && (alpha == 255)) - { - if (noise) - { - const uint8_t b = color & 0xFF; - const uint8_t g = (color >> 8) & 0xFF; - const uint8_t r = (color >> 16) & 0xFF; - int x = widgetX; - while (p < p_end) - { - *p++ = applyNoise(x, widgetY, r, g, b); - x++; - } - } - else - { - while (p < p_end) - { - *p++ = color565; - } - } - } - else - { - const uint8_t a = (color >> 24) & 0xFF; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint16_t r = (color >> 8) & RMASK; - const uint16_t g = (color >> 5) & GMASK; - const uint16_t b = (color >> 3) & BMASK; - while (p < p_end) - { - *p = alphaBlend(r, g, b, *p, alphaTot); - p++; - }; - } - return; - } - - //vx0 is where first color line (y=clSlope*x+clOffset) intersects the horizontal line y=widgetY - float vx0; - if (isHorizontal) - { - vx0 = coord0; - } - else - { - vx0 = (widgetY - clOffset) / clSlope; - if (deltaColor < 0.0f) - { - vx0 -= horizontalDistance; - } - } - - int x = widgetX; - - // Left of gradient - // All pixels up to first gradient line, paint using fixed color - if (x <= vx0) // All pixels up to first gradient line - { - // Starting before gradient - int pixels = (int)(MIN(vx0 + 1 - x, count)); - // Start in correct end of palette depending on direction - const uint32_t colorStart = texture[deltaColor > 0 ? 0 : 1023]; - uint16_t* const p_end = p + pixels; - if (isSolid && (alpha == 255)) - { - const uint16_t color565 = getNativeColor(colorStart); - while (p < p_end) - { - *p++ = color565; - } - } - else - { - const uint8_t a = (colorStart >> 24) & 0xFF; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint16_t r = (colorStart >> 8) & RMASK; - const uint16_t g = (colorStart >> 5) & GMASK; - const uint16_t b = (colorStart >> 3) & BMASK; - while (p < p_end) - { - *p = alphaBlend(r, g, b, *p, alphaTot); - p++; - }; - } - x += pixels; - } - - const int16_t right = widgetX + count; - if (x < right) // More to draw - { - //vx1 is where y=widgetY intersects the last color line (fixed distance from vx0) - const float vx1 = vx0 + horizontalDistance; - - if (x < vx1) // Draw gradient part until last color line - { - const int endx = (int)(MIN(right, vx1)); - const uint16_t* const p_end = p + (endx - x); - - // Start with first or last color depending on direction - float colorF = deltaColor > 0 ? 0.0000f : 1023.9999f; - colorF += (x - vx0) * deltaColor; - - if (isSolid && (alpha == 255)) - { - while (p < p_end) - { - const int colorIndex = (int)colorF; - const uint32_t color = texture[colorIndex]; - const uint8_t b = color & 0xFF; - const uint8_t g = (color >> 8) & 0xFF; - const uint8_t r = (color >> 16) & 0xFF; - *p++ = applyNoise(colorIndex, widgetY, r, g, b); - colorF += deltaColor; - } - } - else - { - while (p < p_end) - { - const int colorIndex = (int)colorF; - - const uint32_t color = texture[colorIndex]; - const uint8_t a = color >> 24; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint16_t r = (color >> 8) & RMASK; - const uint16_t g = (color >> 5) & GMASK; - const uint16_t b = (color >> 3) & BMASK; - *p = alphaBlend(r, g, b, *p, alphaTot); - p++; - colorF += deltaColor; - } - } - x = endx; - } - - if (x < right) // Second fixed color part - { - const uint16_t* const p_end = p + (right - x); - const uint32_t colorEnd = texture[deltaColor > 0 ? 1023 : 0]; - const uint16_t color565 = getNativeColor(colorEnd); - if (isSolid && (alpha == 255)) - { - while (p < p_end) - { - *p++ = color565; - } - } - else - { - const uint8_t a = (colorEnd >> 24) & 0xFF; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint16_t r = (colorEnd >> 8) & RMASK; - const uint16_t g = (colorEnd >> 5) & GMASK; - const uint16_t b = (colorEnd >> 3) & BMASK; - while (p < p_end) - { - *p = alphaBlend(r, g, b, *p, alphaTot); - p++; - }; - } - } - } -} - -void PainterRGB565LinearGradient::tearDown() const -{ -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp deleted file mode 100644 index 964859e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ -void PainterRGB888::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint8_t* RESTRICT framebuffer = destination + offset * 3; - paint::rgb888::lineFromColor(framebuffer, count, painterColor, alpha); -} - -void PainterRGB888::tearDown() const -{ - paint::tearDown(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp deleted file mode 100644 index e1771b6..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888Bitmap.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterRGB888Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::RGB888 || bitmapFormat == Bitmap::ARGB8888) && "PainterRGB888Bitmap only works with RGB888 and ARGB8888 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -void PainterRGB888Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset * 3; - const uint8_t* const lineEnd = framebuffer + count * 3; - const int32_t rowSkip = widgetY * bitmapRect.width; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (bitmapFormat == Bitmap::RGB888) - { - const uint8_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip * 3; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX * 3; - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - paint::rgb888::lineFromRGB888(framebuffer, bitmapPointer, length, alpha); - framebuffer += length * 3; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else // if (bitmapFormat == Bitmap::ARGB8888) - { - const uint32_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip; - const uint32_t* bitmapPointer = bitmapLineStart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - paint::rgb888::lineFromARGB8888(framebuffer, bitmapPointer, length, alpha); - framebuffer += 3 * length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} - -void PainterRGB888Bitmap::tearDown() const -{ - paint::tearDown(); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp deleted file mode 100644 index cf2f274..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888L8Bitmap.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterRGB888L8Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::L8) && "PainterRGB888L8Bitmap only works with appropriate L8 bitmaps"); - if (bitmap.getId() != BITMAP_INVALID) - { - bitmapCLUT = bitmap.getExtraData(); - assert(bitmapData && bitmapCLUT && "The bitmap does not have any data or any CLUT"); - l8format = static_cast(*reinterpret_cast(bitmapCLUT)); - assert((l8format == Bitmap::CLUT_FORMAT_L8_RGB565 || l8format == Bitmap::CLUT_FORMAT_L8_ARGB8888 || l8format == Bitmap::CLUT_FORMAT_L8_RGB888) && "The palette is not in the right format"); - bitmapCLUT += 4; // Skip header - } -} - -void PainterRGB888L8Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset * 3; - const uint8_t* const lineEnd = framebuffer + count * 3; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (l8format == Bitmap::CLUT_FORMAT_L8_RGB888) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - paint::rgb888::lineFromL8RGB888(framebuffer, bitmapPointer, length, alpha); - framebuffer += 3 * length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else // Bitmap::CLUT_FORMAT_L8_ARGB8888 - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - count -= length; - paint::rgb888::lineFromL8ARGB8888(framebuffer, bitmapPointer, length, alpha); - framebuffer += 3 * length; - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} - -bool PainterRGB888L8Bitmap::setup(const Rect& widgetRect) const -{ - if (!AbstractPainterRGB888::setup(widgetRect)) - { - return false; - } - updateBitmapOffsets(widgetWidth); - if (bitmap.getId() != BITMAP_INVALID) - { - paint::setL8Pallette(bitmapCLUT); - return true; - } - return false; -} - -void PainterRGB888L8Bitmap::tearDown() const -{ - paint::tearDown(); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp deleted file mode 100644 index 10fd50a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGB888LinearGradient.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void PainterRGB888LinearGradient::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - uint8_t* p = destination + offset * 3; - - if (isVertical) - { - // The whole line is the same color - uint32_t color; - if (widgetY <= coord0) - { - color = texture[deltaColor > 0 ? 0 : 1023]; - } - else if (widgetY >= coord1) - { - color = texture[deltaColor > 0 ? 1023 : 0]; - } - else - { - const int32_t colorOffset = (int)((widgetY - coord0) * deltaColor); - color = texture[deltaColor > 0 ? colorOffset : 1023 + colorOffset]; - } - - const uint8_t b = color & 0xFF; - const uint8_t g = (color >> 8) & 0xFF; - const uint8_t r = (color >> 16) & 0xFF; - uint8_t* const p_end = p + count * 3; - - if (isSolid && (alpha == 255)) - { - while (p < p_end) - { - *p++ = b; - *p++ = g; - *p++ = r; - } - } - else - { - const uint8_t a = (color >> 24) & 0xFF; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint8_t ialpha = 0xFF - alphaTot; - while (p < p_end) - { - uint8_t pByte = *p; - *p++ = LCD::div255(b * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(g * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(r * alphaTot + pByte * ialpha); - }; - } - return; - } - - //vx0 is where first color line (y=clSlope*x+clOffset) intersects the horizontal line y=widgetY - float vx0; - if (isHorizontal) - { - vx0 = coord0; - } - else - { - vx0 = (widgetY - clOffset) / clSlope; - if (deltaColor < 0.0f) - { - vx0 -= horizontalDistance; - } - } - - int x = widgetX; - - // Left of gradient - // All pixels up to first gradient line, paint using fixed color - if (x <= vx0) - { - // Starting before gradient - int pixels = (int)(MIN(vx0 + 1 - x, count)); - // Start in correct end of palette depending on direction - const uint32_t colorStart = texture[deltaColor > 0 ? 0 : 1023]; - uint8_t* const p_end = p + pixels * 3; - const uint8_t b = colorStart & 0xFF; - const uint8_t g = (colorStart >> 8) & 0xFF; - const uint8_t r = (colorStart >> 16) & 0xFF; - if (isSolid && (alpha == 255)) - { - while (p < p_end) - { - *p++ = b; - *p++ = g; - *p++ = r; - } - } - else - { - const uint8_t a = (colorStart >> 24) & 0xFF; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint8_t ialpha = 0xFF - alphaTot; - while (p < p_end) - { - uint8_t pByte = *p; - *p++ = LCD::div255(b * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(g * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(r * alphaTot + pByte * ialpha); - }; - } - x += pixels; - } - - const int16_t right = widgetX + count; - if (x < right) // More to draw - { - //vx1 is where y=widgetY intersects the last color line (fixed distance from vx0) - const float vx1 = vx0 + horizontalDistance; - - if (x < vx1) // Draw gradient part until last color line - { - const int endx = (int)(MIN(right, vx1)); - const uint8_t* const p_end = p + (endx - x) * 3; - - // Start with first or last color depending on direction - float colorF = deltaColor > 0 ? 0.0000f : 1023.9999f; - colorF += (x - vx0) * deltaColor; - - if (isSolid && (alpha == 255)) - { - while (p < p_end) - { - const int colorIndex = (int)colorF; - const uint8_t* color = (const uint8_t*)(texture + colorIndex); - *p++ = *color++; - *p++ = *color++; - *p++ = *color; - colorF += deltaColor; - } - } - else - { - // Go to 8-bit pointers - const uint8_t* const gradient = (const uint8_t*)texture; - while (p < p_end) - { - const int colorIndex = (int)colorF; - - const uint8_t* color = gradient + colorIndex * 4; - const uint8_t a = color[3]; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint8_t ialpha = 0xFF - alphaTot; - - uint8_t pByte = *p; - *p++ = LCD::div255(*color++ * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(*color++ * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(*color++ * alphaTot + pByte * ialpha); - - colorF += deltaColor; - } - } - x = endx; - } - - if (x < right) // Second fixed color part - { - const uint8_t* const p_end = p + (right - x) * 3; - const uint32_t colorEnd = texture[deltaColor > 0 ? 1023 : 0]; - const uint8_t b = colorEnd & 0xFF; - const uint8_t g = (colorEnd >> 8) & 0xFF; - const uint8_t r = (colorEnd >> 16) & 0xFF; - if (isSolid && (alpha == 255)) - { - while (p < p_end) - { - *p++ = b; - *p++ = g; - *p++ = r; - } - } - else - { - const uint8_t a = (colorEnd >> 24) & 0xFF; - const uint8_t alphaTot = LCD::div255(a * alpha); - const uint8_t ialpha = 0xFF - alphaTot; - while (p < p_end) - { - uint8_t pByte = *p; - *p++ = LCD::div255(b * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(g * alphaTot + pByte * ialpha); - pByte = *p; - *p++ = LCD::div255(r * alphaTot + pByte * ialpha); - }; - } - } - } -} - -void PainterRGB888LinearGradient::tearDown() const -{ -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp deleted file mode 100644 index b4eb0f9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ -void PainterRGBA2222::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - - if (alpha == 0xFF) - { - do - { - *framebuffer = color8; - } while (++framebuffer < lineEnd); - } - else - { - do - { - *framebuffer = alphaBlend(painterRed, painterGreen, painterBlue, *framebuffer, alpha); - } while (++framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp deleted file mode 100644 index 4cb2508..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterRGBA2222Bitmap.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterRGBA2222Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::RGBA2222) && "PainterRGBA2222Bitmap only works with RGBA2222 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -void PainterRGBA2222Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint8_t* RESTRICT framebuffer = destination + offset; - const uint8_t* const lineEnd = framebuffer + count; - const int rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint8_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t rgba = *bitmapPointer++; - const uint8_t srcAlpha = (rgba & 0x03) * 0x55; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = rgba; - } - else if (a) - { - *framebuffer = alphaBlend(rgba, *framebuffer, a); - } - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp deleted file mode 100644 index 55fd08e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include - -namespace touchgfx -{ -void PainterXRGB8888::paint(uint8_t* destination, int16_t offset, int16_t /*widgetX*/, int16_t /*widgetY*/, int16_t count, uint8_t alpha) const -{ - uint32_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; - const uint32_t* const lineEnd = framebuffer + count; - - if (alpha == 0xFF) - { - do - { - *framebuffer = painterColor; - } while (++framebuffer < lineEnd); - } - else - { - do - { - const uint8_t ialpha = 0xFF - alpha; - const uint32_t rgbBg = *framebuffer; - *framebuffer = (LCD::div255(painterBlue * alpha + (rgbBg & 0xFF) * ialpha)) | - (LCD::div255(painterGreen * alpha + ((rgbBg >> 8) & 0xFF) * ialpha) << 8) | - (LCD::div255(painterRed * alpha + ((rgbBg >> 16) & 0xFF) * ialpha) << 16); - } while (++framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp deleted file mode 100644 index ec5ec67..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888Bitmap.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterXRGB8888Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmapFormat == Bitmap::RGB565 || bitmapFormat == Bitmap::RGB888 || bitmapFormat == Bitmap::ARGB8888) && !bitmap.getExtraData() && "PainterXRGB8888Bitmap only works with RGB565 (without alpha), RGB888 and ARGB8888 bitmaps"); - assert(bitmap.getId() == BITMAP_INVALID || bitmapData); -} - -void PainterXRGB8888Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint32_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; - const uint32_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (bitmapFormat == Bitmap::ARGB8888) - { - const uint32_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip; - const uint32_t* bitmapPointer = bitmapLineStart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t srcAlpha = (*bitmapPointer) >> 24; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = *bitmapPointer; - } - else - { - *framebuffer = LCD32bpp_XRGB8888::blendRgb888withXrgb8888(reinterpret_cast(bitmapPointer), *framebuffer, a, 0xFF - a); - } - bitmapPointer++; - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else if (bitmapFormat == Bitmap::RGB888) - { - const uint8_t* const bitmapLineStart = reinterpret_cast(bitmapData) + rowSkip * 3; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX * 3; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - if (alpha == 0xFF) - { - do - { - *framebuffer = LCD32bpp_XRGB8888::rgb888toXrgb8888(bitmapPointer); - bitmapPointer += 3; - } while (++framebuffer < chunkend); - } - else - { - do - { - *framebuffer = LCD32bpp_XRGB8888::blendRgb888withXrgb8888(bitmapPointer, *framebuffer, alpha, 0xFF - alpha); - bitmapPointer += 3; - } while (++framebuffer < chunkend); - } - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else // if (bitmapFormat == Bitmap::RGB565) - { - const uint16_t* const bitmapLineStart = reinterpret_cast(bitmapData) + (widgetY * bitmapRect.width); - const uint16_t* bitmapPointer = bitmapLineStart + widgetX; - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - if (alpha == 0xFF) - { - do - { - *framebuffer = Color::rgb565toXrgb8888(*bitmapPointer++); - } while (++framebuffer < chunkend); - } - else - { - do - { - *framebuffer = LCD32bpp_XRGB8888::blendRgb565withXrgb8888(*bitmapPointer++, *framebuffer, alpha, 0xFF - alpha); - } while (++framebuffer < chunkend); - } - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp deleted file mode 100644 index f1a0fec..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/canvas/PainterXRGB8888L8Bitmap.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -void PainterXRGB8888L8Bitmap::setBitmap(const Bitmap& bmp) -{ - AbstractPainterBitmap::setBitmap(bmp); - assert((bitmap.getId() == BITMAP_INVALID || bitmap.getFormat() == Bitmap::L8) && "PainterXRGB8888L8Bitmap only works with L8 bitmaps"); - if (bitmap.getId() != BITMAP_INVALID) - { - bitmapCLUT = bitmap.getExtraData(); - assert(bitmapData && bitmapCLUT && "The bitmap does not have any data or any CLUT"); - l8format = static_cast(*reinterpret_cast(bitmapCLUT)); - assert((l8format == Bitmap::CLUT_FORMAT_L8_RGB565 || l8format == Bitmap::CLUT_FORMAT_L8_ARGB8888 || l8format == Bitmap::CLUT_FORMAT_L8_RGB888) && "The palette is not in the right format"); - bitmapCLUT += 4; // Skip header - } -} - -void PainterXRGB8888L8Bitmap::paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const -{ - if (!adjustBitmapXY(widgetX, widgetY, offset, count)) - { - return; - } - - uint32_t* RESTRICT framebuffer = reinterpret_cast(destination) + offset; - const uint32_t* const lineEnd = framebuffer + count; - const int32_t rowSkip = widgetY * bitmapRect.width; - const uint8_t* const bitmapLineStart = bitmapData + rowSkip; - const uint8_t* bitmapPointer = bitmapLineStart + widgetX; - int16_t bitmapAvailable = bitmapRect.width - widgetX; - if (l8format == Bitmap::CLUT_FORMAT_L8_RGB565) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - if (alpha == 0xFF) - { - do - { - const uint16_t srcpix = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - *framebuffer = Color::rgb565toXrgb8888(srcpix); - } while (++framebuffer < chunkend); - } - else - { - do - { - const uint16_t srcpix = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - *framebuffer = LCD32bpp_XRGB8888::blendRgb565withXrgb8888(srcpix, *framebuffer, alpha, 0xFF - alpha); - } while (++framebuffer < chunkend); - } - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else if (l8format == Bitmap::CLUT_FORMAT_L8_RGB888) - { - if (alpha == 0xFF) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t* src = bitmapCLUT + *bitmapPointer++ * 3; - *framebuffer = LCD32bpp_XRGB8888::rgb888toXrgb8888(src); - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - else - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - do - { - const uint8_t* src = bitmapCLUT + *bitmapPointer++ * 3; - *framebuffer = LCD32bpp_XRGB8888::blendRgb888withXrgb8888(src, *framebuffer, alpha, 0xFF - alpha); - } while (++framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } - } - else // if (l8format == Bitmap::CLUT_FORMAT_L8_ARGB8888) - { - do - { - const int16_t length = MIN(bitmapAvailable, count); - const uint32_t* const chunkend = framebuffer + length; - count -= length; - do - { - uint32_t src = reinterpret_cast(bitmapCLUT)[*bitmapPointer++]; - const uint8_t srcAlpha = src >> 24; - const uint8_t a = LCD::div255(alpha * srcAlpha); - if (a == 0xFF) - { - *framebuffer = src; - } - else - { - *framebuffer = LCD32bpp_XRGB8888::blendXrgb888withXrgb8888(src, *framebuffer, a, 0xFF - a); - } - framebuffer++; - } while (framebuffer < chunkend); - bitmapPointer = bitmapLineStart; - bitmapAvailable = bitmapRect.width; - } while (framebuffer < lineEnd); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp deleted file mode 100644 index 545b24f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/AbstractDataGraph.cpp +++ /dev/null @@ -1,599 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include -#include - -namespace touchgfx -{ -AbstractDataGraph::AbstractDataGraph(int16_t capacity) - : Container(), - alpha(255), xScale(1), yScale(1), - graphArea(), leftArea(), rightArea(), topArea(), bottomArea(), - topPadding(0), leftPadding(0), rightPadding(0), bottomPadding(0), - maxCapacity(capacity), usedCapacity(0), gapBeforeIndex(0), clickAction(0), dragAction(0), - graphRangeMinX(0), graphRangeMaxX(0), graphRangeMinY(0), graphRangeMaxY(0) -{ - assert(capacity > 0); - AbstractDataGraph::add(graphArea); - AbstractDataGraph::add(topArea); - AbstractDataGraph::add(leftArea); - AbstractDataGraph::add(rightArea); - AbstractDataGraph::add(bottomArea); - // Place all areas properly: - setGraphAreaMargin(0, 0, 0, 0); - setTouchable(true); -} - -void AbstractDataGraph::setWidth(int16_t width) -{ - topArea.setWidth(width); - bottomArea.setWidth(width); - rightArea.setX(width - rightArea.getWidth()); - graphArea.setWidth(width - (leftArea.getWidth() + rightArea.getWidth())); - Container::setWidth(width); - updateAreasPosition(); -} - -void AbstractDataGraph::setHeight(int16_t height) -{ - leftArea.setHeight(height); - rightArea.setHeight(height); - bottomArea.setY(height - bottomArea.getHeight()); - graphArea.setHeight(height - (topArea.getHeight() + bottomArea.getHeight())); - Container::setHeight(height); - updateAreasPosition(); -} - -void AbstractDataGraph::setGraphAreaMargin(int16_t top, int16_t left, int16_t right, int16_t bottom) -{ - graphArea.setPosition(left, top, getWidth() - (left + right), getHeight() - (top + bottom)); - topArea.setPosition(0, 0, getWidth(), top); - leftArea.setPosition(0, 0, left, getHeight()); - rightArea.setPosition(getWidth() - right, 0, right, getHeight()); - bottomArea.setPosition(0, getHeight() - bottom, getWidth(), bottom); - updateAreasPosition(); -} - -void AbstractDataGraph::setGraphAreaPadding(int16_t top, int16_t left, int16_t right, int16_t bottom) -{ - topPadding = top; - leftPadding = left; - rightPadding = right; - bottomPadding = bottom; -} - -void AbstractDataGraph::clear() -{ - usedCapacity = 0; - invalidateGraphArea(); -} - -void AbstractDataGraph::addGraphElement(AbstractGraphElement& d) -{ - graphArea.add(d); - d.setPosition(0, 0, graphArea.getWidth(), graphArea.getHeight()); -} - -void AbstractDataGraph::addTopElement(AbstractGraphDecoration& d) -{ - topArea.add(d); - d.setPosition(0, 0, topArea.getWidth(), topArea.getHeight()); -} - -void AbstractDataGraph::addLeftElement(AbstractGraphDecoration& d) -{ - leftArea.add(d); - d.setPosition(0, 0, leftArea.getWidth(), leftArea.getHeight()); -} - -void AbstractDataGraph::addRightElement(AbstractGraphDecoration& d) -{ - rightArea.add(d); - d.setPosition(0, 0, rightArea.getWidth(), rightArea.getHeight()); -} - -void AbstractDataGraph::addBottomElement(AbstractGraphDecoration& d) -{ - bottomArea.add(d); - d.setPosition(0, 0, bottomArea.getWidth(), bottomArea.getHeight()); -} - -bool AbstractDataGraph::getNearestIndexForScreenXY(int16_t x, int16_t y, int16_t& index) -{ - if (usedCapacity == 0) - { - return false; - } - uint32_t bestDist = 0xFFFFFFFF; - for (int16_t ix = 0; ix < usedCapacity; ix++) - { - const int16_t xDist = indexToScreenX(ix) - x; - const int16_t yDist = indexToScreenY(ix) - y; - const uint32_t dist = xDist * xDist + yDist * yDist; - if (dist < bestDist) - { - index = ix; - bestDist = dist; - } - } - return true; -} - -bool AbstractDataGraph::getNearestIndexForScreenX(int16_t x, int16_t& index) const -{ - if (usedCapacity == 0) - { - return false; - } - uint32_t bestDist = 0xFFFFFFFF; - for (int16_t ix = 0; ix < usedCapacity; ix++) - { - const uint32_t dist = abs(indexToScreenX(ix) - x); - if (dist < bestDist) - { - index = ix; - bestDist = dist; - } - } - return true; -} - -void AbstractDataGraph::handleClickEvent(const ClickEvent& event) -{ - if (event.getType() == ClickEvent::CANCEL) - { - return; - } - const int16_t x = event.getX() - graphArea.getX(); - int16_t index; - if (getNearestIndexForScreenX(x, index)) - { - if (event.getType() == ClickEvent::PRESSED || event.getType() == ClickEvent::RELEASED) - { - if (clickAction && clickAction->isValid()) - { - GraphClickEvent graphClickEvent(index, event); - clickAction->execute(*this, graphClickEvent); - } - } - } -} - -void AbstractDataGraph::handleDragEvent(const DragEvent& event) -{ - const int16_t x = event.getNewX() - graphArea.getX(); - int16_t index; - if (getNearestIndexForScreenX(x, index)) - { - if (event.getType() == DragEvent::DRAGGED) - { - if (dragAction && dragAction->isValid()) - { - GraphDragEvent graphDragEvent(index, event); - dragAction->execute(*this, graphDragEvent); - } - } - } -} - -void AbstractDataGraph::invalidateGraphPointAt(int16_t index) -{ - if (index < usedCapacity) - { - AbstractGraphElement* d = (AbstractGraphElement*)graphArea.getFirstChild(); - while (d) - { - d->invalidateGraphPointAt(index); - d = (AbstractGraphElement*)d->getNextSibling(); - } - } -} - -void AbstractDataGraph::invalidateXAxisPointAt(int16_t index) -{ - AbstractGraphElement* d = (AbstractGraphElement*)topArea.getFirstChild(); - while (d) - { - d->invalidateGraphPointAt(index); - d = (AbstractGraphElement*)d->getNextSibling(); - } - d = (AbstractGraphElement*)bottomArea.getFirstChild(); - while (d) - { - d->invalidateGraphPointAt(index); - d = (AbstractGraphElement*)d->getNextSibling(); - } -} - -void AbstractDataGraph::invalidateAllXAxisPoints() -{ - for (int index = 0; index <= usedCapacity; index++) - { - invalidateXAxisPointAt(index); - } - topArea.invalidate(); - bottomArea.invalidate(); -} - -void AbstractDataGraph::updateAreasPosition() -{ - Drawable* d = graphArea.getFirstChild(); - while (d) - { - d->setPosition(0, 0, graphArea.getWidth(), graphArea.getHeight()); - d = d->getNextSibling(); - } - - d = topArea.getFirstChild(); - while (d) - { - d->setPosition(0, 0, topArea.getWidth(), topArea.getHeight()); - d = d->getNextSibling(); - } - - d = leftArea.getFirstChild(); - while (d) - { - d->setPosition(0, 0, leftArea.getWidth(), leftArea.getHeight()); - d = d->getNextSibling(); - } - - d = rightArea.getFirstChild(); - while (d) - { - d->setPosition(0, 0, rightArea.getWidth(), rightArea.getHeight()); - d = d->getNextSibling(); - } - - d = bottomArea.getFirstChild(); - while (d) - { - d->setPosition(0, 0, bottomArea.getWidth(), bottomArea.getHeight()); - d = d->getNextSibling(); - } - - invalidate(); -} - -void AbstractDataGraph::setGraphRangeXScaled(int min, int max) -{ - assert(min != max); - if (max < min) - { - const int tmp = min; - min = max; - max = tmp; - } - if (min != graphRangeMinX || max != graphRangeMaxX) - { - graphRangeMinX = min; - graphRangeMaxX = max; - topArea.invalidate(); - graphArea.invalidate(); - bottomArea.invalidate(); - } -} - -void AbstractDataGraph::setGraphRangeYScaled(int min, int max) -{ - assert(min != max); - if (max < min) - { - const int tmp = min; - min = max; - max = tmp; - } - if (min != graphRangeMinY || max != graphRangeMaxY) - { - graphRangeMinY = min; - graphRangeMaxY = max; - leftArea.invalidate(); - graphArea.invalidate(); - rightArea.invalidate(); - } -} - -int AbstractDataGraph::convertToNewScale(int value, int oldScale, int newScale) -{ - if (oldScale == newScale) - { - return value; - } - return muldiv(value, newScale, oldScale); -} - -int16_t DynamicDataGraph::addDataPointScaled(int y) -{ - beforeAddValue(); - dataCounter++; - return addValue(y); -} - -void DynamicDataGraph::setGraphRangeYAutoScaled(bool showXaxis, int margin) -{ - if (usedCapacity == 0) - { - return; - } - int indexMin = getGraphRangeXMin(); - int indexMax = getGraphRangeXMax(); - if (indexMin > indexMax) - { - const int tmp = indexMin; - indexMin = indexMax; - indexMax = tmp; - } - indexMin = MAX(indexMin, 0); - indexMax = MIN(indexMax, usedCapacity); - if (indexMin < usedCapacity && indexMax >= 0) - { - int yMin = showXaxis ? margin : yValues[indexMin]; - int yMax = showXaxis ? -margin : yValues[indexMin]; - for (int i = indexMin; i < indexMax; i++) - { - int y = yValues[i]; - if (yMin > y) - { - yMin = y; - } - if (yMax < y) - { - yMax = y; - } - } - yMin -= margin; - yMax += margin; - if (yMin != yMax) - { - setGraphRangeYScaled(yMin, yMax); - } - } -} - -bool DynamicDataGraph::xScreenRangeToIndexRange(int16_t xMin, int16_t xMax, int16_t& indexMin, int16_t& indexMax) const -{ - if (usedCapacity == 0) - { - indexMin = indexMax = -1; - return false; - } - if (getGraphAreaWidth() <= 1) - { - indexMin = 0; - indexMax = usedCapacity - 1; - return true; - } - CWRUtil::Q5 xQ5Min = CWRUtil::muldivQ5(CWRUtil::toQ5(xMin - leftPadding), CWRUtil::Q5(scaled2intX(graphRangeMaxX - graphRangeMinX)), CWRUtil::Q5(getGraphAreaWidth() - 1)) + CWRUtil::toQ5(scaled2intX(graphRangeMinX)); - CWRUtil::Q5 xQ5Max = CWRUtil::muldivQ5(CWRUtil::toQ5(xMax - leftPadding), CWRUtil::Q5(scaled2intX(graphRangeMaxX - graphRangeMinX)), CWRUtil::Q5(getGraphAreaWidth() - 1)) + CWRUtil::toQ5(scaled2intX(graphRangeMinX)); - if (xQ5Min > xQ5Max) - { - const CWRUtil::Q5 tmp = xQ5Min; - xQ5Min = xQ5Max; - xQ5Max = tmp; - } - indexMin = xQ5Min.to(); // X is also index in AbstractDataGraphWithY - indexMax = xQ5Max.ceil(); - if (indexMax < 0) - { - indexMin = indexMax = 0; - return false; - } - if (indexMin > usedCapacity - 1) - { - indexMin = indexMax = usedCapacity - 1; - return false; - } - indexMin = MAX(0, indexMin); - indexMax = MIN(usedCapacity - 1, indexMax); - return true; -} - -void DynamicDataGraph::setScaleX(int scale, bool updateData /*= false*/) -{ - const int oldScale = getScaleX(); - if (scale != oldScale) - { - setGraphRangeXScaled(convertToNewScale(graphRangeMinX, oldScale, scale), convertToNewScale(graphRangeMaxX, oldScale, scale)); - xAxisFactor = convertToNewScale(xAxisFactor, oldScale, scale); - xAxisOffset = convertToNewScale(xAxisOffset, oldScale, scale); - AbstractDataGraph::setScaleX(scale, updateData); - } -} - -void DynamicDataGraph::setScaleY(int scale, bool updateData /*= false*/) -{ - if (updateData) - { - const int oldScale = getScaleY(); - for (int16_t index = 0; index < usedCapacity; index++) - { - yValues[index] = convertToNewScale(yValues[index], oldScale, scale); - } - } - AbstractDataGraph::setScaleY(scale); -} - -void StaticDataGraph::setScaleX(int scale, bool updateData /*= false*/) -{ - if (updateData) - { - const int oldScale = getScaleX(); - for (int16_t index = 0; index < usedCapacity; index++) - { - xValues[index] = convertToNewScale(xValues[index], oldScale, scale); - } - } - AbstractDataGraph::setScaleX(scale); -} - -void StaticDataGraph::setScaleY(int scale, bool updateData /*= false*/) -{ - if (updateData) - { - const int oldScale = getScaleY(); - for (int16_t index = 0; index < usedCapacity; index++) - { - yValues[index] = convertToNewScale(yValues[index], oldScale, scale); - } - } - AbstractDataGraph::setScaleY(scale); -} - -void StaticDataGraph::setGraphRangeXAutoScaled(bool showYaxis, int margin) -{ - if (usedCapacity == 0) - { - return; - } - int xMin = xValues[0]; // First x value is the lowest - int xMax = xValues[usedCapacity - 1]; // Last x value is the highest - if (showYaxis) - { - // The y axis (x=0) must be shown, so make sure 0 is included after subtracting/adding the margin - xMin = MIN(xMin, margin); - xMax = MAX(xMax, -margin); - } - xMin -= margin; - xMax += margin; - if (xMin != xMax) - { - setGraphRangeXScaled(xMin, xMax); - } -} - -void StaticDataGraph::setGraphRangeYAutoScaled(bool showXaxis /*= true*/, int margin /*= 0*/) -{ - if (usedCapacity == 0) - { - return; - } - int xValueMin = getGraphRangeXMinScaled(); // Get shown x range - int xValueMax = getGraphRangeXMaxScaled(); - if (xValueMin > xValueMax) - { - // Swap so min<=max. - const int16_t tmp = xValueMin; - xValueMin = xValueMax; - xValueMax = tmp; - } - int index = 0; - while (xValues[index] < xValueMin && index < usedCapacity) - { - // Skip all indices that have x outside visible area - index++; - } - if (xValues[index] > xValueMax) - { - // No x values are in the visible area - return; - } - int yMin = yValues[index++]; // The index'th value must be visible - int yMax = yMin; - // Go through all points where x is in the visible range - while (xValues[index] < xValueMax && index < usedCapacity) - { - int y = yValues[index++]; - yMin = MIN(yMin, y); - yMax = MAX(yMax, y); - } - if (showXaxis) - { - // The x axis (y=0) must be shown, so make sure 0 is included after subtracting/adding the margin - yMin = MIN(yMin, margin); - yMax = MAX(yMax, -margin); - } - yMin -= margin; - yMax += margin; - if (yMin != yMax) - { - setGraphRangeYScaled(yMin, yMax); - } -} - -int16_t StaticDataGraph::deleteValue(int xvalue) -{ - for (int index = 0; index < usedCapacity; index++) - { - if (xValues[index] == xvalue) - { - return deleteIndex(index); - } - } - return -1; -} - -int16_t StaticDataGraph::deleteIndex(int index) -{ - assert(index >= 0 && index < usedCapacity); - invalidateGraphPointAt(index); - usedCapacity--; - for (int i = index; i < usedCapacity; i++) - { - xValues[i] = xValues[i + 1]; - yValues[i] = yValues[i + 1]; - } - return index; -} - -bool StaticDataGraph::xScreenRangeToIndexRange(int16_t xMin, int16_t xMax, int16_t& indexMin, int16_t& indexMax) const -{ - if (usedCapacity == 0) - { - indexMin = indexMax = -1; - return false; - } - if (getGraphAreaWidth() <= 1) - { - indexMin = 0; - indexMax = usedCapacity - 1; - return true; - } - CWRUtil::Q5 xQ5Min = CWRUtil::muldivQ5(CWRUtil::toQ5(xMin - leftPadding), CWRUtil::Q5(graphRangeMaxX - graphRangeMinX), CWRUtil::Q5(getGraphAreaWidth() - 1)) + CWRUtil::toQ5(graphRangeMinX); - CWRUtil::Q5 xQ5Max = CWRUtil::muldivQ5(CWRUtil::toQ5(xMax - leftPadding), CWRUtil::Q5(graphRangeMaxX - graphRangeMinX), CWRUtil::Q5(getGraphAreaWidth() - 1)) + CWRUtil::toQ5(graphRangeMinX); - if (xQ5Min > xQ5Max) - { - const CWRUtil::Q5 tmp = xQ5Min; - xQ5Min = xQ5Max; - xQ5Max = tmp; - } - const int xValueMin = xQ5Min.to(); // These are REAL x values - const int xValueMax = xQ5Max.ceil(); - indexMin = -1; - while (indexMin < usedCapacity - 1 && xValues[indexMin + 1] <= xValueMin) - { - indexMin++; - } - indexMax = usedCapacity; - while (indexMax > 0 && xValues[indexMax - 1] >= xValueMax) - { - indexMax--; - } - if (indexMax <= 0) - { - indexMin = indexMax = 0; - return false; - } - if (indexMin >= usedCapacity - 1) - { - indexMin = indexMax = usedCapacity - 1; - return false; - } - indexMin = MAX(0, indexMin); - indexMax = MIN(usedCapacity - 1, indexMax); - return true; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp deleted file mode 100644 index 479dfd1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/Graph.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ - -int16_t GraphData::addValue(int xvalue, int yvalue) -{ - int16_t index = 0; - if (usedCapacity == 0 || xValues[usedCapacity - 1] < xvalue) - { - index = usedCapacity; - } - else - { - while (index < usedCapacity && xValues[index] < xvalue) - { - index++; - } - if (index < usedCapacity && xValues[index] == xvalue) // Pointing to an element to replace - { - // Replace point - invalidateGraphPointAt(index); - yValues[index] = yvalue; - invalidateGraphPointAt(index); - return index; - } - } - if ((index == usedCapacity || xValues[index] > xvalue) && usedCapacity == maxCapacity) - { - // Should add at end OR insert in the middle, but no room for more data - return -1; - } - // Insert at 'index', move following points up the array - for (int16_t i = usedCapacity; i > index; i--) - { - xValues[i] = xValues[i - 1]; - yValues[i] = yValues[i - 1]; - } - usedCapacity++; - xValues[index] = xvalue; - yValues[index] = yvalue; - invalidateGraphPointAt(index); - return index; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp deleted file mode 100644 index 1c9a2a8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphElements.cpp +++ /dev/null @@ -1,649 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include - -namespace touchgfx -{ - -Rect AbstractGraphElement::rectFromQ5Coordinates(CWRUtil::Q5 screenXminQ5, CWRUtil::Q5 screenYminQ5, CWRUtil::Q5 screenXmaxQ5, CWRUtil::Q5 screenYmaxQ5) const -{ - if (screenXminQ5 > screenXmaxQ5) - { - const CWRUtil::Q5 tmp = screenXminQ5; - screenXminQ5 = screenXmaxQ5; - screenXmaxQ5 = tmp; - } - if (screenYminQ5 > screenYmaxQ5) - { - const CWRUtil::Q5 tmp = screenYminQ5; - screenYminQ5 = screenYmaxQ5; - screenYmaxQ5 = tmp; - } - const int16_t xMin = screenXminQ5.to(); - const int16_t yMin = screenYminQ5.to(); - const int16_t xMax = screenXmaxQ5.ceil(); - const int16_t yMax = screenYmaxQ5.ceil(); - return Rect(xMin, yMin, xMax - xMin, yMax - yMin); -} - -Rect AbstractGraphElement::rectAround(CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5, CWRUtil::Q5 diameterQ5) const -{ - const CWRUtil::Q5 d2Q5 = CWRUtil::Q5((int32_t)diameterQ5 + 1) / 2; - return rectFromQ5Coordinates(xQ5 - d2Q5, yQ5 - d2Q5, xQ5 + d2Q5, yQ5 + d2Q5); -} - -bool AbstractGraphElement::isCenterInvisible(const AbstractDataGraph* graph, int16_t index) const -{ - const int16_t screenXCenter = indexToScreenXQ5(graph, index).round(); - const int16_t screenYCenter = indexToScreenYQ5(graph, index).round(); - return screenXCenter < graph->getGraphAreaPaddingLeft() || - screenXCenter >= graph->getGraphAreaPaddingLeft() + graph->getGraphAreaWidth() || - screenYCenter < graph->getGraphAreaPaddingTop() || - screenYCenter >= graph->getGraphAreaPaddingTop() + graph->getGraphAreaHeight(); -} - -void AbstractGraphElementNoCWR::normalizeRect(Rect& r) const -{ - if (r.width < 0) - { - r.x += r.width; - r.width = -r.width; - } - if (r.height < 0) - { - r.y += r.height; - r.height = -r.height; - } -} - -void GraphElementGridBase::draw(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - const uint8_t a = LCD::div255(getAlpha() * graph->getAlpha()); - if (lineWidth == 0 || a == 0) - { - return; - } - - const Rect invalidRect = enclosingArea(graph) & invalidatedArea; - - const int minorInterval = getCorrectlyScaledGridInterval(graph); - const int majorInterval = getCorrectlyScaledMajorInterval(graph); - - const CWRUtil::Q5 lw2Q5minor = CWRUtil::toQ5(lineWidth) / 2; - const int16_t start = getGraphAreaStart(graph); - const int16_t length = getGraphAreaLength(graph); - if (minorInterval == 0 && majorInterval == 0) - { - const int16_t pos = (valueToScreenQ5(graph, 0) - lw2Q5minor).round(); - const int16_t graphPos = pos - getGraphAreaStartPos(graph); - if (graphPos + lineWidth >= 0 && graphPos < getGraphAreaEndPos(graph)) - { - drawLine(invalidRect, start, length, pos, lineWidth, a); - } - } - else if (minorInterval > 0) - { - int rangeMin = getGraphRangeMinScaled(graph); - int rangeMax = getGraphRangeMaxScaled(graph); - if (abs(rangeMax - rangeMin) / minorInterval > 500) - { - return; // Too many grid lines - } - - if (valueToScreenQ5(graph, rangeMin) > valueToScreenQ5(graph, rangeMax)) - { - const int tmp = rangeMin; - rangeMin = rangeMax; - rangeMax = tmp; - } - // Now rangeMax has a higher screen coordinate than rangeMin - - const int margin = rangeMin < rangeMax ? +1 : -1; - const int minorLo = (rangeMin / minorInterval) - margin; - const int minorHi = (rangeMax / minorInterval) + margin; - const int minorStep = minorLo < minorHi ? +1 : -1; - if (majorInterval == 0) - { - // No major lines, simply draw all lines - for (int minorIndex = minorLo; minorIndex != minorHi + minorStep; minorIndex += minorStep) - { - const int16_t pos = (valueToScreenQ5(graph, minorInterval * minorIndex) - lw2Q5minor).round(); - const int16_t graphPos = pos - getGraphAreaStartPos(graph); - if (graphPos + lineWidth >= 0 && graphPos < getGraphAreaEndPos(graph)) - { - drawLine(invalidRect, start, length, pos, lineWidth, a); - } - } - } - else - { - const int majorLo = (rangeMin / majorInterval) - margin; - const int majorHi = (rangeMax / majorInterval) + margin; - const int majorStep = majorLo < majorHi ? +1 : -1; - int majorIndex = majorLo; - int16_t majorCoord = valueToScreenQ5(graph, majorInterval * majorIndex).round(); - int minorIndex = minorLo; - int16_t minorCoord = valueToScreenQ5(graph, minorInterval * minorIndex).round(); - for (;;) - { - // Draw minor lines up to the major line - while (minorCoord < majorCoord) - { - const int16_t pos = (valueToScreenQ5(graph, minorInterval * minorIndex) - lw2Q5minor).round(); - const int16_t graphPos = pos - getGraphAreaStartPos(graph); - if (graphPos + lineWidth >= 0 && graphPos < getGraphAreaEndPos(graph)) - { - drawLine(invalidRect, start, length, pos, lineWidth, a); - } - minorIndex += minorStep; - minorCoord = valueToScreenQ5(graph, minorInterval * minorIndex).round(); - } - // Advance minor past the major line we are about to draw - while (minorCoord <= majorCoord) - { - minorIndex += minorStep; - minorCoord = valueToScreenQ5(graph, minorInterval * minorIndex).round(); - } - if (majorCoord <= minorCoord) - { - majorIndex += majorStep; - if (majorIndex == majorHi + majorStep) - { - break; - } - majorCoord = valueToScreenQ5(graph, majorInterval * majorIndex).round(); - } - } - } - } -} - -void GraphElementGridBase::drawLine(const Rect& invalidatedArea, int16_t start, int16_t length, int16_t pos, int16_t width, uint8_t a) const -{ - Rect r = lineRect(start, length, pos, width); - normalizeRect(r); - r &= invalidatedArea; - if (!r.isEmpty()) - { - translateRectToAbsolute(r); - HAL::lcd().fillRect(r, color, a); - } -} - -bool GraphElementArea::drawCanvasWidget(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - if (graph->getUsedCapacity() <= 1) - { - return true; // Nothing to draw, everything is fine! - } - - int16_t indexMin; - int16_t indexMax; - if (!xScreenRangeToIndexRange(graph, invalidatedArea.x, invalidatedArea.right(), indexMin, indexMax)) - { - return true; // Nothing to draw, everything is fine! - } - - const int16_t gapIndex = graph->getGapBeforeIndex(); - const int baseline = convertToGraphScaleY(graph, yBaseline, dataScale); - const CWRUtil::Q5 screenYbaseQ5 = roundQ5(valueToScreenYQ5(graph, baseline)); - CWRUtil::Q5 screenXQ5; - if (indexMin + 1 == gapIndex) - { - if (indexMin > 0) - { - indexMin--; // Draw the last line segment before the gap - } - else - { - indexMin++; // Do not draw a 1 segment line (a "dot") - } - } - - Rect invalidRect = Rect(graph->getGraphAreaPaddingLeft(), graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidth(), graph->getGraphAreaHeight()) & invalidatedArea; - Canvas canvas(this, invalidRect); - canvas.moveTo(roundQ5(indexToScreenXQ5(graph, indexMin)), screenYbaseQ5); - for (int16_t index = indexMin; index <= indexMax; index++) - { - if (index == gapIndex) - { - canvas.lineTo(screenXQ5, screenYbaseQ5); - screenXQ5 = roundQ5(indexToScreenXQ5(graph, index)); - canvas.lineTo(screenXQ5, screenYbaseQ5); - } - else - { - screenXQ5 = roundQ5(indexToScreenXQ5(graph, index)); - } - canvas.lineTo(screenXQ5, roundQ5(indexToScreenYQ5(graph, index))); - } - canvas.lineTo(screenXQ5, screenYbaseQ5); - return canvas.render(graph->getAlpha()); -} - -void GraphElementArea::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - const int baseline = convertToGraphScaleY(graph, yBaseline, dataScale); - const CWRUtil::Q5 screenYbaseQ5 = roundQ5(valueToScreenYQ5(graph, baseline)); - CWRUtil::Q5 screenXminQ5 = indexToScreenXQ5(graph, index); - CWRUtil::Q5 screenXmaxQ5 = screenXminQ5; - CWRUtil::Q5 screenYminQ5 = indexToScreenYQ5(graph, index); - CWRUtil::Q5 screenYmaxQ5 = screenYminQ5; - - if (index > 0) - { - screenXminQ5 = indexToScreenXQ5(graph, index - 1); - const CWRUtil::Q5 screenYnewQ5 = indexToScreenYQ5(graph, index - 1); - screenYminQ5 = MIN(screenYminQ5, screenYnewQ5); - screenYmaxQ5 = MAX(screenYmaxQ5, screenYnewQ5); - } - if (index < graph->getUsedCapacity() - 1) - { - screenXmaxQ5 = indexToScreenXQ5(graph, index + 1); - const CWRUtil::Q5 screenYnewQ5 = indexToScreenYQ5(graph, index + 1); - screenYminQ5 = MIN(screenYminQ5, screenYnewQ5); - screenYmaxQ5 = MAX(screenYmaxQ5, screenYnewQ5); - } - screenYminQ5 = MIN(screenYminQ5, screenYbaseQ5); - screenYmaxQ5 = MAX(screenYmaxQ5, screenYbaseQ5); - Rect dirty(rectFromQ5Coordinates(screenXminQ5, screenYminQ5, screenXmaxQ5, screenYmaxQ5)); - dirty &= Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()); - invalidateRect(dirty); -} - -bool GraphElementLine::drawCanvasWidget(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - if (graph->getUsedCapacity() <= 1) - { - return true; // Nothing to draw, everything is fine! - } - - const CWRUtil::Q5 lineWidthQ5 = CWRUtil::toQ5(lineWidth); - const uint16_t lineWidthHalf = CWRUtil::Q5(((int)lineWidthQ5 + 1) / 2).ceil(); - int16_t indexMin; - int16_t indexMax; - if (!xScreenRangeToIndexRange(graph, invalidatedArea.x - lineWidthHalf, invalidatedArea.right() + lineWidthHalf, indexMin, indexMax)) - { - return true; // Nothing to draw, everything is fine! - } - - Rect invalidRect = Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()) & invalidatedArea; - Canvas canvas(this, invalidRect); - const int16_t gapIndex = graph->getGapBeforeIndex(); - if (gapIndex <= 0 || gapIndex <= indexMin || gapIndex > indexMax) - { - drawIndexRange(canvas, graph, indexMin, indexMax); - } - else - { - drawIndexRange(canvas, graph, indexMin, gapIndex - 1); - drawIndexRange(canvas, graph, gapIndex, indexMax); - } - return canvas.render(graph->getAlpha()); -} - -void GraphElementLine::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - CWRUtil::Q5 lineWidthQ5 = CWRUtil::toQ5(lineWidth); - Rect dirty(rectAround(indexToScreenXQ5(graph, index), indexToScreenYQ5(graph, index), lineWidthQ5)); - if (index > 0) - { - Rect other(rectAround(indexToScreenXQ5(graph, index - 1), indexToScreenYQ5(graph, index - 1), lineWidthQ5)); - dirty.expandToFit(other); - } - if (index < graph->getUsedCapacity() - 1) - { - Rect other(rectAround(indexToScreenXQ5(graph, index + 1), indexToScreenYQ5(graph, index + 1), lineWidthQ5)); - dirty.expandToFit(other); - } - dirty &= Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()); - invalidateRect(dirty); -} - -void GraphElementLine::drawIndexRange(Canvas& canvas, const AbstractDataGraph* graph, int16_t indexMin, int16_t indexMax) const -{ - if (indexMin == indexMax) - { - return; - } - - const CWRUtil::Q5 lineWidthQ5 = CWRUtil::toQ5(lineWidth); - - CWRUtil::Q5 screenXstartQ5 = roundQ5(indexToScreenXQ5(graph, indexMin)); - CWRUtil::Q5 screenYstartQ5 = roundQ5(indexToScreenYQ5(graph, indexMin)); - canvas.moveTo(screenXstartQ5, screenYstartQ5); - int16_t index = indexMin; - int16_t advance = 1; - do - { - if (index == indexMax) - { - advance = -1; - } - index += advance; - const CWRUtil::Q5 screenXendQ5 = roundQ5(indexToScreenXQ5(graph, index)); - const CWRUtil::Q5 screenYendQ5 = roundQ5(indexToScreenYQ5(graph, index)); - CWRUtil::Q5 dxQ5 = screenXendQ5 - screenXstartQ5; - CWRUtil::Q5 dyQ5 = screenYendQ5 - screenYstartQ5; - const CWRUtil::Q5 dQ5 = CWRUtil::length(dxQ5, dyQ5); - if (dQ5) - { - dyQ5 = CWRUtil::muldivQ5(lineWidthQ5, dyQ5, dQ5) / 2; - dxQ5 = CWRUtil::muldivQ5(lineWidthQ5, dxQ5, dQ5) / 2; - canvas.lineTo(screenXstartQ5 - dyQ5, screenYstartQ5 + dxQ5); - canvas.lineTo(screenXendQ5 - dyQ5, screenYendQ5 + dxQ5); - screenXstartQ5 = screenXendQ5; - screenYstartQ5 = screenYendQ5; - } - } while (index > indexMin); -} - -void GraphElementVerticalGapLine::draw(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - const int16_t gapIndex = graph->getGapBeforeIndex(); - const uint8_t a = LCD::div255(getAlpha() * graph->getAlpha()); - if (gapIndex == 0 || a == 0) - { - return; - } - - const int16_t screenXmin = indexToScreenXQ5(graph, gapIndex - 1).round(); - int16_t screenXmax = screenXmin + lineWidth; - if (lineWidth == 0) - { - screenXmax = indexToScreenXQ5(graph, gapIndex).round(); - } - Rect r(screenXmin, graph->getGraphAreaPaddingTop(), screenXmax - screenXmin, graph->getGraphAreaHeight()); - normalizeRect(r); - r &= invalidatedArea; - if (!r.isEmpty()) - { - translateRectToAbsolute(r); - HAL::lcd().fillRect(r, color, a); - } -} - -void GraphElementVerticalGapLine::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - invalidateIndex(graph, graph->getGapBeforeIndex()); - invalidateIndex(graph, index); -} - -void GraphElementVerticalGapLine::invalidateIndex(const AbstractDataGraph* graph, int16_t index) const -{ - if (index > 0) - { - const int16_t screenXmin = indexToScreenXQ5(graph, index - 1).round(); - int16_t screenXmax = screenXmin + lineWidth; - if (lineWidth == 0) - { - screenXmax = indexToScreenXQ5(graph, index).round(); - } - Rect dirty(screenXmin, graph->getGraphAreaPaddingTop(), screenXmax - screenXmin, graph->getGraphAreaHeight()); - normalizeRect(dirty); - invalidateRect(dirty); - } -} - -void GraphElementHistogram::draw(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - const uint8_t a = LCD::div255(getAlpha() * graph->getAlpha()); - if (graph->getUsedCapacity() == 0 || barWidth == 0 || a == 0) - { - return; // Nothing to draw, everything is fine! - } - - const int baseline = convertToGraphScaleY(graph, yBaseline, dataScale); - const CWRUtil::Q5 barOffsetQ5 = CWRUtil::toQ5(barOffset); - const CWRUtil::Q5 barWidthQ5 = CWRUtil::toQ5(barWidth); - const CWRUtil::Q5 barWidthHalfQ5 = CWRUtil::Q5(((int)barWidthQ5 + 1) / 2); - const int16_t barWidthHalf = barWidthHalfQ5.ceil(); - const int16_t screenYzero = valueToScreenYQ5(graph, baseline).round(); - int16_t indexMin; - int16_t indexMax; - if (!xScreenRangeToIndexRange(graph, invalidatedArea.x + barOffset - barWidthHalf, invalidatedArea.right() + barOffset + barWidthHalf, indexMin, indexMax)) - { - return; // Nothing to draw, everything is fine! - } - - Rect invalidRect = Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()) & invalidatedArea; - for (int16_t index = indexMin; index <= indexMax; index++) - { - const int16_t screenX = (indexToScreenXQ5(graph, index) + barOffsetQ5 - barWidthHalfQ5).round(); - const int16_t screenY = indexToScreenYQ5(graph, index).round(); - Rect r(screenX, screenY, barWidth, screenYzero - screenY); - normalizeRect(r); - r &= invalidRect; - if (!r.isEmpty()) - { - translateRectToAbsolute(r); - HAL::lcd().fillRect(r, color, a); - } - } -} - -void GraphElementHistogram::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - const CWRUtil::Q5 screenXQ5 = indexToScreenXQ5(graph, index); - const CWRUtil::Q5 barWidthHalfQ5 = CWRUtil::Q5((int)CWRUtil::toQ5(barWidth) + 1) / 2; - const CWRUtil::Q5 barOffsetQ5 = CWRUtil::toQ5(barOffset); - const int baseline = convertToGraphScaleY(graph, yBaseline, dataScale); - Rect dirty(rectFromQ5Coordinates(screenXQ5 + barOffsetQ5 - barWidthHalfQ5, indexToScreenYQ5(graph, index), screenXQ5 + barOffsetQ5 + barWidthHalfQ5, valueToScreenYQ5(graph, baseline))); - dirty &= Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()); - invalidateRect(dirty); -} - -void GraphElementBoxes::draw(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - const uint8_t a = LCD::div255(getAlpha() * graph->getAlpha()); - if (graph->getUsedCapacity() == 0 || boxWidth == 0 || a == 0) - { - return; // Nothing to draw, everything is fine! - } - - const CWRUtil::Q5 boxWidthQ5 = CWRUtil::toQ5(boxWidth); - const CWRUtil::Q5 boxWidthHalfQ5 = boxWidthQ5 / 2; - const uint16_t boxWidthHalf = CWRUtil::Q5(((int)boxWidthQ5 + 1) / 2).ceil(); - int16_t indexMin; - int16_t indexMax; - if (!xScreenRangeToIndexRange(graph, invalidatedArea.x - boxWidthHalf, invalidatedArea.right() + boxWidthHalf, indexMin, indexMax)) - { - return; // Nothing to draw, everything is fine! - } - - for (int16_t index = indexMin; index <= indexMax; index++) - { - if (isCenterInvisible(graph, index)) - { - continue; - } - const CWRUtil::Q5 screenXQ5 = indexToScreenXQ5(graph, index); - const CWRUtil::Q5 screenYQ5 = indexToScreenYQ5(graph, index); - Rect r((screenXQ5 - boxWidthHalfQ5).round(), (screenYQ5 - boxWidthHalfQ5).round(), boxWidth, boxWidth); - r &= invalidatedArea; - if (!r.isEmpty()) - { - translateRectToAbsolute(r); - HAL::lcd().fillRect(r, color, a); - } - } -} - -void GraphElementBoxes::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - if (isCenterInvisible(graph, index)) - { - return; - } - const CWRUtil::Q5 boxWidthQ5 = CWRUtil::toQ5(boxWidth); - const CWRUtil::Q5 boxWidthHalfQ5 = boxWidthQ5 / 2; - const CWRUtil::Q5 screenXQ5 = indexToScreenXQ5(graph, index); - const CWRUtil::Q5 screenYQ5 = indexToScreenYQ5(graph, index); - Rect dirty((screenXQ5 - boxWidthHalfQ5).round(), (screenYQ5 - boxWidthHalfQ5).round(), boxWidth, boxWidth); - invalidateRect(dirty); -} - -bool GraphElementDots::drawCanvasWidget(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - if (graph->getUsedCapacity() == 0) - { - return true; // Nothing to draw, everything is fine! - } - - const CWRUtil::Q5 dotWidthQ5 = CWRUtil::toQ5(dotWidth); - const CWRUtil::Q5 dotWidth3Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(3), CWRUtil::toQ5(10)); - const CWRUtil::Q5 dotWidth4Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(4), CWRUtil::toQ5(10)); - const CWRUtil::Q5 dotWidth5Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(5), CWRUtil::toQ5(26)); - const CWRUtil::Q5 dotWidth12Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(12), CWRUtil::toQ5(26)); - const CWRUtil::Q5 dotWidth2Q5 = CWRUtil::muldivQ5(dotWidthQ5, CWRUtil::toQ5(1), CWRUtil::toQ5(2)); - const uint16_t dotWidthHalf = CWRUtil::Q5(((int)dotWidthQ5 + 1) / 2).ceil(); // Round up - int16_t indexMin; - int16_t indexMax; - if (!xScreenRangeToIndexRange(graph, invalidatedArea.x - dotWidthHalf, invalidatedArea.right() + dotWidthHalf, indexMin, indexMax)) - { - return true; - } - - const bool bigDots = (dotWidth > 6); - Canvas canvas(this, invalidatedArea); - for (int16_t index = indexMin; index <= indexMax; index++) - { - if (isCenterInvisible(graph, index)) - { - continue; - } - const CWRUtil::Q5 screenXcenterQ5 = roundQ5(indexToScreenXQ5(graph, index)); - const CWRUtil::Q5 screenYcenterQ5 = roundQ5(indexToScreenYQ5(graph, index)); - Rect dirty(rectAround(screenXcenterQ5, screenYcenterQ5, dotWidthQ5) & invalidatedArea); - if (!dirty.isEmpty()) - { - if (bigDots) - { - canvas.moveTo(screenXcenterQ5 - dotWidth2Q5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5 - dotWidth12Q5, screenYcenterQ5 - dotWidth5Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth4Q5, screenYcenterQ5 - dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth3Q5, screenYcenterQ5 - dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth5Q5, screenYcenterQ5 - dotWidth12Q5); - canvas.lineTo(screenXcenterQ5, screenYcenterQ5 - dotWidth2Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth5Q5, screenYcenterQ5 - dotWidth12Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth3Q5, screenYcenterQ5 - dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth4Q5, screenYcenterQ5 - dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth12Q5, screenYcenterQ5 - dotWidth5Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth2Q5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5 + dotWidth12Q5, screenYcenterQ5 + dotWidth5Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth4Q5, screenYcenterQ5 + dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth3Q5, screenYcenterQ5 + dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth5Q5, screenYcenterQ5 + dotWidth12Q5); - canvas.lineTo(screenXcenterQ5, screenYcenterQ5 + dotWidth2Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth5Q5, screenYcenterQ5 + dotWidth12Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth3Q5, screenYcenterQ5 + dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth4Q5, screenYcenterQ5 + dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth12Q5, screenYcenterQ5 + dotWidth5Q5); - } - else - { - canvas.moveTo(screenXcenterQ5 - dotWidth2Q5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5 - dotWidth4Q5, screenYcenterQ5 - dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth3Q5, screenYcenterQ5 - dotWidth4Q5); - canvas.lineTo(screenXcenterQ5, screenYcenterQ5 - dotWidth2Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth3Q5, screenYcenterQ5 - dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth4Q5, screenYcenterQ5 - dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth2Q5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5 + dotWidth4Q5, screenYcenterQ5 + dotWidth3Q5); - canvas.lineTo(screenXcenterQ5 + dotWidth3Q5, screenYcenterQ5 + dotWidth4Q5); - canvas.lineTo(screenXcenterQ5, screenYcenterQ5 + dotWidth2Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth3Q5, screenYcenterQ5 + dotWidth4Q5); - canvas.lineTo(screenXcenterQ5 - dotWidth4Q5, screenYcenterQ5 + dotWidth3Q5); - } - } - } - return canvas.render(graph->getAlpha()); -} - -void GraphElementDots::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - if (isCenterInvisible(graph, index)) - { - return; - } - Rect dirty(rectAround(indexToScreenXQ5(graph, index), indexToScreenYQ5(graph, index), CWRUtil::toQ5(dotWidth))); - dirty &= Rect(0, graph->getGraphAreaPaddingTop(), graph->getGraphAreaWidthIncludingPadding(), graph->getGraphAreaHeight()); - invalidateRect(dirty); -} - -bool GraphElementDiamonds::drawCanvasWidget(const Rect& invalidatedArea) const -{ - const AbstractDataGraph* graph = getGraph(); - if (graph->getUsedCapacity() == 0) - { - return true; // Nothing to draw, everything is fine! - } - - const CWRUtil::Q5 diamondWidthQ5 = CWRUtil::toQ5(diamondWidth); - const CWRUtil::Q5 dotWidthHalfQ5 = diamondWidthQ5 / 2; - const uint16_t dotWidthHalf = CWRUtil::Q5(((int)diamondWidthQ5 + 1) / 2).ceil(); // Round up - int16_t indexMin; - int16_t indexMax; - if (!xScreenRangeToIndexRange(graph, invalidatedArea.x - dotWidthHalf, invalidatedArea.right() + dotWidthHalf, indexMin, indexMax)) - { - return true; - } - - Canvas canvas(this, invalidatedArea); - for (int16_t index = indexMin; index <= indexMax; index++) - { - if (isCenterInvisible(graph, index)) - { - continue; - } - const CWRUtil::Q5 screenXcenterQ5 = roundQ5(indexToScreenXQ5(graph, index)); - const CWRUtil::Q5 screenYcenterQ5 = roundQ5(indexToScreenYQ5(graph, index)); - const Rect dirty(rectAround(screenXcenterQ5, screenYcenterQ5, diamondWidthQ5) & invalidatedArea); - if (!dirty.isEmpty()) - { - canvas.moveTo(screenXcenterQ5 - dotWidthHalfQ5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5, screenYcenterQ5 - dotWidthHalfQ5); - canvas.lineTo(screenXcenterQ5 + dotWidthHalfQ5, screenYcenterQ5); - canvas.lineTo(screenXcenterQ5, screenYcenterQ5 + dotWidthHalfQ5); - } - } - return canvas.render(graph->getAlpha()); -} - -void GraphElementDiamonds::invalidateGraphPointAt(int16_t index) -{ - const AbstractDataGraph* graph = getGraph(); - if (isCenterInvisible(graph, index)) - { - return; - } - Rect dirty(rectAround(indexToScreenXQ5(graph, index), indexToScreenYQ5(graph, index), CWRUtil::toQ5(diamondWidth))); - invalidateRect(dirty); -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp deleted file mode 100644 index 9d2e10e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphLabels.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include -#include -#include -#include - -namespace touchgfx -{ - -void GraphLabelsBase::draw(const Rect& invalidatedArea) const -{ - if (!labelTypedText.hasValidId()) - { - return; - } - const Font* fontToDraw = labelTypedText.getFont(); - if (!fontToDraw) - { - return; - } - - const AbstractDataGraph* graph = getGraph(); - const uint8_t a = LCD::div255(getAlpha() * graph->getAlpha()); - if (a == 0) - { - return; - } - - const int minorInterval = getCorrectlyScaledLabelInterval(graph); - const int majorInterval = getCorrectlyScaledMajorInterval(graph); - - if (majorInterval == 0 && minorInterval == 0) - { - drawString(invalidatedArea, fontToDraw, graph, 0, 0, a); - } - else if (minorInterval > 0) - { - int rangeMin = getGraphRangeMinScaled(graph); - int rangeMax = getGraphRangeMaxScaled(graph); - if (rangeMin > rangeMax) - { - const int tmp = rangeMin; - rangeMin = rangeMax; - rangeMax = tmp; - } - if ((rangeMax - rangeMin) / minorInterval > 100) - { - return; // Too many labels - } - drawIndexRange(invalidatedArea, fontToDraw, graph, rangeMin, rangeMax, minorInterval, majorInterval, a); - } -} - -void GraphLabelsBase::drawIndexRange(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int rangeMin, const int rangeMax, const int minorInterval, const int majorInterval, const uint8_t a) const -{ - if (minorInterval == 0) - { - if ((0 >= rangeMin && 0 <= rangeMax) || (0 >= rangeMax && 0 <= rangeMin)) - { - drawString(invalidatedArea, fontToDraw, graph, 0, 0, a); - } - return; - } - - const int minorLo = (int)(rangeMin / minorInterval) - 1; - const int minorHi = (int)(rangeMax / minorInterval) + 1; - if (majorInterval == 0) - { - for (int minorIndex = minorLo; minorIndex != minorHi + 1; minorIndex++) - { - const int minorValue = (int)(minorInterval * minorIndex); - if ((minorValue >= rangeMin && minorValue <= rangeMax) || (minorValue >= rangeMax && minorValue <= rangeMin)) - { - drawString(invalidatedArea, fontToDraw, graph, minorValue, labelInterval * minorIndex, a); - } - } - } - else - { - const int majorLo = (int)(rangeMin / majorInterval) - 1; - const int majorHi = (int)(rangeMax / majorInterval) + 1; - int majorIndex = majorLo; - int majorValue = majorInterval * majorIndex; - int minorIndex = minorLo; - int minorValue = minorInterval * minorIndex; - for (;;) - { - // Draw strings up to the major - while (minorValue < majorValue) - { - if ((minorValue >= rangeMin && minorValue <= rangeMax) || (minorValue >= rangeMax && minorValue <= rangeMin)) - { - drawString(invalidatedArea, fontToDraw, graph, minorValue, labelInterval * minorIndex, a); - } - minorIndex++; - minorValue += minorInterval; - } - // Advance minor past the major we are about to draw - while (minorValue <= majorValue) - { - minorIndex++; - minorValue += minorInterval; - } - if (majorValue < minorValue) - { - majorIndex++; - if (majorIndex == majorHi + 1) - { - break; - } - majorValue += majorInterval; - } - } - } -} - -void GraphLabelsBase::formatLabel(Unicode::UnicodeChar* buffer, int16_t bufferSize, int label, int decimals, Unicode::UnicodeChar decimalPoint, int scale) const -{ - int length = 0; - if (label < 0 && length < bufferSize - 1) - { - buffer[length++] = '-'; - label = -label; - } - if (decimals == 0) - { - Unicode::snprintf(buffer + length, bufferSize - length, "%d", (label + scale / 2) / scale); - } - else if (decimals > 0) - { - Unicode::snprintf(buffer + length, bufferSize - length, "%d", label / scale); - length = Unicode::strlen(buffer); - if (length < bufferSize - 1) - { - buffer[length++] = decimalPoint; - int remainder = label % scale; - for (int i = 0; i < decimals && length < bufferSize - 1; i++) - { - remainder *= 10; - if (i == decimals - 1 || length == bufferSize - 1) - { - remainder += scale / 2; // Rounding on the last (visible) digit - } - const int digit = (remainder / scale); - buffer[length++] = (Unicode::UnicodeChar)('0' + digit); - remainder %= scale; - } - buffer[length] = (Unicode::UnicodeChar)0; - } - } -} - -void GraphLabelsX::invalidateGraphPointAt(int16_t index) -{ - if (!labelTypedText.hasValidId()) - { - return; - } - const Font* fontToDraw = labelTypedText.getFont(); - if (!fontToDraw) - { - return; - } - - const AbstractDataGraph* graph = getGraph(); - const uint8_t a = LCD::div255(getAlpha() * graph->getAlpha()); - if (a == 0) - { - return; - } - - const int scaledIndex = graph->int2scaledX(index); - const int minorInterval = getCorrectlyScaledLabelInterval(graph); - const int majorInterval = getCorrectlyScaledMajorInterval(graph); - - const bool isOnMinor = (minorInterval > 0 && scaledIndex == minorInterval * (int)(scaledIndex / minorInterval)); - const bool isOnMajor = (majorInterval > 0 && scaledIndex == majorInterval * (int)(scaledIndex / majorInterval)); - if ((majorInterval == 0 && minorInterval == 0 && scaledIndex == 0) || (isOnMinor && !isOnMajor)) - { - Unicode::UnicodeChar wildcard[20]; - const int labelScaled = (minorInterval == 0) ? 0 : (scaledIndex / minorInterval) * labelInterval; - formatLabel(wildcard, 20, getIndexToXAxis(graph, scaledIndex, labelScaled), labelDecimals, labelDecimalPoint, dataScale); - // Adjust to make label centered - int16_t labelWidth; - const Unicode::UnicodeChar* text = labelTypedText.getText(); - if (labelRotation == TEXT_ROTATE_0 || labelRotation == TEXT_ROTATE_180) - { - labelWidth = fontToDraw->getStringWidth(text, wildcard); - } - else - { - // Get full height for all lines, except the last line for which we "replace" the part under - // the baseline with the 'spacing above'. - labelWidth = fontToDraw->getHeight() * fontToDraw->getNumberOfLines(text, wildcard) + fontToDraw->getSpacingAbove(text, wildcard); - } - const int16_t offset = (labelRotation == TEXT_ROTATE_0 || labelRotation == TEXT_ROTATE_90) ? (labelWidth / 2) : ((labelWidth + 1) / 2); - Rect dirty((graph->getGraphAreaMarginLeft() + valueToScreenXQ5(graph, scaledIndex).round()) - offset, 0, labelWidth, getHeight()); - invalidateRect(dirty); - } -} - -void GraphLabelsX::drawIndexRange(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int rangeMin, const int rangeMax, const int minorInterval, const int majorInterval, const uint8_t a) const -{ - const int16_t gapIndex = graph->getGapBeforeIndex(); - if (gapIndex <= 0 || gapIndex <= rangeMin || gapIndex > rangeMax) - { - GraphLabelsBase::drawIndexRange(invalidatedArea, fontToDraw, graph, rangeMin, rangeMax, minorInterval, majorInterval, a); - } - else - { - GraphLabelsBase::drawIndexRange(invalidatedArea, fontToDraw, graph, rangeMin, (int)gapIndex - 1, minorInterval, majorInterval, a); - GraphLabelsBase::drawIndexRange(invalidatedArea, fontToDraw, graph, (int)gapIndex, rangeMax, minorInterval, majorInterval, a); - } -} - -void GraphLabelsX::drawString(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int valueScaled, const int labelScaled, const uint8_t a) const -{ - const int16_t labelX = valueToScreenXQ5(graph, valueScaled).round() - graph->getGraphAreaPaddingLeft(); - if (labelX < 0 || labelX >= graph->getGraphAreaWidth()) - { - return; - } - - Unicode::UnicodeChar wildcard[20]; - formatLabel(wildcard, 20, getIndexToXAxis(graph, valueScaled, labelScaled), labelDecimals, labelDecimalPoint, graph->getScaleX()); - // Adjust to make label centered - int16_t labelWidth; - const Unicode::UnicodeChar* text = labelTypedText.getText(); - if (labelRotation == TEXT_ROTATE_0 || labelRotation == TEXT_ROTATE_180) - { - labelWidth = fontToDraw->getStringWidth(text, wildcard); - } - else - { - labelWidth = fontToDraw->getHeight() * fontToDraw->getNumberOfLines(text, wildcard) + fontToDraw->getSpacingAbove(text, wildcard); - } - const int16_t offset = (labelRotation == TEXT_ROTATE_0 || labelRotation == TEXT_ROTATE_90) ? (labelWidth / 2) : ((labelWidth + 1) / 2); - Rect labelRect((graph->getGraphAreaMarginLeft() + valueToScreenXQ5(graph, valueScaled).round()) - offset, 0, labelWidth, getHeight()); - - Rect dirty = labelRect & invalidatedArea; - if (!dirty.isEmpty()) - { - dirty.x -= labelRect.x; - dirty.y -= labelRect.y; - translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, color, a, labelTypedText.getAlignment(), 0, labelRotation, labelTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); - HAL::lcd().drawString(labelRect, dirty, visuals, text, wildcard, 0); - } -} - -void GraphLabelsY::drawString(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int valueScaled, const int labelScaled, const uint8_t a) const -{ - const int16_t labelCoord = valueToScreenYQ5(graph, valueScaled).round() - graph->getGraphAreaPaddingTop(); - if (labelCoord < 0 || labelCoord >= graph->getGraphAreaHeight()) - { - return; - } - - Unicode::UnicodeChar wildcard[20]; - formatLabel(wildcard, 20, labelScaled, labelDecimals, labelDecimalPoint, dataScale); - - // Adjust to make label centered - int16_t labelHeight; - const Unicode::UnicodeChar* text = labelTypedText.getText(); - if (labelRotation == TEXT_ROTATE_0 || labelRotation == TEXT_ROTATE_180) - { - // Get full height for all lines, except the last line for which we "replace" the part under - // the baseline with the 'spacing above'. - labelHeight = fontToDraw->getHeight() * fontToDraw->getNumberOfLines(text, wildcard) + fontToDraw->getSpacingAbove(text, wildcard); - } - else - { - labelHeight = fontToDraw->getStringWidth(text, wildcard); - } - const int16_t offset = (labelRotation == TEXT_ROTATE_0 || labelRotation == TEXT_ROTATE_90) ? (labelHeight / 2) : ((labelHeight + 1) / 2); - Rect labelRect(0, (graph->getGraphAreaMarginTop() + valueToScreenYQ5(graph, valueScaled).round()) - offset, getWidth(), labelHeight); - - Rect dirty = labelRect & invalidatedArea; - if (!dirty.isEmpty()) - { - dirty.x -= labelRect.x; - dirty.y -= labelRect.y; - translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, color, a, labelTypedText.getAlignment(), 0, labelRotation, labelTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); - HAL::lcd().drawString(labelRect, dirty, visuals, text, wildcard, 0); - } -} - -void GraphTitle::draw(const Rect& invalidatedArea) const -{ - if (!titleTypedText.hasValidId()) - { - return; - } - const Font* fontToDraw = titleTypedText.getFont(); - if (!fontToDraw) - { - return; - } - - const uint8_t a = LCD::div255(getAlpha() * getGraph()->getAlpha()); - if (a == 0) - { - return; - } - - const uint16_t lineHeight = fontToDraw->getHeight() * fontToDraw->getNumberOfLines(titleTypedText.getText()); - - Rect labelRect(rect); - // Adjust to make label centered - if (titleRotation == TEXT_ROTATE_0 || titleRotation == TEXT_ROTATE_180) - { - labelRect.y += (labelRect.height - lineHeight) / 2; - labelRect.height = lineHeight; - } - else - { - labelRect.x += (labelRect.width - lineHeight) / 2; - labelRect.width = lineHeight; - } - - Rect dirty = labelRect & invalidatedArea; - if (!dirty.isEmpty()) - { - dirty.x -= labelRect.x; - dirty.y -= labelRect.y; - translateRectToAbsolute(labelRect); - LCD::StringVisuals visuals(fontToDraw, getColor(), a, titleTypedText.getAlignment(), 0, titleRotation, titleTypedText.getTextDirection(), 0, WIDE_TEXT_NONE); - HAL::lcd().drawString(labelRect, dirty, visuals, titleTypedText.getText(), 0, 0); - } -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp deleted file mode 100644 index 826117e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphScroll.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ - -void GraphScrollData::clear() -{ - DynamicDataGraph::clear(); - current = 0; -} - -int32_t GraphScrollData::indexToGlobalIndex(int16_t index) const -{ - if (usedCapacity < maxCapacity) - { - return dataIndex(index); - } - return (dataCounter - maxCapacity) + index; -} - -void GraphScrollData::beforeAddValue() -{ - if (usedCapacity == maxCapacity) - { - invalidateAllXAxisPoints(); - } -} - -int16_t GraphScrollData::addValue(int value) -{ - const bool graphFull = usedCapacity == maxCapacity; - const int16_t index = current++; - current %= maxCapacity; - if (index == usedCapacity) - { - usedCapacity++; - } - yValues[index] = value; - if (graphFull) - { - invalidateGraphArea(); - invalidateAllXAxisPoints(); - } - else - { - invalidateGraphPointAt(index); - } - return index; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp deleted file mode 100644 index 0d9a7f1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndClear.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ - -void GraphWrapAndClearData::clear() -{ - invalidateAllXAxisPoints(); - DynamicDataGraph::clear(); -} - -void GraphWrapAndClearData::beforeAddValue() -{ - if (usedCapacity >= maxCapacity) - { - clear(); - } -} - -int16_t GraphWrapAndClearData::addValue(int value) -{ - const bool clearGraph = (usedCapacity == 0); - const int16_t index = usedCapacity; - usedCapacity++; - yValues[dataIndex(index)] = value; - if (clearGraph) - { - // Label sizes might have grown, also invalidate new sizes - invalidateAllXAxisPoints(); - } - invalidateGraphPointAt(index); - return index; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp b/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp deleted file mode 100644 index f96857e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/source/touchgfx/widgets/graph/GraphWrapAndOverwrite.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2018(-2023) STMicroelectronics. -* All rights reserved. -* -* This file is part of the TouchGFX 4.21.2 distribution. -* -* This software is licensed under terms that can be found in the LICENSE file in -* the root directory of this software component. -* If no LICENSE file comes with this software, it is provided AS-IS. -* -*******************************************************************************/ - -#include - -namespace touchgfx -{ - -void GraphWrapAndOverwriteData::clear() -{ - DynamicDataGraph::clear(); - current = 0; -} - -int32_t GraphWrapAndOverwriteData::indexToGlobalIndex(int16_t index) const -{ - if (this->usedCapacity < this->maxCapacity) - { - return index; - } - const int16_t gapIndex = this->getGapBeforeIndex(); - if (index < gapIndex) - { - return (this->dataCounter - gapIndex) + index; - } - return ((this->dataCounter - gapIndex) - this->maxCapacity) + index; -} - -void GraphWrapAndOverwriteData::beforeAddValue() -{ - if (current == 0 && usedCapacity >= maxCapacity) - { - int xMin = getGraphRangeXMin(); - int xMax = getGraphRangeXMax(); - for (int i = xMin; i < 0; i++) - { - invalidateXAxisPointAt(i); - } - for (int i = maxCapacity; i <= xMax; i++) - { - invalidateXAxisPointAt(i); - } - } - if (usedCapacity >= maxCapacity) - { - invalidateGraphPointAt(current); - invalidateXAxisPointAt(current); - } -} - -int16_t GraphWrapAndOverwriteData::addValue(int value) -{ - const int16_t index = current++; - current %= maxCapacity; - if (index == usedCapacity) - { - usedCapacity++; - } - yValues[dataIndex(index)] = value; - setGapBeforeIndex(index + 1); - invalidateGraphPointAt(index); - if (usedCapacity >= maxCapacity) - { - invalidateXAxisPointAt(index); - } - if (index == 0 && usedCapacity >= maxCapacity) - { - int xMin = getGraphRangeXMin(); - int xMax = getGraphRangeXMax(); - for (int i = xMin; i < 0; i++) - { - invalidateXAxisPointAt(i); - } - for (int i = maxCapacity; i <= xMax; i++) - { - invalidateXAxisPointAt(i); - } - } - return index; -} - -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out deleted file mode 100644 index a9f6b47..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/linux/fontconvert.out and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out deleted file mode 100644 index e13d041..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out deleted file mode 100644 index a889fe4..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/linux/imageconvert.out and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe deleted file mode 100644 index 461c8eb..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/msvs/ImageConvert.exe and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out deleted file mode 100644 index 461c8eb..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/imageconvert/build/win/imageconvert.out and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/ApplicationFontProvider.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/ApplicationFontProvider.cpp.temp deleted file mode 100644 index 0ca9583..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/ApplicationFontProvider.cpp.temp +++ /dev/null @@ -1,28 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include -#include -#include -<% if save_flashreader? %> - -touchgfx::FlashDataReader* ApplicationFontProvider::fontFlashReader = 0; -<% end %> - -touchgfx::Font* ApplicationFontProvider::getFont(touchgfx::FontId typography) -{ -<% if @typographies.empty? %> - return 0; -<% else %> - switch (typography) - { -<% @typographies.each_with_index do |typography, index| %> - case Typography::<%= typography.name.upcase %>: - // <%= typography.cpp_name %>_<%= typography.font_size %>_<%= typography.bpp %>bpp - return const_cast(TypedTextDatabase::getFonts()[<%= get_font_index(index) %>]); -<% end %> - default: - return 0; - } -<% end %> -} diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/ApplicationFontProvider.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/ApplicationFontProvider.hpp.temp deleted file mode 100644 index 009f12f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/ApplicationFontProvider.hpp.temp +++ /dev/null @@ -1,59 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_APPLICATIONFONTPROVIDER_HPP -#define TOUCHGFX_APPLICATIONFONTPROVIDER_HPP - -#include - -namespace touchgfx -{ -class FlashDataReader; -} - -struct Typography -{ -<% @typographies.each_with_index do |typography, index| %> - static const touchgfx::FontId <%= typography.name.upcase %> = <%= index %>; -<% end %> -}; - -struct TypographyFontIndex -{ -<% @typographies.each_with_index do |typography, index| %> - static const touchgfx::FontId <%= typography.name.upcase %> = <%= get_font_index(index) %>; <%= get_font_comment_space(index) %>// <%= get_font_comment(index) %> -<% end %> - static const uint16_t NUMBER_OF_FONTS = <%= get_max_font_index %>; -}; - -class ApplicationFontProvider : public touchgfx::FontProvider -{ -public: - virtual touchgfx::Font* getFont(touchgfx::FontId typography); - -<% if save_flashreader? %> - static void setFlashReader(touchgfx::FlashDataReader* flashReader) - { - fontFlashReader = flashReader; - } - - static touchgfx::FlashDataReader* getFlashReader() - { - return fontFlashReader; - } - -private: - static touchgfx::FlashDataReader* fontFlashReader; -<% else %> - static void setFlashReader(touchgfx::FlashDataReader* /*flashReader*/) - { - } - - static touchgfx::FlashDataReader* getFlashReader() - { - return 0; - } -<% end %> -}; - -#endif // TOUCHGFX_APPLICATIONFONTPROVIDER_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.cpp.temp deleted file mode 100644 index e1c5760..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.cpp.temp +++ /dev/null @@ -1,55 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include - -namespace touchgfx -{ -const uint8_t* CachedFont::getPixelData(const GlyphNode* glyph) const -{ - // If glyph is cached, then data is present just after the GlyphNode - if (FontCache::isCached(glyph)) - { - const uint8_t* data = FontCache::getPixelData(glyph); - return data; - } - return flashFont->getPixelData(glyph); -} - -const GlyphNode* CachedFont::getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const -{ - // Look first in internal flash font - const GlyphNode* n = flashFont->find(unicode); - - if ((n == 0) && (cache != 0)) - { - // Now look in FontCache table - n = cache->getGlyph(unicode, fontId); - } - - // Revert to normal behaviour if still not found - if (n == 0 && unicode != 0 && unicode != '\n') - { - Unicode::UnicodeChar fallbackChar = flashFont->getFallbackChar(); - n = flashFont->find(fallbackChar); - if (n == 0) - { - n = cache->getGlyph(fallbackChar, fontId); - } - } - - if (n != 0) - { - pixelData = getPixelData(n); - bitsPerPixel = getBitsPerPixel(); - return n; - } - return (const GlyphNode*)0; -} - -int8_t CachedFont::getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const -{ - // Kerning is not supported by Font Caching - return 0; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp deleted file mode 100644 index 52f6ebf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/CachedFont.hpp.temp +++ /dev/null @@ -1,92 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_CACHEDFONT_HPP -#define TOUCHGFX_CACHEDFONT_HPP - -#include -#include - -namespace touchgfx -{ -class CachedFont : public GeneratedFont -{ -public: - CachedFont(const struct touchgfx::BinaryFontData* data, FontId id, FontCache* _cache, const GeneratedFont* _flashFont) - : GeneratedFont(0, // GlyphNode* - data->numberOfGlyphs, - data->fontHeight, - data->baseline, - data->pixAboveTop, - data->pixBelowBottom, - data->bitsPerPixel, - data->byteAlignRow, - data->maxLeft, - data->maxRight, - 0, // glyphDataPointer - 0, // Kerning table not used for cached font - data->fallbackChar, - data->ellipsisChar, - 0, // lsubTablePointer - 0), // contextualFormsPointer - fontId(id), - cache(_cache), - flashFont(_flashFont) - { - } - - CachedFont() - : GeneratedFont() - { - } - - using GeneratedFont::getGlyph; - - virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const; - - virtual const uint8_t* getPixelData(const GlyphNode* glyph) const; - - virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const; - - void setFontCache(FontCache& cache); - FontId getFontId() const - { - return fontId; - } - - virtual const uint16_t* getGSUBTable() const - { - if (gsubTable != 0) - { - return gsubTable; - } - return flashFont->getGSUBTable(); - } - - virtual void setGSUBTable(const uint16_t* table) - { - gsubTable = table; - } - - virtual const FontContextualFormsTable* getContextualFormsTable() const - { - if (arabicTable != 0) - { - return arabicTable; - } - return flashFont->getContextualFormsTable(); - } - - virtual void setContextualFormsTable(const FontContextualFormsTable* table) - { - arabicTable = table; - } - -private: - FontId fontId; - FontCache* cache; - const GeneratedFont* flashFont; -}; -} // namespace touchgfx - -#endif // TOUCHGFX_CACHEDFONT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp deleted file mode 100644 index 88da8ea..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.cpp.temp +++ /dev/null @@ -1,425 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include -#include -#include -#include -#include -#include - -namespace touchgfx -{ -FontCache::FontCache() - : memorySize(0), memory(0), top(0), gsubStart(0), reader(0) -{ -} - -void FontCache::clear(bool keepGsubOrContextTable /* = false */) -{ - memset(fontTable, 0, sizeof(fontTable)); - - // Top is beginning of memory, no glyphs are cached yet - top = memory; - - if (!keepGsubOrContextTable) - { - // gsubStart points to end of memory (nothing loaded yet) - gsubStart = memory + memorySize; - - // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); - } -} - -void FontCache::setMemory(uint8_t* _memory, uint32_t size) -{ - memory = _memory; - memorySize = size; - - clear(); -} - -void FontCache::setReader(FontDataReader* _reader) -{ - reader = _reader; -} - -const GlyphNode* FontCache::getGlyph(Unicode::UnicodeChar unicode, FontId font) const -{ - GlyphNode* g = (GlyphNode*)fontTable[font].first; - while (g) - { - if (g->unicode == unicode) - { - return g; - } - GlyphNode** next = (GlyphNode**)((uint8_t*)g + SizeGlyphNode); - g = *next; - } - return 0; -} - -void FontCache::open() -{ - if (reader) - { - reader->open(); - } -} - -void FontCache::close() -{ - if (reader) - { - reader->close(); - } -} - -void FontCache::initializeCachedFont(TypedText t, CachedFont* font, bool loadGsubOrContextTable /*= false*/) -{ - // Get font index from typed text - FontId fontId = t.getFontId(); - // Reset to start of file - open(); - setPosition(0); - - assert(sizeof(touchgfx::BinaryFontData) < MAX_BUFFER_SIZE); - readData(buffer, sizeof(touchgfx::BinaryFontData)); - const struct touchgfx::BinaryFontData* binaryFontData = reinterpret_cast(buffer); - - const Font** flashFonts = TypedTextDatabase::getFonts(); - const GeneratedFont* flashFont = static_cast(flashFonts[fontId]); - *font = CachedFont(reinterpret_cast(buffer), fontId, this, flashFont); - - if (loadGsubOrContextTable && (binaryFontData->offsetToGSUB != 0)) - { - setPosition(binaryFontData->offsetToGSUB); - - const uint32_t sizeOfGSUB = (binaryFontData->offsetToArabicTable != 0 ? binaryFontData->offsetToArabicTable : binaryFontData->sizeOfFontData) - binaryFontData->offsetToGSUB; - - if (top + sizeOfGSUB < gsubStart) // Room for this GSUB table - { - uint8_t* const gsubPosition = gsubStart - sizeOfGSUB; - readData(gsubPosition, sizeOfGSUB); - font->setGSUBTable(reinterpret_cast(gsubPosition)); - gsubStart -= sizeOfGSUB; - - // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); - } - else - { - font->setGSUBTable(0); - } - } - - if (loadGsubOrContextTable && (binaryFontData->offsetToArabicTable != 0)) - { - setPosition(binaryFontData->offsetToArabicTable); - - const uint32_t sizeTableData = binaryFontData->sizeOfFontData - binaryFontData->offsetToArabicTable; - - if (top + sizeTableData + sizeof(FontContextualFormsTable) < gsubStart) // Room for the ContextualFormsTables - { - // Allocate FontContextualFormsTable first - gsubStart -= sizeof(FontContextualFormsTable); - // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); - - FontContextualFormsTable* table = (FontContextualFormsTable*)gsubStart; - font->setContextualFormsTable(table); - gsubStart -= sizeTableData; - readData(gsubStart, sizeTableData); - - // Set pointers in table - const uint16_t* const base = (const uint16_t*)gsubStart; - // First elements in binary font are offsets to arrays in 16bit words - table->contextualForms4Long = (FontContextualFormsTable::arrayOf5UnicodesPtr)(base + base[0]); - table->contextualForms3Long = (FontContextualFormsTable::arrayOf5UnicodesPtr)(base + base[1]); - table->contextualForms2Long = (FontContextualFormsTable::arrayOf5UnicodesPtr)(base + base[2]); - table->contextualForms0621_063a = (FontContextualFormsTable::arrayOf4UnicodesPtr)(base + base[3]); - table->contextualForms0641_064a = (FontContextualFormsTable::arrayOf4UnicodesPtr)(base + base[4]); - table->contextualForms06XX = (FontContextualFormsTable::arrayOf5UnicodesPtr)(base + base[5]); - table->contextualForms4LongSize = base[6]; - table->contextualForms3LongSize = base[7]; - table->contextualForms2LongSize = base[8]; - table->contextualForms06XXSize = base[9]; - } - else - { - font->setContextualFormsTable(0); - } - } - - close(); -} - -bool FontCache::cacheString(TypedText t, const Unicode::UnicodeChar* string) -{ - open(); - if (!createSortedString(string)) - { - close(); - return false; - } - const bool result = cacheSortedString(t); - close(); - return result; -} - -bool FontCache::cacheLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string) -{ - open(); - if (!createSortedLigatures(font, t, string, 0, 0)) - { - close(); - return false; - } - const bool result = cacheSortedString(t); - close(); - return result; -} - -bool FontCache::cacheSortedString(TypedText t) -{ - setPosition(8); // Skip font index and size - uint32_t glyphNodeOffset; - uint32_t dummy; - readData(&glyphNodeOffset, sizeof(uint32_t)); // offsetToTable - readData(&dummy, sizeof(uint32_t)); // offsetToKerning - readData(&glyphDataOffset, sizeof(uint32_t)); // offsetToGlyphs - readData(&dummy, sizeof(uint32_t)); // offsetToGlyphs - readData(&dummy, sizeof(uint32_t)); // offsetToArabicTable - readData(&numGlyphs, sizeof(uint16_t)); // numberOfGlyphs - - FontId fontId = t.getFontId(); // Get font index from typed text - uint32_t bpp = t.getFont()->getBitsPerPixel(); // Get BPP from standard font - - setPosition(glyphNodeOffset); // Go to glyph nodes for font - currentFileGlyphNumber = 0; - currentFileGlyphNode.unicode = 0; // Force reading of first glyph - - const Unicode::UnicodeChar* string = sortedString; - Unicode::UnicodeChar last = 0; - GlyphNode* firstNewGlyph = 0; - bool outOfMemory = false; - while (*string) - { - Unicode::UnicodeChar ch = *string; - if (ch != last) - { - if (!contains(ch, fontId)) - { - insert(ch, fontId, bpp, outOfMemory); - if (outOfMemory) - { - break; - } - if (firstNewGlyph == 0) - { - firstNewGlyph = (GlyphNode*)fontTable[fontId].last; - } - } - } - last = ch; - string++; - } - - cacheData(bpp, firstNewGlyph); - return !outOfMemory; -} - -bool FontCache::contains(Unicode::UnicodeChar unicode, FontId font) const -{ - GlyphNode* g = (GlyphNode*)fontTable[font].first; - while (g) - { - if (g->unicode == unicode) - { - return true; - } - GlyphNode** next = (GlyphNode**)((uint8_t*)g + SizeGlyphNode); - g = *next; - } - return false; -} - -void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory) -{ - // Insert new glyphnode and glyph after last for font. - uint8_t* oldTop = top; - top = copyGlyph(top, unicode, font, bpp, outOfMemory); - - if (top == oldTop) - { - return; - } - - if (fontTable[font].last == 0) - { - // First glyph - fontTable[font].first = oldTop; - fontTable[font].last = oldTop; - } - else - { - // Set next pointer of old last glyph - uint8_t** old_next = (uint8_t**)(fontTable[font].last + SizeGlyphNode); - *old_next = oldTop; - - // Save new glyph as last glyph - fontTable[font].last = oldTop; - } -} - -uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory) -{ - while (currentFileGlyphNumber < numGlyphs && currentFileGlyphNode.unicode < unicode) - { - readData(¤tFileGlyphNode, sizeof(GlyphNode)); - currentFileGlyphNumber++; - } - if (currentFileGlyphNode.unicode != unicode) - { - // GlyphNode not found - return top; - } - - // GlyphNode found - uint32_t glyphSize = ((currentFileGlyphNode.width() + 1) & ~1) * currentFileGlyphNode.height() * bpp / 8; - glyphSize = (glyphSize + 3) & ~0x03; - uint32_t requiredMem = SizeGlyphNode + 4 + glyphSize; // GlyphNode + next ptr + glyph - - // Is space available before sortedString - if (top + requiredMem > (uint8_t*)sortedString) - { - outOfMemory = true; - return top; - } - - *(GlyphNode*)top = currentFileGlyphNode; - - // Clear next pointer - uint8_t** next = (uint8_t**)(top + SizeGlyphNode); - *next = 0; - top += requiredMem; - return top; -} - -void FontCache::cacheData(uint32_t bpp, GlyphNode* first) -{ - GlyphNode* gn = first; - while (gn) - { - uint8_t* p = (uint8_t*)gn; - if (gn->dataOffset != 0xFFFFFFFF) - { - p += SizeGlyphNode; - // Next pointer - p += 4; - - // Seek and copy - setPosition(glyphDataOffset + gn->dataOffset); - uint32_t glyphSize = ((gn->width() + 1) & ~1) * gn->height() * bpp / 8; - readData(p, glyphSize); - - // Mark glyphNode as cached - gn->dataOffset = 0xFFFFFFFF; - } - - GlyphNode** next = (GlyphNode**)((uint8_t*)gn + SizeGlyphNode); - gn = *next; - } -} - -bool FontCache::createSortedString(const Unicode::UnicodeChar* string) -{ - int length = Unicode::strlen(string); - // Sorted string is allocated at end of buffer - sortedString = (Unicode::UnicodeChar*)(gsubStart - (length + 1) * 2); - if ((uint8_t*)sortedString < top) - { - // Unable to allocate string buffer in end of memory - return false; - } - int n = 0; - Unicode::UnicodeChar* uc = sortedString; - while (*string) - { - *uc++ = *string++; - n++; - } - *uc = 0; - return sortSortedString(n); -} - -bool FontCache::createSortedLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string, ...) -{ - va_list pArg; - va_start(pArg, string); - TextProvider tp; - tp.initialize(string, pArg, font->getGSUBTable(), font->getContextualFormsTable()); - va_end(pArg); - Unicode::UnicodeChar ligature; - sortedString = (Unicode::UnicodeChar*)(gsubStart); - if ((uint8_t*)(sortedString - 1) < top) - { - return false; - } - *--sortedString = 0; - int n = 0; - while ((ligature = tp.getNextLigature(t.getTextDirection())) != 0) - { - if ((uint8_t*)(sortedString - 1) < top) - { - return false; - } - *--sortedString = ligature; - n++; - } - return sortSortedString(n); -} - -bool FontCache::sortSortedString(int n) -{ - Unicode::UnicodeChar* uc = sortedString; - for (int i = 0; i < n - 1; i++) - { - bool swapped = false; - for (int j = 0; j < n - i - 1; j++) - { - if (uc[j] > uc[j + 1]) - { - Unicode::UnicodeChar temp = uc[j]; - uc[j] = uc[j + 1]; - uc[j + 1] = temp; - swapped = true; - } - } - - // If no two elements were swapped by inner loop, then break - if (!swapped) - { - break; - } - } - return true; -} - -void FontCache::setPosition(uint32_t position) -{ - if (reader) - { - reader->setPosition(position); - } -} - -void FontCache::readData(void* out, uint32_t numberOfBytes) -{ - if (reader) - { - reader->readData(out, numberOfBytes); - } -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp deleted file mode 100644 index a9ad16c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/FontCache.hpp.temp +++ /dev/null @@ -1,96 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_FONTCACHE_HPP -#define TOUCHGFX_FONTCACHE_HPP - -#include -#include -#include - -namespace touchgfx -{ -class CachedFont; - -class FontDataReader -{ -public: - virtual ~FontDataReader() - { - } - virtual void open() = 0; - virtual void close() = 0; - virtual void setPosition(uint32_t position) = 0; - virtual void readData(void* out, uint32_t numberOfBytes) = 0; -}; - -class FontCache -{ -public: - FontCache(); - void setReader(FontDataReader* reader); - void clear(bool keepGsubOrContextTable = false); - void setMemory(uint8_t* memory, uint32_t size); - void initializeCachedFont(TypedText t, CachedFont* font, bool loadGsubOrContextTable = false); - bool cacheString(TypedText t, const Unicode::UnicodeChar* string); - bool cacheLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string); - - const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, FontId font) const; - uint32_t getMemoryUsage() - { - return memorySize - (gsubStart - top); - } - - void open(); - void close(); - - static inline const uint8_t* getPixelData(const GlyphNode* glyph) - { - return ((const uint8_t*)glyph) + SizeGlyphNode + 4; - } - static inline bool isCached(const GlyphNode* g) - { - return g->dataOffset == 0xFFFFFFFF; - } - -private: - static const uint32_t SizeGlyphNode = 16; - - bool contains(Unicode::UnicodeChar unicode, FontId font) const; - void insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory); - uint8_t* copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory); - - void cacheData(uint32_t bpp, GlyphNode* first); - bool cacheSortedString(TypedText t); - bool createSortedString(const Unicode::UnicodeChar* string); - bool createSortedLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string, ...); - bool sortSortedString(int n); - - void setPosition(uint32_t position); - void readData(void* out, uint32_t numberOfBytes); - - struct - { - uint8_t* first; // First GlyphNode, glyph in cache; - uint8_t* last; // Last GlyphNode, glyph in cache; - } fontTable[MAX(TypographyFontIndex::NUMBER_OF_FONTS, 1)]; - - uint32_t memorySize; - uint8_t* memory; // Start of memory - uint8_t* top; // First unused byte - uint8_t* gsubStart; // First address of GSUB tables, allocated in the end of the cache - - FontDataReader* reader; - - Unicode::UnicodeChar* sortedString; - // Must be bigger than BinaryFontData - static const uint32_t MAX_BUFFER_SIZE = 64; - char buffer[MAX_BUFFER_SIZE]; - uint32_t glyphDataOffset; - uint16_t numGlyphs; - uint16_t currentFileGlyphNumber; - GlyphNode currentFileGlyphNode; -}; -} // namespace touchgfx - -#endif // TOUCHGFX_FONTCACHE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp deleted file mode 100644 index acbef86..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.cpp.temp +++ /dev/null @@ -1,44 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include - -namespace touchgfx -{ -GeneratedFont::GeneratedFont(const GlyphNode* glyphs, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* const* glyphDataInternalFlash, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar, const uint16_t* const gsubData, const FontContextualFormsTable* formsTable) - : ConstFont(glyphs, numGlyphs, height, baseline, pixAboveTop, pixBelowBottom, bitsPerPixel, byteAlignRow, maxLeft, maxRight, fallbackChar, ellipsisChar), - glyphData(glyphDataInternalFlash), - kerningData(kerningList), - gsubTable(gsubData), - arabicTable(formsTable) -{ -} - -const uint8_t* GeneratedFont::getPixelData(const GlyphNode* glyph) const -{ - const uint8_t* const* table = (const uint8_t* const*)glyphData; - return &(table[glyph->unicode / 2048][glyph->dataOffset]); -} - -int8_t GeneratedFont::getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const -{ - if (!glyph || glyph->kerningTableSize == 0) - { - return 0; - } - - const KerningNode* kerndata = kerningData + glyph->kerningTablePos(); - for (uint16_t i = glyph->kerningTableSize; i > 0; i--, kerndata++) - { - if (prevChar == kerndata->unicodePrevChar) - { - return kerndata->distance; - } - if (prevChar < kerndata->unicodePrevChar) - { - break; - } - } - return 0; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp deleted file mode 100644 index 3a5088f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/GeneratedFont.hpp.temp +++ /dev/null @@ -1,132 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_GENERATEDFONT_HPP -#define TOUCHGFX_GENERATEDFONT_HPP - -#include - -namespace touchgfx -{ -class GeneratedFont : public ConstFont -{ -public: - GeneratedFont(const GlyphNode* glyphs, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* const* glyphDataInternalFlash, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar, const uint16_t* const gsubData, const FontContextualFormsTable* formsTable); - - using ConstFont::getGlyph; - - virtual const uint8_t* getPixelData(const GlyphNode* glyph) const; - - virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const; - - virtual const uint16_t* getGSUBTable() const - { - return gsubTable; - } - - virtual const FontContextualFormsTable* getContextualFormsTable() const - { - return arabicTable; - } - -protected: - GeneratedFont() - : ConstFont(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), glyphData(0), kerningData(0), gsubTable(0), arabicTable(0) - { - } - - const void* glyphData; ///< The glyphs - const KerningNode* kerningData; ///< The kerning - const uint16_t* gsubTable; ///< The GSUB tables - - const FontContextualFormsTable* arabicTable; ///< Contextual forms -}; - -struct BinaryFontData -{ - uint32_t fontIndex; // The font index (as used by TypedTextDatabase) - uint32_t sizeOfFontData; // Size of the complete BinaryFont - uint32_t offsetToTable; // GlyphNode[] - uint32_t offsetToKerning; // KerningNode[] - uint32_t offsetToGlyphs; // uint8_t[] - uint32_t offsetToGSUB; // uint16_t[] - uint32_t offsetToArabicTable; // FontContextualFormsTable - uint16_t numberOfGlyphs; // Number of glyphs in Table and Glyphs - uint16_t fontHeight; // Font height - uint16_t baseline; // Distance to baseline - uint8_t pixAboveTop; // Max pixels above top - uint8_t pixBelowBottom; // Max pixels below bottom - uint8_t bitsPerPixel; // Bpp - uint8_t byteAlignRow; // A4/A2/A1 - uint8_t maxLeft; // The maximum a glyph extends to the left - uint8_t maxRight; // The maximum a glyph extends to the right - Unicode::UnicodeChar fallbackChar; // Fallback Character for the font - Unicode::UnicodeChar ellipsisChar; // Ellipsis Character for the font -}; - -class BinaryFont : public GeneratedFont -{ -public: - BinaryFont(const struct touchgfx::BinaryFontData* data) - : GeneratedFont((const GlyphNode*)((const uint8_t*)data + data->offsetToTable), - data->numberOfGlyphs, - data->fontHeight, - data->baseline, - data->pixAboveTop, - data->pixBelowBottom, - data->bitsPerPixel, - data->byteAlignRow, - data->maxLeft, - data->maxRight, - 0, - (const KerningNode*)((const uint8_t*)data + data->offsetToKerning), - data->fallbackChar, - data->ellipsisChar, - (data->offsetToGSUB == 0) ? 0 : (const uint16_t*)((const uint8_t*)data + data->offsetToGSUB), - 0), - glyphData((const uint8_t*)data + data->offsetToGlyphs) - { - if (data->offsetToArabicTable > 0) - { - setupContextualTable(data); - } - } - - BinaryFont() - : GeneratedFont() - { - } - - virtual const uint8_t* getPixelData(const GlyphNode* glyph) const - { - const uint8_t* data = (const uint8_t*)glyphData; - return &(data[glyph->dataOffset]); - } - -protected: - const uint8_t* glyphData; - FontContextualFormsTable contextualForms; - -private: - typedef const Unicode::UnicodeChar (*array5ptr)[5]; - typedef const Unicode::UnicodeChar (*array4ptr)[4]; - void setupContextualTable(const struct touchgfx::BinaryFontData* data) - { - const uint16_t* const base = (const uint16_t*)(((const uint8_t*)data) + data->offsetToArabicTable); - // First elements in binary font are offsets to arrays in 16bit words - contextualForms.contextualForms4Long = (array5ptr)(base + base[0]); - contextualForms.contextualForms3Long = (array5ptr)(base + base[1]); - contextualForms.contextualForms2Long = (array5ptr)(base + base[2]); - contextualForms.contextualForms0621_063a = (array4ptr)(base + base[3]); - contextualForms.contextualForms0641_064a = (array4ptr)(base + base[4]); - contextualForms.contextualForms06XX = (array5ptr)(base + base[5]); - contextualForms.contextualForms4LongSize = base[6]; - contextualForms.contextualForms3LongSize = base[7]; - contextualForms.contextualForms2LongSize = base[8]; - contextualForms.contextualForms06XXSize = base[9]; - arabicTable = &contextualForms; - } -}; -} // namespace touchgfx - -#endif // TOUCHGFX_GENERATEDFONT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/LanguageXX.cpp.bin.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/LanguageXX.cpp.bin.temp deleted file mode 100644 index 4443ad0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/LanguageXX.cpp.bin.temp +++ /dev/null @@ -1,4 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -// Empty Language file diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/LanguageXX.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/LanguageXX.cpp.temp deleted file mode 100644 index d1c70e2..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/LanguageXX.cpp.temp +++ /dev/null @@ -1,48 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include -#include - -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const uint32_t indices<%= get_language %>[] TEXT_LOCATION_FLASH_ATTRIBUTE; - -<% if remap_global? %> -// Remap all strings -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const uint32_t indices<%= get_language %>[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% text_entries = get_text_entries %> -<% if text_entries.empty? %> - 0 -<% else %> -<% text_entries.each_with_index do |entry, index| %> - <%= get_string_index(entry) %><%= ((index == text_entries.length - 1) ? (index == 0 ? '' : ' '): ',') %><%= get_string_index_spaces(entry)%>// <%= entry.text_id %>: "<%= unicode_array_to_string(entry.int_array) %>" -<% end %> -<% end %> -}; -<% else %> -// Remap local strings -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const touchgfx::Unicode::UnicodeChar texts<%= get_language %>[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% substrings_and_offset = get_substrings_and_offsets(@language_index) %> -<% if substrings_and_offset.empty? %> - 0 -<% else %> -<% get_substrings_and_offsets(@language_index).each do |unicode_array, offset, last| %> - <%= unicode_array.map{|x|"0x%x"%x} * ', ' %><%= last ? '' : ',' %> // @<%= offset %> "<%= unicode_array_to_string(unicode_array) %>" -<% end %> -<% end %> -}; - -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const uint32_t indices<%= get_language %>[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% text_entries = get_text_entries %> -<% if text_entries.empty? %> - 0 -<% else %> -<% text_entries.each_with_index do |entry, index| %> - <%= get_string_index(entry) %><%= ((index == text_entries.length-1) ? ' ': ',') %><%= get_string_index_spaces(entry)%>// <%= entry.text_id %>: "<%= unicode_array_to_string(entry.int_array) %>" -<% end %> -<% end %> -}; -<% end %> diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TextKeysAndLanguages.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TextKeysAndLanguages.hpp.temp deleted file mode 100644 index e5f36c5..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TextKeysAndLanguages.hpp.temp +++ /dev/null @@ -1,23 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_TEXTKEYSANDLANGUAGES_HPP -#define TOUCHGFX_TEXTKEYSANDLANGUAGES_HPP - -enum LANGUAGES -{ -<% get_languages.each do |language| %> - <%= language %>, -<% end %> - NUMBER_OF_LANGUAGES -}; - -enum TEXTS -{ -<% get_texts.each do |text| %> - <%= text.upcase %>, -<% end %> - NUMBER_OF_TEXT_KEYS -}; - -#endif // TOUCHGFX_TEXTKEYSANDLANGUAGES_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/Texts.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/Texts.cpp.temp deleted file mode 100644 index 78d96bf..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/Texts.cpp.temp +++ /dev/null @@ -1,195 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include -#include -#include -#include -#include -#include -#include -#include - -uint16_t touchgfx::Font::getStringWidth(const touchgfx::Unicode::UnicodeChar* text, ...) const -{ - va_list pArg; - va_start(pArg, text); - uint16_t width = getStringWidth<%= is_rtl? ? 'RTL' : 'LTR' %>(TEXT_DIRECTION_LTR, text, pArg); - va_end(pArg); - return width; -} - -uint16_t touchgfx::Font::getStringWidth(touchgfx::TextDirection textDirection, const touchgfx::Unicode::UnicodeChar* text, ...) const -{ - va_list pArg; - va_start(pArg, text); - uint16_t width = getStringWidth<%= is_rtl? ? 'RTL' : 'LTR' %>(textDirection, text, pArg); - va_end(pArg); - return width; -} - -touchgfx::Unicode::UnicodeChar touchgfx::TextProvider::getNextLigature(TextDirection direction) -{ -<% if is_rtl? %> - nextCharacters.replaceAt0(unicodeConverter(direction)); -<% end %> - if (fontGsubTable && nextCharacters.peekChar()) - { - substituteGlyphs(); - if (nextCharacters.peekChar(1) == 0x093F) // Hindi I-matra - { - nextCharacters.replaceAt1(nextCharacters.peekChar()); - nextCharacters.replaceAt0(0x093F); - } - } - return getNextChar(); -} - -void touchgfx::TextProvider::initializeInternal() -{ - fillInputBuffer(); -<% if is_rtl? %> - unicodeConverterInit(); -<% end %> -} - -void touchgfx::LCD::drawString(touchgfx::Rect widgetArea, const touchgfx::Rect& invalidatedArea, const touchgfx::LCD::StringVisuals& stringVisuals, const touchgfx::Unicode::UnicodeChar* format, ...) -{ - va_list pArg; - va_start(pArg, format); - drawString<%= is_rtl? ? 'RTL' : 'LTR' %>(widgetArea, invalidatedArea, stringVisuals, format, pArg); - va_end(pArg); -} - -// Default TypedTextDatabase -extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[]; - -<% if generate_binary_files? %> -extern const touchgfx::Unicode::UnicodeChar EmptyLanguageTexts[]; -extern const uint32_t EmptyLanguageIndices[]; - -<% else %> -<% if remap_global? %> -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% substrings_and_offsets = get_substrings_and_offsets %> -<% if substrings_and_offsets.empty? %> - 0 // No texts in application -<% else %> -<% substrings_and_offsets.each do |(unicode_array, offset, last)| %> - <%= unicode_array.map{|x|"0x%x"%x} * ', ' %><%= last ? '' : ',' %> // @<%= offset %> "<%= unicode_array_to_string(unicode_array) %>" -<% end %> -<% end %> -}; - -<% end %> -<% get_capitalized_languages.each do |lang| %> -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const uint32_t indices<%= lang %>[] TEXT_LOCATION_FLASH_ATTRIBUTE; - -<% if !remap_global? %> -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const touchgfx::Unicode::UnicodeChar texts<%= lang %>[] TEXT_LOCATION_FLASH_ATTRIBUTE; - -<% end %> -<% end %> -<% end %> -// Array holding dynamically installed languages -struct TranslationHeader -{ - uint32_t offset_to_texts; - uint32_t offset_to_indices; - uint32_t offset_to_typedtext; -}; -static const TranslationHeader* languagesArray[<%= has_languages? ? get_number_of_languages : 1 %>] = { 0 }; - -// Compiled and linked in languages -static const uint32_t* const staticLanguageIndices[] = { -<% if generate_binary_files? %> - EmptyLanguageIndices -<% else %> -<% if !has_languages? %> - 0 -<% else %> -<% get_capitalized_languages.each_with_index do |lang, index| %> - indices<%= lang %><%= (index == get_number_of_languages - 1) ? '': ',' %> -<% end %> -<% end %> -<% end %> -}; -<% if generate_binary_files? %> -static const touchgfx::Unicode::UnicodeChar* const staticLanguageTexts[] = { - EmptyLanguageTexts -}; -<% else %> -<% if not remap_global? %> -static const touchgfx::Unicode::UnicodeChar* const staticLanguageTexts[] = { -<% if !has_languages? %> - 0 -<% else %> -<% get_capitalized_languages.each_with_index do |lang, index| %> - texts<%= lang %><%= (index == get_number_of_languages - 1) ? '': ',' %> -<% end %> -<% end %> -}; -<% end %> -<% end %> - -touchgfx::LanguageId touchgfx::Texts::currentLanguage = static_cast(0); -static const touchgfx::Unicode::UnicodeChar* currentLanguagePtr = 0; -static const uint32_t* currentLanguageIndices = 0; - -void touchgfx::Texts::setLanguage(touchgfx::LanguageId id) -{ - const touchgfx::TypedText::TypedTextData* currentLanguageTypedText = 0; - if (id < <%= has_languages? ? get_number_of_languages : 1 %>) - { - if (languagesArray[id] != 0) - { - // Dynamic translation is added - const TranslationHeader* translation = languagesArray[id]; - currentLanguagePtr = (const touchgfx::Unicode::UnicodeChar*)(((const uint8_t*)translation) + translation->offset_to_texts); - currentLanguageIndices = (const uint32_t*)(((const uint8_t*)translation) + translation->offset_to_indices); - currentLanguageTypedText = (const touchgfx::TypedText::TypedTextData*)(((const uint8_t*)translation) + translation->offset_to_typedtext); - } -<% if generate_binary_files? %> - else - { - // Compiled and linked empty texts and indices in typedTextData - currentLanguagePtr = staticLanguageTexts[0]; - currentLanguageIndices = staticLanguageIndices[0]; - currentLanguageTypedText = typedTextDatabaseArray[0]; - } -<% else %> - else - { - // Compiled and linked in languages -<% if remap_global? %> - currentLanguagePtr = texts_all_languages; - currentLanguageIndices = staticLanguageIndices[id]; -<% else %> - currentLanguagePtr = staticLanguageTexts[id]; - currentLanguageIndices = staticLanguageIndices[id]; -<% end %> - currentLanguageTypedText = typedTextDatabaseArray[id]; - } -<% end %> - } - - if (currentLanguageTypedText) - { - currentLanguage = id; - touchgfx::TypedText::registerTypedTextDatabase(currentLanguageTypedText, - TypedTextDatabase::getFonts(), TypedTextDatabase::getInstanceSize()); - } -} - -void touchgfx::Texts::setTranslation(touchgfx::LanguageId id, const void* translation) -{ - languagesArray[id] = (const TranslationHeader*)translation; -} - -const touchgfx::Unicode::UnicodeChar* touchgfx::Texts::getText(TypedTextId id) const -{ - return ¤tLanguagePtr[currentLanguageIndices[id]]; -} diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.cpp.temp deleted file mode 100644 index b0f6fab..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.cpp.temp +++ /dev/null @@ -1,137 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include -#include .hpp> -#include - -<% get_fonts.each do |font| %> -extern touchgfx::<%= get_font_class_name %>& <%= font %>(); -<% end %> - -const touchgfx::Font* touchgfx_fonts[] = { -<% if get_fonts.empty? %> - 0 -<% else %> -<% get_fonts.each_with_index do |font, index| %> - &(<%= font %>())<%= index == get_fonts.length-1 ? '' : ',' %> -<% end %> -<% end %> -}; - -<% if generate_binary_files? %> -extern const touchgfx::TypedText::TypedTextData typedText_database_EMPTY[]; -<% else %> -extern const touchgfx::TypedText::TypedTextData typedText_database_DEFAULT[]; -<% end %> -extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[]; - -<% if generate_binary_files? %> -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const touchgfx::Unicode::UnicodeChar EmptyLanguageTexts[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% get_layouts.each do |layout| %> -<% get_typed_texts(layout).each_with_index do |entry, index| %> - 0<%= ((index == get_typed_texts(layout).length-1) ? '': ',') %> -<% end %> -<% break %> -<% end %> -}; - -TEXT_LOCATION_FLASH_PRAGMA -KEEP extern const uint32_t EmptyLanguageIndices[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% get_layouts.each do |layout| %> -<% get_typed_texts(layout).each_with_index do |entry, index| %> - <%= index %><%= ((index == get_typed_texts(layout).length-1) ? '': ',') %> -<% end %> -<% break %> -<% end %> -}; - -TEXT_LOCATION_FLASH_PRAGMA -const touchgfx::TypedText::TypedTextData typedText_database_EMPTY[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% get_layouts.each do |layout| %> -<% get_typed_texts(layout).each_with_index do |entry, index| %> - <%= ('{ 0, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR }').to_s %><%= ((index == get_typed_texts(layout).length-1) ? '': ',') %> -<% end %> -<% break %> -<% end %> -}; -<% else %> -<% get_layouts.each do |layout| %> -TEXT_LOCATION_FLASH_PRAGMA -const touchgfx::TypedText::TypedTextData typedText_database_<%= layout %>[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% if get_typed_texts(layout).empty? %> - { 0, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR } -<% else %> -<% get_typed_texts(layout).each_with_index do |typed_text, index| %> -<% fontIdx = get_font_index(typed_text.typography) %> -<% alignment = get_touchgfx_aligment(typed_text.alignment) %> -<% direction = get_touchgfx_direction(typed_text.direction) %> - { <%= fontIdx %>, <%= alignment %>, <%= direction %> }<%= index == get_typed_texts(layout).length-1 ? '' : ',' %> -<% end %> -<% end %> -}; -<% end %> -<% end %> - -TEXT_LOCATION_FLASH_PRAGMA -const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[] TEXT_LOCATION_FLASH_ATTRIBUTE = { -<% if generate_binary_files? %> -<% get_languages.each_with_index do |entry,index| %> - typedText_database_EMPTY<%= index == get_languages.length-1 ? '' : ',' %> -<% end %> -<% elsif languages.empty? %> - typedText_database_DEFAULT -<% else %> -<% get_languages.each_with_index do |language, index| %> - typedText_database_<%= get_layouts.find { |l| l == language } || 'DEFAULT' %><%= index == get_languages.length-1 ? '' : ',' %> -<% end %> -<% end %> -}; - -namespace TypedTextDatabase -{ -const touchgfx::TypedText::TypedTextData* getInstance(touchgfx::LanguageId id) -{ - return typedTextDatabaseArray[id]; -} - -uint16_t getInstanceSize() -{ -<% if has_text_entries? %> -<% if generate_binary_files? %> - return sizeof(typedText_database_EMPTY) / sizeof(touchgfx::TypedText::TypedTextData); -<% else %> - return sizeof(typedText_database_DEFAULT) / sizeof(touchgfx::TypedText::TypedTextData); -<% end %> -<% else %> - return 0; -<% end %> -} - -const touchgfx::Font** getFonts() -{ - return touchgfx_fonts; -} - -const touchgfx::Font* setFont(touchgfx::FontId fontId, const touchgfx::Font* font) -{ - const touchgfx::Font* old = touchgfx_fonts[fontId]; - touchgfx_fonts[fontId] = font; - return old; -} - -void resetFont(touchgfx::FontId fontId) -{ -<% if !get_fonts.empty? %> - switch (fontId) - { -<% get_fonts.each_with_index do |font, index| %> - case <%= index %>: - touchgfx_fonts[<%= index %>] = &(<%= font %>()); - break; -<% end %> - } -<% end %> -} -} // namespace TypedTextDatabase diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp deleted file mode 100644 index dafd4d7..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/TypedTextDatabase.hpp.temp +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_TYPEDTEXTDATABASE_HPP -#define TOUCHGFX_TYPEDTEXTDATABASE_HPP - -#include -#include - -namespace TypedTextDatabase -{ -class TypedTextData; -const touchgfx::TypedText::TypedTextData* getInstance(touchgfx::LanguageId id); -const touchgfx::TypedText::TypedTextData* getInstance(); -const touchgfx::Font** getFonts(); -const touchgfx::Font* setFont(touchgfx::FontId fontId, const touchgfx::Font*); -void resetFont(touchgfx::FontId fontId); -uint16_t getInstanceSize(); -} // namespace TypedTextDatabase - -#endif // TOUCHGFX_TYPEDTEXTDATABASE_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.cpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.cpp.temp deleted file mode 100644 index 384f53c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.cpp.temp +++ /dev/null @@ -1,152 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#include -#include -#include - -namespace touchgfx -{ -GlyphNode UnmappedDataFont::glyphNodeBuffer; - -UnmappedDataFont::UnmappedDataFont(const GlyphNode* glyphs, const uint16_t* unicodeList, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* const* glyphDataList, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar, const uint16_t* const gsubData, const FontContextualFormsTable* formsTable) - : Font(height, baseline, pixAboveTop, pixBelowBottom, bitsPerPixel, byteAlignRow, maxLeft, maxRight, fallbackChar, ellipsisChar), - glyphList(glyphs), - listSize(numGlyphs), - unicodes(unicodeList), - glyphDataList(glyphDataList), - kerningData(kerningList), - gsubTable(gsubData), - arabicTable(formsTable) -{ -} - -const GlyphNode* UnmappedDataFont::getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const -{ - int index = lookupUnicode(unicode); - - if (index != -1) - { - // Read glyphNode from unmapped flash - touchgfx::FlashDataReader* const flashReader = ApplicationFontProvider::getFlashReader(); - if (flashReader) - { - flashReader->copyData(glyphList + index, &glyphNodeBuffer, sizeof(GlyphNode)); - - pixelData = getPixelData(const_cast(&glyphNodeBuffer)); - bitsPerPixel = getBitsPerPixel(); - return &glyphNodeBuffer; - } - } - return 0; -} - -const uint8_t* UnmappedDataFont::getPixelData(const GlyphNode* glyph) const -{ - const uint8_t* const* table = (const uint8_t* const*)glyphDataList; - return &(table[glyph->unicode / 2048][glyph->dataOffset]); -} - -int8_t UnmappedDataFont::getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const -{ - if (!glyph || glyph->kerningTableSize == 0) - { - return 0; - } - - const KerningNode* kerndata = kerningData + glyph->kerningTablePos(); - for (uint16_t i = glyph->kerningTableSize; i > 0; i--, kerndata++) - { - if (prevChar == kerndata->unicodePrevChar) - { - return kerndata->distance; - } - if (prevChar < kerndata->unicodePrevChar) - { - break; - } - } - return 0; -} - -int UnmappedDataFont::lookupUnicode(uint16_t unicode) const -{ - int32_t min = 0; - int32_t max = listSize - 1; - - int32_t mid = min + (unicode - unicodes[min]); // Linear up from [min].unicode - if (mid < min) - { - // Unicode < unicodes[min] => not found - return -1; - } - if (mid > max) - { - // Linear up ends too high - mid = max - (unicodes[max] - unicode); // Linear down from [max].unicode - if (mid > max) - { - // Unicode > unicodes[max] => not found - return -1; - } - if (mid < min) - { - // Linear down ends too low, take the middle element - mid = (min + max) / 2; - } - } - while (min <= max) - { - if (unicode == unicodes[mid]) - { - // Found at [mid] - return mid; - } - if (unicode < unicodes[mid]) - { - // Unicode is in lower half - max = mid - 1; - if (max < min) - { - // Range is empty => not found - break; - } - // We adjusted max, try linear down from [max].unicode - mid = max - (unicodes[max] - unicode); - if (mid > max) - { - // Unicode > [max].unicode => not found - break; - } - if (mid < min) - { - // Linear down ends too low, take the middle element - mid = (min + max) / 2; - } - } - else - { - // Unicode is in upper half - min = mid + 1; - if (min > max) - { - // Range is empty => not found - break; - } - // We adjusted min, try linear up from [min].unicode - mid = min + (unicode - unicodes[min]); - if (mid < min) - { - // Unicode < [min].unicode => not found - break; - } - if (mid > max) - { - // Linear up ends too high, take the middle element - mid = (min + max) / 2; - } - } - } - return -1; -} -} // namespace touchgfx diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp deleted file mode 100644 index 41969e1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/Templates/UnmappedDataFont.hpp.temp +++ /dev/null @@ -1,125 +0,0 @@ -/* DO NOT EDIT THIS FILE */ -/* This file is autogenerated by the text-database code generator */ - -#ifndef TOUCHGFX_UNMAPPEDDATAFONT_HPP -#define TOUCHGFX_UNMAPPEDDATAFONT_HPP - -#include - -namespace touchgfx -{ -/** - * An UnmappedDataFont has both glyph table and glyph data placed in a - * flash which does not support random access read (indirect - * access). A unicode table is located in a flash with random read - * access (direct access). - * - * @see Font, ConstFont - */ -class UnmappedDataFont : public Font -{ -public: - /** - * Construct the UnmappedDataFont. - * - * @param glyphs The array of glyphs known to this font (indirect). - * @param unicodes The array of unicodes known to this font (direct). - * @param numGlyphs The number of glyphs in list. - * @param height The height in pixels of the highest character in this font. - * @param baseline The height of the baseline in pixels. - * @param pixBelowBottom The maximum number of pixels that can be drawn below the - * bottom in this font. - * @param bitsPerPixel The number of bits per pixel in this font. - * @param byteAlignRow Are glyphs encoded using A4 format - * @param maxLeft The maximum a character extends to the left. - * @param maxRight The maximum a character extends to the right. - * @param glyphDataList Pointer to pointers the glyph data for the font (indirect). - * @param kerningList pointer to the kerning data for the font (direct). - * @param fallbackChar The fallback character for the typography in case no glyph is - * available. - * @param ellipsisChar The ellipsis character used for truncating long texts. - * @param gsubTable Pointer to GSUB table (direct). - */ - UnmappedDataFont(const GlyphNode* glyphs, const uint16_t* unicodes, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* const* glyphDataList, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar, const uint16_t* const gsubData, const FontContextualFormsTable* formsTable); - - using Font::getGlyph; - - /** - * Gets the glyph data associated with the specified Unicode. The - GlyphNode is allocated in the buffer passed to the constructor. - * - * Please note that in case of Thai letters and Arabic letters - * where diacritics can be placed relative to the previous - * character(s), please use TextProvider::getNextLigature() - * instead as it will create a temporary GlyphNode that will be - * adjusted with respect to X/Y position. - * - * @param unicode The character to look up. - * @param pixelData Pointer to the pixel data for the glyph if the glyph is - * found. This is set by this method. - * @param [out] bitsPerPixel Reference where to place the number of bits per pixel. - * - * @return A pointer to the glyph node or null if the glyph was not found. - */ - virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const; - - /** - * Obtains the address to the pixel data for the specified glyph. - * - * @param glyph The glyph to get the pixels data of. - * - * @return The address of the pixel data of the glyph. - */ - virtual const uint8_t* getPixelData(const GlyphNode* glyph) const; - - /** - * Gets the kerning distance between two characters. - * - * @param prevChar The unicode value of the previous character. - * @param glyph the glyph object for the current character. - * - * @return The kerning distance between prevChar and glyph char. - */ - virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const; - - /** - * Gets GSUB table. - * - * @return The GSUB table or null if font has GSUB no table - */ - virtual const uint16_t* getGSUBTable() const - { - return gsubTable; - } - - /** - * Gets the contextual forms table used in arabic fonts. - * - * @return The FontContextualFormsTable or null if the font has no table. - */ - virtual const FontContextualFormsTable* getContextualFormsTable() const - { - return arabicTable; - } - -protected: - UnmappedDataFont() - : Font(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), glyphList(0), unicodes(0), glyphDataList(0), kerningData(0), gsubTable(0) - { - } - int lookupUnicode(uint16_t unicode) const; - - const GlyphNode* glyphList; ///< The list of glyphs - uint16_t listSize; ///< The size of the list of glyphs - const uint16_t* unicodes; ///< LookupTable with all unicodes in this font - const void* glyphDataList; ///< The glyphs (list of pointers) - const KerningNode* kerningData; ///< The kerning - const uint16_t* gsubTable; ///< The GSUB tables - - const FontContextualFormsTable* arabicTable; ///< Contextual forms - - static GlyphNode glyphNodeBuffer; ///< Buffer for GlyphNodes read from unmapped flash -}; -} // namespace touchgfx - -#endif // TOUCHGFX_UNMAPPEDDATAFONT_HPP diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb deleted file mode 100644 index 6ed89ab..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_cpp.rb +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'json' - -class ApplicationFontProviderCpp < Template - def initialize(text_entries, typographies, language, output_directory, generate_font_format) - super(text_entries, typographies, language, output_directory) - @generate_font_format = generate_font_format - @cache = {} - end - def input_path - File.join(root_dir,'Templates','ApplicationFontProvider.cpp.temp') - end - def output_path - 'src/ApplicationFontProvider.cpp' - end - def cache_file - File.join(@output_directory, 'cache/ApplicationFontProvider.cache') - end - def output_filename - File.join(@output_directory, output_path) - end - def run - @cache["typographies"] = typographies.collect{|t| [t.name, t.font_file, t.font_size, t.bpp] } - @cache["generate_font_format"] = @generate_font_format - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - if !File::exists?(output_filename) || new_cache_file - #generate ApplicationFontProvider.cpp - super - end - end - - def save_flashreader? - @generate_font_format == "1" - end - - def get_font_index(index) - font_index[typography_name(@typographies[index])] - end - - private - - def typography_name(typography) - "#{typography.cpp_name}_#{typography.font_size}_#{typography.bpp}bpp" - end - - def font_index - #map typographies to index of first using same font = font index - @font_index ||= @typographies.inject(Hash.new) do |list, typography| - name = typography_name(typography) - list[name] ||= list.size - list - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb deleted file mode 100644 index 63f21aa..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/application_font_provider_hpp.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class ApplicationFontProviderHpp < Template - def initialize(text_entries, typographies, languages, output_directory, generate_font_format) - super(text_entries, typographies, languages, output_directory) - @generate_font_format = generate_font_format - @cache = {} - #map typographies to index of first using same font = font index - @font_index = @typographies.inject(Hash.new) do |list, typography| - name = typography_name(typography) - list[name] ||= list.size - list - end - end - def input_path - File.join(root_dir,'Templates','ApplicationFontProvider.hpp.temp') - end - def output_path - '/include/fonts/ApplicationFontProvider.hpp' - end - def cache_file - File.join(@output_directory, 'cache/ApplicationFontProviderHpp.cache') - end - def output_filename - File.join(@output_directory, output_path) - end - def run - @cache["typographies"] = @typographies.collect{|t| [t.name, t.font_file, t.font_size, t.bpp] } - @cache["generate_font_format"] = @generate_font_format - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - if !File::exists?(output_filename) || new_cache_file - #generate ApplicationFontProvider.hpp - super - end - end - - def save_flashreader? - @generate_font_format == "1" - end - - def get_font_index(index) - @font_index[typography_name(@typographies[index])] - end - - def get_max_font_index - @font_index.size - end - - def get_font_comment_space(index) - @max_length ||= @typographies.map { |t| t.name.length }.max - ' ' * (@max_length - @typographies[index].name.length) - end - - def get_font_comment(index) - typography_name(@typographies[index]) - end - - private - - def typography_name(typography) - "#{typography.cpp_name}_#{typography.font_size}_#{typography.bpp}bpp" - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb deleted file mode 100644 index 2cbce63..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_cpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class CachedFontCpp < Template - def input_path - File.join(root_dir,'Templates','CachedFont.cpp.temp') - end - def output_path - '/src/CachedFont.cpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate CachedFont.cpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb deleted file mode 100644 index 1c76077..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/cached_font_hpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class CachedFontHpp < Template - def input_path - File.join(root_dir,'Templates','CachedFont.hpp.temp') - end - def output_path - '/include/fonts/CachedFont.hpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate CachedFont.hpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb deleted file mode 100644 index e4349f1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_cpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class FontCacheCpp < Template - def input_path - File.join(root_dir,'Templates','FontCache.cpp.temp') - end - def output_path - '/src/FontCache.cpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate FontCache.cpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb deleted file mode 100644 index 21ff33f..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/font_cache_hpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class FontCacheHpp < Template - def input_path - File.join(root_dir,'Templates','FontCache.hpp.temp') - end - def output_path - '/include/fonts/FontCache.hpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate FontCache.hpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb deleted file mode 100644 index 4a99b11..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/fonts_cpp.rb +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class FontsCpp - def self.font_convert=(font_convert) - @@font_convert = font_convert - end - - def initialize(text_entries, typographies, languages, output_directory, font_asset_path, autohint_setting, data_format, generate_binary_fonts, generate_font_format) - @typographies = typographies - @languages = languages - @output_directory = output_directory - @font_asset_path = font_asset_path - @autohint_setting = autohint_setting - @data_format = data_format - @generate_binary_fonts = generate_binary_fonts - @generate_font_format = generate_font_format - end - def run - unique_typographies = @typographies.map{ |t| Typography.new("", t.font_file, t.font_size, t.bpp, t.fallback_character, t.ellipsis_character) }.uniq - - #remove old Table, Kerning, Font files - #1. Create a list of font names - font_names = unique_typographies.collect do |typography| - "#{typography.cpp_name}_#{typography.font_size}_#{typography.bpp}bpp" - end - local_path = "#{@output_directory}/src".gsub('\\','/') - - #2, scan for Kerning files, delete files not using a font in font_names - Dir["#{local_path}/Kerning_*.cpp"].each do |kerning_file| - if font_names.none? {|font_name| kerning_file == "#{local_path}/Kerning_#{font_name}.cpp" } - FileUtils.rm(kerning_file) - end - end - - #3, scan for Table files - Dir["#{local_path}/Table_*.cpp"].each do |table_file| - if font_names.none? {|font_name| table_file == "#{local_path}/Table_#{font_name}.cpp" } - FileUtils.rm(table_file) - end - end - - #4, scan for Font files, remove unused - Dir["#{local_path}/Font_*.cpp"].each do |font_file| - if font_names.none? {|font_name| font_file.match /#{local_path}\/Font_#{font_name}_\d+.cpp/ } - FileUtils.rm(font_file) - end - end - - #5, scan for cache files - local_path = "#{@output_directory}/cache".gsub('\\','/') - Dir["#{local_path}/Font_*Cpp.cache"].each do |cache_file| - if font_names.none? {|font_name| cache_file == "#{local_path}/Font_#{font_name}Cpp.cache" } - FileUtils.rm(cache_file) - end - end - - context_tables_is_generated = {} - generate_contextual_table = false - unique_typographies.sort_by { |t| sprintf("%s %04d %d",t.font_file,t.font_size,t.bpp) }.each do |typography| - fonts_directory = @output_directory - font_file = "#{@font_asset_path}/#{typography.font_file}" - font_index = get_font_index(typography) - fallback_char = typography[:fallback_character] - fallback_char ||= 0 - ellipsis_char = typography[:ellipsis_character] - ellipsis_char ||= 0 - autohint = @autohint_setting == "no" ? "-nah" : @autohint_setting == "force" ? "-fah" : "" - byte_align = @data_format.match("A#{typography.bpp}") ? "-ba" : "" - #generate contextual forms table for font if not already done - generate_contextual_table = context_tables_is_generated[typography.cpp_name] ? "no" : "yes" - context_tables_is_generated[typography.cpp_name] = true #set done for next font with this name - cmd = "\"#{@@font_convert}\" \ --f \"#{font_file}\" \ --i #{font_index} \ --w #{typography.font_size} \ --r #{typography.font_size} \ --o \"#{fonts_directory}\" \ --c \"#{@output_directory}/UnicodeList#{typography.cpp_name}_#{typography.font_size}_#{typography.bpp}.txt\" \ --n \"#{typography.cpp_name}\" \ --b #{typography.bpp} \ --d #{fallback_char} \ --e #{ellipsis_char} \ --ct #{generate_contextual_table} \ --bf #{@generate_binary_fonts} \ --ff #{@generate_font_format} \ -#{autohint} \ -#{byte_align}" - output = `#{cmd}`.force_encoding('iso-8859-1') - if !$?.success? - puts "Command: #{cmd}" - puts output - fail "ERROR: While generating font from #{font_file}" - else - puts "Command: #{cmd}" if ENV['DEBUG'] - puts output - end - end - end - - def fonts - @cached_fonts ||= - @typographies.map{ |t| Typography.new("", t.font_file, t.font_size, t.bpp) }.uniq.collect { |t| get_getFont_name(t) } - end - - def fontmap - @cached_fontmap ||= - fonts.each_with_index.inject(Hash.new) { |map, (f, i)| map[f] = i; map } - end - - def get_font_index(typography) - fontmap[get_getFont_name(typography)] - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb deleted file mode 100644 index c6ab69c..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_cpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class GeneratedFontCpp < Template - def input_path - File.join(root_dir,'Templates','GeneratedFont.cpp.temp') - end - def output_path - '/src/GeneratedFont.cpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate GeneratedFont.cpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb deleted file mode 100644 index f9968a4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/generated_font_hpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class GeneratedFontHpp < Template - def input_path - File.join(root_dir,'Templates','GeneratedFont.hpp.temp') - end - def output_path - '/include/fonts/GeneratedFont.hpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate GeneratedFont.hpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb deleted file mode 100644 index 0c4b3d4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_bin.rb +++ /dev/null @@ -1,284 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'json' - -class LanguagesBin - def initialize(text_entries, typographies, languages, output_directory) - @text_entries = text_entries - @typographies = typographies - @languages = languages - @output_directory = output_directory - end - def run - #remove_old_binary_files - @languages.each do |language| - LanguageXxBin.new(@text_entries, @typographies, @output_directory, @languages, language).run - end - end - - private - - def remove_old_binary_files - # Remove any old bin file - local_path = @output_directory.gsub('\\','/') - Dir["#{local_path}/binary/Language*.bin"].each do |language_bin_file| - puts "Deleting #{language_bin_file}" - FileUtils.rm(language_bin_file) - end - end -end - -class LanguageXxBin < Template - Presenter = Struct.new(:text_id, :unicodes) - LanguageHeader = Struct.new(:offset_to_texts, :offset_to_indices, :offset_to_typedtext) - TypedTextPresenter = Struct.new(:alignment, :direction, :typography) - - ALIGNMENT = { "LEFT" => 0, "CENTER" => 1, "RIGHT" => 2 } - TEXT_DIRECTION = { "LTR" => 0, "RTL" => 1 } - - def initialize(text_entries, typographies, output_directory, languages, language) - @languages = languages - @language = language - @typographies = typographies - @text_entries = text_entries - @output_directory = output_directory - @cache = {} - end - - def cache_file - File.join(@output_directory, "cache/LanguageBin_#{@language.capitalize}.cache") - end - - def alignment_to_value(alignment) - ALIGNMENT[alignment.to_s] - end - - def text_direction_to_value(direction) - TEXT_DIRECTION[direction.to_s] - end - - def language - @language - end - - def entries - #only generate entries once - @cached_entries ||= - begin - entries = text_entries - entries = handle_no_entries(entries, "DO_NOT_USE") - present(entries) - end - end - - def entries_texts_const_initialization - entries.map { |entry| " #{entry.text_id}_#{language.capitalize}" }.join(",\n") - end - - def input_path - File.join(@output_directory, output_path) - end - - def output_path - "binary/Language#{language.capitalize}.bin" - end - - def typed_texts(language) - text_entries.collect do |entry| - typography_name = entry.typographies[language] || entry.default_typography - typography = typographies.find { |t| t.name == typography_name } - alignment = entry.alignments[language] || entry.default_alignment - direction = entry.directions[language] || entry.default_direction - TypedTextPresenter.new(alignment, direction, typography); - end - end - - def typed_texts_(language) - typed_text_str = typed_texts(language) - puts "typed_text_str = #{typed_text_str}" - end - - def fonts - typographies.map{ |t| Typography.new("", t.font_file, t.font_size, t.bpp) }.uniq.collect do |t| - get_getFont_name(t) - end - end - - def get_font_index(typography) - fontmap[get_getFont_name(typography)] - end - - def fontmap - fontmap = Hash.new - fonts.each_with_index do |f, i| - fontmap[f] = i - end - fontmap - end - - def header(entries) - nb_entries = 0 - header_struct_size = 12 - header_unicodes_size = 0; - offset_to_texts = 0 - offset_to_indices = 0 - offset_to_typedtext = 0 - entries.each do |entry| - nb_entries += 1 - entry.unicodes.split(', ').each { |c| - header_unicodes_size += 2 - } - end - offset_to_texts = header_struct_size - offset_to_indices = ((offset_to_texts + header_unicodes_size + 3) &~ 0x3) - offset_to_typedtext = ((offset_to_indices + (4 * nb_entries) + 3) &~ 0x3) - #puts "Number of Entries = #{nb_entries}" - #puts "Header size = #{header_struct_size}" - #puts "Unicodes size = #{header_unicodes_size}" - #puts "Text Offset = #{offset_to_texts}" - #puts "Indices Offset = #{offset_to_indices}" - #puts "TypedText Offset = #{offset_to_typedtext}" - LanguageHeader.new('0x' + offset_to_texts.to_s(16), '0x' + offset_to_indices.to_s(16), '0x' + offset_to_typedtext.to_s(16)) - end - - def output_filename - File.join(@output_directory, output_path) - end - - def run - #build cache dictionary - @cache["typographies"] = typographies.collect{|t| [t.name, t.font_file, t.font_size, t.bpp] } - @cache["language"] = @language - @cache["language_index"] = @languages.index(@language) - list = [] #list of index,textid - entries.each_with_index do |entry, index| - list[index] = [entry.unicodes, entry.text_id] - end - @cache["indices"] = list - - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - - if !File::exists?(output_filename) || new_cache_file - #generate LanguageXX.bin - FileUtils.mkdir_p(File.dirname(input_path)) - callingPath = Pathname.new($calling_path) - filePath = Pathname.new(input_path) - puts "Generating #{filePath.relative_path_from(callingPath)}" - File.open(input_path,'wb') do |f| - # create indices array - indices_arr = [] - - # Writing Language Header - lang_header = header(entries) - lang_header.each { |c| - f.write [c.to_i(16)].pack("L") - } - - # Writing Texts data - indices_arr.clear - indices_arr << 0 # first element is @ offset zero - nb_data_in_entry = 0 - entries.each do |entry| - #puts "All Unicodes #{entry.unicodes}" - entry.unicodes.split(', ').each { |c| - f.write [c.to_i(16)].pack("S") - nb_data_in_entry += 1 - } - indices_arr << nb_data_in_entry #populate the indices array - end - - # Add padding to align on word size for next indeces data writing - loop do - if Integer(f.pos) == Integer(lang_header.offset_to_indices) - break - end - f.write ["0x00".to_i(16)].pack("S") - end - - # Remove last indice - indices_arr.pop - - # Writing Indices - indices_arr.each { |idx| f.write [idx].pack("L") } - - # Add padding to align on word size for next typed_text data writing - loop do - if Integer(f.pos) == Integer(lang_header.offset_to_typedtext) - break - end - f.write ["0x00".to_i(16)].pack("S") - end - - # Create and Fill TypedTextsData Array - typed_text_arr = [] - if typed_texts(language).empty? - #puts " { #{0}, #{alignment_to_value("LEFT")}, #{text_direction_to_value("LTR")} }" - typed_text_arr << 0 << alignment_to_value("LEFT") << text_direction_to_value("LTR") - else - typed_texts(language).map do |typed_text| - fontIdx = get_font_index(typed_text.typography) - alignment = alignment_to_value(typed_text.alignment.upcase) - direction = text_direction_to_value(typed_text.direction.upcase) - #puts "Font Index --> #{fontIdx}" - #puts "Alignment --> #{typed_text.alignment.upcase}" - #puts "Text Direction --> #{typed_text.direction.upcase}" - #puts " { #{fontIdx}, #{alignment_to_value(typed_text.alignment.upcase)}, #{text_direction_to_value(typed_text.direction.upcase)} }" - combined = direction.to_s(2).to_i(2) * 4 + alignment.to_s(2).to_i(2) - typed_text_arr << fontIdx << combined - end - end - - # Writing TypedTextsData - typed_text_arr.each do |idx| - f.write [idx].pack("C") - end - - # # Add padding to align the binary file size on word size - loop do - if (f.pos & 0x3) == 0 - break - end - f.write ["0x00".to_i(16)].pack("C") - end - end - end - end - - private - - def handle_no_entries(entries, text) - if entries.empty? - empty_entry = TextEntry.new(text, "typography", "left", "ltr") - empty_entry.add_translation(language, "") - [empty_entry] - else - entries - end - end - - def present(entries) - entries.map do |entry| - Presenter.new(entry.cpp_text_id, ( entry.translation_in(language).unicodes.map { |u| '0x' + u.to_s(16) } ).join(', ') ) - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb deleted file mode 100644 index a5a2f6a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/languages_cpp.rb +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'json' -require 'lib/string_collector' - -class LanguagesCpp - def initialize(string_indices, characters, text_entries, languages, output_directory, remap_global, generate_binary_translations) - @string_indices = string_indices #dictionary of all string indices into the characters array - @characters = characters - @text_entries = text_entries - @languages = languages - @output_directory = output_directory - @remap_global = remap_global - @generate_binary_translations = generate_binary_translations - end - def run - # First remove any unused LanguageXX.cpp files (ie. remove - # LanguageGB.cpp before creating LanguageGb.cpp on windows which - # ignores case on filenames) - Dir.glob("#{@output_directory}/src/Language*.cpp").each do |file| - m = /Language(.*).cpp/.match(file) - xx = m[1] - if !@languages.any? { |l| l.capitalize == xx } - File.delete(file) if File.exist?(file) - end - end - - @languages.each_with_index do |language, language_index| - language_index = 0 if @remap_global=="yes" - LanguageXxCpp.new(@string_indices, language_index, @characters, @text_entries, @output_directory, @remap_global, @generate_binary_translations, language).run - end - end -end - -class LanguageXxCpp < Template - Presenter = Struct.new(:text_id, :int_array) - - def initialize(string_indices, language_index, characters, text_entries, output_directory, remap_global, generate_binary_translations, language) - @string_indices = string_indices #dictionary of all string indices into the characters array - @characters = characters - @remap_global = remap_global - @generate_binary_translations = generate_binary_translations - @language = language - @language_index = language_index - super(text_entries, [], [], output_directory) - @cache = {} - end - - def cache_file - File.join(@output_directory, "cache/LanguageCpp_#{@language.capitalize}.cache") - end - def input_path - File.join(root_dir, 'Templates', generate_binary_files? ? 'LanguageXX.cpp.bin.temp' : 'LanguageXX.cpp.temp') - end - def output_path - "src/Language#{get_language}.cpp" - end - def output_filename - File.join(@output_directory, output_path) - end - def texts - @text_entries.entries.map(&:cpp_text_id) - end - def run - #build cache dictionary - @cache["remap"] = @remap_global - @cache["language"] = @language - @cache["language_index"] = @language_index - #save text ids and index - @cache["indices"] = get_text_entries.collect do |entry| - [get_string_index(entry), entry.text_id] - end #list of index,textid - if @remap_global!="yes" - @cache["characters"] = @characters[@language_index] - end - - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - - if !File::exists?(output_filename) || new_cache_file - #generate LanguageXX.cpp - super - end - end - - private - - def remap_global? - @remap_global=="yes" - end - - def get_language - @language.capitalize - end - - def get_text_entries - #only generate entries once - @cached_entries ||= - begin - present(@text_entries) - end - end - - def get_string_index_spaces(entry) - last = get_text_entries.length-1 - @max_length ||= get_text_entries.each_with_index.map { |e,i| get_string_index(e).length + (i < last || last == 0 ? 1 : 0) }.max - ' ' * (@max_length - get_string_index(entry).to_s.length) - end - - def get_string_index(entry) - index = @string_indices[@language_index][entry.int_array] - index ||= 0 - index.to_s - end - - def generate_binary_files? - @generate_binary_translations=="yes" - end - - def present(entries) - entries.map do |entry| - Presenter.new(entry.cpp_text_id, entry.translation_in(@language).unicodes) - end - end - - def get_substrings_and_offsets(lang_index) - unicode_array_to_hex_offset_comment(@characters[lang_index]) - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb deleted file mode 100644 index ac36572..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/template.rb +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'erb' -require 'lib/file_io' - -class Template - attr_accessor :text_entries - attr_accessor :typographies - attr_accessor :languages - - def initialize(text_entries, typographies, languages, output_directory) - @text_entries = text_entries - @typographies = typographies - @languages = languages - @output_directory = output_directory - end - def run - result = ERB.new(File.read(input_path).gsub(WINDOWS_LINE_ENDINGS, UNIX_LINE_ENDINGS),0,"<>"). - result(binding). - gsub(WINDOWS_LINE_ENDINGS, UNIX_LINE_ENDINGS). - gsub(UNIX_LINE_ENDINGS, LINE_ENDINGS) - FileIO.write_file(File.join(@output_directory, output_path), result) - end -end - diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb deleted file mode 100644 index 791da45..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/text_keys_and_languages_hpp.rb +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'json' - -class TextKeysAndLanguages < Template - def initialize(text_entries, typographies, languages, output_directory) - super(text_entries, typographies, languages, output_directory) - @cache = {} - end - def get_languages - @languages.map(&:upcase) - end - def get_texts - @text_entries.entries.map(&:cpp_text_id) - end - def input_path - File.join(root_dir,'Templates','TextKeysAndLanguages.hpp.temp') - end - def output_path - 'include/texts/TextKeysAndLanguages.hpp' - end - def cache_file - File.join(@output_directory, 'cache/TextKeysAndLanguages.cache') - end - def output_filename - File.join(@output_directory, output_path) - end - def run - @cache["languages"] = languages - @cache["textids"] = get_texts - - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - - if !File::exists?(output_filename) || new_cache_file || $Force_Generate_TextKeysAndLanguages - #generate TextKeysAndLanguages.hpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb deleted file mode 100644 index e986e08..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/texts_cpp.rb +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'lib/string_collector' - -class TextsCpp < Template - def initialize(characters, text_entries, typographies, languages, output_directory, remap_global, generate_binary_translations) - @characters = characters # one array (per language, or all at index 0 if global remapping) of the needed strings in optimal order - @remap_global = remap_global - @generate_binary_translations = generate_binary_translations - super(text_entries, typographies, languages, output_directory) - @cache = {} - end - def cache_file - File.join(@output_directory, 'cache/TextsCpp.cache') - end - def input_path - File.join(root_dir,'Templates','Texts.cpp.temp') - end - def output_path - 'src/Texts.cpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - #build @cache and compare with file if exists - @cache["remap"] = @remap_global - @cache["languages"] = get_capitalized_languages - if @remap_global=="yes" - @cache["characters"] = @characters.flatten - end - - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - - if !File::exists?(output_filename) || new_cache_file - #generate TypedTextDatabase.cpp - super - end - end - - def remap_global? - @remap_global=="yes" - end - - def generate_binary_files? - @generate_binary_translations=="yes" - end - - def get_capitalized_languages - @languages.map(&:capitalize) - end - - def get_number_of_languages - @languages.count - end - - def has_languages? - !@languages.empty? - end - - def is_rtl? - text_entries.is_rtl - end - - def get_substrings_and_offsets - unicode_array_to_hex_offset_comment(@characters.flatten) - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb deleted file mode 100644 index f95e9c8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_cpp.rb +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class TypedTextDatabaseCpp < Template - TypedTextPresenter = Struct.new(:alignment, :direction, :typography) - - def initialize(text_entries, typographies, languages, output_directory, generate_binary_translations, generate_font_format) - super(text_entries, typographies, languages, output_directory) - @generate_binary_translations = generate_binary_translations - @generate_font_format = generate_font_format - @cache = {} - end - - def cache_file - File.join(@output_directory, 'cache/TypedTextDatabaseCpp.cache') - end - def input_path - File.join(root_dir,'Templates','TypedTextDatabase.cpp.temp') - end - def output_path - 'src/TypedTextDatabase.cpp' - end - def output_filename - File.join(@output_directory, output_path) - end - - def run - #compute the typed text table once - compute_typed_texts - - #calculate the cache map - #first the layout databases - databases = {} - get_layouts.each do |layout| - typed_texts = get_typed_texts(layout) - typed_text_db = [] - typed_texts.inject(typed_text_db) do |a, typed_text| - #each text has a font index, alignment and direction - fontIdx = get_font_index(typed_text.typography) - a << [fontIdx, typed_text.alignment.upcase, typed_text.direction.upcase] - end - databases[layout] = typed_text_db - end - #now the list of typed text databases - language_db_list = [] - @languages.inject(language_db_list) do |list, lang| - list << (get_layouts.find{|l|l==lang}||'DEFAULT');list - end - @cache["databases"] = databases - @cache["database_list"]=language_db_list - @cache["fonts"] = fontmap - @cache["generate_font_format"] = @generate_font_format - - new_cache_file = false - if not File::exists?(cache_file) - new_cache_file = true - else - #cache file exists, compare data with cache file - old_cache = JSON.parse(File.read(cache_file)) - new_cache_file = (old_cache != @cache) - end - - if new_cache_file - #write new cache file - FileIO.write_file_silent(cache_file, @cache.to_json) - end - - if !File::exists?(output_filename) || new_cache_file - #generate TypedTextDatabase.cpp - super - end - end - - def has_text_entries? - !text_entries.empty? - end - - def get_font_class_name - @generate_font_format == "1" ? "UnmappedDataFont" : "GeneratedFont" - end - - def get_touchgfx_aligment(alignment) - "touchgfx::#{alignment.upcase}" - end - - def get_touchgfx_direction(direction) - "touchgfx::TEXT_DIRECTION_#{direction.upcase}" - end - - def get_font_index(typography) - fontmap[get_getFont_name(typography)] - end - - def get_fonts - @cached_fonts ||= - begin - typographies.map{ |t| Typography.new("", t.font_file, t.font_size, t.bpp) }.uniq.collect do |t| - get_getFont_name(t) - end - end - end - - def get_typed_texts(layout) - @typed_texts[layout] - end - - def get_layouts - @cached_layouts ||= - begin - if text_entries.empty? - ["DEFAULT"] - else - (text_entries.languages_with_specific_settings << "DEFAULT").uniq - end - end - end - - def get_languages - @languages - end - - def compute_typed_texts - @typed_texts = {} - get_layouts.each do |layout| - @typed_texts[layout] = text_entries.collect do |entry| - typography_name = entry.typographies[layout] || entry.default_typography - typography = typographies.find { |t| t.name == typography_name } - alignment = entry.alignments[layout] || entry.default_alignment - direction = entry.directions[layout] || entry.default_direction - TypedTextPresenter.new(alignment, direction, typography); - end - end - end - - def generate_binary_files? - @generate_binary_translations=="yes" - end - - def fontmap - @fontmap ||= - begin - @fontmap = Hash.new - get_fonts.each_with_index do |f, i| - fontmap[f] = i - end - fontmap - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb deleted file mode 100644 index a7a7aee..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/typed_text_database_hpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class TypedTextDatabaseHpp < Template - def input_path - File.join(root_dir,'Templates','TypedTextDatabase.hpp.temp') - end - def output_path - 'include/texts/TypedTextDatabase.hpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate TypedTextDatabase.hpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb deleted file mode 100644 index 0e8d7a3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unicodes_txt.rb +++ /dev/null @@ -1,544 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class UnicodesTxt - def initialize(text_entries, typographies, languages, output_directory) - @text_entries = text_entries - @typographies = typographies - @languages = languages - @output_directory = output_directory - end - def run - unique_typographies = @typographies.map{ |t| Typography.new("", t.font_file, t.font_size, t.bpp) }.uniq.sort_by { |t| sprintf("%s %04d %d",t.font_file,t.font_size,t.bpp) } - unique_typographies.each do |unique_typography| - UnicodeForTypographyTxt.new(@text_entries, @typographies, unique_typography, @output_directory).run - end - end -end - -class UnicodeForTypographyTxt - def initialize(text_entries, typographies, unique_typography, output_directory) - @text_entries = text_entries - @typographies = typographies - @unique_typography = unique_typography - @output_directory = output_directory - end - - def convert_to_contextual_forms(unicodes) - unicodes.sort! - [ - [[0x0621],[0xFE80]], # ARABIC LETTER HAMZA - [[0x0622],[0xFE81,0xFE82]], # ARABIC LETTER ALEF WITH MADDA ABOVE - [[0x0622,0x0644],[0xFEF5,0xFEF6]], # ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE - [[0x0623],[0xFE83,0xFE84]], # ARABIC LETTER ALEF WITH HAMZA ABOVE - [[0x0623,0x0644],[0xFEF7,0xFEF8]], # ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE - [[0x0624],[0xFE85,0xFE86]], # ARABIC LETTER WAW WITH HAMZA ABOVE - [[0x0625],[0xFE87,0xFE88]], # ARABIC LETTER ALEF WITH HAMZA BELOW - [[0x0625,0x0644],[0xFEF9,0xFEFA]], # ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW - [[0x0626],[0xFE89,0xFE8A,0xFE8B,0xFE8C]], # ARABIC LETTER YEH WITH HAMZA ABOVE - [[0x0626,0x0627],[0xFBEA,0xFBEB]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF - [[0x0626,0x062C],[0xFC00,0xFC97]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH JEEM - [[0x0626,0x062D],[0xFC01,0xFC98]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HAH - [[0x0626,0x062E],[0xFC99]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH KHAH - [[0x0626,0x0631],[0xFC64]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH REH - [[0x0626,0x0632],[0xFC65]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ZAIN - [[0x0626,0x0645],[0xFC02,0xFC66,0xFC9A,0xFCDF]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM - [[0x0626,0x0646],[0xFC67]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH NOON - [[0x0626,0x0647],[0xFC9B,0xFCE0]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HEH - [[0x0626,0x0648],[0xFBEE,0xFBEF]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH WAW - [[0x0626,0x0649],[0xFBF9,0xFBFA,0xFBFB,0xFC03,0xFC68]], # ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA / ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA - [[0x0626,0x064A],[0xFC04,0xFC69]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YEH - [[0x0626,0x06C6],[0xFBF2,0xFBF3]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH OE - [[0x0626,0x06C7],[0xFBF0,0xFBF1]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH U - [[0x0626,0x06C8],[0xFBF4,0xFBF5]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YU - [[0x0626,0x06D0],[0xFBF6,0xFBF7,0xFBF8]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH E - [[0x0626,0x06D5],[0xFBEC,0xFBED]], # ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH AE - [[0x0627],[0xFE8D,0xFE8E]], # ARABIC LETTER ALEF - [[0x0627,0x0628,0x0631,0x0643],[0xFDF3]], # ARABIC LIGATURE AKBAR - [[0x0627,0x0631,0x0644,0x06CC],[0xFDFC]], # RIAL SIGN - [[0x0627,0x0643],[0xFC37,0xFC80]], # ARABIC LIGATURE KAF WITH ALEF - [[0x0627,0x0644],[0xFEFB,0xFEFC]], # ARABIC LIGATURE LAM WITH ALEF - [[0x0627,0x0644,0x0647],[0xFDF2]], # ARABIC LIGATURE ALLAH - [[0x0627,0x0645],[0xFC88]], # ARABIC LIGATURE MEEM WITH ALEF - [[0x0627,0x064B],[0xFD3C,0xFD3D]], # ARABIC LIGATURE ALEF WITH FATHATAN - [[0x0628],[0xFE8F,0xFE90,0xFE91,0xFE92]], # ARABIC LETTER BEH - [[0x0628,0x062C],[0xFC05,0xFC9C]], # ARABIC LIGATURE BEH WITH JEEM - [[0x0628,0x062D],[0xFC06,0xFC9D]], # ARABIC LIGATURE BEH WITH HAH - [[0x0628,0x062D,0x064A],[0xFDC2]], # ARABIC LIGATURE BEH WITH HAH WITH YEH - [[0x0628,0x062E],[0xFC07,0xFC9E]], # ARABIC LIGATURE BEH WITH KHAH - [[0x0628,0x062E,0x064A],[0xFD9E]], # ARABIC LIGATURE BEH WITH KHAH WITH YEH - [[0x0628,0x0631],[0xFC6A]], # ARABIC LIGATURE BEH WITH REH - [[0x0628,0x0632],[0xFC6B]], # ARABIC LIGATURE BEH WITH ZAIN - [[0x0628,0x0645],[0xFC08,0xFC6C,0xFC9F,0xFCE1]], # ARABIC LIGATURE BEH WITH MEEM - [[0x0628,0x0646],[0xFC6D]], # ARABIC LIGATURE BEH WITH NOON - [[0x0628,0x0647],[0xFCA0,0xFCE2]], # ARABIC LIGATURE BEH WITH HEH - [[0x0628,0x0649],[0xFC09,0xFC6E]], # ARABIC LIGATURE BEH WITH ALEF MAKSURA - [[0x0628,0x064A],[0xFC0A,0xFC6F]], # ARABIC LIGATURE BEH WITH YEH - [[0x0629],[0xFE93,0xFE94]], # ARABIC LETTER TEH MARBUTA - [[0x062A],[0xFE95,0xFE96,0xFE97,0xFE98]], # ARABIC LETTER TEH - [[0x062A,0x062C],[0xFC0B,0xFCA1]], # ARABIC LIGATURE TEH WITH JEEM - [[0x062A,0x062C,0x062D],[0xFD51,0xFD52]], # ARABIC LIGATURE TEH WITH HAH WITH JEEM - [[0x062A,0x062C,0x0645],[0xFD50,0xFD55]], # ARABIC LIGATURE TEH WITH JEEM WITH MEEM / ARABIC LIGATURE TEH WITH MEEM WITH JEEM - [[0x062A,0x062C,0x0649],[0xFDA0]], # ARABIC LIGATURE TEH WITH JEEM WITH ALEF MAKSURA - [[0x062A,0x062C,0x064A],[0xFD9F]], # ARABIC LIGATURE TEH WITH JEEM WITH YEH - [[0x062A,0x062D],[0xFC0C,0xFCA2]], # ARABIC LIGATURE TEH WITH HAH - [[0x062A,0x062D,0x0645],[0xFD53,0xFD56]], # ARABIC LIGATURE TEH WITH HAH WITH MEEM / ARABIC LIGATURE TEH WITH MEEM WITH HAH - [[0x062A,0x062E],[0xFC0D,0xFCA3]], # ARABIC LIGATURE TEH WITH KHAH - [[0x062A,0x062E,0x0645],[0xFD54,0xFD57]], # ARABIC LIGATURE TEH WITH KHAH WITH MEEM / ARABIC LIGATURE TEH WITH MEEM WITH KHAH - [[0x062A,0x062E,0x0649],[0xFDA2]], # ARABIC LIGATURE TEH WITH KHAH WITH ALEF MAKSURA - [[0x062A,0x062E,0x064A],[0xFDA1]], # ARABIC LIGATURE TEH WITH KHAH WITH YEH - [[0x062A,0x0631],[0xFC70]], # ARABIC LIGATURE TEH WITH REH - [[0x062A,0x0632],[0xFC71]], # ARABIC LIGATURE TEH WITH ZAIN - [[0x062A,0x0645],[0xFC0E,0xFC72,0xFCA4,0xFCE3]], # ARABIC LIGATURE TEH WITH MEEM - [[0x062A,0x0645,0x0649],[0xFDA4]], # ARABIC LIGATURE TEH WITH MEEM WITH ALEF MAKSURA - [[0x062A,0x0645,0x064A],[0xFDA3]], # ARABIC LIGATURE TEH WITH MEEM WITH YEH - [[0x062A,0x0646],[0xFC73]], # ARABIC LIGATURE TEH WITH NOON - [[0x062A,0x0647],[0xFCA5,0xFCE4]], # ARABIC LIGATURE TEH WITH HEH - [[0x062A,0x0649],[0xFC0F,0xFC74]], # ARABIC LIGATURE TEH WITH ALEF MAKSURA - [[0x062A,0x064A],[0xFC10,0xFC75]], # ARABIC LIGATURE TEH WITH YEH - [[0x062B],[0xFE99,0xFE9A,0xFE9B,0xFE9C]], # ARABIC LETTER THEH - [[0x062B,0x062C],[0xFC11]], # ARABIC LIGATURE THEH WITH JEEM - [[0x062B,0x0631],[0xFC76]], # ARABIC LIGATURE THEH WITH REH - [[0x062B,0x0632],[0xFC77]], # ARABIC LIGATURE THEH WITH ZAIN - [[0x062B,0x0645],[0xFC12,0xFC78,0xFCA6,0xFCE5]], # ARABIC LIGATURE THEH WITH MEEM - [[0x062B,0x0646],[0xFC79]], # ARABIC LIGATURE THEH WITH NOON - [[0x062B,0x0647],[0xFCE6]], # ARABIC LIGATURE THEH WITH HEH - [[0x062B,0x0649],[0xFC13,0xFC7A]], # ARABIC LIGATURE THEH WITH ALEF MAKSURA - [[0x062B,0x064A],[0xFC14,0xFC7B]], # ARABIC LIGATURE THEH WITH YEH - [[0x062C],[0xFE9D,0xFE9E,0xFE9F,0xFEA0]], # ARABIC LETTER JEEM - [[0x062C,0x062D],[0xFC15,0xFC17,0xFCA7,0xFCA9]], # ARABIC LIGATURE JEEM WITH HAH / ARABIC LIGATURE HAH WITH JEEM - [[0x062C,0x062D,0x0633],[0xFD5C,0xFD5D]], # ARABIC LIGATURE SEEN WITH HAH WITH JEEM / ARABIC LIGATURE SEEN WITH JEEM WITH HAH - [[0x062C,0x062D,0x0645],[0xFD58,0xFD59,0xFD89,0xFD8C]], # ARABIC LIGATURE JEEM WITH MEEM WITH HAH / ARABIC LIGATURE MEEM WITH HAH WITH JEEM / ARABIC LIGATURE MEEM WITH JEEM WITH HAH - [[0x062C,0x062D,0x0646],[0xFDB8,0xFDBD]], # ARABIC LIGATURE NOON WITH JEEM WITH HAH - [[0x062C,0x062D,0x0649],[0xFDA6]], # ARABIC LIGATURE JEEM WITH HAH WITH ALEF MAKSURA - [[0x062C,0x062D,0x064A],[0xFDBE,0xFDBF]], # ARABIC LIGATURE JEEM WITH HAH WITH YEH / ARABIC LIGATURE HAH WITH JEEM WITH YEH - [[0x062C,0x062E],[0xFC19,0xFCAB]], # ARABIC LIGATURE KHAH WITH JEEM - [[0x062C,0x062E,0x0645],[0xFD8E,0xFD92]], # ARABIC LIGATURE MEEM WITH KHAH WITH JEEM / ARABIC LIGATURE MEEM WITH JEEM WITH KHAH - [[0x062C,0x0633],[0xFC1C,0xFCAD,0xFD34]], # ARABIC LIGATURE SEEN WITH JEEM - [[0x062C,0x0633,0x0645],[0xFD61]], # ARABIC LIGATURE SEEN WITH MEEM WITH JEEM - [[0x062C,0x0633,0x0649],[0xFD5E]], # ARABIC LIGATURE SEEN WITH JEEM WITH ALEF MAKSURA - [[0x062C,0x0634],[0xFD09,0xFD25,0xFD2D,0xFD37]], # ARABIC LIGATURE SHEEN WITH JEEM - [[0x062C,0x0634,0x064A],[0xFD69]], # ARABIC LIGATURE SHEEN WITH JEEM WITH YEH - [[0x062C,0x0636],[0xFC22,0xFCB4]], # ARABIC LIGATURE DAD WITH JEEM - [[0x062C,0x0639],[0xFC29,0xFCBA]], # ARABIC LIGATURE AIN WITH JEEM - [[0x062C,0x0639,0x0645],[0xFD75,0xFDC4]], # ARABIC LIGATURE AIN WITH JEEM WITH MEEM - [[0x062C,0x063A],[0xFC2B,0xFCBC]], # ARABIC LIGATURE GHAIN WITH JEEM - [[0x062C,0x0641],[0xFC2D,0xFCBE]], # ARABIC LIGATURE FEH WITH JEEM - [[0x062C,0x0643],[0xFC38,0xFCC4]], # ARABIC LIGATURE KAF WITH JEEM - [[0x062C,0x0644],[0xFC3F,0xFCC9,0xFD83,0xFD84]], # ARABIC LIGATURE LAM WITH JEEM / ARABIC LIGATURE LAM WITH JEEM WITH JEEM - [[0x062C,0x0644,0x0645],[0xFDBA,0xFDBC]], # ARABIC LIGATURE LAM WITH JEEM WITH MEEM - [[0x062C,0x0644,0x064A],[0xFDAC]], # ARABIC LIGATURE LAM WITH JEEM WITH YEH - [[0x062C,0x0645],[0xFC16,0xFC45,0xFCA8,0xFCCE,0xFD8D]], # ARABIC LIGATURE JEEM WITH MEEM / ARABIC LIGATURE MEEM WITH JEEM / ARABIC LIGATURE MEEM WITH JEEM WITH MEEM - [[0x062C,0x0645,0x0646],[0xFD97,0xFD98]], # ARABIC LIGATURE NOON WITH JEEM WITH MEEM - [[0x062C,0x0645,0x0647],[0xFD93]], # ARABIC LIGATURE HEH WITH MEEM WITH JEEM - [[0x062C,0x0645,0x0649],[0xFDA7]], # ARABIC LIGATURE JEEM WITH MEEM WITH ALEF MAKSURA - [[0x062C,0x0645,0x064A],[0xFDA5,0xFDC0]], # ARABIC LIGATURE JEEM WITH MEEM WITH YEH / ARABIC LIGATURE MEEM WITH JEEM WITH YEH - [[0x062C,0x0646],[0xFC4B,0xFCD2]], # ARABIC LIGATURE NOON WITH JEEM - [[0x062C,0x0646,0x0649],[0xFD99]], # ARABIC LIGATURE NOON WITH JEEM WITH ALEF MAKSURA - [[0x062C,0x0646,0x064A],[0xFDC7]], # ARABIC LIGATURE NOON WITH JEEM WITH YEH - [[0x062C,0x0647],[0xFC51,0xFCD7]], # ARABIC LIGATURE HEH WITH JEEM - [[0x062C,0x0649],[0xFD01,0xFD1D]], # ARABIC LIGATURE JEEM WITH ALEF MAKSURA - [[0x062C,0x064A],[0xFC55,0xFCDA,0xFD02,0xFD1E,0xFDAF]], # ARABIC LIGATURE YEH WITH JEEM / ARABIC LIGATURE JEEM WITH YEH / ARABIC LIGATURE YEH WITH JEEM WITH YEH - [[0x062D],[0xFEA1,0xFEA2,0xFEA3,0xFEA4]], # ARABIC LETTER HAH - [[0x062D,0x062E],[0xFC1A]], # ARABIC LIGATURE KHAH WITH HAH - [[0x062D,0x062F,0x0645],[0xFDF4]], # ARABIC LIGATURE MOHAMMAD - [[0x062D,0x0633],[0xFC1D,0xFCAE,0xFD35]], # ARABIC LIGATURE SEEN WITH HAH - [[0x062D,0x0633,0x0645],[0xFD5F,0xFD60]], # ARABIC LIGATURE SEEN WITH MEEM WITH HAH - [[0x062D,0x0634],[0xFD0A,0xFD26,0xFD2E,0xFD38]], # ARABIC LIGATURE SHEEN WITH HAH - [[0x062D,0x0634,0x0645],[0xFD67,0xFD68]], # ARABIC LIGATURE SHEEN WITH HAH WITH MEEM - [[0x062D,0x0634,0x064A],[0xFDAA]], # ARABIC LIGATURE SHEEN WITH HAH WITH YEH - [[0x062D,0x0635],[0xFC20,0xFCB1,0xFD64,0xFD65]], # ARABIC LIGATURE SAD WITH HAH / ARABIC LIGATURE SAD WITH HAH WITH HAH - [[0x062D,0x0635,0x064A],[0xFDA9]], # ARABIC LIGATURE SAD WITH HAH WITH YEH - [[0x062D,0x0636],[0xFC23,0xFCB5]], # ARABIC LIGATURE DAD WITH HAH - [[0x062D,0x0636,0x0649],[0xFD6E]], # ARABIC LIGATURE DAD WITH HAH WITH ALEF MAKSURA - [[0x062D,0x0636,0x064A],[0xFDAB]], # ARABIC LIGATURE DAD WITH HAH WITH YEH - [[0x062D,0x0637],[0xFC26,0xFCB8]], # ARABIC LIGATURE TAH WITH HAH - [[0x062D,0x0637,0x0645],[0xFD71,0xFD72]], # ARABIC LIGATURE TAH WITH MEEM WITH HAH - [[0x062D,0x0641],[0xFC2E,0xFCBF]], # ARABIC LIGATURE FEH WITH HAH - [[0x062D,0x0642],[0xFC33,0xFCC2]], # ARABIC LIGATURE QAF WITH HAH - [[0x062D,0x0642,0x0645],[0xFD7E,0xFDB4]], # ARABIC LIGATURE QAF WITH MEEM WITH HAH - [[0x062D,0x0643],[0xFC39,0xFCC5]], # ARABIC LIGATURE KAF WITH HAH - [[0x062D,0x0644],[0xFC40,0xFCCA]], # ARABIC LIGATURE LAM WITH HAH - [[0x062D,0x0644,0x0645],[0xFD80,0xFD87,0xFD88,0xFDB5]], # ARABIC LIGATURE LAM WITH HAH WITH MEEM / ARABIC LIGATURE LAM WITH MEEM WITH HAH - [[0x062D,0x0644,0x0649],[0xFD82]], # ARABIC LIGATURE LAM WITH HAH WITH ALEF MAKSURA - [[0x062D,0x0644,0x064A],[0xFD81]], # ARABIC LIGATURE LAM WITH HAH WITH YEH - [[0x062D,0x0645],[0xFC18,0xFC46,0xFCAA,0xFCCF,0xFD8A]], # ARABIC LIGATURE HAH WITH MEEM / ARABIC LIGATURE MEEM WITH HAH / ARABIC LIGATURE MEEM WITH HAH WITH MEEM - [[0x062D,0x0645,0x0646],[0xFD95]], # ARABIC LIGATURE NOON WITH HAH WITH MEEM - [[0x062D,0x0645,0x0649],[0xFD5B]], # ARABIC LIGATURE HAH WITH MEEM WITH ALEF MAKSURA - [[0x062D,0x0645,0x064A],[0xFD5A,0xFD8B]], # ARABIC LIGATURE HAH WITH MEEM WITH YEH / ARABIC LIGATURE MEEM WITH HAH WITH YEH - [[0x062D,0x0646],[0xFC4C,0xFCD3]], # ARABIC LIGATURE NOON WITH HAH - [[0x062D,0x0646,0x0649],[0xFD96]], # ARABIC LIGATURE NOON WITH HAH WITH ALEF MAKSURA - [[0x062D,0x0646,0x064A],[0xFDB3]], # ARABIC LIGATURE NOON WITH HAH WITH YEH - [[0x062D,0x0649],[0xFCFF,0xFD1B]], # ARABIC LIGATURE HAH WITH ALEF MAKSURA - [[0x062D,0x064A],[0xFC56,0xFCDB,0xFD00,0xFD1C,0xFDAE]], # ARABIC LIGATURE YEH WITH HAH / ARABIC LIGATURE HAH WITH YEH / ARABIC LIGATURE YEH WITH HAH WITH YEH - [[0x062E],[0xFEA5,0xFEA6,0xFEA7,0xFEA8]], # ARABIC LETTER KHAH - [[0x062E,0x0633],[0xFC1E,0xFCAF,0xFD36]], # ARABIC LIGATURE SEEN WITH KHAH - [[0x062E,0x0633,0x0649],[0xFDA8]], # ARABIC LIGATURE SEEN WITH KHAH WITH ALEF MAKSURA - [[0x062E,0x0633,0x064A],[0xFDC6]], # ARABIC LIGATURE SEEN WITH KHAH WITH YEH - [[0x062E,0x0634],[0xFD0B,0xFD27,0xFD2F,0xFD39]], # ARABIC LIGATURE SHEEN WITH KHAH - [[0x062E,0x0634,0x0645],[0xFD6A,0xFD6B]], # ARABIC LIGATURE SHEEN WITH MEEM WITH KHAH - [[0x062E,0x0635],[0xFCB2]], # ARABIC LIGATURE SAD WITH KHAH - [[0x062E,0x0636],[0xFC24,0xFCB6]], # ARABIC LIGATURE DAD WITH KHAH - [[0x062E,0x0636,0x0645],[0xFD6F,0xFD70]], # ARABIC LIGATURE DAD WITH KHAH WITH MEEM - [[0x062E,0x0641],[0xFC2F,0xFCC0]], # ARABIC LIGATURE FEH WITH KHAH - [[0x062E,0x0641,0x0645],[0xFD7C,0xFD7D]], # ARABIC LIGATURE FEH WITH KHAH WITH MEEM - [[0x062E,0x0643],[0xFC3A,0xFCC6]], # ARABIC LIGATURE KAF WITH KHAH - [[0x062E,0x0644],[0xFC41,0xFCCB]], # ARABIC LIGATURE LAM WITH KHAH - [[0x062E,0x0644,0x0645],[0xFD85,0xFD86]], # ARABIC LIGATURE LAM WITH KHAH WITH MEEM - [[0x062E,0x0645],[0xFC1B,0xFC47,0xFCAC,0xFCD0,0xFD8F]], # ARABIC LIGATURE KHAH WITH MEEM / ARABIC LIGATURE MEEM WITH KHAH / ARABIC LIGATURE MEEM WITH KHAH WITH MEEM - [[0x062E,0x0645,0x064A],[0xFDB9]], # ARABIC LIGATURE MEEM WITH KHAH WITH YEH - [[0x062E,0x0646],[0xFC4D,0xFCD4]], # ARABIC LIGATURE NOON WITH KHAH - [[0x062E,0x0649],[0xFD03,0xFD1F]], # ARABIC LIGATURE KHAH WITH ALEF MAKSURA - [[0x062E,0x064A],[0xFC57,0xFCDC,0xFD04,0xFD20]], # ARABIC LIGATURE YEH WITH KHAH / ARABIC LIGATURE KHAH WITH YEH - [[0x062F],[0xFEA9,0xFEAA]], # ARABIC LETTER DAL - [[0x0630],[0xFEAB,0xFEAC]], # ARABIC LETTER THAL - [[0x0630,0x0670],[0xFC5B]], # ARABIC LIGATURE THAL WITH SUPERSCRIPT ALEF - [[0x0631],[0xFEAD,0xFEAE]], # ARABIC LETTER REH - [[0x0631,0x0633],[0xFD0E,0xFD2A]], # ARABIC LIGATURE SEEN WITH REH - [[0x0631,0x0633,0x0644,0x0648],[0xFDF6]], # ARABIC LIGATURE RASOUL - [[0x0631,0x0634],[0xFD0D,0xFD29]], # ARABIC LIGATURE SHEEN WITH REH - [[0x0631,0x0635],[0xFD0F,0xFD2B]], # ARABIC LIGATURE SAD WITH REH - [[0x0631,0x0636],[0xFD10,0xFD2C]], # ARABIC LIGATURE DAD WITH REH - [[0x0631,0x0646],[0xFC8A]], # ARABIC LIGATURE NOON WITH REH - [[0x0631,0x064A],[0xFC91]], # ARABIC LIGATURE YEH WITH REH - [[0x0631,0x0670],[0xFC5C]], # ARABIC LIGATURE REH WITH SUPERSCRIPT ALEF - [[0x0632],[0xFEAF,0xFEB0]], # ARABIC LETTER ZAIN - [[0x0632,0x0646],[0xFC8B]], # ARABIC LIGATURE NOON WITH ZAIN - [[0x0632,0x064A],[0xFC92]], # ARABIC LIGATURE YEH WITH ZAIN - [[0x0633],[0xFEB1,0xFEB2,0xFEB3,0xFEB4]], # ARABIC LETTER SEEN - [[0x0633,0x0644,0x0645,0x0648],[0xFDF8]], # ARABIC LIGATURE WASALLAM - [[0x0633,0x0645],[0xFC1F,0xFCB0,0xFCE7,0xFD62,0xFD63]], # ARABIC LIGATURE SEEN WITH MEEM / ARABIC LIGATURE SEEN WITH MEEM WITH MEEM - [[0x0633,0x0647],[0xFCE8,0xFD31]], # ARABIC LIGATURE SEEN WITH HEH - [[0x0633,0x0649],[0xFCFB,0xFD17]], # ARABIC LIGATURE SEEN WITH ALEF MAKSURA - [[0x0633,0x064A],[0xFCFC,0xFD18]], # ARABIC LIGATURE SEEN WITH YEH - [[0x0634],[0xFEB5,0xFEB6,0xFEB7,0xFEB8]], # ARABIC LETTER SHEEN - [[0x0634,0x0645],[0xFCE9,0xFD0C,0xFD28,0xFD30,0xFD6C,0xFD6D]], # ARABIC LIGATURE SHEEN WITH MEEM / ARABIC LIGATURE SHEEN WITH MEEM WITH MEEM - [[0x0634,0x0647],[0xFCEA,0xFD32]], # ARABIC LIGATURE SHEEN WITH HEH - [[0x0634,0x0649],[0xFCFD,0xFD19]], # ARABIC LIGATURE SHEEN WITH ALEF MAKSURA - [[0x0634,0x064A],[0xFCFE,0xFD1A]], # ARABIC LIGATURE SHEEN WITH YEH - [[0x0635],[0xFEB9,0xFEBA,0xFEBB,0xFEBC]], # ARABIC LETTER SAD - [[0x0635,0x0639,0x0644,0x0645],[0xFDF5]], # ARABIC LIGATURE SALAM - [[0x0635,0x0644,0x0649],[0xFDF9]], # ARABIC LIGATURE SALLA - [[0x0635,0x0644,0x06D2],[0xFDF0]], # ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN - [[0x0635,0x0645],[0xFC21,0xFCB3,0xFD66,0xFDC5]], # ARABIC LIGATURE SAD WITH MEEM / ARABIC LIGATURE SAD WITH MEEM WITH MEEM - [[0x0635,0x0649],[0xFD05,0xFD21]], # ARABIC LIGATURE SAD WITH ALEF MAKSURA - [[0x0635,0x064A],[0xFD06,0xFD22]], # ARABIC LIGATURE SAD WITH YEH - [[0x0636],[0xFEBD,0xFEBE,0xFEBF,0xFEC0]], # ARABIC LETTER DAD - [[0x0636,0x0645],[0xFC25,0xFCB7]], # ARABIC LIGATURE DAD WITH MEEM - [[0x0636,0x0649],[0xFD07,0xFD23]], # ARABIC LIGATURE DAD WITH ALEF MAKSURA - [[0x0636,0x064A],[0xFD08,0xFD24]], # ARABIC LIGATURE DAD WITH YEH - [[0x0637],[0xFEC1,0xFEC2,0xFEC3,0xFEC4]], # ARABIC LETTER TAH - [[0x0637,0x0645],[0xFC27,0xFD33,0xFD3A,0xFD73]], # ARABIC LIGATURE TAH WITH MEEM / ARABIC LIGATURE TAH WITH MEEM WITH MEEM - [[0x0637,0x0645,0x064A],[0xFD74]], # ARABIC LIGATURE TAH WITH MEEM WITH YEH - [[0x0637,0x0649],[0xFCF5,0xFD11]], # ARABIC LIGATURE TAH WITH ALEF MAKSURA - [[0x0637,0x064A],[0xFCF6,0xFD12]], # ARABIC LIGATURE TAH WITH YEH - [[0x0638],[0xFEC5,0xFEC6,0xFEC7,0xFEC8]], # ARABIC LETTER ZAH - [[0x0638,0x0645],[0xFC28,0xFCB9,0xFD3B]], # ARABIC LIGATURE ZAH WITH MEEM - [[0x0639],[0xFEC9,0xFECA,0xFECB,0xFECC]], # ARABIC LETTER AIN - [[0x0639,0x0644,0x0647,0x064A],[0xFDF7]], # ARABIC LIGATURE ALAYHE - [[0x0639,0x0645],[0xFC2A,0xFCBB,0xFD76,0xFD77]], # ARABIC LIGATURE AIN WITH MEEM / ARABIC LIGATURE AIN WITH MEEM WITH MEEM - [[0x0639,0x0645,0x0649],[0xFD78]], # ARABIC LIGATURE AIN WITH MEEM WITH ALEF MAKSURA - [[0x0639,0x0645,0x064A],[0xFDB6]], # ARABIC LIGATURE AIN WITH MEEM WITH YEH - [[0x0639,0x0649],[0xFCF7,0xFD13]], # ARABIC LIGATURE AIN WITH ALEF MAKSURA - [[0x0639,0x064A],[0xFCF8,0xFD14]], # ARABIC LIGATURE AIN WITH YEH - [[0x063A],[0xFECD,0xFECE,0xFECF,0xFED0]], # ARABIC LETTER GHAIN - [[0x063A,0x0645],[0xFC2C,0xFCBD,0xFD79]], # ARABIC LIGATURE GHAIN WITH MEEM / ARABIC LIGATURE GHAIN WITH MEEM WITH MEEM - [[0x063A,0x0645,0x0649],[0xFD7B]], # ARABIC LIGATURE GHAIN WITH MEEM WITH ALEF MAKSURA - [[0x063A,0x0645,0x064A],[0xFD7A]], # ARABIC LIGATURE GHAIN WITH MEEM WITH YEH - [[0x063A,0x0649],[0xFCF9,0xFD15]], # ARABIC LIGATURE GHAIN WITH ALEF MAKSURA - [[0x063A,0x064A],[0xFCFA,0xFD16]], # ARABIC LIGATURE GHAIN WITH YEH - [[0x0640,0x064B],[0xFE71]], # ARABIC TATWEEL WITH FATHATAN ABOVE - [[0x0640,0x064E],[0xFE77]], # ARABIC FATHA - [[0x0640,0x064E,0x0651],[0xFCF2]], # ARABIC LIGATURE SHADDA WITH FATHA - [[0x0640,0x064F],[0xFE79]], # ARABIC DAMMA - [[0x0640,0x064F,0x0651],[0xFCF3]], # ARABIC LIGATURE SHADDA WITH DAMMA - [[0x0640,0x0650],[0xFE7B]], # ARABIC KASRA - [[0x0640,0x0650,0x0651],[0xFCF4]], # ARABIC LIGATURE SHADDA WITH KASRA - [[0x0640,0x0651],[0xFE7D]], # ARABIC SHADDA - [[0x0640,0x0652],[0xFE7F]], # ARABIC SUKUN - [[0x0641],[0xFED1,0xFED2,0xFED3,0xFED4]], # ARABIC LETTER FEH - [[0x0641,0x0645],[0xFC30,0xFCC1]], # ARABIC LIGATURE FEH WITH MEEM - [[0x0641,0x0645,0x064A],[0xFDC1]], # ARABIC LIGATURE FEH WITH MEEM WITH YEH - [[0x0641,0x0649],[0xFC31,0xFC7C]], # ARABIC LIGATURE FEH WITH ALEF MAKSURA - [[0x0641,0x064A],[0xFC32,0xFC7D]], # ARABIC LIGATURE FEH WITH YEH - [[0x0642],[0xFED5,0xFED6,0xFED7,0xFED8]], # ARABIC LETTER QAF - [[0x0642,0x0644,0x06D2],[0xFDF1]], # ARABIC LIGATURE QALA USED AS KORANIC STOP SIGN - [[0x0642,0x0645],[0xFC34,0xFCC3,0xFD7F]], # ARABIC LIGATURE QAF WITH MEEM / ARABIC LIGATURE QAF WITH MEEM WITH MEEM - [[0x0642,0x0645,0x064A],[0xFDB2]], # ARABIC LIGATURE QAF WITH MEEM WITH YEH - [[0x0642,0x0649],[0xFC35,0xFC7E]], # ARABIC LIGATURE QAF WITH ALEF MAKSURA - [[0x0642,0x064A],[0xFC36,0xFC7F]], # ARABIC LIGATURE QAF WITH YEH - [[0x0643],[0xFED9,0xFEDA,0xFEDB,0xFEDC]], # ARABIC LETTER KAF - [[0x0643,0x0644],[0xFC3B,0xFC81,0xFCC7,0xFCEB]], # ARABIC LIGATURE KAF WITH LAM - [[0x0643,0x0645],[0xFC3C,0xFC82,0xFCC8,0xFCEC,0xFDBB,0xFDC3]], # ARABIC LIGATURE KAF WITH MEEM / ARABIC LIGATURE KAF WITH MEEM WITH MEEM - [[0x0643,0x0645,0x064A],[0xFDB7]], # ARABIC LIGATURE KAF WITH MEEM WITH YEH - [[0x0643,0x0649],[0xFC3D,0xFC83]], # ARABIC LIGATURE KAF WITH ALEF MAKSURA - [[0x0643,0x064A],[0xFC3E,0xFC84]], # ARABIC LIGATURE KAF WITH YEH - [[0x0644],[0xFEDD,0xFEDE,0xFEDF,0xFEE0]], # ARABIC LETTER LAM - [[0x0644,0x0645],[0xFC42,0xFC85,0xFCCC,0xFCED]], # ARABIC LIGATURE LAM WITH MEEM - [[0x0644,0x0645,0x064A],[0xFDAD]], # ARABIC LIGATURE LAM WITH MEEM WITH YEH - [[0x0644,0x0647],[0xFCCD]], # ARABIC LIGATURE LAM WITH HEH - [[0x0644,0x0649],[0xFC43,0xFC86]], # ARABIC LIGATURE LAM WITH ALEF MAKSURA - [[0x0644,0x064A],[0xFC44,0xFC87]], # ARABIC LIGATURE LAM WITH YEH - [[0x0645],[0xFC48,0xFC89,0xFCD1,0xFEE1,0xFEE2,0xFEE3,0xFEE4]], # ARABIC LIGATURE MEEM WITH MEEM / ARABIC LETTER MEEM - [[0x0645,0x0646],[0xFC4E,0xFC8C,0xFCD5,0xFCEE]], # ARABIC LIGATURE NOON WITH MEEM - [[0x0645,0x0646,0x0649],[0xFD9B]], # ARABIC LIGATURE NOON WITH MEEM WITH ALEF MAKSURA - [[0x0645,0x0646,0x064A],[0xFD9A]], # ARABIC LIGATURE NOON WITH MEEM WITH YEH - [[0x0645,0x0647],[0xFC52,0xFCD8,0xFD94]], # ARABIC LIGATURE HEH WITH MEEM / ARABIC LIGATURE HEH WITH MEEM WITH MEEM - [[0x0645,0x0649],[0xFC49]], # ARABIC LIGATURE MEEM WITH ALEF MAKSURA - [[0x0645,0x064A],[0xFC4A,0xFC58,0xFC93,0xFCDD,0xFCF0,0xFD9C,0xFD9D,0xFDB0,0xFDB1]], # ARABIC LIGATURE MEEM WITH YEH / ARABIC LIGATURE YEH WITH MEEM / ARABIC LIGATURE YEH WITH MEEM WITH MEEM / ARABIC LIGATURE YEH WITH MEEM WITH YEH / ARABIC LIGATURE MEEM WITH MEEM WITH YEH - [[0x0646],[0xFC8D,0xFEE5,0xFEE6,0xFEE7,0xFEE8]], # ARABIC LIGATURE NOON WITH NOON / ARABIC LETTER NOON - [[0x0646,0x0647],[0xFCD6,0xFCEF]], # ARABIC LIGATURE NOON WITH HEH - [[0x0646,0x0649],[0xFC4F,0xFC8E]], # ARABIC LIGATURE NOON WITH ALEF MAKSURA - [[0x0646,0x064A],[0xFC50,0xFC8F,0xFC94]], # ARABIC LIGATURE NOON WITH YEH / ARABIC LIGATURE YEH WITH NOON - [[0x0647],[0xFEE9,0xFEEA,0xFEEB,0xFEEC]], # ARABIC LETTER HEH - [[0x0647,0x0649],[0xFC53]], # ARABIC LIGATURE HEH WITH ALEF MAKSURA - [[0x0647,0x064A],[0xFC54,0xFCDE,0xFCF1]], # ARABIC LIGATURE HEH WITH YEH / ARABIC LIGATURE YEH WITH HEH - [[0x0647,0x0670],[0xFCD9]], # ARABIC LIGATURE HEH WITH SUPERSCRIPT ALEF - [[0x0648],[0xFEED,0xFEEE]], # ARABIC LETTER WAW - [[0x0649],[0xFBE8,0xFBE9,0xFEEF,0xFEF0]], # ARABIC LETTER UIGHUR KAZAKH KIRGHIZ ALEF MAKSURA / ARABIC LETTER ALEF MAKSURA - [[0x0649,0x064A],[0xFC59,0xFC95]], # ARABIC LIGATURE YEH WITH ALEF MAKSURA - [[0x0649,0x0670],[0xFC5D,0xFC90]], # ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF - [[0x064A],[0xFC5A,0xFC96,0xFEF1,0xFEF2,0xFEF3,0xFEF4]], # ARABIC LIGATURE YEH WITH YEH / ARABIC LETTER YEH - [[0x064B],[0xFE70]], # ARABIC FATHATAN - [[0x064C],[0xFE72]], # ARABIC DAMMATAN - [[0x064C,0x0651],[0xFC5E]], # ARABIC LIGATURE SHADDA WITH DAMMATAN - [[0x064D],[0xFE74]], # ARABIC KASRATAN - [[0x064D,0x0651],[0xFC5F]], # ARABIC LIGATURE SHADDA WITH KASRATAN - [[0x064E],[0xFE76]], # ARABIC FATHA - [[0x064E,0x0651],[0xFC60]], # ARABIC LIGATURE SHADDA WITH FATHA - [[0x064F],[0xFE78]], # ARABIC DAMMA - [[0x064F,0x0651],[0xFC61]], # ARABIC LIGATURE SHADDA WITH DAMMA - [[0x0650],[0xFE7A]], # ARABIC KASRA - [[0x0650,0x0651],[0xFC62]], # ARABIC LIGATURE SHADDA WITH KASRA - [[0x0651],[0xFE7C]], # ARABIC SHADDA - [[0x0651,0x0670],[0xFC63]], # ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF - [[0x0652],[0xFE7E]], # ARABIC SUKUN - [[0x0671],[0xFB50,0xFB51]], # ARABIC LETTER ALEF WASLA - [[0x0677],[0xFBDD]], # ARABIC LETTER U WITH HAMZA ABOVE - [[0x0679],[0xFB66,0xFB67,0xFB68,0xFB69]], # ARABIC LETTER TTEH - [[0x067A],[0xFB5E,0xFB5F,0xFB60,0xFB61]], # ARABIC LETTER TTEHEH - [[0x067B],[0xFB52,0xFB53,0xFB54,0xFB55]], # ARABIC LETTER BEEH - [[0x067E],[0xFB56,0xFB57,0xFB58,0xFB59]], # ARABIC LETTER PEH - [[0x067F],[0xFB62,0xFB63,0xFB64,0xFB65]], # ARABIC LETTER TEHEH - [[0x0680],[0xFB5A,0xFB5B,0xFB5C,0xFB5D]], # ARABIC LETTER BEHEH - [[0x0683],[0xFB76,0xFB77,0xFB78,0xFB79]], # ARABIC LETTER NYEH - [[0x0684],[0xFB72,0xFB73,0xFB74,0xFB75]], # ARABIC LETTER DYEH - [[0x0686],[0xFB7A,0xFB7B,0xFB7C,0xFB7D]], # ARABIC LETTER TCHEH - [[0x0687],[0xFB7E,0xFB7F,0xFB80,0xFB81]], # ARABIC LETTER TCHEHEH - [[0x0688],[0xFB88,0xFB89]], # ARABIC LETTER DDAL - [[0x068C],[0xFB84,0xFB85]], # ARABIC LETTER DAHAL - [[0x068D],[0xFB82,0xFB83]], # ARABIC LETTER DDAHAL - [[0x068E],[0xFB86,0xFB87]], # ARABIC LETTER DUL - [[0x0691],[0xFB8C,0xFB8D]], # ARABIC LETTER RREH - [[0x0698],[0xFB8A,0xFB8B]], # ARABIC LETTER JEH - [[0x06A4],[0xFB6A,0xFB6B,0xFB6C,0xFB6D]], # ARABIC LETTER VEH - [[0x06A6],[0xFB6E,0xFB6F,0xFB70,0xFB71]], # ARABIC LETTER PEHEH - [[0x06A9],[0xFB8E,0xFB8F,0xFB90,0xFB91]], # ARABIC LETTER KEHEH - [[0x06AD],[0xFBD3,0xFBD4,0xFBD5,0xFBD6]], # ARABIC LETTER NG - [[0x06AF],[0xFB92,0xFB93,0xFB94,0xFB95]], # ARABIC LETTER GAF - [[0x06B1],[0xFB9A,0xFB9B,0xFB9C,0xFB9D]], # ARABIC LETTER NGOEH - [[0x06B3],[0xFB96,0xFB97,0xFB98,0xFB99]], # ARABIC LETTER GUEH - [[0x06BA],[0xFB9E,0xFB9F]], # ARABIC LETTER NOON GHUNNA - [[0x06BB],[0xFBA0,0xFBA1,0xFBA2,0xFBA3]], # ARABIC LETTER RNOON - [[0x06BE],[0xFBAA,0xFBAB,0xFBAC,0xFBAD]], # ARABIC LETTER HEH DOACHASHMEE - [[0x06C0],[0xFBA4,0xFBA5]], # ARABIC LETTER HEH WITH YEH ABOVE - [[0x06C1],[0xFBA6,0xFBA7,0xFBA8,0xFBA9]], # ARABIC LETTER HEH GOAL - [[0x06C5],[0xFBE0,0xFBE1]], # ARABIC LETTER KIRGHIZ OE - [[0x06C6],[0xFBD9,0xFBDA]], # ARABIC LETTER OE - [[0x06C7],[0xFBD7,0xFBD8]], # ARABIC LETTER U - [[0x06C8],[0xFBDB,0xFBDC]], # ARABIC LETTER YU - [[0x06C9],[0xFBE2,0xFBE3]], # ARABIC LETTER KIRGHIZ YU - [[0x06CB],[0xFBDE,0xFBDF]], # ARABIC LETTER VE - [[0x06CC],[0xFBFC,0xFBFD,0xFBFE,0xFBFF]], # ARABIC LETTER FARSI YEH - [[0x06D0],[0xFBE4,0xFBE5,0xFBE6,0xFBE7]], # ARABIC LETTER E - [[0x06D2],[0xFBAE,0xFBAF]], # ARABIC LETTER YEH BARREE - [[0x06D3],[0xFBB0,0xFBB1]], # ARABIC LETTER YEH BARREE WITH HAMZA ABOVE - [[0],[0]] - ].each do |u,l| - if (unicodes & u) == u - unicodes += l - end - end - unicodes.uniq - end - - def mirror_brackes(unicodes) - [['<','>'],['(',')'],['[',']'],['{','}']].each do |l,r| - has_l = unicodes.include?(l.ord) - has_r = unicodes.include?(r.ord) - unicodes.push(r.ord) if has_l && !has_r - unicodes.push(l.ord) if has_r && !has_l - end - unicodes - end - - def add_thai(unicodes) - # Add Thai unicodes which are used to calculate diacritic positions when the Thai characters have special shapes. - [[0x0E09, 0x0E08],[0x0E13,0x0E0C],[0x0E19,0x0E18],[0x0E1B, 0x0E1A],[0x0E1D,0x0E1C],[0x0E1F,0x0E1E],[0x0E33,0x0E32],[0x0E33,0x0E4D]].each do |has,need| - has_unicode = unicodes.include?(has) - has_needed = unicodes.include?(need) - unicodes.push(need) if has_unicode && !has_needed - end - unicodes - end - - def check_for_rtl(unicodes) - return if @text_entries.is_rtl # No need to look for unicode if RTL already detected - # Look for hebrew (0x0590-0x05ff) or arabic (0x0600-0x06ff) + arabic ligatures (0xFE70-0xFEFF) - @text_entries.unicode_uses_rtl if unicodes.any?{|u| u.between?(0x0590, 0x05FF) || u.between?(0x0600, 0x06FF) || u.between?(0xFE70, 0xFEFE) } - end - - def decode_ranges(str) - result = [] - while str.length > 0 - char_range = str.match(/^(.)-(.)(.*)$/) - if char_range - first_char = char_range[1] - last_char = char_range[2] - result += (first_char.ord .. last_char.ord).to_a - str = char_range[3] - else - num_range = str.match(/^(0[xX][0-9a-fA-F]+|\d+)(?:\.0+)?-(0[xX][0-9a-fA-F]+|\d+)(?:\.0+)?(.*)$/) - if num_range - first_num = Integer(num_range[1]) - last_num = Integer(num_range[2]) - result += (first_num..last_num).to_a - str = num_range[3] - else - num = str.match(/^(0[xX][0-9a-fA-F]+|\d+)(?:\.0+)?(.*)/) - if num - # Check for typo such as 0,2-9 - if num[1].length == 1 - result += [ num[1].ord ] - else - result += [ Integer(num[1]) ] - end - str = num[2] - else - abort "Unexpected character at #{str}" - end - end - end - if str.length > 0 - if str[0] == ',' - str = str[1..-1] - else - abort "Please separate wildcard ranges with ','" - end - end - end - result - end - - def run - typographies_identical = @typographies.select{ |t| t.font_file == @unique_typography.font_file && - t.font_size == @unique_typography.font_size && - t.bpp == @unique_typography.bpp } - typography_names = typographies_identical.map(&:name).uniq - - # Find a typography with a fallback character - typography_with_fallback_character = typographies_identical.find { |t| t.fallback_character } - if typography_with_fallback_character - # Now get the actual fallback character (or 'skip') - typography_fallback_character = typography_with_fallback_character.fallback_character - # Check to see if one of the other typographes has a different fallback character - index = typographies_identical.find_index{ |t| t.fallback_character && t.fallback_character != typography_fallback_character } - if index - abort "The fallback character differs for typography \"#{typography_with_fallback_character.name}\" and typography \"#{typographies_identical[index].name}\"" - end - # set all fallback characters to the same character - typographies_identical.each { |t| t.fallback_character = typography_fallback_character } - end - - # Find a typography with a ellipsis character - typography_with_ellipsis_character = typographies_identical.find { |t| t.ellipsis_character } - if typography_with_ellipsis_character - # Now get the actual ellipsis character (or 'skip') - typography_ellipsis_character = typography_with_ellipsis_character.ellipsis_character - # Check to see if one of the other typographes has a different ellipsis character - index = typographies_identical.find_index{ |t| t.ellipsis_character && t.ellipsis_character != typography_ellipsis_character } - if index - abort "The ellipsis character differs for typography \"#{typography_with_ellipsis_character.name}\" and typography \"#{typographies_identical[index].name}\"" - end - # set all ellipsis characters to the same character - typographies_identical.each { |t| t.ellipsis_character = typography_ellipsis_character } - end - - all_translations = typography_names.map{ |typography_name| @text_entries.collect{ |entry| entry.translations_with_typography(typography_name) }.flatten }.flatten - - unicodes = all_translations.map(&:unicodes).flatten.uniq.sort - - typographies_identical.each do |t| - fbc = t.fallback_character - fbcUnicode = 0 - if fbc - if fbc.downcase == 'skip' - fbcUnicode = 0xFEFF - elsif fbc.length == 1 - fbcUnicode = fbc[0].ord - else - begin - fbcUnicode = Integer(fbc.gsub(/\.0*$/,'')) - rescue - fail "ERROR: Please only specify one character or ('skip') as Fallback Character, typography \"#{typography_with_fallback_character.name}\" has Fallback Character \"#{typography_with_fallback_character.fallback_character}\"" - end - end - unicodes += [ fbcUnicode ] - end - t.fallback_character = fbcUnicode - - tec = t.ellipsis_character - tecUnicode = 0 - if tec - if tec.length == 1 - tecUnicode = tec[0].ord - else - begin - tecUnicode = Integer(tec.gsub(/\.0*$/,'')) - rescue - fail "ERROR: Please only specify one character as Ellipsis Character for typography \"#{typography_with_fallback_character.name}\"" - end - end - unicodes += [ tecUnicode ] - end - t.ellipsis_character = tecUnicode - end - typographies_identical.each{ |t| - if t.wildcard_characters - t.wildcard_characters.to_s.split('').each { |c| - unicodes += [ c[0].ord ] - } - end - if t.widget_wildcard_characters - t.widget_wildcard_characters.to_s.split('').each { |c| - unicodes += [ c[0].ord ] - } - end - if t.wildcard_ranges - unicodes += decode_ranges(t.wildcard_ranges) - end - } - - unicodes = convert_to_contextual_forms(unicodes) - unicodes = mirror_brackes(unicodes) - unicodes = add_thai(unicodes) - - unicodes.delete(0x0000) # Zero termination of strings - unicodes.delete(0x0002) # TouchGFX wildcard character - unicodes.delete(0x200B) # ZERO WIDTH SPACE - unicodes.delete(0xFEFF) # ZERO WIDTH NO-BREAK SPACE - - unicodes = unicodes.uniq.sort - - check_for_rtl(unicodes) - - FileIO.write_file_silent(File.join(@output_directory, "UnicodeList#{@unique_typography.cpp_name}_#{@unique_typography.font_size}_#{@unique_typography.bpp}.txt"), unicodes.join(LINE_ENDINGS) ) - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb deleted file mode 100644 index 42bd816..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_cpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class UnmappedDataFontCpp < Template - def input_path - File.join(root_dir,'Templates','UnmappedDataFont.cpp.temp') - end - def output_path - '/src/UnmappedDataFont.cpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate UnmappedDataFont.cpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb deleted file mode 100644 index d444094..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/emitters/unmapped_data_font_hpp.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class UnmappedDataFontHpp < Template - def input_path - File.join(root_dir,'Templates','UnmappedDataFont.hpp.temp') - end - def output_path - '/include/fonts/UnmappedDataFont.hpp' - end - def output_filename - File.join(@output_directory, output_path) - end - def run - if !File::exists?(output_filename) - #generate GeneratedFont.hpp - super - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb deleted file mode 100644 index bad8722..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/excel_reader.rb +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'roo' -require 'lib/text_entries' - -class ExcelRow - - def initialize(excel_file, header, row_number, first_column) - @excel_file = excel_file - @header = header - @row_number = row_number - @first_column = first_column - end - - def [](column_header) - value_at(@row_number, column_number(column_header.to_s)) - end - - def exists?(name) - !@header[name.to_s.downcase].nil? - end - - private - - def column_number(name) - column_index = @header[name.downcase] - fail "ERROR: #{name} column not found in excel file" if column_index.nil? - column_index + @first_column - end - - def value_at(row, col) - value = @excel_file.cell(row,col).to_s - if value.empty? - nil - else - check_encoding(value) - value - end - end - - def check_encoding(value) - puts value if value.force_encoding("UTF-8").valid_encoding? == false - end - -end - -class ExcelReader - - def initialize(file_name, sheet, header_row, first_column) - @excel_file = Roo::Excelx.new file_name - @sheet = sheet - @excel_file.default_sheet = sheet - @header_row = header_row - @first_column = first_column - @header = {} - header.each_with_index do |cell, ix| - @header[cell.downcase] = ix - end - end - - def read_header - yield header - end - - def read_rows - (@header_row + 1).upto(last_row_number) do |row_number| - yield row(row_number) - end - end - - private - - def last_row_number - @excel_file.last_row - end - - def header - @excel_file.row(@header_row).compact.map(&:strip) - end - - def row(row_number) - ExcelRow.new(@excel_file, @header, row_number, @first_column) - end - -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb deleted file mode 100644 index 5df7396..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/file_io.rb +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'rubygems' -require 'erb' -require 'fileutils' -require 'pathname' - -class FileIO - def self.write_file(file_name, contents) - callingPath = Pathname.new($calling_path) - filePath = Pathname.new(file_name) - puts "Generating #{filePath.relative_path_from(callingPath)}" - write_file_silent(file_name, contents) - end - def self.write_file_silent(file_name, contents) - FileUtils.mkdir_p(File.dirname(file_name)) - unless File.exist?(file_name) && contents == File.open(file_name, 'r') { |f| f.read() } - File.open(file_name, 'w') { |f| f.write(contents) } - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb deleted file mode 100644 index 5767537..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/generator.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'lib/outputter' -require 'lib/sanitizer' -require 'lib/string_collector' -require 'lib/text_database_parser' -require 'lib/xml_reader' -require 'lib/xml_validator' - -class Generator - def run(xml_file_name, output_path, text_output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, framebuffer_bpp, generate_font_format) - xml_doc = XMLReader.new.read(xml_file_name) - XMLValidator.new.validate(xml_file_name) - languages, typographies, text_entries = TextDatabaseParser.new(xml_doc).run - Sanitizer.new(text_entries, typographies, languages, framebuffer_bpp).run - string_indices, characters = StringCollector.new(text_entries, languages, typographies).run(remap_global == "yes") - Outputter.new(string_indices, characters, text_entries, typographies, languages, text_output_path, output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, generate_font_format).run - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb deleted file mode 100644 index d45de2a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/outputter.rb +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'lib/file_io' -require 'lib/emitters/template' -require 'lib/emitters/text_keys_and_languages_hpp' -require 'lib/emitters/texts_cpp' -require 'lib/emitters/languages_cpp' -require 'lib/emitters/languages_bin' -require 'lib/emitters/unicodes_txt' -require 'lib/emitters/fonts_cpp' -require 'lib/emitters/generated_font_cpp' -require 'lib/emitters/generated_font_hpp' -require 'lib/emitters/unmapped_data_font_cpp' -require 'lib/emitters/unmapped_data_font_hpp' -require 'lib/emitters/cached_font_cpp' -require 'lib/emitters/cached_font_hpp' -require 'lib/emitters/font_cache_cpp' -require 'lib/emitters/font_cache_hpp' -require 'lib/emitters/application_font_provider_hpp' -require 'lib/emitters/application_font_provider_cpp' -require 'lib/emitters/typed_text_database_hpp' -require 'lib/emitters/typed_text_database_cpp' - -class Outputter - def initialize(string_indices, characters, text_entries, typographies, languages, localization_output_directory, fonts_output_directory, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, generate_font_format) - @string_indices = string_indices #dictionary of all string indices into the characters array - @characters = characters #one array of the needed strings in optimal order - @text_entries = text_entries - @typographies = typographies - @languages = languages - @localization_output_directory = localization_output_directory - @fonts_output_directory = fonts_output_directory - @font_asset_path = font_asset_path - @data_format = data_format - @remap_global = remap_global - @autohint_setting = autohint_setting - @generate_binary_translations = generate_binary_translations - @generate_binary_fonts = generate_binary_fonts - @generate_font_format = generate_font_format - end - - def run - - [ GeneratedFontHpp, - GeneratedFontCpp, - UnmappedDataFontHpp, - UnmappedDataFontCpp, - CachedFontHpp, - CachedFontCpp, - FontCacheHpp, - FontCacheCpp, - UnicodesTxt ].each { |template| template.new(@text_entries, @typographies, @languages, @fonts_output_directory).run } - - [ ApplicationFontProviderCpp, - ApplicationFontProviderHpp ].each { |template| template.new(@text_entries, @typographies, @languages, @fonts_output_directory, @generate_font_format).run } - - [ TextKeysAndLanguages, - TypedTextDatabaseHpp].each { |template| template.new(@text_entries, @typographies, @languages, @localization_output_directory).run } - - TypedTextDatabaseCpp.new(@text_entries, @typographies, @languages, @localization_output_directory, @generate_binary_translations, @generate_font_format).run - - TextsCpp.new(@characters, @text_entries, @typographies, @languages, @localization_output_directory, @remap_global, @generate_binary_translations).run - - LanguagesCpp.new(@string_indices, @characters, @text_entries, @languages, @localization_output_directory, @remap_global, @generate_binary_translations).run - - FontsCpp.new(@text_entries, @typographies, @languages, @fonts_output_directory, @font_asset_path, @autohint_setting, @data_format, @generate_binary_fonts, @generate_font_format).run - - if @generate_binary_translations.downcase == 'yes' - [ LanguagesBin ].each { |template| template.new(@text_entries, @typographies, @languages, @localization_output_directory).run } - end - end -end - diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb deleted file mode 100644 index 21c56a1..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/sanitizer.rb +++ /dev/null @@ -1,175 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -TextEntrySanitizer = Struct.new(:text_entries, :typographies, :languages, :framebuffer_bpp) - -class Sanitizer < TextEntrySanitizer - - def run - [ RemoveDuplicateKeys, - # RemoveIncompleteLanguages, - RemoveKeysWithMoreThanTwoSubstitutions, - RemoveKeysWithDifferentNumberOfSubstitutions, - RemoveTextEntriesWithInvalidTypography, - RemoveTextEntriesWithInvalidAlignment, - RemoveTextEntriesWithInvalidDirection, - CheckSizeAndBpp, - DowngradeFontsBitDepth - ].each do |sanitizer| - sanitizer.new(text_entries, typographies, languages, framebuffer_bpp).run - end - end -end - -class RemoveDuplicateKeys < TextEntrySanitizer - def run - counts = Hash.new(0) - counts = text_entries.inject(Hash.new(0)) do |h, entry| - h[entry.cpp_text_id.upcase] = h[entry.cpp_text_id.upcase] + 1 - h - end - - text_entries.each do |text_entry| - if counts[text_entry.cpp_text_id.upcase] > 1 - fail "ERROR: Duplicate key removed: #{text_entry.text_id}, yields cpp identifier #{text_entry.cpp_text_id.upcase}" - text_entries.remove(text_entry) - end - end - end -end - -class RemoveIncompleteLanguages < TextEntrySanitizer - def run - languages.each do |language| - text_entries_with_missing_translations = text_entries.select do |text_entry| - text_entry.translation_in(language).empty? - end - text_entries_with_missing_translations.each do |text_entry| - fail "ERROR: Language #{language} is missing translation for #{text_entry.text_id}" - end - if text_entries_with_missing_translations.any? - text_entries.remove_language(language) - end - end - end -end - -class RemoveKeysWithMoreThanTwoSubstitutions < TextEntrySanitizer - def run - languages.each do |language| - text_entries_with_more_than_two_substitutions = text_entries.select do |text_entry| - text_entry.number_of_substitutions_in(language) > 2 - end - text_entries_with_more_than_two_substitutions.each do |text_entry| - fail "ERROR: Text Id #{text_entry.text_id} has #{text_entry.number_of_substitutions_in(language)} substitutions" - #text_entries.remove(text_entry) - end - end if languages - end -end - -class RemoveKeysWithDifferentNumberOfSubstitutions < TextEntrySanitizer - def run - text_entries.each do |text_entry| - translations = text_entry.translations - number_of_substitutions_per_translation = translations.collect { |translation| translation.number_of_substitutions } - if number_of_substitutions_per_translation.uniq.count > 1 - fail "ERROR: Text Id #{text_entry.text_id} has different number of substitutions for some languages" - #text_entries.remove(text_entry) - end - end - end -end - -class RemoveTextEntriesWithInvalidTypography < TextEntrySanitizer - def run - text_entries.each do |text_entry| - non_existing_typographies = (text_entry.get_all_typographies - typographies.map( &:name )).compact; - - if non_existing_typographies.any? - fail "ERROR: Text Id #{text_entry.text_id} uses unknown typographies #{non_existing_typographies}" - #text_entries.remove(text_entry) - end - end - end -end - -class RemoveTextEntriesWithInvalidAlignment < TextEntrySanitizer - def run - text_entries.each do |text_entry| - alignments = text_entry.get_all_alignments_as_string - illegal_alignments = alignments.uniq - ['LEFT', 'RIGHT', 'CENTER'] - if illegal_alignments.any? - fail "ERROR: Text Id #{text_entry.text_id} uses unknown alignments #{illegal_alignments}" - #text_entries.remove(text_entry) - end - end - end -end - -class RemoveTextEntriesWithInvalidDirection < TextEntrySanitizer - def run - text_entries.each do |text_entry| - directions = text_entry.get_all_directions_as_string - illegal_directions = directions.uniq - ['LTR', 'RTL'] - if illegal_directions.any? - fail "ERROR: Text Id '#{text_entry.text_id}' uses unknown directions #{illegal_directions}" - #text_entries.remove(text_entry) - end - end - end -end - -class CheckSizeAndBpp < TextEntrySanitizer - def run - typographies.each do |typography| - if ![1, 2, 4, 8].include?(typography.bpp) - fail "ERROR: Typography named '#{typography.name}' has bpp value '#{typography.bpp}', which is not a valid value" - end - - if !typography.font_size.integer? || typography.font_size < 1 - fail "ERROR: Typography named '#{typography.name}' has font size value '#{typography.font_size}', which is not a valid value" - end - end - end -end - -class DowngradeFontsBitDepth < TextEntrySanitizer - def run - if !framebuffer_bpp.nil? - m = framebuffer_bpp.match(/BPP(\d+)/) - bpp = m.nil? ? 24 : m[1].to_i - typographies.each do |typography| - case bpp - when 8 - if typography.bpp > 2 - puts "Downgrading typography #{typography.name} from #{typography.bpp.to_s}bpp to 2bpp" - typography.bpp = 2 - end - when 4 - if typography.bpp > 4 - puts "Downgrading typography #{typography.name} from #{typography.bpp.to_s}bpp to 4bpp" - typography.bpp = 4 - end - when 2 - if typography.bpp > 2 - puts "Downgrading typography #{typography.name} from #{typography.bpp.to_s}bpp to 2bpp" - typography.bpp = 2 - end - when 1 - if typography.bpp > 1 - puts "Downgrading typography #{typography.name} from #{typography.bpp.to_s}bpp to 1bpp" - typography.bpp = 1 - end - end - end - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb deleted file mode 100644 index 236cab3..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/string_collector.rb +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -CollectorStruct = Struct.new(:text_entries, :languages, :typographies) - -def get_getFont_name(typography) - "getFont_#{typography.cpp_name}_#{typography.font_size}_#{typography.bpp}bpp" -end - -def unicode_array_to_hex_offset_comment(array) - strings = array.slice_after(0).to_a - # Inject ([], 0) and on each interation insert - # * the substring - # * the offset - # * a flag for "last element" - # in the [] array + update the offset for next substring - # Return [0] which is the array (discarding the offset placed at [1] in the injected ([],0) - strings.each_with_index.inject([Array.new,0]) { |(result, offset), (string, index)| [ result.push([string, offset, index==strings.length-1]), offset + string.length ] }[0] -end - -def unicode_array_to_string(array) - array.inject('') do |txt, unicode| - if unicode==2 - txt << "<>" - elsif unicode>=32 && unicode<127 - txt << unicode.chr - elsif unicode==0 - return txt - elsif unicode==13 - txt << '\r' - elsif unicode==10 - txt << '\n' - else - txt << '?' - end - txt - end -end - -class StringCollector < CollectorStruct - def run(remap_global) - #collect all strings for sorting - all_strings = Array.new(languages.count, Array.new) - text_entries.each do |text_entry| - text_entry.translations.each_with_index do |translation, lang_index| - # Fold all languages into one entry if global remapping - all_strings[remap_global ? 0 : lang_index] += [translation] - end - end - # sort by: Same length => sort by text, otherwise reverse sort on length - # [ 'Slide','Yes','Cover','None' ] => [ 'Cover', 'Slide', 'None', 'Yes' ] - all_strings = all_strings.map do |strings| - strings.sort{|x,y| x.length == y.length ? x.text <=> y.text : y.length <=> x.length } - end - - #collect all string indeces, and add to characters array - string_mapping = Array.new - characters_lists = Array.new - all_strings.each_with_index do |strings, lang_index| - string_indices = Hash.new - characters = Array.new - strings.each do |translation| - #lookup translation in hash - #if not found, add to characters and insert index in hash for translation and all suffices - #if found, do nothing - unicodes = translation.unicodes # This includes a terminating zero character - index = string_indices[unicodes] - if !index - new_index = characters.length - #puts "new string: #{translation.to_cpp} index: #{new_index}" - characters.concat(unicodes) - for start in 0 .. unicodes.length-1 - sub_string = unicodes[start..-1] - # if the substring is present, all shorter substrings are also present, so do not add again - break if string_indices[sub_string] - string_indices[sub_string] = (new_index + start) - end - else - #puts "existing string: #{translation.to_cpp} index: #{index}" - end - end - string_mapping[lang_index] = string_indices - characters_lists[lang_index] = characters - end - [string_mapping, characters_lists] - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb deleted file mode 100644 index ac79bfe..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser.rb +++ /dev/null @@ -1,173 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'nokogiri' -require 'lib/text_entries' -require 'lib/typographies' - -class ParserBase - def initialize(xml_doc) - @xml_doc = xml_doc - end - -protected - def empty_to_nil(str) - str ? str.strip.empty? ? nil : str.strip : nil - end -end - -class TextDatabaseParser < ParserBase - def run - languages = LanguageParser.new(@xml_doc).run - typographies = TypographyParser.new(@xml_doc, languages).run - text_entries = TextParser.new(@xml_doc, languages, typographies).run - - return languages, typographies.get_typographies(), text_entries - end -end - -class LanguageParser < ParserBase - def run - languages = [] - @xml_doc.xpath("/TextDatabase/Languages/Language").each do |lang_node| - language = empty_to_nil(lang_node["Id"]) - fail "ERROR: Attribute 'Id' not specified in line #{lang_node.line} in #{lang_node.to_s}" if language.nil? - if !language.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{lang_node.line} for " - end - languages.push(language) - end - - return languages - end -end - -class TypographyParser < ParserBase - def initialize(xml_doc, languages) - super(xml_doc) - @languages = languages - @typographies = Typographies.new - end - - def run - @xml_doc.xpath("/TextDatabase/Typographies/Typography").each do |typo_node| - typo_id = empty_to_nil(typo_node["Id"]) - font = empty_to_nil(typo_node["Font"]) - size = empty_to_nil(typo_node["Size"]) - bpp = empty_to_nil(typo_node["Bpp"]) - direction = empty_to_nil(typo_node["Direction"]) - fallback_character = empty_to_nil(typo_node["FallbackCharacter"]) - wildcard_characters = empty_to_nil(typo_node["WildcardCharacters"]) - wildcard_widget_characters = empty_to_nil(typo_node["WidgetWildcardCharacters"]) - wildcard_character_ranges = empty_to_nil(typo_node["WildcardCharacterRanges"]) - ellipsis_character = empty_to_nil(typo_node["EllipsisCharacter"]) - - fail "ERROR: Attribute 'Id' not specified in line #{typo_node.line} in #{typo_node.to_s}" if typo_id.nil? - fail "ERROR: Attribute 'Font' not specified in line #{typo_node.line} for " if font.nil? - fail "ERROR: Attribute 'Size' not specified in line #{typo_node.line} for " if size.nil? - fail "ERROR: Attribute 'Bpp' not specified in line #{typo_node.line} for " if bpp.nil? - fail "ERROR: Attribute 'Direction' not specified in line #{typo_node.line} for " if direction.nil? - if !typo_id.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{typo_node.line} for " - end - - # Default typography - @typographies.add(typo_id, "", font, size, bpp, fallback_character, ellipsis_character, wildcard_characters, wildcard_widget_characters, wildcard_character_ranges, direction) - - typo_node.xpath('./LanguageSetting').each do |language_setting| - language = empty_to_nil(language_setting["Language"]) - font = empty_to_nil(language_setting["Font"]) - size = empty_to_nil(language_setting["Size"]) - bpp = empty_to_nil(language_setting["Bpp"]) - direction = empty_to_nil(language_setting["Direction"]) - fallback_character = empty_to_nil(language_setting["FallbackCharacter"]) - wildcard_characters = empty_to_nil(language_setting["WildcardCharacters"]) - wildcard_widget_characters = empty_to_nil(language_setting["WidgetWildcardCharacters"]) - wildcard_character_ranges = empty_to_nil(language_setting["WildcardCharacterRanges"]) - ellipsis_character = empty_to_nil(language_setting["EllipsisCharacter"]) - - fail "ERROR: Attribute 'Language' not specified in line #{language_setting.line} in #{language_setting.to_s}" if language.nil? - fail "ERROR: Attribute 'Font' not specified in line #{language_setting.line} for " if font.nil? - fail "ERROR: Attribute 'Size' not specified in line #{language_setting.line} for " if size.nil? - fail "ERROR: Attribute 'Bpp' not specified in line #{language_setting.line} for " if bpp.nil? - fail "ERROR: Attribute 'Direction' not specified in line #{language_setting.line} for " if direction.nil? - if !language.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{language_setting.line} for " - end - fail "ERROR: Unknown language '#{language}'" if !@languages.include?(language) - - # Language specific typography - @typographies.add(typo_id, language, font, size, bpp, fallback_character, ellipsis_character, wildcard_characters, wildcard_widget_characters, wildcard_character_ranges, direction) - end - end - return @typographies - end -end - -class TextParser < ParserBase - def initialize(xml_doc, languages, typographies) - super(xml_doc) - @languages = languages - @typographies = typographies - @text_entries = TextEntries.new - end - - def run - @xml_doc.xpath("/TextDatabase/Texts/TextGroup/Text").each do |text_node| - text_id = empty_to_nil(text_node["Id"]) - default_typography_id = empty_to_nil(text_node["TypographyId"]) - default_alignment = empty_to_nil(text_node["Alignment"]) - - fail "ERROR: Attribute 'Id' not specified in line #{text_node.line} in #{text_node.to_s}" if text_id.nil? - fail "ERROR: Attribute 'TypographyId' not specified in line #{text_node.line} for " if default_typography_id.nil? - fail "ERROR: Attribute 'Alignment' not specified in line #{text_node.line} for " if default_alignment.nil? - if !text_id.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{text_node.line} for " - end - - default_typography_name = @typographies.get_typography_name(default_typography_id, "") - default_direction = @typographies.get_direction(default_typography_id, "") - - text_entry = TextEntry.new(text_id, default_typography_name, default_alignment, default_direction); - - fail "ERROR: Translation not specified in line #{text_node.line} for " if !text_node.at("Translation") - - text_node.xpath('./Translation').each do |translation| - language = empty_to_nil(translation["Language"]) - specific_alignment = empty_to_nil(translation["Alignment"]) - - fail "ERROR: Attribute 'Language' not specified in line #{translation.line} for Translation" if language.nil? - if !language.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{translation.line} for " - end - fail "ERROR: Unknown language '#{language}'" if !@languages.include?(language) - - if translation.text.match(/\n\t|\n /) - puts "WARNING: Text in line #{translation.line} for with Language '#{language}' contains tabs or whitespace indentation" - end - - specific_typography_name = @typographies.get_typography_name(default_typography_id, language) - specific_direction = @typographies.get_direction(default_typography_id, language) - - specific_typography_name = nil if specific_typography_name == default_typography_name - specific_direction = nil if specific_direction == default_direction - specific_alignment = nil if specific_alignment == default_alignment - - text_entry.add_translation(language, translation.text) - text_entry.add_typography(language, specific_typography_name) if !specific_typography_name.nil? - text_entry.add_direction(language, specific_direction) if !specific_direction.nil? - text_entry.add_alignment(language, specific_alignment) if !specific_alignment.nil? - end - - @text_entries.add(text_entry) - end - return @text_entries - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb deleted file mode 100644 index 062381d..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_17.rb +++ /dev/null @@ -1,175 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'lib/excel_reader' -require 'lib/text_entries' -require 'lib/typographies' - -class TextDatabaseParser_4_17 - def initialize(file_name) - @file_name = file_name - end - - def run - typographies = TypographyParser_4_17.new(@file_name).run - text_entries = TextParser_4_17.new(@file_name).run - return typographies, text_entries - end -end - -class TypographyParser_4_17 - def initialize(file_name) - header_row_number = 3 - header_column_number = 2 - @reader = ExcelReader.new(file_name, 'Typography', header_row_number, header_column_number) - end - - def run - typographies = [] - @reader.read_rows do |row| - name = row[:'Typography Name'] - font = row[:font] - size = row[:size] - bpp = row[:bpp] - if row.exists?(:'Fallback Character') - fallback_character = row[:'Fallback Character'] - end - if row.exists?(:'Wildcard Characters') - wildcard_characters = row[:'Wildcard Characters'] - end - if row.exists?(:'Widget Wildcard Characters') - widget_wildcard_characters = row[:'Widget Wildcard Characters'] - end - if row.exists?(:'Character Ranges') # New name - wildcard_ranges = row[:'Character Ranges'] - elsif row.exists?(:'Wildcard Ranges') # Old name - wildcard_ranges = row[:'Wildcard Ranges'] - end - if row.exists?(:'Ellipsis Character') - ellipsis_character = row[:'Ellipsis Character'] - end - - if name - name.strip! - unless name.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in Text ID '#{name}'" - end - end - font = font.strip if font - size = size.strip if size - bpp = bpp.strip if bpp - fallback_character = fallback_character.strip if fallback_character - wildcard_characters = wildcard_characters.strip if wildcard_characters - widget_wildcard_characters = widget_wildcard_characters.strip if widget_wildcard_characters - wildcard_ranges = wildcard_ranges.strip if wildcard_ranges - ellipsis_character = ellipsis_character.strip if ellipsis_character - - if name && font && size && bpp - typographies.push Typography.new(name, font, size.to_i, bpp.to_i, fallback_character, ellipsis_character, wildcard_characters, widget_wildcard_characters, wildcard_ranges) - end - end - typographies - end -end - -class TextParser_4_17 - def initialize(file_name) - header_row_number = 3 - header_column_number = 2 - @reader = ExcelReader.new(file_name, "Translation", header_row_number, header_column_number) - end - - def language_capitalization(lang) - lang_upcase = lang.upcase - @languages.find { |l| l.upcase == lang_upcase } - end - - def run - @reader.read_header do |header| - @alignments = header.select { |column| column.match(/^.*-ALIGNMENT$/i) } - @directions = header.select { |column| column.match(/^.*-DIRECTION$/i) } - @typographies = header.select { |column| column.match(/^.*-TYPOGRAPHY$/i) } - @languages = header.select { |column| column.match(/^(\w{1,3})$/i ) } - end - - # Check for undefined languages in language specific typographies - @typographies.each do |typography| - language, _ = typography.upcase.split('-') - fail "ERROR: Unknown language in column #{language}-TYPOGRAPHY" if !@languages.any?{ |lang| lang.upcase == language } - end - - # Check for undefined languages in language specific alignments - @alignments.each do |alignment| - language, _ = alignment.upcase.split('-') - fail "ERROR: Unknown language in column #{language}-ALIGNMENT" if not @languages.any?{ |lang| lang.upcase == language } - end - - # Check for undefined languages in language specific directions - @directions.each do |direction| - language, _ = direction.upcase.split('-') - fail "ERROR: Unknown language in column #{language}-DIRECTION" if not @languages.any?{ |lang| lang.upcase == language } - end - - text_entries = TextEntries.new - @reader.read_rows do |row| - text_id = row[:"Text ID"] - default_typography = row[:"Typography Name"] - default_alignment = row[:Alignment] - if row.exists?(:Direction) - default_direction = row[:Direction] - end - - text_id = text_id.strip if text_id - default_typography = default_typography.strip if default_typography - default_alignment = default_alignment.strip if default_alignment - default_direction = default_direction.strip if default_direction - - if text_id && default_typography - unless text_id.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in Text ID '#{text_id}'" - end - - text_entry = TextEntry.new(text_id, default_typography, default_alignment, default_direction) - - @typographies.each do |typography| - language, _ = typography.split('-') - language = language_capitalization(language) - t = row[typography] - t = t.strip if t - text_entry.add_typography(language, t) - end - - @alignments.each do |alignment| - language, _ = alignment.split('-') - language = language_capitalization(language) - a = row[alignment] - a = a.strip if a - text_entry.add_alignment(language, a) - end - - @directions.each do |direction| - language, _ = direction.split('-') - language = language_capitalization(language) - d = row[direction] - d = d.strip if d - text_entry.add_direction(language, d) - end - - @languages.each do |language| - # Do *not* strip leading/trailing whitespace from translations. - text_entry.add_translation(language, row[language]) - end - - text_entries.add(text_entry) - end - end - text_entries - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb deleted file mode 100644 index d0481db..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_parser_4_18.rb +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'nokogiri' -require 'lib/text_entries' -require 'lib/typographies' - -class TextDatabaseParser_4_18 - def initialize(file_name) - @file_name = file_name - end - - def run - typographies = TypographyParser_4_18.new(@file_name).run - text_entries = TextParser_4_18.new(@file_name).run - - return typographies, text_entries - end -end - -class TypographyParser_4_18 - def empty_to_nil(str) - str ? str.strip.empty? ? nil : str.strip : nil - end - - def initialize(xml_doc) - @xml_doc = xml_doc - @typographies = [] - end - - def run - @xml_doc.xpath("/TextDatabase/Typographies/Typography").each do |typo_node| - typo_id = empty_to_nil(typo_node["Id"]) - font = empty_to_nil(typo_node["Font"]) - size = empty_to_nil(typo_node["Size"]) - bpp = empty_to_nil(typo_node["Bpp"]) - fallback_character = empty_to_nil(typo_node["FallbackCharacter"]) - wildcard_characters = empty_to_nil(typo_node["WildcardCharacters"]) - wildcard_widget_characters = empty_to_nil(typo_node["WidgetWildcardCharacters"]) - wildcard_character_ranges = empty_to_nil(typo_node["WildcardCharacterRanges"]) - ellipsis_character = empty_to_nil(typo_node["EllipsisCharacter"]) - - fail "ERROR: Attribute 'Id' not specified in line #{typo_node.line} in #{typo_node.to_s}" if typo_id.nil? - fail "ERROR: Attribute 'Font' not specified in line #{typo_node.line} for " if font.nil? - fail "ERROR: Attribute 'Size' not specified in line #{typo_node.line} for " if size.nil? - fail "ERROR: Attribute 'Bpp' not specified in line #{typo_node.line} for " if bpp.nil? - - if !typo_id.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{typo_node.line} for " - end - - @typographies.push Typography.new(typo_id, font, size.to_i, bpp.to_i, fallback_character, ellipsis_character, wildcard_characters, wildcard_widget_characters, wildcard_character_ranges) - end - @typographies - end -end - -class TextParser_4_18 - def initialize(xml_doc) - @xml_doc = xml_doc - @text_entries = TextEntries.new - end - - def empty_to_nil(str) - str ? str.strip.empty? ? nil : str.strip : nil - end - - def get_value_or_nil(a) - a.nil? ? nil : (a.value.nil? ? nil : a.value.strip) - end - - def run - texts = @xml_doc.xpath("/TextDatabase/Texts/Text").map do |text| - text_id = empty_to_nil(text["Id"]) - default_typography = empty_to_nil(text["TypographyId"]) - default_alignment = empty_to_nil(text["Alignment"]) - default_direction = empty_to_nil(text["Direction"]) - fail "ERROR: Attribute 'Id' not specified in line #{text.line} in #{text.to_s}" if text_id.nil? - fail "ERROR: Attribute 'TypographyId' not specified in line #{text.line} for " if default_typography.nil? - fail "ERROR: Attribute 'Alignment' not specified in line #{text.line} for " if default_alignment.nil? - fail "ERROR: Attribute 'Direction' not specified in line #{text.line} for " if default_direction.nil? - - if !text_id.match(/^([0-9a-zA-Z_])*$/) - fail "ERROR: Illegal characters found in line #{text.line} for " - end - - fail "ERROR: Translation not specified in line #{text.line} for " if !text.at("Translation") - - { - :id => text_id, :typography => default_typography, :alignment => default_alignment, :direction => default_direction, - :translations => text.xpath('./Translation').inject({}) do |result, translation| - - fail "ERROR: Attribute 'Language' not specified in line #{translation.line} for Translation" if translation.attributes["Language"].nil? - language = translation.attributes["Language"].value - - if translation.text.match(/\n\t|\n /) - puts "WARNING: Text in line #{translation.line} for with Language '#{language}' contains tabs or whitespace indentation" - end - - result[ language.strip ] = { - :value => translation.text, - :typography => get_value_or_nil(translation.attributes["TypographyId"]), - :alignment => get_value_or_nil(translation.attributes["Alignment"]), - :direction => get_value_or_nil(translation.attributes["Direction"]) - }; result - end - } - end - - languages_with_specific_typographies = texts.map do |text| - translations = text[:translations] - translations.keys.select { |language| translations[language][:typography] } - end.flatten.uniq - - languages_with_specific_alignments = texts.map do |text| - translations = text[:translations] - translations.keys.select { |language| translations[language][:alignment] } - end.flatten.uniq - - languages_with_specific_directions = texts.map do |text| - translations = text[:translations] - translations.keys.select { |language| translations[language][:direction] } - end.flatten.uniq - - languages = texts.map { |text| text[:translations].keys }.flatten.uniq - - texts.each do |text| - text_entry = TextEntry.new(text[:id], text[:typography], text[:alignment], text[:direction]) - - languages_with_specific_typographies.each do |language| - typography = text[:translations][language][:typography] - text_entry.add_typography(language, typography) - end - - languages_with_specific_alignments.each do |language| - alignment = text[:translations][language][:alignment] - text_entry.add_alignment(language, alignment) - end - - languages_with_specific_directions.each do |language| - direction = text[:translations][language][:direction] - text_entry.add_direction(language, direction) - end - - languages.each do |language| - translation = text[:translations][language].nil? ? "" : text[:translations][language][:value] - text_entry.add_translation(language, translation) - end - - @text_entries.add(text_entry) - end - - @text_entries - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb deleted file mode 100644 index e884bda..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_upgrader.rb +++ /dev/null @@ -1,439 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'nokogiri' -require 'rubygems/version' -require 'lib/text_database_parser_4_17' -require 'lib/sanitizer' -require 'lib/version' -require 'lib/xml_reader' -require 'lib/xml_writer' - -class TextDatabaseUpgrader - def initialize(file_name, upgrade_version) - @file_name = file_name - @upgrade_version = Gem::Version.new(upgrade_version) - file_ext = File.extname(@file_name) - case file_ext - when '.xlsx' - @xml_doc = Nokogiri::XML::Document.new - @intermediate_version = Gem::Version.new('4.17.0') # or earlier - when '.xml' - @xml_doc = XMLReader.new.read(@file_name) - @intermediate_version = Gem::Version.new(@xml_doc.at('TextDatabase')['Version']) - else - fail "ERROR: Unsupported text database file extension: #{file_ext}" - end - end - - def run - # For each version where an upgrade of the text database is required, - # a code snippet, like the 4 lines below, must be added, including - # implementation of the actual UpgradeTo_X_Y class. - # Note! In case of versions where the text database doesn't change, - # nothing has to be done. The text database will automatically be - # updated with the new @upgrade_version. - version_4_18 = Gem::Version.new('4.18.0') - if @intermediate_version < version_4_18 && @upgrade_version >= version_4_18 - @xml_doc, @intermediate_version = UpgradeTo_4_18.new(@file_name).run - end - # Now @xml_doc contains 4.18.0 xml data - - version_4_19 = Gem::Version.new('4.19.0') - if @intermediate_version < version_4_19 && @upgrade_version >= version_4_19 - @xml_doc, @intermediate_version = UpgradeTo_4_19.new(@xml_doc).run - end - # Now @xml_doc contains 4.19.0 xml data - - if @xml_doc.at('//TextDatabase') - @xml_doc.at('TextDatabase')['Version'] = @upgrade_version.version - xml_file_name = @file_name.gsub(/\.xlsx$/, '.xml') - XMLWriter.new.write(xml_file_name, @xml_doc) - else - fail "ERROR: Unsupported upgrade version: #{@upgrade_version.version}" - end - end -end - -class UpgradeTo_4_19 - def initialize(xml_doc) - @xml_doc = xml_doc - @languages = [] - @typographies = [] - @texts = [] - end - - def run - xml_doc = Nokogiri::XML::Document.new - xml_doc.encoding = 'utf-8' - - create_data_structures - - # Create - textdatabase_node = xml_doc.add_child(Nokogiri::XML::Node.new('TextDatabase', xml_doc)) - textdatabase_node['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance' - textdatabase_node['xsi:noNamespaceSchemaLocation'] = 'texts.xsd' - textdatabase_node['Version'] = @intermediate_version.to_s - - # Create inside - languages_node = textdatabase_node.add_child(Nokogiri::XML::Node.new('Languages', xml_doc)) - @languages.each do |language| - # Add with required attributes inside - language_node = languages_node.add_child(Nokogiri::XML::Node.new('Language', xml_doc)) - language_node['Id'] = language - end - - # Create inside - texts_node = textdatabase_node.add_child(Nokogiri::XML::Node.new('Texts', xml_doc)) - - # Create inside - text_group_node = texts_node.add_child(Nokogiri::XML::Node.new('TextGroup', xml_doc)) - text_group_node['Id'] = "Group1" - @texts.each do |text| - # Add with required attributes inside - text_node = text_group_node.add_child(Nokogiri::XML::Node.new('Text', xml_doc)) - text_node['Id'] = text.id - text_node['TypographyId'] = text.typography_id - text_node['Alignment'] = text.alignment - text.translations.each do |translation| - # Add with required attribute - translation_node = text_node.add_child(Nokogiri::XML::Node.new('Translation', xml_doc)) - translation_node['Language'] = translation.language - # Add optional attribute - translation_node['Alignment'] = translation.alignment if translation.alignment - # Add actual text - translation_node.add_child(Nokogiri::XML::Text.new(translation.text, xml_doc)) - end - end - - # Add inside - typographies_node = textdatabase_node.add_child(Nokogiri::XML::Node.new('Typographies', xml_doc)) - @typographies.each do |typography| - # Add with required attributes inside - typography_node = typographies_node.add_child(Nokogiri::XML::Node.new('Typography', xml_doc)) - typography_node['Id'] = typography.id - typography_node['Font'] = typography.font_file - typography_node['Size'] = typography.font_size - typography_node['Bpp'] = typography.bpp - typography_node['Direction'] = typography.direction - # Add optional attributes - typography_node['FallbackCharacter'] = typography.fallback_character if typography.fallback_character - typography_node['WildcardCharacters'] = typography.wildcard_characters if typography.wildcard_characters - typography_node['WidgetWildcardCharacters'] = typography.widget_wildcard_characters if typography.widget_wildcard_characters - typography_node['WildcardCharacterRanges'] = typography.wildcard_ranges if typography.wildcard_ranges - typography_node['EllipsisCharacter'] = typography.ellipsis_character if typography.ellipsis_character - # Add with required attributes inside - typography.language_settings.each do |language_setting| - language_setting_node = typography_node.add_child(Nokogiri::XML::Node.new('LanguageSetting', xml_doc)) - language_setting_node['Language'] = language_setting.language - language_setting_node['Font'] = language_setting.font_file - language_setting_node['Size'] = language_setting.font_size - language_setting_node['Bpp'] = language_setting.bpp - language_setting_node['Direction'] = language_setting.direction - # Add optional attributes - language_setting_node['FallbackCharacter'] = language_setting.fallback_character if language_setting.fallback_character - language_setting_node['WildcardCharacters'] = language_setting.wildcard_characters if language_setting.wildcard_characters - language_setting_node['WidgetWildcardCharacters'] = language_setting.widget_wildcard_characters if language_setting.widget_wildcard_characters - language_setting_node['WildcardCharacterRanges'] = language_setting.wildcard_ranges if language_setting.wildcard_ranges - language_setting_node['EllipsisCharacter'] = language_setting.ellipsis_character if language_setting.ellipsis_character - end - end - - return xml_doc, Gem::Version.new('4.19.0') - end - -private - class Typography - attr_reader :id, :font_file, :font_size, :bpp, :direction, :fallback_character, :wildcard_characters, :widget_wildcard_characters, :wildcard_ranges, :ellipsis_character, :language_settings, :text_ids - attr_writer :id - def initialize(id, font_file, font_size, bpp, direction, fallback_character, wildcard_characters, widget_wildcard_characters, wildcard_ranges, ellipsis_character) - @id = id - @font_file = font_file - @font_size = font_size - @bpp = bpp - @direction = direction - @fallback_character = fallback_character - @wildcard_characters = wildcard_characters - @widget_wildcard_characters = widget_wildcard_characters - @wildcard_ranges = wildcard_ranges - @ellipsis_character = ellipsis_character - @direction = direction - @language_settings = [] - @text_ids = [] - end - - def add_language_setting(setting) - @language_settings.push(setting) - end - - def add_text_id(id) - @text_ids.push(id) - end - - def ==(other) - self.id == other.id && - self.font_file == other.font_file && - self.font_size == other.font_size && - self.bpp == other.bpp && - self.direction == other.direction && - self.fallback_character == other.fallback_character && - self.wildcard_characters == other.wildcard_characters && - self.widget_wildcard_characters == other.widget_wildcard_characters && - self.wildcard_ranges == other.wildcard_ranges && - self.ellipsis_character == other.ellipsis_character && - self.language_settings == other.language_settings - end - - alias eql? == - - class LanguageSetting - attr_reader :language, :font_file, :font_size, :bpp, :direction, :fallback_character, :wildcard_characters, :widget_wildcard_characters, :wildcard_ranges, :ellipsis_character - def initialize(language, font_file, font_size, bpp, direction, fallback_character, wildcard_characters, widget_wildcard_characters, wildcard_ranges, ellipsis_character) - @language = language - @font_file = font_file - @font_size = font_size - @bpp = bpp - @direction = direction - @fallback_character = fallback_character - @wildcard_characters = wildcard_characters - @widget_wildcard_characters = widget_wildcard_characters - @wildcard_ranges = wildcard_ranges - @ellipsis_character = ellipsis_character - end - - def ==(other) - self.language == other.language && - self.font_file == other.font_file && - self.font_size == other.font_size && - self.bpp == other.bpp && - self.direction == other.direction && - self.fallback_character == other.fallback_character && - self.wildcard_characters == other.wildcard_characters && - self.widget_wildcard_characters == other.widget_wildcard_characters && - self.wildcard_ranges == other.wildcard_ranges && - self.ellipsis_character == other.ellipsis_character - end - - alias eql? == - end - end - - class Text - attr_reader :id, :typography_id, :alignment, :translations - attr_writer :typography_id - def initialize(id, typography_id, alignment) - @id = id - @typography_id = typography_id - @alignment = alignment - @translations = [] - end - - def add_translation(translation) - @translations.push(translation) - end - - class Translation - attr_reader :language, :alignment, :text - def initialize(language, alignment, text) - @language = language - @alignment = alignment - @text = text - end - end - end - - # Objective for create_data_structure: - # Create data structures that fits the new xml layout and make it easier - # to identify and resolve any upgrading conflicts. - # How it is done: - # Iterate text nodes and create data structures for @languages, @typographies and @texts. - # Note! Unused typographies will bee added at the end. - def create_data_structures - @xml_doc.xpath('/TextDatabase/Texts/Text').each do |text_node| - text_id = text_node['Id'] - typo_id = text_node['TypographyId'] - alignment = text_node['Alignment'] - typography_node = @xml_doc.xpath("/TextDatabase/Typographies/Typography[@Id=\"#{typo_id}\"]") - font_file = typography_node.attr('Font'); font_file = font_file.value if font_file - font_size = typography_node.attr('Size'); font_size = font_size.value if font_size - bpp = typography_node.attr('Bpp'); bpp = bpp.value if bpp - direction = text_node['Direction'] - fallback_character = typography_node.attr('FallbackCharacter'); fallback_character = fallback_character.value if fallback_character - wildcard_characters = typography_node.attr('WildcardCharacters'); wildcard_characters = wildcard_characters.value if wildcard_characters - widget_wildcard_characters = typography_node.attr('WidgetWildcardCharacters'); widget_wildcard_characters = widget_wildcard_characters.value if widget_wildcard_characters - wildcard_ranges = typography_node.attr('WildcardCharacterRanges'); wildcard_ranges = wildcard_ranges.value if wildcard_ranges - ellipsis_character = typography_node.attr('EllipsisCharacter'); ellipsis_character = ellipsis_character.value if ellipsis_character - - typography = Typography.new(typo_id, font_file, font_size, bpp, direction, fallback_character, wildcard_characters, widget_wildcard_characters, wildcard_ranges, ellipsis_character) - typography.add_text_id(text_id) - text = Text.new(text_id, typo_id, alignment) - - text_node.xpath('./Translation').each do |translation_node| - language = translation_node['Language'] - alignment = translation_node['Alignment'] - typo_id = translation_node['TypographyId'] - typography_node = @xml_doc.xpath("/TextDatabase/Typographies/Typography[@Id=\"#{typo_id}\"]") - font_file = typography_node.attr('Font'); font_file = font_file.value if font_file - font_size = typography_node.attr('Size'); font_size = font_size.value if font_size - bpp = typography_node.attr('Bpp'); bpp = bpp.value if bpp - direction = translation_node['Direction'] - fallback_character = typography_node.attr('FallbackCharacter'); fallback_character = fallback_character.value if fallback_character - wildcard_characters = typography_node.attr('WildcardCharacters'); wildcard_characters = wildcard_characters.value if wildcard_characters - widget_wildcard_characters = typography_node.attr('WidgetWildcardCharacters'); widget_wildcard_characters = widget_wildcard_characters.value if widget_wildcard_characters - wildcard_ranges = typography_node.attr('WildcardCharacterRanges'); wildcard_ranges = wildcard_ranges.value if wildcard_ranges - ellipsis_character = typography_node.attr('EllipsisCharacter'); ellipsis_character = ellipsis_character.value if ellipsis_character - # Only add language setting if translation specific typography or direction is present - # Note! Default values are used if no specific values exists - if typo_id || direction - language_setting = Typography::LanguageSetting.new( - language, - font_file ? font_file : typography.font_file, - font_size ? font_size : typography.font_size, - bpp ? bpp : typography.bpp, - direction ? direction : typography.direction, - fallback_character ? fallback_character : typography.fallback_character, - wildcard_characters ? wildcard_characters : typography.wildcard_characters, - widget_wildcard_characters ? widget_wildcard_characters : typography.widget_wildcard_characters, - wildcard_ranges ? wildcard_ranges : typography.wildcard_ranges, - ellipsis_character ? ellipsis_character : typography.ellipsis_character, - ) - typography.add_language_setting(language_setting) - end - text.add_translation(Text::Translation.new(language, alignment, translation_node.text)) - - # Only add language if not included in @languages - @languages.push(language) if !@languages.include?(language) - end - - # Only add typography if not included in @typographies - if @typographies.include?(typography) - index = @typographies.index(typography) - # Move text_ids from duplicate - # Note! text_ids represents all the texts that uses this specific typography - (@typographies[index].text_ids << typography.text_ids).flatten! - else - @typographies.push(typography) - end - - @texts.push(text) - end - - # Add unused typographies and give them direction "LTR" - @xml_doc.xpath('/TextDatabase/Typographies/Typography').each do |typo_node| - typo_id = typo_node['Id'] - if !@typographies.any? { |typography| typography.id == typo_id} - @typographies.push(Typography.new(typo_id, typo_node['Font'], typo_node['Size'], typo_node['Bpp'], 'LTR', typo_node['FallbackCharacter'], typo_node['WildcardCharacters'], typo_node['WidgetWildcardCharacters'], typo_node['WildcardCharacterRanges'], typo_node['EllipsisCharacter'])) - end - end - - resolve_any_typography_naming_conflict - end - - def resolve_any_typography_naming_conflict - used_typography_ids = @typographies.collect{|typography| typography.id}.uniq - - # Group typographies according to id and resolve naming conflicts - @typographies.group_by {|typography| typography.id}.each do |id, group| - group.sort! do |a,b| - # Most used first, or LTR before RTL, or first id occurrence - a.text_ids.length != b.text_ids.length ? b.text_ids.length <=> a.text_ids.length : a.direction != b.direction ? a.direction <=> b.direction : a.text_ids <=> b.text_ids - end - - # More than one typography with the same id - if group.length > 1 - puts "WARNING: Resolving typography naming conflict for #{id}!" - end - - # Do not rename first element, it is already reserved in used_typography_ids - group[1..].each do |typography| - # Rename typography - new_id = id - if typography.direction != group[0].direction - new_id = "#{new_id}_#{typography.direction}" - end - if used_typography_ids.include?(new_id) - suffix = 'A' - while used_typography_ids.include?("#{new_id}_#{suffix}") - suffix.next! - end - new_id = "#{new_id}_#{suffix}" - end - typography_index = @typographies.index(typography) - @typographies[typography_index].id = new_id - - # Update texts with new typography ids - @typographies[typography_index].text_ids.each do |text_id| - text_index = @texts.index {|text| text.id == text_id} - @texts[text_index].typography_id = @typographies[typography_index].id - end - - used_typography_ids.push(new_id) - end - end - end -end - -class UpgradeTo_4_18 - def initialize(xlsx_file_name) - @typographies, @text_entries = TextDatabaseParser_4_17.new(xlsx_file_name).run - end - - def run - xml_doc = Nokogiri::XML::Document.new - xml_doc.encoding = 'utf-8' - - # Create - textdatabase_node = xml_doc.add_child(Nokogiri::XML::Node.new('TextDatabase', xml_doc)) - textdatabase_node['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance' - textdatabase_node['xsi:noNamespaceSchemaLocation'] = 'texts.xsd' - textdatabase_node['Version'] = @intermediate_version.to_s - - # Create inside - texts_node = textdatabase_node.add_child(Nokogiri::XML::Node.new('Texts', xml_doc)) - @text_entries.each do |entry| - # Add with required attributes inside - text_node = texts_node.add_child(Nokogiri::XML::Node.new('Text', xml_doc)) - text_node['Id'] = entry.text_id - text_node['TypographyId'] = entry.default_typography - text_node['Alignment'] = entry.default_alignment.capitalize - text_node['Direction'] = entry.default_direction - @text_entries.entries.first.languages.each do |lang| - # Add with required attribute - translation_node = text_node.add_child(Nokogiri::XML::Node.new('Translation', xml_doc)) - translation_node['Language'] = lang - # Add optional attributes - translation_node['TypographyId'] = entry.typographies[lang] if entry.typographies[lang] - translation_node['Alignment'] = entry.alignments[lang].capitalize if entry.alignments[lang] - translation_node['Direction'] = entry.directions[lang] if entry.directions[lang] - # Add actual text - translation_node.add_child(Nokogiri::XML::Text.new(entry.translation_in(lang).text, xml_doc)) - end - end - - # Add inside - typographies_node = textdatabase_node.add_child(Nokogiri::XML::Node.new('Typographies', xml_doc)) - @typographies.each do |typo| - # Add with required attributes inside - typography_node = typographies_node.add_child(Nokogiri::XML::Node.new('Typography', xml_doc)) - typography_node['Id'] = typo.name - typography_node['Font'] = typo.font_file - typography_node['Size'] = typo.font_size - typography_node['Bpp'] = typo.bpp - # Add optional attributes - typography_node['FallbackCharacter'] = typo.fallback_character if typo.fallback_character - typography_node['WildcardCharacters'] = typo.wildcard_characters if typo.wildcard_characters - typography_node['WidgetWildcardCharacters'] = typo.widget_wildcard_characters if typo.widget_wildcard_characters - typography_node['WildcardCharacterRanges'] = typo.wildcard_ranges if typo.wildcard_ranges - typography_node['EllipsisCharacter'] = typo.ellipsis_character if typo.ellipsis_character - end - - return xml_doc, Gem::Version.new('4.18.0') - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb deleted file mode 100644 index 6168772..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_database_validator.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'lib/sanitizer' -require 'lib/text_database_parser' -require 'lib/text_database_parser_4_17' -require 'lib/text_database_parser_4_18' -require 'lib/xml_reader' - -class TextDatabaseValidator - def validate(file_name) - @typographies - @text_entries - @languages - file_ext = File.extname(file_name) - if file_ext == '.xlsx' - @typographies, @text_entries = TextDatabaseParser_4_17.new(file_name).run - elsif file_ext == '.xml' - xml_doc = XMLReader.new.read(file_name) - if xml_doc.at("TextDatabase") - version = xml_doc.at("TextDatabase")["Version"] - case version - when '4.18.0', '4.18.1' - @typographies, @text_entries = TextDatabaseParser_4_18.new(xml_doc).run - when '4.19.0', '4.19.1', '4.20.0', '4.21.0', '4.21.1', '4.21.2' - @languages, @typographies, @text_entries = TextDatabaseParser.new(xml_doc).run - else - fail "ERROR: Unknown text database version: #{version}" - end - else - fail "ERROR: Invalid text database: #{file_name}" - end - else - fail "ERROR: Unsupported text database file extension: #{file_ext}" - end - Sanitizer.new(@text_entries, @typographies, @languages, nil).run - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb deleted file mode 100644 index 0c03736..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/text_entries.rb +++ /dev/null @@ -1,242 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class TextEntries - include Enumerable - - def initialize - @entries = [] - @unicode_is_rtl = false - end - - def each(&block) - @entries.each(&block) - end - - def remove(entry) - @entries.delete(entry) - end - - def add(entry) - @entries.push(entry) - end - - def empty? - @entries.empty? - end - - def different_typographies - [ar,default] - end - - def different_alignments - [ar,default] - end - - def languages_with_specific_settings - @entries.collect { |entry| entry.typographies.keys + entry.alignments.keys + entry.directions.keys }.flatten.uniq - end - - def remove_language(language) - @entries.each { |entry| entry.remove_translation_in(language) } - end - - def typographies - @entries.map(&:default_typography).uniq - end - - def entries - @entries - end - - def with_typography(typography) - @entries.select { |entry| entry.typography == typography } - end - - def text_id(text_id) - @entries.find { |entry| entry.text_id == text_id } - end - - def all_text_ids - @entries.collect { |entry| entry.text_id } - end - - def include?(text_entry) - @entries.find { |entry| entry.text_id == text_entry.text_id || entry.cpp_text_id == text_entry.cpp_text_id } - end - - def unicode_uses_rtl - @unicode_is_rtl = true - end - - def is_rtl - @unicode_is_rtl || @entries.any? { |entry| entry.is_rtl } - end -end - -class TextEntry - attr_reader :text_id - attr_reader :typographies - attr_reader :alignments - attr_reader :directions - attr_reader :default_typography - attr_reader :default_alignment - attr_reader :default_direction - - def initialize(text_id, default_typography, default_alignment, default_direction) - @text_id = text_id - @typographies = {} - @alignments = {} - @directions = {} - @translations = {} - - # default typography - @default_typography = default_typography - - # default alignment - @default_alignment = get_alignment_as_string(default_alignment) - - # default direction - @default_direction = get_direction_as_string(default_direction) - end - - def add_typography(language, typography) - @typographies[language] = typography - end - def add_alignment(language, alignment) - @alignments[language] = alignment - end - def add_direction(language, direction) - @directions[language] = direction - end - - def add_translation(language, text) - translation = Translation.new(text) - @translations[language] = translation - end - - def remove_translation_in(language) - @translations.delete(language) - end - - def translations - @translations.values - end - - def translation_in(language) - @translations[language] - end - - def translations_with_typography(typography) - languages_with_typography = languages.select do |language| - if @typographies[language].nil? - @default_typography == typography - else - @typographies[language] == typography - end - end - - languages_with_typography.collect{ |language| translation_in(language) } - end - - def languages - @translations.keys - end - - def number_of_substitutions_in(language) - @translations[language].number_of_substitutions - end - - def cpp_text_id - cppify(text_id) - end - - # includes the default typography - def get_all_typographies - @typographies.values.compact.insert(0, @default_typography) - end - - # includes the default alignment - def get_all_alignments_as_string - @alignments.values.compact.collect{ |a| get_alignment_as_string(a) }.insert(0, @default_alignment) - end - - # includes the default direction - def get_all_directions_as_string - @directions.values.compact.collect{ |a| get_direction_as_string(a) }.insert(0, @default_direction) - end - - def is_rtl - get_all_directions_as_string.any? { |dir| dir == 'RTL' } - end - - private - - def get_alignment_as_string(a) - a.to_s.empty? ? 'LEFT' : a.to_s.upcase - end - - def get_direction_as_string(d) - d.to_s.empty? ? 'LTR' : d.to_s.upcase - end - - def cppify(text) - t_type = "T_" + text.upcase - - # strip the keys for characters, that can not be used in C++ - t_type = t_type.to_ascii - t_type.gsub!(" ", "_") - t_type.gsub!(/[^0-9a-zA-Z_]/, '') - t_type - end -end - -class Translation - attr_reader :text - def initialize(text) - @text = text - end - def empty? - @text.nil? || @text.empty? - end - def length - @text.length - end - def number_of_substitutions - to_cpp.count("\2") - end - def unicodes - # Collect all unicodes and add a terminating zero, which is also part of the string - @unicodes ||= - begin - numbers.map { |number| number.to_s.gsub(/\[|\]/,'').to_i } + [0] - end - end - def to_cpp - cpp_text = @text.gsub("\2", '') # Remove all existing placeholders - regex = Regexp.new(/([^\\]|^)<(|.*?[^\\])>/) # Avoid matching \< and \> - while cpp_text.match(regex) - cpp_text.gsub!(regex, '\1'+"\2") - end - cpp_text.gsub('\\<', '<').gsub('\\>', '>') # Remove \ before < and > - end - private - def numbers - to_cpp.unpack('U*') - end -end - -class String - def to_ascii - # modernized version of http://craigjolicoeur.com/blog/ruby-iconv-to-the-rescue - self.encode("ASCII", "UTF-8", :undef => :replace, :invalid => :replace, :replace => ''). - unpack('U*').select { |cp| cp < 127 }.pack('U*') - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb deleted file mode 100644 index 7f2e75e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/translation_io.rb +++ /dev/null @@ -1,282 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -# coding: iso-8859-1 -require 'nokogiri' -require 'rubyxl' -require 'rubyXL/convenience_methods' -require 'lib/text_entries' -require 'lib/xml_reader' -require 'lib/xml_writer' - -# From https://github.com/weshatheleopard/rubyXL/wiki/How-to -class RubyXL::Cell - def unlock - xf = get_cell_xf.dup - xf.protection = xf.protection&.dup || RubyXL::Protection.new - xf.protection.locked = false - xf.apply_protection = true - self.style_index = workbook.register_new_xf(xf) - end -end -class RubyXL::Worksheet - def add_frozen_split(row:, column:) - worksheetview = RubyXL::WorksheetView.new - worksheetview.pane = RubyXL::Pane.new(:top_left_cell => RubyXL::Reference.new(row,column), - :y_split => row, - :x_split => column, - :state => 'frozenSplit', - :activePane => 'bottomRight') - worksheetviews = RubyXL::WorksheetViews.new - worksheetviews << worksheetview - self.sheet_views = worksheetviews - end -end - -class TranslationIO - def initialize(file_name, translation_name) - @xml_doc = XMLReader.new.read(file_name) - @translation_name = translation_name - @file_name = file_name - @xml_file_version = @xml_doc.at("TextDatabase")["Version"] - end - - WHITE = 'FFFFFF' - BLACK = '000000' - - HEADER_BACKGROUND = '4472C4' - HEADER_FOREGROUND = WHITE - FIRST_ROW_BACKGROUND = 'B4C6E7' - FIRST_ROW_FOREGROUND = BLACK - SECOND_ROW_BACKGROUND = 'D9E1F2' - SECOND_ROW_FOREGROUND = BLACK - - SHEET_NAME = 'TouchGFX Translation' - TEXT_ID = 'Text Id' - - def exportExcel(languages) - workbook = RubyXL::Workbook.new - worksheet = workbook[0] - worksheet.sheet_name = SHEET_NAME - - existing_languages = get_languages - if languages.empty? - # Empty string means "put TextID in this column" - languages = [ '' ] + existing_languages - else - # Empty string means "put TextID in this column" - languages = [''] + languages.map do |lang| - lang_upcase = lang.upcase - actual_language = existing_languages.find { |l| l.upcase == lang_upcase } - fail "ERROR: Unknown export language: #{lang}" if !actual_language - actual_language - end - end - languages.uniq! - languages.each_with_index do |lang, column| - cell = worksheet.add_cell(0, column, lang.empty? ? TEXT_ID : lang) - cell.change_font_color(HEADER_FOREGROUND) - cell.change_fill(HEADER_BACKGROUND) - cell.change_font_bold(true) - worksheet.change_column_width(column, lang.empty? ? 20 : 30) - end - - # This line is only needed if the font_size of each cell is to be updated (inside the loop below) - # typography_map = @typographies.inject({}) { |map,typo| map[typo.name] = typo; map } - get_text_entries.each_with_index do |text, row| - languages.each_with_index do |lang, column| - cell = worksheet.add_cell(row+1, column, lang.empty? ? text.text_id : text.translation_in(lang)) - cell.change_vertical_alignment('top') - if (row % 2) == 0 - cell.change_font_color(FIRST_ROW_FOREGROUND) - cell.change_fill(FIRST_ROW_BACKGROUND) - else - cell.change_font_color(SECOND_ROW_FOREGROUND) - cell.change_fill(SECOND_ROW_BACKGROUND) - end - cell.change_font_bold(lang.empty?) - cell.change_border(:bottom, 'thin') - if !lang.empty? - cell.change_border(:right, 'thin') - cell.change_text_wrap(true) - # Lines only needed if the font size of each cell is to be updated - #typography_name = text.typographies[lang] || text.typography - #cell.change_font_size((typography_map[typography_name].font_size / 1.5).to_i) - alignment = text.alignment_in(lang) || text.alignment - cell.change_horizontal_alignment(alignment.downcase) - cell.unlock - end - end - end - - worksheet.add_frozen_split(:row => 1, :column => 1) - worksheet.sheet_protection = RubyXL::WorksheetProtection.new(sheet: true, format_columns: false, format_rows: false) - - workbook.write(@translation_name) - end - - def importExcel(languages) - require 'lib/xml_writer' - - workbook = RubyXL::Parser.parse(@translation_name) - worksheet = workbook.worksheets.find { |sheet| sheet.sheet_name == SHEET_NAME } - fail "ERROR: \"#{@translation_name}\" does not contain a sheet called \"#{SHEET_NAME}\"" if !worksheet - - existing_languages = get_languages - - header = [] # Collect the header with correctly capitalized languages - text_id_column = nil # Which column contains the TEXT_ID - import_columns = [] # Which columns to import - column = 0 - while column < worksheet[0].size - if worksheet[0][column] - lang_cell = worksheet[0][column].value - if !lang_cell.empty? - lang_upcase = lang_cell.upcase - if lang_upcase == TEXT_ID.upcase - text_id_column = column - fail "ERROR: Multiple columns contain \"#{TEXT_ID}\"" if header.include?('') - header << '' - else - # Find the language with the correct capitalization - orig_lang = existing_languages.find { |l| l.upcase == lang_upcase } - # Fail if all languages should be imported AND the language from the spreadsheet is illegal - fail "ERROR: Text Database does not contain language \"#{lang_cell}\", create the language in the TouchGFX Designer" if languages.empty? && !orig_lang - # if no languages specified, import all. Otherwise only import if language is wanted - if languages.empty? || languages.any? { |l| l.upcase == lang_upcase } - import_columns += [ column ] - end - fail "ERROR: Multiple columns contain translations for language \"#{orig_lang}\"" if header.include?(orig_lang) - header << orig_lang - end - end - end - column += 1 - end - - upper_languages = languages.map(&:upcase) - upper_existing_languages = existing_languages.map(&:upcase) - # Did we ask to import a language (on the command line) which does not exist in the spreadsheet? - fail "ERROR: Unknown language(s) #{(upper_languages - upper_existing_languages)*','}" if !(upper_languages - upper_existing_languages).empty? - fail "ERROR: Missing column \"#{TEXT_ID}\"" if !text_id_column - - text_nodes = get_text_nodes_map - # Row 0 is the header - row = 1 - all_text_ids = [] - while row < worksheet.sheet_data.rows.size - if worksheet[row] && worksheet[row][text_id_column] - text_id = worksheet[row][text_id_column].value - if text_id && !text_id.empty? - fail "ERROR: Extra translations of Text Id \"#{text_id}\" given in line #{row}" if all_text_ids.include?(text_id) - import_columns.each do |column| - text_node = text_nodes[text_id] - fail "ERROR: The Text Id \"#{text_id}\" in line #{row} does not exist in the database" if !text_node - cell = worksheet[row][column] - cell_text = cell ? cell.value.to_s : '' - set_text_node_translation(text_node, header[column], cell_text) - #puts "Setting #{text_id}.#{header[column]} = #{worksheet[row][column].value}" - end - all_text_ids << text_id - end - end - row += 1 - end - - all_predefined_ids = get_text_ids - if !(all_predefined_ids - all_text_ids).empty? - puts "WARNING: \"#{@translation_name}\" does not contain the following Text Id's: #{(all_predefined_ids - all_text_ids)*', '}" - end - - XMLWriter.new.write(@file_name, @xml_doc) - end - -protected - def empty_to_nil(str) - str ? str.strip.empty? ? nil : str.strip : nil - end - - #Get array of all Languages in XML - def get_languages - @xml_doc.xpath("/TextDatabase/Languages/Language").inject([]) do |languages, lang_node| - language = empty_to_nil(lang_node["Id"]) - languages.push(language) - end - end - - #Get array of all text IDs in XML - def get_text_ids - @xml_doc.xpath("/TextDatabase/Texts/TextGroup/Text").map{ |text_node| text_node["Id"] } - end - - #Map of textId to XML node - def get_text_nodes_map - @xml_doc.xpath("/TextDatabase/Texts/TextGroup/Text").inject({}) do |nodes, text_node| - nodes[text_node["Id"]] = text_node - nodes - end - end - - #Update the translation of a text - def set_text_node_translation(text_node, language, new_translation) - text_node.xpath("./Translation").each do |translation_node| - if translation_node["Language"] == language - #Remove old translation - translation_node.child.remove if translation_node.child - - translation_node.add_child(Nokogiri::XML::Text.new(new_translation, @xml_doc)) - end - end - end - - #Class holding single text with ID, default alignment, translations, and alignments - class TextEntry - def initialize(text_id, alignment) - @text_id = text_id - @alignment = alignment - @alignments = {} # Language -> alignment - @translations = {} # Language -> text (translation) - end - def text_id - @text_id - end - def translation_in(language) - @translations[language] - end - def alignment - @alignment - end - def alignment_in(language) - @alignments[language] || alignment - end - def set_alignment(language, alignment) - @alignments[language] = alignment - end - def set_translation(language, text) - @translations[language] = text - end - end - - #Compute array of TextEntry objects - def get_text_entries - texts = [] - @xml_doc.xpath("/TextDatabase/Texts/TextGroup/Text").each do |text_node| - text = TextEntry.new(text_node["Id"], text_node["Alignment"]) - text_node.search("Translation").each do |translation| - language = translation["Language"] - alignment = translation["Alignment"] - text.set_alignment(language, alignment) unless alignment.nil? - text.set_translation(language, translation.text) - end - texts << text - end - texts - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb deleted file mode 100644 index e6c6eb0..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/typographies.rb +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -class Typographies - def initialize() - @entries = {} - end - - def add(default_typography, language, font_file, font_size, bpp, fallback_character, ellipsis_character, wildcard_characters, widget_wildcard_characters, wildcard_ranges, direction) - name = "#{default_typography}" - name += "_AUTO_GENERATED_FOR_#{language}" if !language.empty? - typography = Typography.new(name, font_file, font_size.to_i, bpp.to_i, fallback_character, ellipsis_character, wildcard_characters, widget_wildcard_characters, wildcard_ranges) - - index = Index.new(default_typography, language) - @entries[index] = {:typography => typography, :direction => direction} - - resolve_any_typography_naming_conflicts - end - - def get_typographies - @entries.values.map { |entry| entry[:typography] } - end - - def get_typography_name(default_typography, language) - index = lookup_index(default_typography, language) - @entries[index][:typography].name - end - - def get_direction(default_typography, language) - index = lookup_index(default_typography, language) - @entries[index][:direction] - end - -private - def lookup_index(default_typography, language) - # First lookup language specific, if not present, then lookup default - index = Index.new(default_typography, language) - if @entries[index].nil? - index = Index.new(default_typography, "") - end - if @entries[index].nil? - language_error_text = " with language setting for '#{language}'" if !language.empty? - fail "ERROR: Unknown typography '#{default_typography}'#{language_error_text}" - end - index - end - - def is_all_typography_names_uniq - original = @entries.values.map { |entry| entry[:typography].name} - original == original.uniq - end - - def rename_typography_at(index) - id = 1 - suffix = @entries[index][:typography].name.match(/_(\d+$)/) - if !suffix.nil? - @entries[index][:typography].name.delete_suffix!(suffix[0]) - id += suffix[1].to_i - end - @entries[index][:typography].name += "_#{id}" - end - - def resolve_any_typography_naming_conflicts - # Objective: - # Do not change default names - # Change language specific typography names if conflicts - default_typographies = @entries.select { |index, entry| index.language.empty? } - while !is_all_typography_names_uniq - language_specific_typographies = @entries.select { |index, entry| !index.language.empty? } - language_specific_typographies.each do |index, lang_spec_entry| - if default_typographies.values.any? { |def_entry| def_entry[:typography].name == lang_spec_entry[:typography].name } - # Rename language specific typography - rename_typography_at(index) - end - end - end - end -end - -class Typography < Struct.new(:name, :font_file, :font_size, :bpp, :fallback_character, :ellipsis_character, :wildcard_characters, :widget_wildcard_characters, :wildcard_ranges) - def cpp_name - font_file.gsub(/\.ttf$/,"").gsub(/[^0-9a-zA-Z]/, "_") - end -end - -# Inspired by class Book example: https://ruby-doc.org/core-3.1.0/Hash.html -class Index - attr_reader :default_typography, :language - - def initialize(default_typography, language) - @default_typography = default_typography - @language = language - end - - def ==(other) - self.class === other && - other.default_typography == @default_typography && - other.language == @language - end - - alias eql? == - - def hash - @default_typography.hash ^ @language.hash # XOR - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb deleted file mode 100644 index 9086219..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/version.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -# Current version - -TOUCHGFX_VERSION = "4.21.2" diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb deleted file mode 100644 index 48ee9ca..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_reader.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'nokogiri' - -class XMLReader - def read(file_name) - xml_doc = Nokogiri::XML::Document.parse(File.new(file_name)) - if !xml_doc.errors.none? - fail (["ERROR: Malformed xml in #{file_name}"] + xml_doc.errors.map { |err| "Line #{err.line}: #{err.message}" }) * "\n" - end - xml_doc - end -end - diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb deleted file mode 100644 index 126be1e..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_validator.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'nokogiri' - -class XMLValidator - def validate(xml_file_name) - xml_doc = Nokogiri::XML(File.read(xml_file_name)) - schema_file_name = xml_file_name.gsub(/\.xml$/, '.xsd') - if File.exists?(schema_file_name) - xsd = Nokogiri::XML::Schema(File.read(schema_file_name)) - result = xsd.validate(xml_doc) - if !result.empty? - fail (["ERROR: Invalid \"#{xml_file_name}\""] + result.map { |err| "Line #{err.line}: #{err.message}" }) * "\n" - end - else - fail "ERROR: Schema file \"#{schema_file_name}\" not found." - end - end -end - diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb deleted file mode 100644 index 3d44c05..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/lib/xml_writer.rb +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'nokogiri' -require 'fileutils' - -class XMLWriter - def write(file_name, xml_doc) - # Convert newlines to " " - xml_doc.xpath("//Text/Translation").each do |translation_node| - translation_node.native_content = translation_node.encode_special_chars(translation_node.text).gsub("\n", '& ') - end - - # Create a formatter for nice output before writing to file - content = xml_doc.to_xml - content.gsub!('/>', ' />') - - if File.exist?(file_name) - old_content = File.read(file_name) - return if content == old_content - end - - File.write(file_name, content) - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb deleted file mode 100644 index 0a239b4..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/main.rb +++ /dev/null @@ -1,261 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -$:.unshift File.dirname(__FILE__) - -require 'lib/version' - -WINDOWS_LINE_ENDINGS = "\r\n" -UNIX_LINE_ENDINGS = "\n" -#on windows/mingw file.write will it self translate \n to \r\n, on linux not -LINE_ENDINGS = RUBY_PLATFORM.match(/linux/) ? WINDOWS_LINE_ENDINGS : UNIX_LINE_ENDINGS - -def root_dir - # Get the dirname of this (main.rb) file: - @root_dir ||= File.dirname(__FILE__) -end - -class Main - - def self.banner - <<-BANNER -Create binary and cpp text files from Text Database - -Usage: #{File.basename($0)} file.xml path/to/fontconvert.out path/to/fonts_output_dir path/to/localization_output_dir path/to/font/asset calling_path {remap|yes|no} {A1|A2|A4|A8} {binary_translations} {binary_fonts} {RGB565|RGB888|BW|GRAY2|GRAY4|ARGB2222|ABGR2222|RGBA2222|BGRA2222} - -Where 'remap'/'yes' will map identical texts to the same memory area to save space - 'A1'/'A2'/'A4'/'A8' will generate fonts in the given format - 'binary_translations' will generate binary translations instead of cpp files - 'binary_fonts' will generate binary font files instead of cpp files - last argument is the framebuffer format (used to limit the bit depth of the generated fonts) - Configuration specified in the application.config file take precedence over the command line arguments -BANNER - end - - def self.upgrade - <<-UPGRADE - ---------------------------------------------------------------------------- -Your TouchGFX Environment is using an old Ruby version (#{RUBY_VERSION}). -TouchGFX #{TOUCHGFX_VERSION} uses Ruby version 3. -Please use the new TouchGFX Environment. ---------------------------------------------------------------------------- - -UPGRADE - end - - def self.missing_files - return !File.exists?("#{@fonts_output_path}/include/fonts/ApplicationFontProvider.hpp") || - !File.exists?("#{@localization_output_path}/include/texts/TextKeysAndLanguages.hpp") - end - - if Integer(RUBY_VERSION.match(/\d+/)[0]) < 3 && !RUBY_PLATFORM.match(/linux/) - puts self.upgrade - end - - if __FILE__ == $0 - - if ARGV.count < 6 - abort self.banner - end - - file_name = ARGV.shift - font_convert_path = ARGV.shift - @fonts_output_path = ARGV.shift - @localization_output_path = ARGV.shift - font_asset_path = ARGV.shift - $calling_path = ARGV.shift - - #optional arguments - remap_global = ARGV.include?("yes") || ARGV.include?("remap") ? "yes" : "no" - autohint_setting = "default" - - data_format_a1 = ARGV.include?("A1") ? "A1" : "" - data_format_a2 = ARGV.include?("A2") ? "A2" : "" - data_format_a4 = ARGV.include?("A4") ? "A4" : "" - data_format_a8 = ARGV.include?("A8") ? "A8" : "" - - generate_binary_translations = ARGV.include?("binary_translations") ? "yes" : "no" - generate_binary_fonts = ARGV.include?("binary_fonts") ? "yes" : "no" - - framebuffer_bpp = "" - ["BPP32", "BPP24", "BPP16", "BPP8", "BPP4", "BPP2", "BPP1"].each do |format| - if ARGV.include?(format) - framebuffer_bpp = format - end - end - - generate_font_format = "0" # 0 = normal font format, 1 = unmapped_flash_font_format - - require 'json' - - application_config = File.join($calling_path, "application.config") - if File.file?(application_config) - text_conf = JSON.parse(File.read(application_config))["text_configuration"] || {} - - remap = text_conf["remap"] - if remap - remap_global = remap == "yes" ? "yes" : "no" - end - - autohint = text_conf["autohint"] - if autohint - autohint_setting = (autohint == "no" || autohint == "force") ? autohint : "default" - end - - a1 = text_conf["a1"] - if a1 - data_format_a1 = a1 == "yes" ? "A1" : "" - end - a2 = text_conf["a2"] - if a2 - data_format_a2 = a2 == "yes" ? "A2" : "" - end - a4 = text_conf["a4"] - if a4 - data_format_a4 = a4 == "yes" ? "A4" : "" - end - a8 = text_conf["a8"] - if a8 - data_format_a8 = a8 == "yes" ? "A8" : "" - end - - binary_translations = text_conf["binary_translations"] - if binary_translations - generate_binary_translations = binary_translations == "yes" ? "yes" : "no" - end - - binary_fonts = text_conf["binary_fonts"] - if binary_fonts - generate_binary_fonts = binary_fonts == "yes" ? "yes" : "no" - end - - bpp = text_conf["framebuffer_bpp"] - if bpp - framebuffer_bpp = "BPP" + bpp - end - - font_format = text_conf["font_format"] - if font_format - values = ["0", "1"] - if values.include? font_format - generate_font_format = font_format - else - puts "Font format #{font_format} not correct, using default: \"0\"" - end - end - end - - remap_global ||= "no" - - data_format = "#{data_format_a1}#{data_format_a2}#{data_format_a4}#{data_format_a8}" - if generate_binary_translations == "yes" && remap_global == "yes" - puts "Disabling global remapping of identical texts, because binary language files are generated" - remap_global = "no" - end - - begin - # 0. check text database file extension. Allow texts.xlsx as parameter, but require a texts.xml to be present - # 1. if text_converter/font_converter is newer than compile_time.cache, remove all files under generated/texts and generated/fonts - # 1b if generated/fonts/include/fonts/ApplicationFontProvider.hpp is missing, force generation of TextKeysAndLanguages.hpp - # 1c if generated/texts/cache/options.cache contents differ from supplies arguments, force run - # 2. if generated/texts/cache/compile_time.cache is newer than xml file and fonts/ApplicationFontProvider.hpp exists then stop now - # 3. remove UnicodeList*.txt and CharSizes*.csv - # 4. create #{@localization_output_path}/include/texts/ and #{@fonts_output_path}/include/fonts/ - - require 'fileutils' - - # 0: - if file_name.match(/\.xlsx$/) - xml_file_name = file_name.gsub(/\.xlsx$/, '.xml') - if File.exists?(xml_file_name) - if File.exists?(file_name) - puts "WARNING: Using \"#{xml_file_name}\" instead of \"#{file_name}\"" - end - else - fail "ERROR: #{xml_file_name} not found" - end - file_name = xml_file_name - end - - # 1: - text_converter_time = Dir[File.join(__dir__,'**','*'), font_convert_path].collect{|f| [File.mtime(f), File.ctime(f)]}.flatten.max - - if ((compile_time_exists = File.exists?("#{@localization_output_path}/cache/compile_time.cache")) && text_converter_time > File.mtime("#{@localization_output_path}/cache/compile_time.cache")) || !compile_time_exists - #remove all files, as text converter is newer (probably upgraded to new TouchGFX) - puts "Cleaning generated files from #{@localization_output_path} and #{@fonts_output_path}." - if @localization_output_path.match /generated\/texts$/ - local_path = @localization_output_path.gsub('\\','/') - FileUtils.rm_rf("#{local_path}") - end - if @fonts_output_path.match /generated\/fonts$/ - local_path = @fonts_output_path.gsub('\\','/') - FileUtils.rm_rf("#{local_path}") - end - end - - # 1b: - $Force_Generate_TextKeysAndLanguages = self.missing_files - - # 1c: - force_run = false - options_file = "#{@localization_output_path}/cache/options.cache" - options = File.exists?(options_file) && File.read(options_file) - - new_options = { :remap => remap_global, - :autohint => autohint_setting, - :data_format => data_format, - :binary_translations => generate_binary_translations, - :binary_fonts => generate_binary_fonts, - :font_format => generate_font_format, - :framebuffer_bpp => framebuffer_bpp }.to_json - - if (options != new_options) - force_run = true - require 'lib/file_io' - FileIO.write_file_silent(options_file, new_options) - end - - # 2: - if File.exists?("#{@localization_output_path}/cache/compile_time.cache") && !self.missing_files && !force_run - mod_time = [File.mtime(file_name), File.ctime(file_name)].max - if mod_time < File.mtime("#{@localization_output_path}/cache/compile_time.cache") - exit - end - end - - # 3: - Dir["#{@fonts_output_path}/UnicodeList*.txt"].each do |text_file| - FileUtils.rm_f(text_file) - end - Dir["#{@fonts_output_path}/CharSizes*.csv"].each do |text_file| - FileUtils.rm_f(text_file) - end - - # 4: - FileUtils.mkdir_p("#{@localization_output_path}/include/texts/") - FileUtils.mkdir_p("#{@fonts_output_path}/include/fonts") - - require 'lib/emitters/fonts_cpp' - require 'lib/generator' - FontsCpp.font_convert = font_convert_path - Generator.new.run(file_name, @fonts_output_path, @localization_output_path, font_asset_path, data_format, remap_global, autohint_setting, generate_binary_translations, generate_binary_fonts, framebuffer_bpp, generate_font_format) - #touch the cache compile time that we rely on in the makefile - FileUtils.touch "#{@localization_output_path}/cache/compile_time.cache" - - rescue SystemExit => e - - rescue Exception => e - STDERR.puts e - STDERR.puts e.backtrace if ENV['DEBUG'] - abort "An error occurred during text convertion" - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/readme.md b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/readme.md deleted file mode 100644 index edb2dc8..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Touchgfx text database -## texts.xml - - An example of a touchgfx text database -## texts.xsd - - The XML schema used for validating the texts.xml - -The texts.xml has a reference to the texts.xsd, so when opening the texts.xml in an XML -editor (e.g. visual studio) your texts.xml will be validated according to the texts.xsd. diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/texts.xml b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/texts.xml deleted file mode 100644 index 25a0167..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/texts.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - main page - الصفحة الرئيسية - - - title - لقب - - - - - - - - - \ No newline at end of file diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/texts.xsd b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/texts.xsd deleted file mode 100644 index eaab278..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/schema/texts.xsd +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb deleted file mode 100644 index 8bb1c74..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/translations.rb +++ /dev/null @@ -1,72 +0,0 @@ -#!env ruby -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ - -$:.unshift File.dirname(__FILE__) - -require 'lib/text_database_validator' -require 'lib/translation_io' -require 'lib/version' - -WINDOWS_LINE_ENDINGS = "\r\n" -UNIX_LINE_ENDINGS = "\n" -#on windows/mingw file.write will it self translate \n to \r\n, on linux not -LINE_ENDINGS = RUBY_PLATFORM.match(/linux/) ? WINDOWS_LINE_ENDINGS : UNIX_LINE_ENDINGS - -def root_dir - # Get the dirname of this (main.rb) file: - @root_dir ||= File.dirname(__FILE__) -end - -class Main - def self.banner - <<-BANNER -Export and import the text database for translation using e.g. Excel - -Usage: #{File.basename($0)} {export|import} assets/texts/texts.xml translations.xlsx [language]* - -Export: Will create the "translations.xlsx" by extracting the texts for - all languages from the given assets/texts/texts.xml - -Import: Will merge the text translations from "translations.xlsx" into - the given assets/texts/texts.xml. Only the actual texts are - imported, not alignment and text direction. - -If no languages are specified, all languages will be handled, -otherwise only the specified languages are imported/exported. -BANNER - end - - abort self.banner if ARGV.count < 3 - - option = ARGV.shift - abort self.banner if option!='import' && option!='export' - file_name = ARGV.shift # texts.xml - translation_name = ARGV.shift # translations.xlsx - languages = ARGV # Remaining arguments are the languages - - begin - TextDatabaseValidator.new.validate(file_name) - translation_io = TranslationIO.new(file_name, translation_name) - if option == 'export' - translation_io.exportExcel(languages) - else option=='import' - translation_io.importExcel(languages) - end - - rescue SystemExit => e - - rescue Exception => e - STDERR.puts e - STDERR.puts e.backtrace if ENV['DEBUG'] - abort "An error occurred during translations #{option}!" - end -end \ No newline at end of file diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb deleted file mode 100644 index d0dec01..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/textconvert/upgrader.rb +++ /dev/null @@ -1,55 +0,0 @@ -#!env ruby -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ - -$:.unshift File.dirname(__FILE__) - -require 'rubygems/version' -require 'lib/text_database_upgrader' -require 'lib/text_database_validator' -require 'lib/version' - -def root_dir - # Get the dirname of this (upgrader.rb) file: - @root_dir ||= File.dirname(__FILE__) -end - -class Main - def self.banner - <<-BANNER -Upgrade the text database to a specific version or the latest TouchGFX version #{TOUCHGFX_VERSION} - -Usage: #{File.basename($0)} path/to/text_database [version] - -Note! If no version is specified the text database will be upgraded to TouchGFX version #{TOUCHGFX_VERSION} -BANNER - end - - abort self.banner if ARGV.count < 1 - - file_name = ARGV.shift # texts.xml or texts.xlsx - version = ARGV.shift # Version to upgrade to, if not the latest TouchGFX version - - version ||= TOUCHGFX_VERSION - fail "ERROR: Version #{version} is greater than latest TouchGFX version #{TOUCHGFX_VERSION}" if Gem::Version.new(version) > Gem::Version.new(TOUCHGFX_VERSION) - - begin - TextDatabaseValidator.new.validate(file_name) - TextDatabaseUpgrader.new(file_name, version).run - - rescue SystemExit => e - - rescue Exception => e - STDERR.puts e - STDERR.puts e.backtrace if ENV['DEBUG'] - abort "An error occurred during text database upgrading!" - end -end \ No newline at end of file diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb deleted file mode 100644 index 306e345..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/videoconvert/bintoelf.rb +++ /dev/null @@ -1,50 +0,0 @@ -#!env ruby -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'fileutils' - -###### SETUP ############### -input = ARGV[0] -output = ARGV[1] -bins = Dir[input + "/bin/*.bin"] -FileUtils.mkdir_p("#{output}/obj") #Create obj folder -symbol_file_name = "#{output}/obj/rename_symbols.txt" -############################################### - -############### Process files ######################## -bins.each do |bin| - bin_file_name = File.basename(bin) - - puts "Generating elf32 object from binary file #{input}/bin/#{bin_file_name}..." - `arm-none-eabi-objcopy.exe -B arm --rename-section .data=ExtFlashSection,contents,alloc,load,readonly,data -I binary -O elf32-littlearm #{input}/bin/#{bin_file_name} #{output}/obj/#{bin_file_name}.o` - - #Rename the symbols - output_folder_name_subst = "#{output+'/bin'}".gsub('.', '_').gsub('/', '_') - bin_file_name_subst = File.basename(bin).gsub('.', '_').gsub('/', '_') - str = output_folder_name_subst + "_" + bin_file_name_subst - - content = - "_binary_#{str}_start video_#{bin_file_name_subst}_start\n" + - "_binary_#{str}_end video_#{bin_file_name_subst}_end\n" + - "_binary_#{str}_size video_#{bin_file_name_subst}_size\n" - - puts "Renaming symbols..." - FileUtils.mkdir_p(File.dirname(symbol_file_name)) - unless File.exist?(symbol_file_name) && content == File.open(symbol_file_name, 'r') { |f| f.read() } - File.open(symbol_file_name, 'w') { |f| f.write(content) } - end - - # Bulk rename using objcopy --redefine-syms - `arm-none-eabi-objcopy.exe --redefine-syms #{output}/obj/rename_symbols.txt #{output}/obj/#{bin_file_name}.o` -end - -#Remove temp file -FileUtils.rm(symbol_file_name) \ No newline at end of file diff --git a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb b/TouchGFX/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb deleted file mode 100644 index de188de..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/framework/tools/videoconvert/videoconvert.rb +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright (c) 2018(-2023) STMicroelectronics. -# All rights reserved. -# -# This file is part of the TouchGFX 4.21.2 distribution. -# -# This software is licensed under terms that can be found in the LICENSE file in -# the root directory of this software component. -# If no LICENSE file comes with this software, it is provided AS-IS. -# -###############################################################################/ -require 'fileutils' - -def root_dir - # Get the dirname of this (videoconvert.rb) file: - @root_dir ||= File.dirname(__FILE__) -end - -class Main - def self.banner - <<-BANNER -Convert video files. - -Usage: #{File.basename($0)} {root_folder} asset_folder generated_folder - -Example: #{File.basename($0)} assets/videos generated/videos - will process files in assets/videos and place the result in generated/videos - -Example: #{File.basename($0)} /c/Project assets/videos generated/videos - will process files in /c/Project/assets/videos and place the result in /c/Project/generated/videos -BANNER - end - - def self.write_file(file_name, content) - FileUtils.mkdir_p(File.dirname(file_name)) - unless File.exist?(file_name) && content == File.open(file_name, 'r') { |f| f.read() } - puts "Generating #{file_name}" - File.open(file_name, 'w') { |f| f.write(content) } - end - end - - - def self.bin_to_obj(bin, out_dir) - - symbol_file_name = "#{out_dir}/obj/rename_symbols.txt" - bin_file_name = File.basename(bin) - - puts "Generating elf32 object from binary file #{out_dir}/bin/#{bin_file_name}..." - `arm-none-eabi-objcopy.exe -B arm --rename-section .data=ExtFlashSection,contents,alloc,load,readonly,data -I binary -O elf32-littlearm \"#{out_dir}/bin/#{bin_file_name}\" \"#{out_dir}/obj/#{bin_file_name}.o\"` - - #Rename the symbols - output_folder_name_subst = "#{out_dir+'/bin'}".gsub('.', '_').gsub('/', '_') - bin_file_name_subst = File.basename(bin).gsub('.', '_').gsub('/', '_') - str = output_folder_name_subst + "_" + bin_file_name_subst - - content = - "_binary_#{str}_start video_#{bin_file_name_subst}_start\n" + - "_binary_#{str}_end video_#{bin_file_name_subst}_end\n" + - "_binary_#{str}_size video_#{bin_file_name_subst}_size\n" - - puts "Renaming symbols..." - File.open(symbol_file_name, 'w') { |f| f.write(content) } - - # Bulk rename using objcopy --redefine-syms - `arm-none-eabi-objcopy.exe --redefine-syms #{symbol_file_name} \"#{out_dir}/obj/#{bin_file_name}.o\"` - - #Remove temp file - FileUtils.rm(symbol_file_name) - end - - root_dir = '.' - if ARGV.count == 3 - root_dir = ARGV.shift - end - - if ARGV.count != 2 - abort self.banner - end - - Dir.chdir(root_dir) do - avi_dir = ARGV.shift.gsub('\\', '/') - out_dir = ARGV.shift.gsub('\\', '/') - bin_dir = File.join(out_dir, 'bin') - obj_dir = File.join(out_dir, 'obj') - avis = Dir[File.join(avi_dir, '**', '*.avi')] - - # Create the output folder: - FileUtils.mkdir_p(bin_dir) - - # Create mapping from existing .avi files to the .bin files - avi2bin = {} - avi2obj = {} - obj2avi = {} - bin2avi = {} - - avis.each do |avi| - bin = File.join(bin_dir, File.basename(avi.gsub(/avi$/i,'bin'))) - obj = File.join(obj_dir, File.basename(avi.gsub(/avi$/i,'bin.o'))) - avi2bin[avi] = bin - avi2obj[avi] = obj - - if bin2avi[bin] - abort "Duplication avi files: #{bin2avi[bin]} and #{avi}" - end - - bin2avi[bin] = avi - obj2avi[obj] = avi - end - - # Remove bin files that have no corresponding avi file - Dir[File.join(bin_dir, '*.bin')].each do |bin| - if !bin2avi[bin] - puts "Removing #{bin}" - FileUtils.rm_f(bin) - end - end - - # Remove obj files that have no corresponding avi file - Dir[File.join(obj_dir, '*.bin.o')].each do |obj| - if !obj2avi[obj] - puts "Removing #{obj}" - FileUtils.rm_f(obj) - end - end - - # Now process each avi file - avi2bin.each do |avi,bin| - if !File.exist?(bin) || (File.mtime(avi) > File.mtime(bin)) - puts "Generating #{bin}" - FileUtils.cp(avi, bin) - end - end - - # Convert .bin to .obj - FileUtils.mkdir_p("#{out_dir}/obj") - avi2obj.each do |avi, obj| - bin = avi2bin[avi] - - if !File.exist?(obj) || (File.mtime(bin) > File.mtime(obj)) - puts "Converting #{bin} to #{obj}" - bin_to_obj(bin, out_dir) - end - end - - # Generate header file - hpp_content = "" - keil_export = "" - keil_incbin = "" - - avi2bin.each do |avi,bin| - name = File.basename(bin).gsub('.', '_').gsub('/', '_') - length = File.size(avi); - - symbol = "video_#{name}" - start_symbol = "#{symbol}_start" - length_symbol = "#{symbol}_length" - - hpp_content += "const uint32_t #{length_symbol} = #{length};\n" - hpp_content += "#ifdef SIMULATOR\n" - hpp_content += "extern const uint8_t* #{start_symbol};\n" - hpp_content += "#else\n" - hpp_content += "extern const uint8_t #{start_symbol}[];\n" - hpp_content += "#endif\n\n" - - keil_export += "\tEXPORT\t#{start_symbol}\n" - keil_incbin += "\n#{start_symbol}\n\tINCBIN\t../TouchGFX/#{bin}\n" - end - - hpp_file = File.join(out_dir, 'include', 'videos', 'VideoDatabase.hpp') - write_file(hpp_file, - "// Generated by videoconvert. Please, do not edit!\n\n"+ - "#ifndef TOUCHGFX_VIDEODATABASE_HPP\n"+ - "#define TOUCHGFX_VIDEODATABASE_HPP\n"+ - "\n#include \n\n"+ - hpp_content+ - "#endif // TOUCHGFX_VIDEODATABASE_HPP\n") - - project_file = Dir['../*.ioc'].first - toolchain_is_keil = false # Assume it is not Keil - if project_file - # From cubemx_project_selector.rb in touchgfx-cli: - content = File.read(project_file, :encoding=>'utf-8') - target_toolchain = content.match(/ProjectManager.TargetToolchain=([\w\s\d\.\-]+)/) || abort("Unable to parse #{File.expand_path(@project_file)}") - toolchain = target_toolchain.captures.first - toolchain_is_keil = toolchain.match(/MDK-ARM/) # "ProjectManager.TargetToolchain=MDK-ARM..." is Keil - end - - keil_path = [out_dir, 'src', 'keil', 'Videos.s'] - keil_file = File.join(keil_path) - # Only generate Videos.s if there are video files AND we are using Keil: - if avi2bin.empty? || !toolchain_is_keil - # Try to remove existing Videos.s file and folder structure (if it is empty) - begin - FileUtils.rm(keil_file) if File.exist?(keil_file) - keil_folder = File.join(keil_path[0...-1]) - FileUtils.rmdir(keil_folder) if File.directory?(keil_folder) - src_folder = File.join(keil_path[0...-2]) - FileUtils.rmdir(File.join(keil_path[0...-2])) if File.directory?(src_folder); - rescue - end - else - # There are videos and we are on Keil. Generate Videos.s - write_file(keil_file, - "; Generated by videoconvert. Please, do not edit!\n\n"+ - "\tAREA\tExtFlashSection, DATA, READONLY\n\n"+ - keil_export+ - keil_incbin+ - "\n\tEND\n") - end - end -end diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a deleted file mode 100644 index 0ec91f3..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a deleted file mode 100644 index 35728cf..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/IAR8.x/touchgfx_core_release.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib deleted file mode 100644 index 50d70a1..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil/touchgfx_core.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib deleted file mode 100644 index e12c365..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar16.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib deleted file mode 100644 index 1e8ec8c..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/Keil6.x/touchgfx_core_wchar32.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a deleted file mode 100644 index d8bf907..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m0/gcc/libtouchgfx.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a deleted file mode 100644 index 751f960..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a deleted file mode 100644 index a9a17f7..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/IAR8.x/touchgfx_core_release.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib deleted file mode 100644 index ab70b96..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar16.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib deleted file mode 100644 index f795ac7..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/Keil6.x/touchgfx_core_wchar32.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a deleted file mode 100644 index 13a9ac2..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx-float-abi-hard.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a deleted file mode 100644 index c04eba6..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m33/gcc/libtouchgfx.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a deleted file mode 100644 index db50e22..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a deleted file mode 100644 index b87eb2c..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/IAR8.x/touchgfx_core_release.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib deleted file mode 100644 index a90491c..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil/touchgfx_core.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib deleted file mode 100644 index 669aef1..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar16.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib deleted file mode 100644 index d84a9d6..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/Keil6.x/touchgfx_core_wchar32.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a deleted file mode 100644 index 66b1ef8..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a deleted file mode 100644 index e399fb0..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core.a deleted file mode 100644 index c374196..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core_release.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core_release.a deleted file mode 100644 index b943a92..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR/touchgfx_core_release.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a deleted file mode 100644 index 7c2cde8..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a deleted file mode 100644 index 2d3d74b..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/IAR8.x/touchgfx_core_release.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib deleted file mode 100644 index a49fac8..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil/touchgfx_core.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib deleted file mode 100644 index d265cab..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar16.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib deleted file mode 100644 index b8f39d6..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/Keil6.x/touchgfx_core_wchar32.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a deleted file mode 100644 index 2287104..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx-float-abi-hard.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a b/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a deleted file mode 100644 index 8d04516..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a b/TouchGFX/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a deleted file mode 100644 index 08e0922..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/README-SDL.txt b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/README-SDL.txt deleted file mode 100644 index fade0b9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/README-SDL.txt +++ /dev/null @@ -1,13 +0,0 @@ - -Please distribute this file with the SDL runtime environment: - -The Simple DirectMedia Layer (SDL for short) is a cross-platform library -designed to make it easy to write multi-media software, such as games and -emulators. - -The Simple DirectMedia Layer library source code is available from: -http://www.libsdl.org/ - -This library is distributed under the terms of the zlib license: -http://www.zlib.net/zlib_license.html - diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2.dll b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2.dll deleted file mode 100644 index 15ad52e..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2.dll and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2.lib deleted file mode 100644 index 19abda2..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2_image.dll b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2_image.dll deleted file mode 100644 index cd35db0..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2_image.dll and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2_image.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2_image.lib deleted file mode 100644 index 715c8e3..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/SDL2_image.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/dll2lib.bat b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/dll2lib.bat deleted file mode 100644 index 70e2a4a..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/dll2lib.bat +++ /dev/null @@ -1,43 +0,0 @@ -@echo off -rem The SDL2.DLL was downloaded from http://libsdl.org -rem The SDL2.LIB was created using "dumpbin" and "lib" -rem The libSDL2.a was created using "dumpbin" and "dlltool" - -rem Visual Studio uses SDL2.lib for linking -rem Gcc uses libSDL2.a for linking -rem Both use SDL2.dll at runtime - -set oldpath=%path% -set path="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin";C:\touchgfx-env\MinGW\msys\1.0\bin;C:\touchgfx-env\MinGW\bin;%path% - -rem create SDL2.lib for Visual Studio -echo EXPORTS > SDL2.def -dumpbin /EXPORTS SDL2.dll | grep SDL_ | cut -c 27- >>SDL2.def -lib /def:SDL2.def /machine:x86 /out:SDL2.lib - -rem create libSDL2.a for mingw32 -echo LIBRARY SDL2.DLL >SDL2.def -echo EXPORTS >> SDL2.def -dumpbin /EXPORTS SDL2.dll | grep SDL_ | cut -c 27- >>SDL2.def -dlltool -d SDL2.def -l libSDL2.a - -del SDL2.def -del SDL2.exp - -rem create SDL2_image.lib for Visual Studio -echo EXPORTS > SDL2_image.def -dumpbin /EXPORTS SDL2_image.dll | grep IMG_ | cut -c 27- >>SDL2_image.def -lib /def:SDL2_image.def /machine:x86 /out:SDL2_image.lib - -rem create libSDL2_image.a for mingw32 -echo LIBRARY SDL2_image.DLL >SDL2_image.def -echo EXPORTS >> SDL2_image.def -dumpbin /EXPORTS SDL2_image.dll | grep IMG_ | cut -c 27- >>SDL2_image.def -dlltool -d SDL2_image.def -l libSDL2_image.a - -del SDL2_image.def -del SDL2_image.exp - - -set path=%oldpath% -set oldpath= diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libSDL2.a b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libSDL2.a deleted file mode 100644 index 9dc1911..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libSDL2.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libSDL2_image.a b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libSDL2_image.a deleted file mode 100644 index 72c0262..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libSDL2_image.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libpng16-16.dll b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libpng16-16.dll deleted file mode 100644 index 30833f0..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/libpng16-16.dll and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/zlib1.dll b/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/zlib1.dll deleted file mode 100644 index 68a8bf7..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/sdl2/win32/zlib1.dll and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a b/TouchGFX/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a deleted file mode 100644 index 92b63de..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/mingw32/libtouchgfx.a and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib deleted file mode 100644 index a4a9f68..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib deleted file mode 100644 index 98627f9..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v100_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib deleted file mode 100644 index dff44fe..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib deleted file mode 100644 index 5fa0570..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v110_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib deleted file mode 100644 index f78cd06..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib deleted file mode 100644 index 58a8c92..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v120_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib deleted file mode 100644 index e41e972..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib deleted file mode 100644 index af04eae..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v140_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib deleted file mode 100644 index c3cb011..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib deleted file mode 100644 index 65b6bef..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v141_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib deleted file mode 100644 index c3cb011..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib deleted file mode 100644 index 65b6bef..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v142_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib deleted file mode 100644 index c3cb011..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib b/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib deleted file mode 100644 index 65b6bef..0000000 Binary files a/TouchGFX/Middlewares/ST/touchgfx/lib/win/msvs/libtouchgfx_v143_debug.lib and /dev/null differ diff --git a/TouchGFX/Middlewares/ST/touchgfx/os/OSWrappers.cpp b/TouchGFX/Middlewares/ST/touchgfx/os/OSWrappers.cpp deleted file mode 100644 index 9b66124..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/os/OSWrappers.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include "FreeRTOS.h" -#include "task.h" -#include "queue.h" -#include "semphr.h" -#include -#include - -using namespace touchgfx; - -static xSemaphoreHandle frame_buffer_sem; -static xQueueHandle vsync_q = 0; - -// Just a dummy value to insert in the VSYNC queue. -static uint8_t dummy = 0x5a; - -void OSWrappers::initialize() -{ - vSemaphoreCreateBinary(frame_buffer_sem); - // Create a queue of length 1 - vsync_q = xQueueGenericCreate(1, 1, 0); -} - -void OSWrappers::takeFrameBufferSemaphore() -{ - xSemaphoreTake(frame_buffer_sem, portMAX_DELAY); -} -void OSWrappers::giveFrameBufferSemaphore() -{ - xSemaphoreGive(frame_buffer_sem); -} - -void OSWrappers::tryTakeFrameBufferSemaphore() -{ - xSemaphoreTake(frame_buffer_sem, 0); -} - -void OSWrappers::giveFrameBufferSemaphoreFromISR() -{ - // Since this is called from an interrupt, FreeRTOS requires special handling to trigger a - // re-scheduling. May be applicable for other OSes as well. - portBASE_TYPE px = pdFALSE; - xSemaphoreGiveFromISR(frame_buffer_sem, &px); - portEND_SWITCHING_ISR(px); -} - -void OSWrappers::signalVSync() -{ - if (vsync_q) - { - // Since this is called from an interrupt, FreeRTOS requires special handling to trigger a - // re-scheduling. May be applicable for other OSes as well. - portBASE_TYPE px = pdFALSE; - xQueueSendFromISR(vsync_q, &dummy, &px); - portEND_SWITCHING_ISR(px); - } -} - -void OSWrappers::waitForVSync() -{ - // First make sure the queue is empty, by trying to remove an element with 0 timeout. - xQueueReceive(vsync_q, &dummy, 0); - - // Then, wait for next VSYNC to occur. - xQueueReceive(vsync_q, &dummy, portMAX_DELAY); -} - -void OSWrappers::taskDelay(uint16_t ms) -{ - vTaskDelay(ms); -} - -static portBASE_TYPE IdleTaskHook(void* p) -{ - if ((int)p) // Idle task sched out - { - touchgfx::HAL::getInstance()->setMCUActive(true); - } - else // Idle task sched in - { - touchgfx::HAL::getInstance()->setMCUActive(false); - } - return pdTRUE; -} - -// FreeRTOS specific handlers -extern "C" -{ - void vApplicationStackOverflowHook(xTaskHandle xTask, - signed portCHAR* pcTaskName) - { - while (1); - } - - void vApplicationMallocFailedHook(xTaskHandle xTask, - signed portCHAR* pcTaskName) - { - while (1); - } - - void vApplicationIdleHook(void) - { - // Set task tag in order to have the "IdleTaskHook" function called when the idle task is - // switched in/out. Used solely for measuring MCU load, and can be removed if MCU load - // readout is not needed. - vTaskSetApplicationTaskTag(NULL, IdleTaskHook); - } -} diff --git a/TouchGFX/Middlewares/ST/touchgfx/os/OSWrappers_cmsis.cpp b/TouchGFX/Middlewares/ST/touchgfx/os/OSWrappers_cmsis.cpp deleted file mode 100644 index 3804ce9..0000000 --- a/TouchGFX/Middlewares/ST/touchgfx/os/OSWrappers_cmsis.cpp +++ /dev/null @@ -1,121 +0,0 @@ - -#include -#include -#include - -#include -#include - -using namespace touchgfx; - -static osSemaphoreId frame_buffer_sem = 0; -static osMessageQId vsync_queue = 0; - -// Just a dummy value to insert in the VSYNC queue. -static uint32_t dummy = 0x5a; - -void OSWrappers::initialize() -{ - // Create a queue of length 1 - osSemaphoreDef(frame_buffer_sem); - frame_buffer_sem = osSemaphoreCreate(osSemaphore(frame_buffer_sem), 1); // Binary semaphore - osSemaphoreWait(frame_buffer_sem, osWaitForever); // take the lock - - // Create a queue of length 1 - osMessageQDef(vsync_queue, 1, uint32_t); - vsync_queue = osMessageCreate(osMessageQ(vsync_queue),NULL); -} - -void OSWrappers::takeFrameBufferSemaphore() -{ - assert(frame_buffer_sem); - osSemaphoreWait(frame_buffer_sem, osWaitForever); -} - -void OSWrappers::giveFrameBufferSemaphore() -{ - assert(frame_buffer_sem); - osSemaphoreRelease(frame_buffer_sem); -} - -void OSWrappers::tryTakeFrameBufferSemaphore() -{ - assert(frame_buffer_sem); - osSemaphoreWait(frame_buffer_sem, 0); -} - -void OSWrappers::giveFrameBufferSemaphoreFromISR() -{ - assert(frame_buffer_sem); - osSemaphoreRelease(frame_buffer_sem); -} - -void OSWrappers::signalVSync() -{ - if (vsync_queue) - { - osMessagePut(vsync_queue, dummy, 0); - } -} - -void OSWrappers::waitForVSync() -{ - if (vsync_queue) - { - // First make sure the queue is empty, by trying to remove an element with 0 timeout. - osMessageGet(vsync_queue, 0); - - // Then, wait for next VSYNC to occur. - osMessageGet(vsync_queue, osWaitForever); - } -} - -void OSWrappers::taskDelay(uint16_t ms) -{ - osDelay(static_cast(ms)); -} - - -// NOTE: -// The remainder of this file is FreeRTOS-specific. If using a different OS, -// you can just remove all the following code, as it is optional. -// However, if MCU load percentage readout is required, you need to find a way -// to inform TouchGFX of when the idle task is switched in/out and call the -// setMCUActive function accordingly (see below). - -//FreeRTOS hook function being called when idle task is switched in or out. -static portBASE_TYPE IdleTaskHook(void* p) -{ - if ((int)p) // Idle task sched out - { - touchgfx::HAL::getInstance()->setMCUActive(true); - } - else // Idle task sched in - { - touchgfx::HAL::getInstance()->setMCUActive(false); - } - return pdTRUE; -} - -extern "C" -{ - void vApplicationStackOverflowHook(xTaskHandle xTask, - signed portCHAR* pcTaskName) - { - while (1); - } - - void vApplicationMallocFailedHook(xTaskHandle xTask, - signed portCHAR* pcTaskName) - { - while (1); - } - - void vApplicationIdleHook(void) - { - // Set task tag in order to have the "IdleTaskHook" function called when the idle task is - // switched in/out. Used solely for measuring MCU load, and can be removed if MCU load - // readout is not needed. - vTaskSetApplicationTaskTag(NULL, IdleTaskHook); - } -} diff --git a/TouchGFX/application.config b/TouchGFX/application.config index 8378ef3..2ba48da 100644 --- a/TouchGFX/application.config +++ b/TouchGFX/application.config @@ -17,7 +17,8 @@ "logo_dv_small_white.png": { "layout_rotation": "90" } - } + }, + "l8_compression": "LZW9" }, "text_configuration": { "remap": "yes", diff --git a/TouchGFX/assets/texts/texts.xml b/TouchGFX/assets/texts/texts.xml index 1f5df5f..69db711 100644 --- a/TouchGFX/assets/texts/texts.xml +++ b/TouchGFX/assets/texts/texts.xml @@ -1,5 +1,5 @@ - + @@ -172,13 +172,13 @@ - + <value> - + <value> diff --git a/TouchGFX/config/gcc/app.mk b/TouchGFX/config/gcc/app.mk index 6f567ec..6a5485a 100644 --- a/TouchGFX/config/gcc/app.mk +++ b/TouchGFX/config/gcc/app.mk @@ -3,6 +3,6 @@ touchgfx_path := ../Middlewares/ST/touchgfx # Location of the TouchGFX Environment -touchgfx_env := C:/TouchGFX/4.21.2/env +touchgfx_env := C:/TouchGFX/4.22.0/env # Optional additional compiler flags user_cflags := -DUSE_BPP=16 -std=gnu++1z -Wno-cast-qual -Wno-missing-declarations -Wno-format-truncation -Wno-unused-variable diff --git a/TouchGFX/generated/fonts/cache/Font_CHINN____20_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_CHINN____20_4bppCpp.cache index b9cfe5d..c1b4a74 100644 --- a/TouchGFX/generated/fonts/cache/Font_CHINN____20_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_CHINN____20_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 FU:0 32 37 46 diff --git a/TouchGFX/generated/fonts/cache/Font_CHINN____30_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_CHINN____30_4bppCpp.cache index 1995cb9..cec9e6a 100644 --- a/TouchGFX/generated/fonts/cache/Font_CHINN____30_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_CHINN____30_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:0 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:0 FU:0 32 45 48 diff --git a/TouchGFX/generated/fonts/cache/Font_CHINN____40_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_CHINN____40_4bppCpp.cache index 67e41fc..8df67fd 100644 --- a/TouchGFX/generated/fonts/cache/Font_CHINN____40_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_CHINN____40_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:0 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:0 FU:0 32 33 63 diff --git a/TouchGFX/generated/fonts/cache/Font_lucon_TTF_33_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_lucon_TTF_33_4bppCpp.cache index c1f2ff9..53653af 100644 --- a/TouchGFX/generated/fonts/cache/Font_lucon_TTF_33_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_lucon_TTF_33_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 FU:0 44 45 46 diff --git a/TouchGFX/generated/fonts/cache/Font_lucon_TTF_50_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_lucon_TTF_50_4bppCpp.cache index 9a9f0c2..67871f0 100644 --- a/TouchGFX/generated/fonts/cache/Font_lucon_TTF_50_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_lucon_TTF_50_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:0 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:0 FU:0 32 44 45 diff --git a/TouchGFX/generated/fonts/cache/Font_verdana_20_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_verdana_20_4bppCpp.cache index e672411..e261324 100644 --- a/TouchGFX/generated/fonts/cache/Font_verdana_20_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_verdana_20_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 FU:0 32 33 34 diff --git a/TouchGFX/generated/fonts/cache/Font_verdanab_20_4bppCpp.cache b/TouchGFX/generated/fonts/cache/Font_verdanab_20_4bppCpp.cache index e672411..e261324 100644 --- a/TouchGFX/generated/fonts/cache/Font_verdanab_20_4bppCpp.cache +++ b/TouchGFX/generated/fonts/cache/Font_verdanab_20_4bppCpp.cache @@ -1,4 +1,4 @@ -AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 +AH:0 BA:1 FC:63 EC:0 FF:0 CF:1 FU:0 32 33 34 diff --git a/TouchGFX/generated/fonts/include/fonts/CachedFont.hpp b/TouchGFX/generated/fonts/include/fonts/CachedFont.hpp index 52f6ebf..687a32b 100644 --- a/TouchGFX/generated/fonts/include/fonts/CachedFont.hpp +++ b/TouchGFX/generated/fonts/include/fonts/CachedFont.hpp @@ -49,6 +49,7 @@ public: virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const; void setFontCache(FontCache& cache); + FontId getFontId() const { return fontId; diff --git a/TouchGFX/generated/fonts/include/fonts/FontCache.hpp b/TouchGFX/generated/fonts/include/fonts/FontCache.hpp index a9ad16c..153d33d 100644 --- a/TouchGFX/generated/fonts/include/fonts/FontCache.hpp +++ b/TouchGFX/generated/fonts/include/fonts/FontCache.hpp @@ -18,6 +18,7 @@ public: virtual ~FontDataReader() { } + virtual void open() = 0; virtual void close() = 0; virtual void setPosition(uint32_t position) = 0; @@ -36,6 +37,7 @@ public: bool cacheLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string); const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, FontId font) const; + uint32_t getMemoryUsage() { return memorySize - (gsubStart - top); @@ -46,8 +48,9 @@ public: static inline const uint8_t* getPixelData(const GlyphNode* glyph) { - return ((const uint8_t*)glyph) + SizeGlyphNode + 4; + return ((const uint8_t*)glyph) + SizeGlyphNode + sizeof(void*); } + static inline bool isCached(const GlyphNode* g) { return g->dataOffset == 0xFFFFFFFF; @@ -57,10 +60,10 @@ private: static const uint32_t SizeGlyphNode = 16; bool contains(Unicode::UnicodeChar unicode, FontId font) const; - void insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory); - uint8_t* copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory); + void insert(Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory); + uint8_t* copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory); - void cacheData(uint32_t bpp, GlyphNode* first); + void cacheData(GlyphNode* first); bool cacheSortedString(TypedText t); bool createSortedString(const Unicode::UnicodeChar* string); bool createSortedLigatures(CachedFont* font, TypedText t, const Unicode::UnicodeChar* string, ...); @@ -69,6 +72,17 @@ private: void setPosition(uint32_t position); void readData(void* out, uint32_t numberOfBytes); + uint32_t getGlyphSize(const GlyphNode* gn) + { + if (byteAlignRow) + { + // Round up line width to byte boundary and multiply by height + return (gn->width() * bpp + 7) / 8 * gn->height(); + } + // Calculate number of pixels and round up to byte bounday + return (gn->width() * gn->height() * bpp + 7) / 8; + } + struct { uint8_t* first; // First GlyphNode, glyph in cache; @@ -89,6 +103,8 @@ private: uint32_t glyphDataOffset; uint16_t numGlyphs; uint16_t currentFileGlyphNumber; + uint8_t bpp; + uint8_t byteAlignRow; GlyphNode currentFileGlyphNode; }; } // namespace touchgfx diff --git a/TouchGFX/generated/fonts/include/fonts/GeneratedFont.hpp b/TouchGFX/generated/fonts/include/fonts/GeneratedFont.hpp index 3a5088f..9b2d9cd 100644 --- a/TouchGFX/generated/fonts/include/fonts/GeneratedFont.hpp +++ b/TouchGFX/generated/fonts/include/fonts/GeneratedFont.hpp @@ -42,6 +42,21 @@ protected: const FontContextualFormsTable* arabicTable; ///< Contextual forms }; +class FusedFont : public GeneratedFont +{ +public: + FusedFont(const GlyphNode* glyphs, uint16_t numGlyphs, uint16_t height, uint16_t baseline, uint8_t pixAboveTop, uint8_t pixBelowBottom, uint8_t bitsPerPixel, uint8_t byteAlignRow, uint8_t maxLeft, uint8_t maxRight, const uint8_t* const* glyphDataInternalFlash, const KerningNode* kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar, const uint16_t* const gsubData, const FontContextualFormsTable* formsTable, GlyphNode& fontFusedNode) + : GeneratedFont(glyphs, numGlyphs, height, baseline, pixAboveTop, pixBelowBottom, bitsPerPixel, byteAlignRow, + maxLeft, maxRight, glyphDataInternalFlash, kerningList, fallbackChar, ellipsisChar, + gsubData, formsTable), fusedNode(fontFusedNode) + { } + + using GeneratedFont::getGlyph; + virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const; +private: + GlyphNode& fusedNode; +}; + struct BinaryFontData { uint32_t fontIndex; // The font index (as used by TypedTextDatabase) @@ -110,6 +125,7 @@ protected: private: typedef const Unicode::UnicodeChar (*array5ptr)[5]; typedef const Unicode::UnicodeChar (*array4ptr)[4]; + void setupContextualTable(const struct touchgfx::BinaryFontData* data) { const uint16_t* const base = (const uint16_t*)(((const uint8_t*)data) + data->offsetToArabicTable); diff --git a/TouchGFX/generated/fonts/include/fonts/UnmappedDataFont.hpp b/TouchGFX/generated/fonts/include/fonts/UnmappedDataFont.hpp index 41969e1..4f260ea 100644 --- a/TouchGFX/generated/fonts/include/fonts/UnmappedDataFont.hpp +++ b/TouchGFX/generated/fonts/include/fonts/UnmappedDataFont.hpp @@ -107,6 +107,7 @@ protected: : Font(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), glyphList(0), unicodes(0), glyphDataList(0), kerningData(0), gsubTable(0) { } + int lookupUnicode(uint16_t unicode) const; const GlyphNode* glyphList; ///< The list of glyphs diff --git a/TouchGFX/generated/fonts/src/FontCache.cpp b/TouchGFX/generated/fonts/src/FontCache.cpp index 88da8ea..0b78936 100644 --- a/TouchGFX/generated/fonts/src/FontCache.cpp +++ b/TouchGFX/generated/fonts/src/FontCache.cpp @@ -28,7 +28,7 @@ void FontCache::clear(bool keepGsubOrContextTable /* = false */) gsubStart = memory + memorySize; // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); + gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(sizeof(void*) - 1)); } } @@ -100,13 +100,11 @@ void FontCache::initializeCachedFont(TypedText t, CachedFont* font, bool loadGsu if (top + sizeOfGSUB < gsubStart) // Room for this GSUB table { - uint8_t* const gsubPosition = gsubStart - sizeOfGSUB; + // Round down to aligned address + uint8_t* const gsubPosition = (uint8_t*)((uintptr_t)(gsubStart - sizeOfGSUB) & ~(sizeof(void*) - 1)); readData(gsubPosition, sizeOfGSUB); font->setGSUBTable(reinterpret_cast(gsubPosition)); - gsubStart -= sizeOfGSUB; - - // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); + gsubStart = gsubPosition; } else { @@ -125,7 +123,7 @@ void FontCache::initializeCachedFont(TypedText t, CachedFont* font, bool loadGsu // Allocate FontContextualFormsTable first gsubStart -= sizeof(FontContextualFormsTable); // Round down to 32bit address - gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(uintptr_t)0x3); + gsubStart = (uint8_t*)((uintptr_t)gsubStart & ~(sizeof(void*) - 1)); FontContextualFormsTable* table = (FontContextualFormsTable*)gsubStart; font->setContextualFormsTable(table); @@ -194,7 +192,8 @@ bool FontCache::cacheSortedString(TypedText t) readData(&numGlyphs, sizeof(uint16_t)); // numberOfGlyphs FontId fontId = t.getFontId(); // Get font index from typed text - uint32_t bpp = t.getFont()->getBitsPerPixel(); // Get BPP from standard font + bpp = t.getFont()->getBitsPerPixel(); // Get BPP from standard font + byteAlignRow = t.getFont()->getByteAlignRow(); // Get ByteAlign from font setPosition(glyphNodeOffset); // Go to glyph nodes for font currentFileGlyphNumber = 0; @@ -211,7 +210,7 @@ bool FontCache::cacheSortedString(TypedText t) { if (!contains(ch, fontId)) { - insert(ch, fontId, bpp, outOfMemory); + insert(ch, fontId, outOfMemory); if (outOfMemory) { break; @@ -226,7 +225,7 @@ bool FontCache::cacheSortedString(TypedText t) string++; } - cacheData(bpp, firstNewGlyph); + cacheData(firstNewGlyph); return !outOfMemory; } @@ -245,11 +244,11 @@ bool FontCache::contains(Unicode::UnicodeChar unicode, FontId font) const return false; } -void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory) +void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory) { // Insert new glyphnode and glyph after last for font. uint8_t* oldTop = top; - top = copyGlyph(top, unicode, font, bpp, outOfMemory); + top = copyGlyph(top, unicode, font, outOfMemory); if (top == oldTop) { @@ -273,7 +272,7 @@ void FontCache::insert(Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, } } -uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, uint32_t bpp, bool& outOfMemory) +uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId font, bool& outOfMemory) { while (currentFileGlyphNumber < numGlyphs && currentFileGlyphNode.unicode < unicode) { @@ -287,9 +286,10 @@ uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId } // GlyphNode found - uint32_t glyphSize = ((currentFileGlyphNode.width() + 1) & ~1) * currentFileGlyphNode.height() * bpp / 8; - glyphSize = (glyphSize + 3) & ~0x03; - uint32_t requiredMem = SizeGlyphNode + 4 + glyphSize; // GlyphNode + next ptr + glyph + uint32_t glyphSize = getGlyphSize(¤tFileGlyphNode); + const int alignment = sizeof(void*); + glyphSize = (glyphSize + (alignment - 1)) & ~(alignment - 1); + uint32_t requiredMem = SizeGlyphNode + sizeof(void*) + glyphSize; // GlyphNode + next ptr + glyph // Is space available before sortedString if (top + requiredMem > (uint8_t*)sortedString) @@ -307,7 +307,7 @@ uint8_t* FontCache::copyGlyph(uint8_t* top, Unicode::UnicodeChar unicode, FontId return top; } -void FontCache::cacheData(uint32_t bpp, GlyphNode* first) +void FontCache::cacheData(GlyphNode* first) { GlyphNode* gn = first; while (gn) @@ -317,12 +317,11 @@ void FontCache::cacheData(uint32_t bpp, GlyphNode* first) { p += SizeGlyphNode; // Next pointer - p += 4; + p += sizeof(void*); // Seek and copy setPosition(glyphDataOffset + gn->dataOffset); - uint32_t glyphSize = ((gn->width() + 1) & ~1) * gn->height() * bpp / 8; - readData(p, glyphSize); + readData(p, getGlyphSize(gn)); // Mark glyphNode as cached gn->dataOffset = 0xFFFFFFFF; diff --git a/TouchGFX/generated/fonts/src/GeneratedFont.cpp b/TouchGFX/generated/fonts/src/GeneratedFont.cpp index acbef86..2080709 100644 --- a/TouchGFX/generated/fonts/src/GeneratedFont.cpp +++ b/TouchGFX/generated/fonts/src/GeneratedFont.cpp @@ -41,4 +41,19 @@ int8_t GeneratedFont::getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* } return 0; } + +const GlyphNode* FusedFont::getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const +{ + if (unicode < 0xAC00 || unicode > 0xD7A3) + { + return GeneratedFont::getGlyph(unicode, pixelData, bitsPerPixel); + } + else + { + fusedNode.unicode = unicode; + bitsPerPixel = 1; + pixelData = 0; + return const_cast(&fusedNode); + } +} } // namespace touchgfx diff --git a/TouchGFX/generated/gui_generated/src/common/FrontendApplicationBase.cpp b/TouchGFX/generated/gui_generated/src/common/FrontendApplicationBase.cpp index 6f22010..3984f91 100644 --- a/TouchGFX/generated/gui_generated/src/common/FrontendApplicationBase.cpp +++ b/TouchGFX/generated/gui_generated/src/common/FrontendApplicationBase.cpp @@ -31,6 +31,7 @@ FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap) touchgfx::HAL::getInstance()->setDisplayOrientation(touchgfx::ORIENTATION_LANDSCAPE); touchgfx::Texts::setLanguage(GB); reinterpret_cast(touchgfx::HAL::lcd()).enableTextureMapperAll(); + reinterpret_cast(touchgfx::HAL::lcd()).enableDecompressorL8_All(); } /* @@ -41,7 +42,7 @@ FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap) void FrontendApplicationBase::gotoAMIScreenNoTransition() { - transitionCallback = touchgfx::Callback(this, &FrontendApplication::gotoAMIScreenNoTransitionImpl); + transitionCallback = touchgfx::Callback(this, &FrontendApplicationBase::gotoAMIScreenNoTransitionImpl); pendingScreenTransitionCallback = &transitionCallback; } @@ -54,7 +55,7 @@ void FrontendApplicationBase::gotoAMIScreenNoTransitionImpl() void FrontendApplicationBase::gotoDriverViewScreenNoTransition() { - transitionCallback = touchgfx::Callback(this, &FrontendApplication::gotoDriverViewScreenNoTransitionImpl); + transitionCallback = touchgfx::Callback(this, &FrontendApplicationBase::gotoDriverViewScreenNoTransitionImpl); pendingScreenTransitionCallback = &transitionCallback; } @@ -67,7 +68,7 @@ void FrontendApplicationBase::gotoDriverViewScreenNoTransitionImpl() void FrontendApplicationBase::gotoDebugViewScreenNoTransition() { - transitionCallback = touchgfx::Callback(this, &FrontendApplication::gotoDebugViewScreenNoTransitionImpl); + transitionCallback = touchgfx::Callback(this, &FrontendApplicationBase::gotoDebugViewScreenNoTransitionImpl); pendingScreenTransitionCallback = &transitionCallback; } @@ -80,7 +81,7 @@ void FrontendApplicationBase::gotoDebugViewScreenNoTransitionImpl() void FrontendApplicationBase::gotoVehicleConfigScreenNoTransition() { - transitionCallback = touchgfx::Callback(this, &FrontendApplication::gotoVehicleConfigScreenNoTransitionImpl); + transitionCallback = touchgfx::Callback(this, &FrontendApplicationBase::gotoVehicleConfigScreenNoTransitionImpl); pendingScreenTransitionCallback = &transitionCallback; } diff --git a/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp b/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp index d73c606..e328fb8 100644 --- a/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp +++ b/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp @@ -156,7 +156,7 @@ DriverViewViewBase::DriverViewViewBase() : add(statusBar); - errorPopup.setXY(12, 150); + errorPopup.setXY(12, 125); errorPopup.setVisible(false); add(errorPopup); } diff --git a/TouchGFX/generated/images/src/BitmapDatabase.cpp b/TouchGFX/generated/images/src/BitmapDatabase.cpp index 12b0f25..4c955fd 100644 --- a/TouchGFX/generated/images/src/BitmapDatabase.cpp +++ b/TouchGFX/generated/images/src/BitmapDatabase.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0xa2d5059d +// 4.22.0 0xa2d5059d // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_Fasttube_Logo.cpp b/TouchGFX/generated/images/src/image_Fasttube_Logo.cpp index 9930454..0cb22eb 100644 --- a/TouchGFX/generated/images/src/image_Fasttube_Logo.cpp +++ b/TouchGFX/generated/images/src/image_Fasttube_Logo.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x092d512b D2 R0 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0x092d512b D2 R0 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_Fasttube_Logo_small.cpp b/TouchGFX/generated/images/src/image_Fasttube_Logo_small.cpp index e987ae4..a85ef62 100644 --- a/TouchGFX/generated/images/src/image_Fasttube_Logo_small.cpp +++ b/TouchGFX/generated/images/src/image_Fasttube_Logo_small.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x94f45210 D2 R0 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0x94f45210 D2 R0 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_Fasttube_Logo_small_white.cpp b/TouchGFX/generated/images/src/image_Fasttube_Logo_small_white.cpp index d0cdeea..a5a6ca7 100644 --- a/TouchGFX/generated/images/src/image_Fasttube_Logo_small_white.cpp +++ b/TouchGFX/generated/images/src/image_Fasttube_Logo_small_white.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x5f92dea6 D2 R1 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0x5f92dea6 D2 R1 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_Fasttube_Logo_white.cpp b/TouchGFX/generated/images/src/image_Fasttube_Logo_white.cpp index a192259..75f7d29 100644 --- a/TouchGFX/generated/images/src/image_Fasttube_Logo_white.cpp +++ b/TouchGFX/generated/images/src/image_Fasttube_Logo_white.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x95446343 D2 R0 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0x95446343 D2 R0 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_bat_bar_bg.cpp b/TouchGFX/generated/images/src/image_bat_bar_bg.cpp index 963e16a..95b91d5 100644 --- a/TouchGFX/generated/images/src/image_bat_bar_bg.cpp +++ b/TouchGFX/generated/images/src/image_bat_bar_bg.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0xc3618369 D2 R0 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0xc3618369 D2 R0 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_logo_dv_small.cpp b/TouchGFX/generated/images/src/image_logo_dv_small.cpp index eb61ff3..07a229a 100644 --- a/TouchGFX/generated/images/src/image_logo_dv_small.cpp +++ b/TouchGFX/generated/images/src/image_logo_dv_small.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0xda117bb4 D2 AY R1 FARGB8888 U565 N0 SExtFlashSection +// 4.22.0 0xda117bb4 D2 AY R1 FARGB8888 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_logo_dv_small_white.cpp b/TouchGFX/generated/images/src/image_logo_dv_small_white.cpp index 66ab440..89887ad 100644 --- a/TouchGFX/generated/images/src/image_logo_dv_small_white.cpp +++ b/TouchGFX/generated/images/src/image_logo_dv_small_white.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x699a54f0 D2 AY R1 FARGB8888 U565 N0 SExtFlashSection +// 4.22.0 0x699a54f0 D2 AY R1 FARGB8888 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_precharge_bg.cpp b/TouchGFX/generated/images/src/image_precharge_bg.cpp index 33adfd3..6a2f0c8 100644 --- a/TouchGFX/generated/images/src/image_precharge_bg.cpp +++ b/TouchGFX/generated/images/src/image_precharge_bg.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x4a6709fe D2 R0 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0x4a6709fe D2 R0 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/images/src/image_prog_horiz_bg.cpp b/TouchGFX/generated/images/src/image_prog_horiz_bg.cpp index cc62fde..476dc4e 100644 --- a/TouchGFX/generated/images/src/image_prog_horiz_bg.cpp +++ b/TouchGFX/generated/images/src/image_prog_horiz_bg.cpp @@ -1,4 +1,4 @@ -// 4.21.2 0x7e1be905 D2 R0 FRGB565 U565 N0 SExtFlashSection +// 4.22.0 0x7e1be905 D2 R0 FRGB565 U565 N0 SExtFlashSection // Generated by imageconverter. Please, do not edit! #include diff --git a/TouchGFX/generated/simulator/src/video/SoftwareMJPEGDecoder.cpp b/TouchGFX/generated/simulator/src/video/SoftwareMJPEGDecoder.cpp index 14552d8..e191bfc 100644 --- a/TouchGFX/generated/simulator/src/video/SoftwareMJPEGDecoder.cpp +++ b/TouchGFX/generated/simulator/src/video/SoftwareMJPEGDecoder.cpp @@ -15,9 +15,6 @@ struct JPEG_RGB uint8_t B; uint8_t G; uint8_t R; -#if VIDEO_DECODE_FORMAT == 32 - uint8_t X; -#endif }; } // namespace @@ -478,7 +475,13 @@ bool SoftwareMJPEGDecoder::decodeFrame(const touchgfx::Rect& area, uint8_t* fram memcpy(lineptr + startX * 3, lineBuffer + startX * 3, (endX - startX) * 3); lineptr += framebuffer_width * 3; //move to next line #else - memcpy(lineptr + startX, lineBuffer + startX * 4, (endX - startX) * 4); + JPEG_RGB* RGB_matrix = (JPEG_RGB*)lineBuffer; + //loop row RGB888->ARGB8888 for required line part + for (uint32_t counter = startX; counter < endX; counter++) + { + const uint32_t pix = (0xFF << 24) | (RGB_matrix[counter].R << 16) | (RGB_matrix[counter].G << 8) | RGB_matrix[counter].B; + *(lineptr + counter) = pix; + } lineptr += framebuffer_width; //move to next line #endif } diff --git a/TouchGFX/generated/texts/cache/options.cache b/TouchGFX/generated/texts/cache/options.cache index 19012f8..5e277d1 100644 --- a/TouchGFX/generated/texts/cache/options.cache +++ b/TouchGFX/generated/texts/cache/options.cache @@ -1 +1 @@ -{"remap":"yes","autohint":"default","data_format":"A4","binary_translations":"no","binary_fonts":"no","font_format":"0","framebuffer_bpp":"BPP16"} \ No newline at end of file +{"remap":"yes","autohint":"default","data_format":"A4","binary_translations":"no","binary_fonts":"no","font_format":"0","framebuffer_bpp":"BPP16","fusion_fonts":null} \ No newline at end of file diff --git a/TouchGFX/generated/texts/include/texts/TypedTextDatabase.hpp b/TouchGFX/generated/texts/include/texts/TypedTextDatabase.hpp index dafd4d7..0faee81 100644 --- a/TouchGFX/generated/texts/include/texts/TypedTextDatabase.hpp +++ b/TouchGFX/generated/texts/include/texts/TypedTextDatabase.hpp @@ -4,8 +4,8 @@ #ifndef TOUCHGFX_TYPEDTEXTDATABASE_HPP #define TOUCHGFX_TYPEDTEXTDATABASE_HPP -#include #include +#include namespace TypedTextDatabase { diff --git a/TouchGFX/generated/user.config b/TouchGFX/generated/user.config index a939f17..d5200ce 100644 --- a/TouchGFX/generated/user.config +++ b/TouchGFX/generated/user.config @@ -1,3 +1,3 @@ { - "touchgfx_installation_path" : "C:/TouchGFX/4.21.2" + "touchgfx_installation_path" : "C:/TouchGFX/4.22.0" } \ No newline at end of file diff --git a/TouchGFX/steering-wheel.touchgfx b/TouchGFX/steering-wheel.touchgfx index 8e4f488..12f5a84 100644 --- a/TouchGFX/steering-wheel.touchgfx +++ b/TouchGFX/steering-wheel.touchgfx @@ -10,7 +10,7 @@ "Name": "prompt", "X": 41, "Y": 15, - "Width": 398, + "Width": 397, "Height": 37, "TextId": "__SingleUse_6GPV", "TextRotation": "0", @@ -572,7 +572,7 @@ "Type": "CustomContainerInstance", "Name": "errorPopup", "X": 12, - "Y": 150, + "Y": 125, "Width": 456, "Height": 150, "Visible": false, @@ -1375,5 +1375,5 @@ "OptionalComponents": [], "AdditionalFeatures": [] }, - "Version": "4.21.2" + "Version": "4.22.0" } \ No newline at end of file diff --git a/TouchGFX/steering-wheel_backup.touchgfx b/TouchGFX/steering-wheel_backup.touchgfx deleted file mode 100644 index cef3e1f..0000000 --- a/TouchGFX/steering-wheel_backup.touchgfx +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Application": { - "Screens": [ - { - "Name": "screen", - "Components": [], - "Interactions": [] - } - ], - "CustomContainerDefinitions": [], - "Name": "MyApplication", - "Resolution": { - "Width": 800, - "Height": 480 - }, - "SelectedColorDepth": 16, - "StartupScreenName": "screen", - "TouchGfxPath": "touchgfx", - "UIPath": ".", - "AvailableColorDepths": [], - "AvailableSections": [ - "ExtFlashSection", - "IntFlashSection" - ], - "AvailableResolutions": [ - { - "Width": 800, - "Height": 480 - } - ], - "PhysicalButtons": [], - "GenerateAssetsCommand": "make -f simulator/gcc/Makefile assets -j8", - "PostGenerateCommand": "touchgfx update_project --project-file=simulator/msvs/Application.vcxproj", - "CompileSimulatorCommand": "make -f simulator/gcc/Makefile -j8", - "RunSimulatorCommand": "build\\bin\\simulator.exe", - "LandscapeSkinX": 0, - "LandscapeSkinY": 0, - "PortraitSkinX": 0, - "PortraitSkinY": 0, - "DisplayOrientation": "Landscape" - }, - "Version": "4.21.1" -} \ No newline at end of file diff --git a/TouchGFX/target/generated/OSWrappers.cpp b/TouchGFX/target/generated/OSWrappers.cpp index 0d3d6a7..175b6b7 100644 --- a/TouchGFX/target/generated/OSWrappers.cpp +++ b/TouchGFX/target/generated/OSWrappers.cpp @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : OSWrappers.cpp ****************************************************************************** - * This file is generated by TouchGFX Generator 4.21.2. Please, do not edit! + * This file is generated by TouchGFX Generator 4.22.0. Please, do not edit! ****************************************************************************** * @attention * @@ -242,4 +242,3 @@ void OSWrappers::taskYield() } /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/TouchGFX/target/generated/STM32DMA.cpp b/TouchGFX/target/generated/STM32DMA.cpp index 3220e56..bb77229 100644 --- a/TouchGFX/target/generated/STM32DMA.cpp +++ b/TouchGFX/target/generated/STM32DMA.cpp @@ -3,7 +3,7 @@ ****************************************************************************** * File Name : STM32DMA.cpp ****************************************************************************** - * This file is generated by TouchGFX Generator 4.21.2. Please, do not edit! + * This file is generated by TouchGFX Generator 4.22.0. Please, do not edit! ****************************************************************************** * @attention * @@ -23,7 +23,6 @@ #include #include #include -#include #include /* Makes touchgfx specific types and variables visible to this file */ @@ -269,7 +268,7 @@ void STM32DMA::setupDataCopy(const BlitOp& blitOp) MODIFY_REG(DMA2D->FGPFCCR, (DMA2D_FGPFCCR_CS | DMA2D_FGPFCCR_CCM), (((palette->size - 1) << DMA2D_FGPFCCR_CS_Pos) | (DMA2D_CCM_ARGB8888 << DMA2D_FGPFCCR_CCM_Pos))); break; case Bitmap::CLUT_FORMAT_L8_RGB888: - if(blitOp.alpha == 255) + if (blitOp.alpha == 255) { blend = false; } @@ -291,7 +290,7 @@ void STM32DMA::setupDataCopy(const BlitOp& blitOp) DMA2D->IFCR = (DMA2D_FLAG_CTC); /* Set DMA2D mode */ - if(blend) + if (blend) { WRITE_REG(DMA2D->CR, DMA2D_M2M_BLEND | DMA2D_IT_TC | DMA2D_CR_START); } @@ -407,7 +406,7 @@ const clutData_t* L8CLUT = 0; uint32_t L8ClutLoaded = 0; } // namespace -void setL8Pallette(const uint8_t* const data) +void setL8Palette(const uint8_t* const data) { L8CLUT = reinterpret_cast(data - offsetof(clutData_t, data)); L8ClutLoaded = 0; diff --git a/TouchGFX/target/generated/STM32DMA.hpp b/TouchGFX/target/generated/STM32DMA.hpp index d5a98f0..089442d 100644 --- a/TouchGFX/target/generated/STM32DMA.hpp +++ b/TouchGFX/target/generated/STM32DMA.hpp @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : STM32DMA.hpp ****************************************************************************** - * This file is generated by TouchGFX Generator 4.21.2. Please, do not edit! + * This file is generated by TouchGFX Generator 4.22.0. Please, do not edit! ****************************************************************************** * @attention * diff --git a/TouchGFX/target/generated/TouchGFXConfiguration.cpp b/TouchGFX/target/generated/TouchGFXConfiguration.cpp index 4c637b3..14f6da8 100644 --- a/TouchGFX/target/generated/TouchGFXConfiguration.cpp +++ b/TouchGFX/target/generated/TouchGFXConfiguration.cpp @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : TouchGFXConfiguration.cpp ****************************************************************************** - * This file is generated by TouchGFX Generator 4.21.2. Please, do not edit! + * This file is generated by TouchGFX Generator 4.22.0. Please, do not edit! ****************************************************************************** * @attention * diff --git a/TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp b/TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp index 92b0199..7263312 100644 --- a/TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp +++ b/TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : TouchGFXGeneratedHAL.cpp ****************************************************************************** - * This file is generated by TouchGFX Generator 4.21.2. Please, do not edit! + * This file is generated by TouchGFX Generator 4.22.0. Please, do not edit! ****************************************************************************** * @attention * @@ -28,9 +28,8 @@ using namespace touchgfx; namespace { - static volatile bool refreshRequested = false; - static uint16_t lcd_int_active_line; - static uint16_t lcd_int_porch_line; +static uint16_t lcd_int_active_line; +static uint16_t lcd_int_porch_line; } void TouchGFXGeneratedHAL::initialize() @@ -76,10 +75,6 @@ bool TouchGFXGeneratedHAL::beginFrame() void TouchGFXGeneratedHAL::endFrame() { - if (frameBufferUpdatedThisFrame) - { - refreshRequested = true; - } HAL::endFrame(); } diff --git a/TouchGFX/target/generated/TouchGFXGeneratedHAL.hpp b/TouchGFX/target/generated/TouchGFXGeneratedHAL.hpp index 32a111f..49696e2 100644 --- a/TouchGFX/target/generated/TouchGFXGeneratedHAL.hpp +++ b/TouchGFX/target/generated/TouchGFXGeneratedHAL.hpp @@ -2,7 +2,7 @@ ****************************************************************************** * File Name : TouchGFXGeneratedHAL.hpp ****************************************************************************** - * This file is generated by TouchGFX Generator 4.21.2. Please, do not edit! + * This file is generated by TouchGFX Generator 4.22.0. Please, do not edit! ****************************************************************************** * @attention * diff --git a/steering-wheel.ioc b/steering-wheel.ioc index ae0b048..d422253 100644 --- a/steering-wheel.ioc +++ b/steering-wheel.ioc @@ -152,13 +152,13 @@ Mcu.Pin7=PF2 Mcu.Pin70=VP_TIM1_VS_ClockSourceINT Mcu.Pin71=VP_TIM2_VS_ClockSourceINT Mcu.Pin72=VP_TIM17_VS_ClockSourceINT -Mcu.Pin73=VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.21.2 -Mcu.Pin74=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0 +Mcu.Pin73=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0 +Mcu.Pin74=VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.22.0 Mcu.Pin8=PF3 Mcu.Pin9=PF4 Mcu.PinsNb=75 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0 -Mcu.ThirdParty1=STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2 +Mcu.ThirdParty1=STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0 Mcu.ThirdPartyNb=2 Mcu.UserConstants= Mcu.UserName=STM32H7A3ZITx @@ -445,8 +445,10 @@ ProjectManager.RegisterCallBack= ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=Makefile ProjectManager.ToolChainLocation= +ProjectManager.UAScriptAfterPath= +ProjectManager.UAScriptBeforePath= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,4-MX_DMA_Init-DMA-false-HAL-true,5-MX_FDCAN1_Init-FDCAN1-false-HAL-true,6-MX_LTDC_Init-LTDC-false-HAL-true,7-MX_JPEG_Init-JPEG-false-HAL-true,8-MX_OCTOSPI1_Init-OCTOSPI1-false-HAL-true,9-MX_SPI3_Init-SPI3-false-HAL-true,10-MX_TIM1_Init-TIM1-false-HAL-true,11-MX_TIM2_Init-TIM2-false-HAL-true,12-MX_TIM4_Init-TIM4-false-HAL-true,13-MX_CRC_Init-CRC-false-HAL-true,14-MX_TIM17_Init-TIM17-false-HAL-true,15-MX_DMA2D_Init-DMA2D-false-HAL-true,17-MX_TouchGFX_Init-STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2-false-HAL-false,18-MX_TouchGFX_Process-STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2-false-HAL-false,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true +ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,5-MX_LTDC_Init-LTDC-false-HAL-true,6-MX_JPEG_Init-JPEG-false-HAL-true,7-MX_OCTOSPI1_Init-OCTOSPI1-false-HAL-true,8-MX_SPI3_Init-SPI3-false-HAL-true,9-MX_TIM1_Init-TIM1-false-HAL-true,10-MX_TIM2_Init-TIM2-false-HAL-true,11-MX_TIM4_Init-TIM4-false-HAL-true,12-MX_CRC_Init-CRC-false-HAL-true,13-MX_TIM17_Init-TIM17-false-HAL-true,14-MX_DMA2D_Init-DMA2D-false-HAL-true,16-MX_TouchGFX_Init-STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2-false-HAL-false,17-MX_TouchGFX_Process-STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2-false-HAL-false,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true RCC.ADCFreq_Value=2000000 RCC.AHB12Freq_Value=160000000 RCC.AHB4Freq_Value=160000000 @@ -568,18 +570,18 @@ STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0.TX_APP_GENERATE_INIT_CODE=false STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0.ThreadXCcRTOSJjThreadXJjCore=true STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0_IsAnAzureRtosMw=true STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0_SwParameter=ThreadXCcRTOSJjThreadXJjCore\:true; -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.ApplicationCcGraphicsJjApplication=TouchGFXOoGenerator -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.GraphicsJjApplication_Checked=true -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.IPParameters=tgfx_display_interface,tgfx_buffering_strategy,tgfx_location,tgfx_address1,tgfx_address2,tgfx_vsync,tgfx_hardware_accelerator,ApplicationCcGraphicsJjApplication -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_address1=0x24040000 -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_address2=0x240A0000 -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_buffering_strategy=Double -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_display_interface=disp_ltdc -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_hardware_accelerator=dma_2d -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_location=By Address -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2.tgfx_vsync=vsync_ltdc -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2_IsPackSelfContextualization=true -STMicroelectronics.X-CUBE-TOUCHGFX.4.21.2_SwParameter=ApplicationCcGraphicsJjApplication\:TouchGFXOoGenerator; +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.ApplicationCcGraphicsJjApplication=TouchGFXOoGenerator +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.GraphicsJjApplication_Checked=true +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.IPParameters=tgfx_display_interface,tgfx_vsync,tgfx_hardware_accelerator,tgfx_buffering_strategy,tgfx_location,tgfx_address1,tgfx_address2,ApplicationCcGraphicsJjApplication +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_address1=0x24040000 +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_address2=0x240A0000 +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_buffering_strategy=Double +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_display_interface=disp_ltdc +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_hardware_accelerator=dma_2d +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_location=By Address +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0.tgfx_vsync=vsync_ltdc +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0_IsPackSelfContextualization=true +STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0_SwParameter=ApplicationCcGraphicsJjApplication\:TouchGFXOoGenerator; TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1 TIM1.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2 TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3 @@ -606,8 +608,8 @@ VP_OCTOSPI1_VS_quad.Mode=quad_mode VP_OCTOSPI1_VS_quad.Signal=OCTOSPI1_VS_quad VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0.Mode=RTOSJjThreadX VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0 -VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.21.2.Mode=GraphicsJjApplication -VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.21.2.Signal=STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.21.2 +VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.22.0.Mode=GraphicsJjApplication +VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.22.0.Signal=STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.22.0 VP_SYS_VS_tim6.Mode=TIM6 VP_SYS_VS_tim6.Signal=SYS_VS_tim6 VP_TIM17_VS_ClockSourceINT.Mode=Enable_Timer