39 #include <visp3/core/vpConfig.h>
41 #if defined(VISP_HAVE_SIMDLIB)
42 #include "vpImageIoBackend.h"
43 #include <Simd/SimdLib.h>
47 size_t stride = 0, width = 0, height = 0;
48 SimdPixelFormatType format = SimdPixelFormatGray8;
49 uint8_t *data = SimdImageLoadFromFile(filename.c_str(), &stride, &width, &height, &format);
51 I.
init(
static_cast<unsigned int>(height),
static_cast<unsigned int>(width));
52 for (
size_t i = 0; i < height; ++i) {
53 memcpy(
reinterpret_cast<uint8_t *
>(I.
bitmap) + i * width, data + i * stride, width);
60 size_t stride = 0, width = 0, height = 0;
61 SimdPixelFormatType format = SimdPixelFormatRgba32;
62 uint8_t *data = SimdImageLoadFromFile(filename.c_str(), &stride, &width, &height, &format);
64 I.
init(
static_cast<unsigned int>(height),
static_cast<unsigned int>(width));
65 for (
size_t i = 0; i < height; ++i) {
66 memcpy(
reinterpret_cast<uint8_t *
>(I.
bitmap) + i * width * 4, data + i * stride, 4 * width);
74 SimdImageFileJpeg, quality, filename.c_str());
77 void writeJPEGSimdlib(
const vpImage<vpRGBa> &I,
const std::string &filename,
int quality)
80 SimdImageFileJpeg, quality, filename.c_str());
86 SimdImageFilePng, 90, filename.c_str());
89 void writePNGSimdlib(
const vpImage<vpRGBa> &I,
const std::string &filename)
92 SimdImageFilePng, 90, filename.c_str());
void init(unsigned int height, unsigned int width)
Set the size of the image.
unsigned int getWidth() const
Type * bitmap
points toward the bitmap
unsigned int getHeight() const