@@ -1729,11 +1729,11 @@ void clip_image_f32_batch_free(struct clip_image_f32_batch * batch) {
17291729 }
17301730}
17311731
1732- static void build_clip_img_from_data (const stbi_uc * data , int nx, int ny, clip_image_u8 * img) {
1732+ void clip_build_img_from_pixels (const unsigned char * rgb_pixels , int nx, int ny, clip_image_u8 * img) {
17331733 img->nx = nx;
17341734 img->ny = ny;
17351735 img->buf .resize (3 * nx * ny);
1736- memcpy (img->buf .data (), data , img->buf .size ());
1736+ memcpy (img->buf .data (), rgb_pixels , img->buf .size ());
17371737}
17381738
17391739bool clip_image_load_from_file (const char * fname, clip_image_u8 * img) {
@@ -1743,7 +1743,7 @@ bool clip_image_load_from_file(const char * fname, clip_image_u8 * img) {
17431743 LOG_ERR (" %s: failed to load image '%s'\n " , __func__, fname);
17441744 return false ;
17451745 }
1746- build_clip_img_from_data (data, nx, ny, img);
1746+ clip_build_img_from_pixels (data, nx, ny, img);
17471747 stbi_image_free (data);
17481748 return true ;
17491749}
@@ -1755,7 +1755,7 @@ bool clip_image_load_from_bytes(const unsigned char * bytes, size_t bytes_length
17551755 LOG_ERR (" %s: failed to decode image bytes\n " , __func__);
17561756 return false ;
17571757 }
1758- build_clip_img_from_data (data, nx, ny, img);
1758+ clip_build_img_from_pixels (data, nx, ny, img);
17591759 stbi_image_free (data);
17601760 return true ;
17611761}
0 commit comments