banned raw void pointer from public API

This commit is contained in:
Hartmut Seichter 2022-06-07 17:13:02 +02:00
parent 2b312f3494
commit a5830ad9cd
5 changed files with 25 additions and 19 deletions

View file

@ -18,13 +18,13 @@ struct image_io::impl
image read_impl(const std::string& uri,uint32_t flags)
{
int x{ 0 }, y{ 0 }, n{ 0 };
auto data = stbi_load(uri.c_str(), &x, &y, &n, 4);
const auto data = stbi_load(uri.c_str(), &x, &y, &n, 4);
if (data) {
image r;
r.create(size(x,y),image::pixel_layout::RGBA8,data);
r.create(size(x,y),image::pixel_layout::RGBA8,reinterpret_cast<image::data_t*>(data));
stbi_image_free(data);