2020#define __STM32IPL_H_
2121
2222#include "stm32ipl_conf.h"
23- #include "stm32ipl_imlib_ext .h"
23+ #include "stm32ipl_imlib .h"
2424
2525#ifdef __cplusplus
2626extern "C" {
@@ -110,51 +110,53 @@ if (!STM32Ipl_ImageFormatSupported((img), (formats))) \
110110 } else \
111111 STM32Ipl_RectInit(realRoi, 0, 0, img->w, img->h); \
112112
113-
114113/**
115114 * @brief STM32IPL color type. It has 0xRRGGBB format.
116115 * STM32IPL_COLOR_xxx colors follow such format.
117116 */
118- typedef uint32_t stm32ipl_color_t ;
117+ typedef uint32_t stm32ipl_color_t ; /**< STM32IPL color type. It has 0xRRGGBB format. */
119118
120119/**
121120 * @brief STM32IPL error types.
122121 */
123122typedef enum _stm32ipl_err_t
124123{
125- stm32ipl_err_Ok = 0 ,
126- stm32ipl_err_Generic = -1 ,
127- stm32ipl_err_InvalidParameter = -2 ,
128- stm32ipl_err_OutOfMemory = -3 ,
129- stm32ipl_err_BadPointer = -4 ,
130- stm32ipl_err_UnsupportedFormat = -5 ,
131- stm32ipl_err_OpeningFile = -6 ,
132- stm32ipl_err_ClosingFile = -7 ,
133- stm32ipl_err_ReadingFile = -8 ,
134- stm32ipl_err_WritingFile = -9 ,
135- stm32ipl_err_SeekingFile = -10 ,
136- stm32ipl_err_NotImplemented = -11 ,
137- stm32ipl_err_OpNotCompleted = -12 ,
138- stm32ipl_err_WrongSize = -13 ,
139- stm32ipl_err_EmptyImage = -14 ,
140- stm32ipl_err_EmptyMatrix = -15 ,
141- stm32ipl_err_WrongMatrixDim = -16 ,
142- stm32ipl_err_ZeroMatrixDim = -17 ,
143- stm32ipl_err_ReadingDatabase = -18 ,
144- stm32ipl_err_WritingDatabase = -19 ,
145- stm32ipl_err_UnsupportedMethod = -20 ,
146- stm32ipl_err_NotAllowed = -21 ,
147- stm32ipl_err_NotInPlaceFunction = -22 ,
148- stm32ipl_err_OpeningSource = -23 ,
149- stm32ipl_err_WrongROI = -24 ,
124+ stm32ipl_err_Ok = 0 , /**< No error. */
125+ stm32ipl_err_Generic = -1 , /**< Generic error. */
126+ stm32ipl_err_InvalidParameter = -2 , /**< Function parameter is not valid. */
127+ stm32ipl_err_OutOfMemory = -3 , /**< No memory is available. */
128+ stm32ipl_err_BadPointer = -4 , /**< Invalid pointer. */
129+ stm32ipl_err_UnsupportedFormat = -5 , /**< Format is not supported. */
130+ stm32ipl_err_OpeningFile = -6 , /**< Error opening file. */
131+ stm32ipl_err_ClosingFile = -7 , /**< Error closing file. */
132+ stm32ipl_err_ReadingFile = -8 , /**< Error reading file. */
133+ stm32ipl_err_WritingFile = -9 , /**< Error writing file. */
134+ stm32ipl_err_SeekingFile = -10 , /**< Error seeking file. */
135+ stm32ipl_err_NotImplemented = -11 , /**< Function is not implemented. */
136+ stm32ipl_err_OpNotCompleted = -12 , /**< Operation was not completed. */
137+ stm32ipl_err_WrongSize = -13 , /**< Size is wrong. */
138+ stm32ipl_err_EmptyImage = -14 , /**< Image is empty. */
139+ stm32ipl_err_EmptyMatrix = -15 , /**< Matrix is empty. */
140+ stm32ipl_err_WrongMatrixDim = -16 , /**< Matrix has wrong dimension. */
141+ stm32ipl_err_ZeroMatrixDim = -17 , /**< Matrix has zero dimension. */
142+ stm32ipl_err_ReadingDatabase = -18 , /**< Error reading the database. */
143+ stm32ipl_err_WritingDatabase = -19 , /**< Error writing the database. */
144+ stm32ipl_err_UnsupportedMethod = -20 , /**< Method is not supported. */
145+ stm32ipl_err_NotAllowed = -21 , /**< Operation is not allowed. */
146+ stm32ipl_err_NotInPlaceFunction = -22 , /**< Function does not work in place. */
147+ stm32ipl_err_OpeningSource = -23 , /**< Error opening source. */
148+ stm32ipl_err_WrongROI = -24 , /**< ROI is wrong. */
150149} stm32ipl_err_t ;
151150
152151/**
153- * @brief The image formats supported by this library.
152+ * The image formats supported by this library.
154153 */
155154typedef enum _stm32ipl_if_t
156155{
157- stm32ipl_if_binary = 1 , stm32ipl_if_grayscale = 2 , stm32ipl_if_rgb565 = 4 , stm32ipl_if_rgb888 = 8 ,
156+ stm32ipl_if_binary = 1 ,
157+ stm32ipl_if_grayscale = 2 ,
158+ stm32ipl_if_rgb565 = 4 ,
159+ stm32ipl_if_rgb888 = 8 ,
158160} stm32ipl_if_t ;
159161
160162/**
@@ -165,9 +167,9 @@ typedef enum _stm32ipl_if_t
165167 */
166168typedef struct _ellipse_t
167169{
168- point_t center ; /**< Coordinates of the center of the ellipse.*/
169- int16_t radiusX ; /**< Length of the horizontal semi-axis. */
170- int16_t radiusY ; /**< Length of the vertical semi-axis. */
170+ point_t center ; /**< Coordinates of the center of the ellipse. */
171+ int16_t radiusX ; /**< Length of the horizontal semi-axis. */
172+ int16_t radiusY ; /**< Length of the vertical semi-axis. */
171173 int16_t rotation ; /**< Rotation angle (degrees). */
172174} ellipse_t ;
173175
@@ -194,7 +196,18 @@ bool STM32Ipl_ImageFormatSupported(const image_t *img, uint32_t formats);
194196stm32ipl_err_t STM32Ipl_Copy (const image_t * src , image_t * dst );
195197stm32ipl_err_t STM32Ipl_CopyData (const image_t * src , image_t * dst );
196198stm32ipl_err_t STM32Ipl_Clone (const image_t * src , image_t * dst );
197- uint32_t STM32Ipl_AdaptColor (const image_t * img , uint32_t color );
199+ uint32_t STM32Ipl_AdaptColor (const image_t * img , stm32ipl_color_t color );
200+ /** @} */
201+
202+ /**
203+ * @defgroup memAlloc Memory allocation functions
204+ *
205+ * @{
206+ */
207+ void * STM32Ipl_Alloc (uint32_t size );
208+ void * STM32Ipl_Alloc0 (uint32_t size );
209+ void STM32Ipl_Free (void * mem );
210+ void * STM32Ipl_Realloc (void * mem , uint32_t size );
198211/** @} */
199212
200213/**
0 commit comments