Handle channel conversion

This commit is contained in:
Maurice Heumann 2021-05-16 21:52:36 +02:00
parent f9ea94773e
commit 02bdf573d6

View File

@ -20,12 +20,7 @@ namespace utils
stbi_image_free(rgb_image);
});
if(channels != 4)
{
throw std::runtime_error("Invalid channel count");
}
const auto size = this->width * this->height * channels;
const auto size = this->width * this->height * 4;
this->data.resize(size);
std::memmove(this->data.data(), rgb_image, size);