@@ -1729,11 +1729,11 @@ void clip_image_f32_batch_free(struct clip_image_f32_batch * batch) {
1729
1729
}
1730
1730
}
1731
1731
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) {
1733
1733
img->nx = nx;
1734
1734
img->ny = ny;
1735
1735
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 ());
1737
1737
}
1738
1738
1739
1739
bool 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) {
1743
1743
LOG_ERR (" %s: failed to load image '%s'\n " , __func__, fname);
1744
1744
return false ;
1745
1745
}
1746
- build_clip_img_from_data (data, nx, ny, img);
1746
+ clip_build_img_from_pixels (data, nx, ny, img);
1747
1747
stbi_image_free (data);
1748
1748
return true ;
1749
1749
}
@@ -1755,7 +1755,7 @@ bool clip_image_load_from_bytes(const unsigned char * bytes, size_t bytes_length
1755
1755
LOG_ERR (" %s: failed to decode image bytes\n " , __func__);
1756
1756
return false ;
1757
1757
}
1758
- build_clip_img_from_data (data, nx, ny, img);
1758
+ clip_build_img_from_pixels (data, nx, ny, img);
1759
1759
stbi_image_free (data);
1760
1760
return true ;
1761
1761
}
0 commit comments