Skip to content

Commit f81dd94

Browse files
committed
Merge branch 'sra' into foss2
2 parents 0636786 + 5ba273e commit f81dd94

21 files changed

+419
-221
lines changed

Inc/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define debug_printf(...)
2525
#endif
2626

27+
/* STM32IPL: commented as not used.
2728
#define OMV_MAX(a,b) \
2829
({ \
2930
__typeof__ (a) _a = (a); \
@@ -37,4 +38,5 @@
3738
__typeof__ (b) _b = (b); \
3839
_a < _b ? _a : _b; \
3940
})
41+
*/ // STM32IPL
4042
#endif //__OMV_COMMON_H__

Inc/imlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#ifndef __IMLIB_H__
1212
#define __IMLIB_H__
1313

14-
#include "stm32ipl_imlib_ext.h"
14+
#include "stm32ipl_imlib.h"
1515
#include "stm32ipl_imlib_int.h"
1616

1717
#endif //__IMLIB_H__

Inc/stm32ipl.h

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
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
2626
extern "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
*/
123122
typedef 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
*/
155154
typedef 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
*/
166168
typedef 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);
194196
stm32ipl_err_t STM32Ipl_Copy(const image_t *src, image_t *dst);
195197
stm32ipl_err_t STM32Ipl_CopyData(const image_t *src, image_t *dst);
196198
stm32ipl_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
/**

Inc/stm32ipl_image_io_jpg_sw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef __STM32IPL_IMAGE_IO_JPG_SW_H_
2020
#define __STM32IPL_IMAGE_IO_JPG_SW_H_
2121

22+
///@cond
23+
2224
#include "stm32ipl.h"
2325

2426
#ifdef STM32IPL_ENABLE_IMAGE_IO
@@ -42,4 +44,6 @@ stm32ipl_err_t saveJPEGSW(const image_t *img, const char *filename);
4244
#endif /* STM32IPL_ENABLE_JPEG */
4345
#endif /* STM32IPL_ENABLE_IMAGE_IO */
4446

47+
///@endcond
48+
4549
#endif /* __STM32IPL_IMAGE_IO_JPG_SW_H_ */

Inc/stm32ipl_imlib_ext.h renamed to Inc/stm32ipl_imlib.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @file stm32ipl_imlib.h
3+
*/
14
/*
25
* This file is part of the OpenMV project.
36
*
@@ -21,7 +24,6 @@
2124
#include <float.h>
2225
#include <math.h>
2326
#include <arm_math.h>
24-
#include "stm32ipl_mem_alloc.h"
2527
#include "array.h"
2628
#include "fmath.h"
2729
#include "collections.h"
@@ -136,10 +138,10 @@ typedef struct color_thresholds_list_lnk_data
136138
{
137139
uint8_t LMin; /**< Minimum L* (lightness) value. */
138140
uint8_t LMax; /**< Maximum L* (lightness) value. */
139-
int8_t AMin; /**< Minimum A* (green-red opponent) color value. */
140-
int8_t AMax; /**< Maximum A* (green-red opponent) color value. */
141-
int8_t BMin; /**< Minimum B* (blue-yellow opponent) color value. */
142-
int8_t BMax; /**< Maximum B* (blue-yellow opponent) color value. */
141+
int8_t AMin; /**< Minimum A* (green-red opponent) color value. */
142+
int8_t AMax; /**< Maximum A* (green-red opponent) color value. */
143+
int8_t BMin; /**< Minimum B* (blue-yellow opponent) color value. */
144+
int8_t BMax; /**< Maximum B* (blue-yellow opponent) color value. */
143145
} color_thresholds_list_lnk_data_t;
144146

145147
/////////////////
@@ -721,8 +723,8 @@ typedef struct cascade
721723
*/
722724
typedef enum template_match
723725
{
724-
SEARCH_EX, /**< Exhaustive search */
725-
SEARCH_DS, /**< Diamond search */
726+
SEARCH_EX, /**< Exhaustive search. */
727+
SEARCH_DS, /**< Diamond search. */
726728
} template_match_t;
727729

728730
/**

Inc/stm32ipl_imlib_int.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef __STM32IPL_IMLIB_INT_H__
1313
#define __STM32IPL_IMLIB_INT_H__
1414

15+
#include "stm32ipl_mem_alloc.h" // STM32IPL
16+
1517
///@cond
1618

1719
#ifndef M_PI // STM32IPL

Inc/stm32ipl_mem_alloc.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef __STM32IPL_MEM_ALLOC_H_
2020
#define __STM32IPL_MEM_ALLOC_H_
2121

22+
///@cond
23+
2224
#ifdef STM32IPL
2325

2426
#include <stdint.h>
@@ -35,16 +37,16 @@ extern "C" {
3537
void umm_alloc_fail(void);
3638

3739
/* General purpose allocation functions.
38-
* They can be used at app side.
40+
* They are for library internals only.
41+
* Do not use at application side!
3942
*/
4043
void* xalloc(uint32_t size);
41-
void* xalloc_try_alloc(uint32_t size);
4244
void* xalloc0(uint32_t size);
4345
void xfree(void *mem);
4446
void* xrealloc(void *mem, uint32_t size);
4547

4648
/* Frame buffer allocation functions.
47-
* They are for openmv internals only.
49+
* They are for library internals only.
4850
* Do not use at application side!
4951
*/
5052
void fb_init(void);
@@ -65,4 +67,6 @@ void fb_free_all(void);
6567

6668
#endif /* STM32IPL */
6769

70+
///@endcond
71+
6872
#endif /* __STM32IPL_MEM_ALLOC_H_ */

0 commit comments

Comments
 (0)