[poppler] OpenCV and the image format in older versions of Poppler
suzuki toshiya
mpsuzuki at hiroshima-u.ac.jp
Sun May 1 10:04:22 UTC 2022
Hi Stéphane,
According to:
https://gitlab.freedesktop.org/poppler/poppler/-/blob/poppler-0.62.0/cpp/poppler-page-renderer.cpp#L191
const image img(reinterpret_cast<char *>(data_ptr), bw, bh, image::format_argb32);
It might be ARGB32 format (although I've not confirmed yet).
Regards,
mpsuzuki
On 2022/05/01 9:08, Stéphane Charette wrote:
> I'm combining Poppler and OpenCV. I use poppler::page_renderer's call
> set_image_format() so the image can easily be used in OpenCV. Code
> more-or-less looks like this:
>
> renderer.set_image_format(poppler::image::format_enum::format_bgr24);
> poppler::image image = renderer.render_page(page, dpi, dpi);
> cv::Mat mat(image.height(), image.width(), CV_8UC3, image.data(),
> image.bytes_per_row());
>
> But with older versions of Poppler (like what is included in Ubuntu
> 18.04: poppler 0.62.0) the call to set_image_format() does not exist.
> What is the image format used by poppler in this case?
>
> Stéphane
More information about the poppler
mailing list