Reputation: 149
I was trying to load image using opeimageio which I installed using vcpkg. But I get an error saying F:\vcpkg\installed\x64-windows\include\OpenImageIO\fmt\format-inl.h(1371,8): error C2061: syntax error: identifier 'HANDLE'. My code is this
#include <OpenImageIO/imageio.h>
#include <string_view>
#include <tuple>
#include <vector>
std::tuple<int, int, int> loadImageFromFile(std::string_view filePath,
std::vector<unsigned char> &data) { auto input = OIIO::ImageInput::open(filePath.data());
auto &specs = input->spec();
int width = specs.width;
int height = specs.height;
int channels = specs.nchannels;
data = std::vector<unsigned char>(width * height * channels);
input->read_image(OIIO::TypeDesc::UINT8, &data[0]);
input->close();
return {width, height, channels};
}
Thanks!
Upvotes: 1
Views: 352