47#include <visp3/core/vpConfig.h>
49#ifndef VISP_SKIP_BAYER_CONVERSION
50#include "private/vpBayerConversion.h"
52#include "private/vpImageConvert_impl.h"
53#if defined(VISP_HAVE_SIMDLIB)
54#include <Simd/SimdLib.h>
56#include <visp3/core/vpImageConvert.h>
59bool vpImageConvert::YCbCrLUTcomputed =
false;
60int vpImageConvert::vpCrr[256];
61int vpImageConvert::vpCgb[256];
62int vpImageConvert::vpCgr[256];
63int vpImageConvert::vpCbb[256];
110 const unsigned char var_uc_255 = 255;
111 for (
unsigned int i = 0; i < max_xy; ++i) {
112 float val = 255.f * ((src.
bitmap[i] - min) / (max - min));
116 else if (val > 255.f) {
117 dest.bitmap[i] = var_uc_255;
120 dest.bitmap[i] =
static_cast<unsigned char>(val);
138 const unsigned int val_3 = 3;
139 const unsigned char var_uc_255 = 255;
140 for (
unsigned int i = 0; i < srcHeight; ++i) {
141 for (
unsigned int j = 0; j < srcWidth; ++j) {
142 for (
unsigned int c = 0; c < val_3; ++c) {
143 float val = 255.f * ((
reinterpret_cast<const float *
>(&(src[i][j]))[c] -
reinterpret_cast<float *
>(&min)[c]) /
144 (
reinterpret_cast<float *
>(&max)[c] -
reinterpret_cast<float *
>(&min)[c]));
146 reinterpret_cast<unsigned char *
>(&(dest[i][j]))[c] = 0;
148 else if (val > 255.f) {
149 reinterpret_cast<unsigned char *
>(&(dest[i][j]))[c] = var_uc_255;
152 reinterpret_cast<unsigned char *
>(&(dest[i][j]))[c] =
static_cast<unsigned char>(val);
167 const unsigned int srcSize = srcHeight * srcWidth;
168 dest.resize(srcHeight, srcWidth);
169 for (
unsigned int i = 0; i < srcSize; ++i) {
170 dest.bitmap[i] =
static_cast<float>(src.
bitmap[i]);
188 const unsigned char var_uc_255 = 255;
189 for (
unsigned int i = 0; i < max_xy; ++i) {
190 double val = 255. * ((src.
bitmap[i] - min) / (max - min));
194 else if (val > 255.0) {
195 dest.bitmap[i] = var_uc_255;
198 dest.bitmap[i] =
static_cast<unsigned char>(val);
211 const unsigned int srcSize = src.
getSize();
214 for (
unsigned int i = 0; i < srcSize; ++i) {
215 dest.bitmap[i] =
static_cast<unsigned char>(src.
bitmap[i] >> bitshift);
227 const unsigned int srcSize = src.
getSize();
230 for (
unsigned int i = 0; i < srcSize; ++i) {
231 dest.bitmap[i] =
static_cast<unsigned char>(src.
bitmap[i] << bitshift);
243 const unsigned int srcSize = srcHeight * srcWidth;
244 dest.resize(srcHeight, srcWidth);
245 for (
unsigned int i = 0; i < srcSize; ++i) {
246 dest.bitmap[i] =
static_cast<double>(src.
bitmap[i]);
259 vp_createDepthHistogram(src_depth, dest_rgba);
270 vp_createDepthHistogram(src_depth, dest_depth);
282 vp_createDepthHistogram(src_depth, dest_rgba);
293 vp_createDepthHistogram(src_depth, dest_depth);
329#if defined(VISP_HAVE_SIMDLIB)
337 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
340 unsigned char *src = flip ? (rgb + (width * height * 3) + lineStep) : rgb;
345 for (i = 0; i < height; ++i) {
346 unsigned char *line = src;
347 for (j = 0; j < width; ++j) {
356#if defined(VISP_HAVE_SIMDLIB)
375#if defined(VISP_HAVE_SIMDLIB)
376 SimdBgraToBgr(rgba, size, 1, size * 4, rgb, size * 3);
378 unsigned char *pt_input = rgba;
379 unsigned char *pt_end = rgba + (4 * size);
380 unsigned char *pt_output = rgb;
382 while (pt_input != pt_end) {
383 *(++pt_output) = *(++pt_input);
384 *(++pt_output) = *(++pt_input);
385 *(++pt_output) = *(++pt_input);
425#if defined(VISP_HAVE_SIMDLIB)
427 SimdRgbToGray(rgb, width, height, width * 3, grey, width);
433 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
436 unsigned char *src = flip ? (rgb + (width * height * 3) + lineStep) : rgb;
443 for (i = 0; i < height; ++i) {
444 unsigned char *line = src;
445 for (j = 0; j < width; ++j) {
449 *grey++ =
static_cast<unsigned char>((0.2126 * r) + (0.7152 * g) + (0.0722 * b));
455#if defined(VISP_HAVE_SIMDLIB)
476 unsigned int nThreads)
478#if !defined(_OPENMP) || !defined(VISP_HAVE_SIMDLIB)
481#if defined(VISP_HAVE_SIMDLIB)
482 const int heightAsInt =
static_cast<int>(height);
485 omp_set_num_threads(
static_cast<int>(nThreads));
487#pragma omp parallel for
489 for (
int i = 0; i < heightAsInt; ++i) {
490 unsigned int i_ =
static_cast<unsigned int>(i);
491 SimdRgbaToGray(rgba + (i_ * width * 4), width, 1, width * 4, grey + (i_ * width), width);
513#if defined(VISP_HAVE_SIMDLIB)
514 SimdRgbaToGray(rgba, size, 1, size * 4, grey, size);
516 const unsigned int val_2 = 2;
517 const unsigned int val_4 = 4;
518 unsigned char *pt_input = rgba;
519 unsigned char *pt_end = rgba + (size * 4);
520 unsigned char *pt_output = grey;
522 while (pt_input != pt_end) {
523 *pt_output =
static_cast<unsigned char>((0.2126 * (*pt_input)) + (0.7152 * (*(pt_input + 1))) + (0.0722 * (*(pt_input + val_2))));
544#if defined(VISP_HAVE_SIMDLIB)
565#if defined(VISP_HAVE_SIMDLIB)
568 const unsigned int val_2 = 2;
569 const unsigned int val_3 = 3;
570 const unsigned int val_4 = 4;
571 unsigned char *pt_input = grey;
572 unsigned char *pt_end = grey + size;
573 unsigned char *pt_output = rgba;
575 while (pt_input != pt_end) {
576 unsigned char p = *pt_input;
578 *(pt_output + 1) = p;
579 *(pt_output + val_2) = p;
600#if defined(VISP_HAVE_SIMDLIB)
601 SimdGrayToBgr(grey, size, 1, size, rgb, size * 3);
603 const unsigned int val_2 = 2;
604 const unsigned int val_3 = 3;
605 unsigned char *pt_input = grey;
606 unsigned char *pt_end = grey + size;
607 unsigned char *pt_output = rgb;
609 while (pt_input != pt_end) {
610 unsigned char p = *pt_input;
612 *(pt_output + 1) = p;
613 *(pt_output + val_2) = p;
640#if defined(VISP_HAVE_SIMDLIB)
648 const unsigned int val_2 = 2;
649 const unsigned int val_3 = 3;
650 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
653 unsigned char *src = flip ? (bgr + (width * height * 3) + lineStep) : bgr;
655 for (
unsigned int i = 0; i < height; ++i) {
656 unsigned char *line = src;
657 for (
unsigned int j = 0; j < width; ++j) {
658 *rgba++ = *(line + val_2);
659 *rgba++ = *(line + 1);
660 *rgba++ = *(line + 0);
668#if defined(VISP_HAVE_SIMDLIB)
691#if defined(VISP_HAVE_SIMDLIB)
693 SimdBgraToRgba(bgra, width, height, width * 4, rgba, width * 4);
699 const unsigned int val_2 = 2;
700 const unsigned int val_3 = 3;
701 const unsigned int val_4 = 4;
702 int lineStep = flip ? -
static_cast<int>(width * 4) :
static_cast<int>(width * 4);
705 unsigned char *src = flip ? (bgra + (width * height * val_4) + lineStep) : bgra;
707 for (
unsigned int i = 0; i < height; ++i) {
708 unsigned char *line = src;
709 for (
unsigned int j = 0; j < width; ++j) {
710 *rgba++ = *(line + val_2);
711 *rgba++ = *(line + 1);
712 *rgba++ = *(line + 0);
713 *rgba++ = *(line + val_3);
720#if defined(VISP_HAVE_SIMDLIB)
741 bool flip,
unsigned int nThreads)
743#if !defined(_OPENMP) || !defined(VISP_HAVE_SIMDLIB)
746#if defined(VISP_HAVE_SIMDLIB)
747 const int heightAsInt =
static_cast<int>(height);
751 omp_set_num_threads(
static_cast<int>(nThreads));
753#pragma omp parallel for
755 for (
int i = 0; i < heightAsInt; ++i) {
756 unsigned int i_ =
static_cast<unsigned int>(i);
757 SimdBgrToGray(bgr + (i_ * width * 3), width, 1, width * 3, grey + (i_ * width), width);
764 const unsigned int val_2 = 2;
765 const unsigned int val_3 = 3;
766 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
769 unsigned char *src = flip ? (bgr + (width * height * 3) + lineStep) : bgr;
771 for (
unsigned int i = 0; i < height; ++i) {
772 unsigned char *line = src;
773 for (
unsigned int j = 0; j < width; ++j) {
774 *grey++ =
static_cast<unsigned char>(
static_cast<unsigned int>((0.2126 * *(line + val_2)) + (0.7152 * *(line + 1)) + (0.0722 * *(line + 0))));
781#if defined(VISP_HAVE_SIMDLIB)
802 bool flip,
unsigned int nThreads)
804#if !defined(_OPENMP) || !defined(VISP_HAVE_SIMDLIB)
807#if defined(VISP_HAVE_SIMDLIB)
809 const int heightAsInt =
static_cast<int>(height);
812 omp_set_num_threads(
static_cast<int>(nThreads));
814#pragma omp parallel for
816 for (
int i = 0; i < heightAsInt; ++i) {
817 unsigned int i_ =
static_cast<unsigned int>(i);
818 SimdBgraToGray(bgra + (i_ * width * 4), width, 1, width * 4, grey + (i_ * width), width);
825 const unsigned int val_2 = 2;
826 const unsigned int val_4 = 4;
827 int lineStep = flip ? -
static_cast<int>(width * 4) :
static_cast<int>(width * 4);
830 unsigned char *src = flip ? (bgra + (width * height * 4) + lineStep) : bgra;
832 for (
unsigned int i = 0; i < height; ++i) {
833 unsigned char *line = src;
834 for (
unsigned int j = 0; j < width; ++j) {
835 *grey++ =
static_cast<unsigned char>((0.2126 * *(line + val_2)) + (0.7152 * *(line + 1)) + (0.0722 * *(line + 0)));
842#if defined(VISP_HAVE_SIMDLIB)
850void vpImageConvert::computeYCbCrLUT()
852 if (YCbCrLUTcomputed ==
false) {
853 const int val_256 = 256;
858 int aux = index - 128;
859 vpImageConvert::vpCrr[index] =
static_cast<int>((364.6610 * aux) / val_256);
860 vpImageConvert::vpCgb[index] =
static_cast<int>((-89.8779 * aux) / val_256);
861 vpImageConvert::vpCgr[index] =
static_cast<int>((-185.8154 * aux) / val_256);
862 vpImageConvert::vpCbb[index] =
static_cast<int>((460.5724 * aux) / val_256);
865 YCbCrLUTcomputed =
true;
892 const unsigned int val_2 = 2;
893 const unsigned int val_3 = 3;
894 const int val_255 = 255;
895 const unsigned int val_255u = 255u;
898 unsigned char *pt_ycbcr = ycbcr;
899 unsigned char *pt_rgb = rgb;
901 crv = pt_ycbcr + val_3;
903 vpImageConvert::computeYCbCrLUT();
905 unsigned int col = 0;
908 int val_r, val_g, val_b;
909 if (!(col % val_2)) {
911 crv = pt_ycbcr + val_3;
914 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
915 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
916 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
918 *pt_rgb++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
919 *pt_rgb++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
920 *pt_rgb++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
954 const unsigned int val_2 = 2;
955 const unsigned int val_3 = 3;
956 const int val_255 = 255;
957 const unsigned int val_255u = 255u;
960 unsigned char *pt_ycbcr = ycbcr;
961 unsigned char *pt_rgba = rgba;
963 crv = pt_ycbcr + val_3;
965 vpImageConvert::computeYCbCrLUT();
967 unsigned int col = 0;
970 int val_r, val_g, val_b;
971 if (!(col % val_2)) {
973 crv = pt_ycbcr + val_3;
976 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
977 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
978 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
980 *pt_rgba++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
981 *pt_rgba++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
982 *pt_rgba++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
1011 const unsigned val_2 = 2;
1012 const unsigned val_4 = 4;
1013 unsigned int i = 0, j = 0;
1014 const unsigned int doubleSize = size * 2;
1015 while (j < doubleSize) {
1016 grey[i++] = ycbcr[j];
1017 grey[i++] = ycbcr[j + val_2];
1045 const unsigned int val_2 = 2;
1046 const unsigned int val_3 = 3;
1047 const int val_255 = 255;
1048 const unsigned int val_255u = 255u;
1051 unsigned char *pt_ycbcr = ycrcb;
1052 unsigned char *pt_rgb = rgb;
1054 cbv = pt_ycbcr + val_3;
1056 vpImageConvert::computeYCbCrLUT();
1058 unsigned int col = 0;
1061 int val_r, val_g, val_b;
1062 if (!(col % val_2)) {
1064 cbv = pt_ycbcr + val_3;
1067 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
1068 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
1069 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
1071 *pt_rgb++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
1072 *pt_rgb++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
1073 *pt_rgb++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
1106 const unsigned int val_2 = 2;
1107 const unsigned int val_3 = 3;
1108 const int val_255 = 255;
1109 const unsigned int val_255u = 255u;
1112 unsigned char *pt_ycbcr = ycrcb;
1113 unsigned char *pt_rgba = rgba;
1115 cbv = pt_ycbcr + val_3;
1117 vpImageConvert::computeYCbCrLUT();
1119 unsigned int col = 0;
1122 int val_r, val_g, val_b;
1123 if (!(col % val_2)) {
1125 cbv = pt_ycbcr + val_3;
1128 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
1129 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
1130 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
1132 *pt_rgba++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
1133 *pt_rgba++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
1134 *pt_rgba++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
1187#if defined(VISP_HAVE_SIMDLIB)
1202 unsigned char *ptrR = pR ? pR->
bitmap :
new unsigned char[src.
getSize()];
1203 unsigned char *ptrG = pG ? pG->
bitmap :
new unsigned char[src.
getSize()];
1204 unsigned char *ptrB = pB ? pB->
bitmap :
new unsigned char[src.
getSize()];
1205 unsigned char *ptrA = pa ? pa->
bitmap :
new unsigned char[src.
getSize()];
1227 unsigned int width = src.
getWidth();
1228 unsigned char *input;
1230 const unsigned int index_0 = 0;
1231 const unsigned int index_1 = 1;
1232 const unsigned int index_2 = 2;
1233 const unsigned int index_3 = 3;
1237 tabChannel[index_0] = pR;
1238 tabChannel[index_1] = pG;
1239 tabChannel[index_2] = pB;
1240 tabChannel[index_3] = pa;
1243 const unsigned int val_3 = 3;
1244 const unsigned int val_4 = 4;
1245 for (
unsigned int j = 0; j < val_4; ++j) {
1246 if (tabChannel[j] !=
nullptr) {
1247 if ((tabChannel[j]->getHeight() != height) || (tabChannel[j]->getWidth() != width)) {
1248 tabChannel[j]->
resize(height, width);
1250 dst =
static_cast<unsigned char *
>(tabChannel[j]->
bitmap);
1252 input = (
unsigned char *)src.
bitmap + j;
1257 for (; i < n; i += val_4) {
1274 for (; i < n; ++i) {
1298 std::map<unsigned int, unsigned int> mapOfWidths, mapOfHeights;
1300 ++mapOfWidths[R->getWidth()];
1301 ++mapOfHeights[R->getHeight()];
1319 if ((mapOfWidths.size() == 1) && (mapOfHeights.size() == 1)) {
1320 unsigned int width = mapOfWidths.begin()->first;
1321 unsigned int height = mapOfHeights.begin()->first;
1323 RGBa.
resize(height, width);
1326#if defined(VISP_HAVE_SIMDLIB)
1327 if ((R !=
nullptr) && (G !=
nullptr) && (B !=
nullptr) && (a !=
nullptr)) {
1328 SimdInterleaveBgra(R->bitmap, width, G->
bitmap, width, B->
bitmap, width, a->
bitmap, width, width, height,
1329 reinterpret_cast<uint8_t *
>(RGBa.
bitmap), width *
sizeof(
vpRGBa));
1333 unsigned int size = width * height;
1334 for (
unsigned int i = 0; i < size; ++i) {
1336 RGBa.
bitmap[i].R = R->bitmap[i];
1351#if defined(VISP_HAVE_SIMDLIB)
1372 const int val_256 = 256;
1373 int i = (
static_cast<int>(size) * 2) - 1;
1374 int j =
static_cast<int>(size) - 1;
1377 int y = grey16[i--];
1378 grey[j--] =
static_cast<unsigned char>((y + (grey16[i] * val_256)) / val_256);
1396 int i = (
static_cast<int>(size) * 2) - 1;
1397 int j = (
static_cast<int>(size) * 4) - 1;
1400 int y = grey16[i--];
1401 unsigned char v =
static_cast<unsigned char>((y + (grey16[i] * 256)) / 256);
1411#ifndef VISP_SKIP_BAYER_CONVERSION
1425 unsigned int height,
unsigned int nThreads)
1427 demosaicBGGRToRGBaBilinearTpl(bggr, rgba, width, height, nThreads);
1443 unsigned int height,
unsigned int nThreads)
1445 demosaicBGGRToRGBaBilinearTpl(bggr, rgba, width, height, nThreads);
1461 unsigned int height,
unsigned int nThreads)
1463 demosaicGBRGToRGBaBilinearTpl(gbrg, rgba, width, height, nThreads);
1479 unsigned int height,
unsigned int nThreads)
1481 demosaicGBRGToRGBaBilinearTpl(gbrg, rgba, width, height, nThreads);
1497 unsigned int height,
unsigned int nThreads)
1499 demosaicGRBGToRGBaBilinearTpl(grbg, rgba, width, height, nThreads);
1515 unsigned int height,
unsigned int nThreads)
1517 demosaicGRBGToRGBaBilinearTpl(grbg, rgba, width, height, nThreads);
1533 unsigned int height,
unsigned int nThreads)
1535 demosaicRGGBToRGBaBilinearTpl(rggb, rgba, width, height, nThreads);
1551 unsigned int height,
unsigned int nThreads)
1553 demosaicRGGBToRGBaBilinearTpl(rggb, rgba, width, height, nThreads);
1571 unsigned int height,
unsigned int nThreads)
1573 demosaicBGGRToRGBaMalvarTpl(bggr, rgba, width, height, nThreads);
1589 unsigned int height,
unsigned int nThreads)
1591 demosaicBGGRToRGBaMalvarTpl(bggr, rgba, width, height, nThreads);
1607 unsigned int height,
unsigned int nThreads)
1609 demosaicGBRGToRGBaMalvarTpl(gbrg, rgba, width, height, nThreads);
1625 unsigned int height,
unsigned int nThreads)
1627 demosaicGBRGToRGBaMalvarTpl(gbrg, rgba, width, height, nThreads);
1643 unsigned int height,
unsigned int nThreads)
1645 demosaicGRBGToRGBaMalvarTpl(grbg, rgba, width, height, nThreads);
1661 unsigned int height,
unsigned int nThreads)
1663 demosaicGRBGToRGBaMalvarTpl(grbg, rgba, width, height, nThreads);
1679 unsigned int height,
unsigned int nThreads)
1681 demosaicRGGBToRGBaMalvarTpl(rggb, rgba, width, height, nThreads);
1697 unsigned int height,
unsigned int nThreads)
1699 demosaicRGGBToRGBaMalvarTpl(rggb, rgba, width, height, nThreads);
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
static void MONO16ToGrey(unsigned char *grey16, unsigned char *grey, unsigned int size)
static void demosaicBGGRToRGBaBilinear(const uint8_t *bggr, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void demosaicGRBGToRGBaBilinear(const uint8_t *grbg, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void demosaicGRBGToRGBaMalvar(const uint8_t *grbg, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void demosaicGBRGToRGBaMalvar(const uint8_t *gbrg, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void merge(const vpImage< unsigned char > *R, const vpImage< unsigned char > *G, const vpImage< unsigned char > *B, const vpImage< unsigned char > *a, vpImage< vpRGBa > &RGBa)
static void demosaicBGGRToRGBaMalvar(const uint8_t *bggr, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void demosaicGBRGToRGBaBilinear(const uint8_t *gbrg, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void YCbCrToGrey(unsigned char *ycbcr, unsigned char *grey, unsigned int size)
static void split(const vpImage< vpRGBa > &src, vpImage< unsigned char > *pR, vpImage< unsigned char > *pG, vpImage< unsigned char > *pB, vpImage< unsigned char > *pa=nullptr)
static void YCrCbToRGB(unsigned char *ycrcb, unsigned char *rgb, unsigned int size)
static void YCbCrToRGBa(unsigned char *ycbcr, unsigned char *rgb, unsigned int size)
static void createDepthHistogram(const vpImage< uint16_t > &src_depth, vpImage< vpRGBa > &dest_rgba)
static void demosaicRGGBToRGBaMalvar(const uint8_t *rggb, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void GreyToRGBa(unsigned char *grey, unsigned char *rgba, unsigned int width, unsigned int height)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
static void MONO16ToRGBa(unsigned char *grey16, unsigned char *rgba, unsigned int size)
static void RGBToGrey(unsigned char *rgb, unsigned char *grey, unsigned int width, unsigned int height, bool flip=false)
static void RGBaToGrey(unsigned char *rgba, unsigned char *grey, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void GreyToRGB(unsigned char *grey, unsigned char *rgb, unsigned int size)
static void YCrCbToRGBa(unsigned char *ycrcb, unsigned char *rgb, unsigned int size)
static void RGBToRGBa(unsigned char *rgb, unsigned char *rgba, unsigned int size)
static void YCbCrToRGB(unsigned char *ycbcr, unsigned char *rgb, unsigned int size)
static void BGRaToGrey(unsigned char *bgra, unsigned char *grey, unsigned int width, unsigned int height, bool flip=false, unsigned int nThreads=0)
static void BGRToGrey(unsigned char *bgr, unsigned char *grey, unsigned int width, unsigned int height, bool flip=false, unsigned int nThreads=0)
static void BGRToRGBa(unsigned char *bgr, unsigned char *rgba, unsigned int width, unsigned int height, bool flip=false)
static void demosaicRGGBToRGBaBilinear(const uint8_t *rggb, uint8_t *rgba, unsigned int width, unsigned int height, unsigned int nThreads=0)
static void BGRaToRGBa(unsigned char *bgra, unsigned char *rgba, unsigned int width, unsigned int height, bool flip=false)
static void RGBaToRGB(unsigned char *rgba, unsigned char *rgb, unsigned int size)
Definition of the vpImage class member functions.
unsigned int getWidth() const
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
unsigned int getNumberOfPixel() const
unsigned int getSize() const
Type * bitmap
points toward the bitmap
unsigned int getHeight() const
void getMinMaxValue(Type &min, Type &max, bool onlyFiniteVal=true) const
Look for the minimum and the maximum value within the bitmap.