Merge pull request #878 from openmv/inline_fix

Add inline functions declarations in header.
This commit is contained in:
Ibrahim Abd Elkader 2020-08-12 20:46:42 +02:00 committed by GitHub
commit cfa7991789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -548,7 +548,8 @@ uint32_t draw_scaleop_RGB565_to_RGB888(uint32_t pixel, uint32_t scale)
* @param pixel Pixel value.
* @return pixel in binary format.
*/
inline bool pixel_to_binary(int bpp, uint32_t pixel) {
inline bool imlib_pixel_to_binary(int bpp, uint32_t pixel)
{
switch (bpp) {
case IMAGE_BPP_BINARY: {
return pixel;
@ -588,8 +589,8 @@ static void int_generate_cache_line_grayscale(uint16_t *cache_line, int alpha, u
bool mask1 = true, mask2 = true;
if (mask_row_ptr) {
mask1 = pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x));
mask2 = pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x + 1));
mask1 = imlib_pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x));
mask2 = imlib_pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x + 1));
}
uint32_t alpha1 = mask1 ? (alpha - weight_x) : 0;
@ -638,8 +639,8 @@ static void int_generate_cache_line_rgb565(uint32_t *cache_line, int alpha, cons
bool mask1 = true, mask2 = true;
if (mask_row_ptr) {
mask1 = pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x));
mask2 = pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x + 1));
mask1 = imlib_pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x));
mask2 = imlib_pixel_to_binary(mask_bpp, imlib_get_pixel_fast(mask_bpp, mask_row_ptr, other_x + 1));
}
uint32_t alpha1 = mask1 ? (alpha - weight_x) : 0;

View File

@ -1159,6 +1159,7 @@ uint16_t imlib_yuv_to_rgb(uint8_t y, int8_t u, int8_t v);
void imlib_bayer_to_rgb565(image_t *img, int w, int h, int xoffs, int yoffs, uint16_t *rgbbuf);
void imlib_bayer_to_y(image_t *img, int x_offset, int y_offset, int width, uint8_t *Y);
void imlib_bayer_to_binary(image_t *img, int x_offset, int y_offset, int width, uint8_t *binary);
bool imlib_pixel_to_binary(int bpp, uint32_t pixel);
/* Image file functions */
void ppm_read_geometry(FIL *fp, image_t *img, const char *path, ppm_read_settings_t *rs);
@ -1282,6 +1283,7 @@ void imlib_flood_fill_int(image_t *out, image_t *img, int x, int y,
flood_fill_call_back_t cb, void *data);
// Drawing Functions
int imlib_get_pixel(image_t *img, int x, int y);
int imlib_get_pixel_fast(int img_bpp, const void *row_ptr, int x);
void imlib_set_pixel(image_t *img, int x, int y, int p);
void imlib_draw_line(image_t *img, int x0, int y0, int x1, int y1, int c, int thickness);
void imlib_draw_rectangle(image_t *img, int rx, int ry, int rw, int rh, int c, int thickness, bool fill);