39 #include <visp3/core/vpConfig.h>
41 #if defined(VISP_HAVE_SIMDLIB)
42 #include "vpImageIoBackend.h"
43 #include <Simd/SimdLib.h>
49 size_t stride = 0, width = 0, height = 0;
50 SimdPixelFormatType format = SimdPixelFormatGray8;
51 uint8_t *data = SimdImageLoadFromFile(filename.c_str(), &stride, &width, &height, &format);
53 I.
init(
static_cast<unsigned int>(height),
static_cast<unsigned int>(width));
54 for (
size_t i = 0; i < height; ++i) {
55 memcpy(
reinterpret_cast<uint8_t *
>(I.
bitmap) + i * width, data + i * stride, width);
62 size_t stride = 0, width = 0, height = 0;
63 SimdPixelFormatType format = SimdPixelFormatRgba32;
64 uint8_t *data = SimdImageLoadFromFile(filename.c_str(), &stride, &width, &height, &format);
66 I.
init(
static_cast<unsigned int>(height),
static_cast<unsigned int>(width));
67 for (
size_t i = 0; i < height; ++i) {
68 memcpy(
reinterpret_cast<uint8_t *
>(I.
bitmap) + i * width * 4, data + i * stride, 4 * width);
76 SimdImageFileJpeg, quality, filename.c_str());
79 void writeJPEGSimdlib(
const vpImage<vpRGBa> &I,
const std::string &filename,
int quality)
82 SimdImageFileJpeg, quality, filename.c_str());
88 SimdImageFilePng, 90, filename.c_str());
91 void writePNGSimdlib(
const vpImage<vpRGBa> &I,
const std::string &filename)
94 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