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>
59 bool vpImageConvert::YCbCrLUTcomputed =
false;
60 int vpImageConvert::vpCrr[256];
61 int vpImageConvert::vpCgb[256];
62 int vpImageConvert::vpCgr[256];
63 int 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) {
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) {
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);
328 #if defined(VISP_HAVE_SIMDLIB)
336 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
339 unsigned char *src = flip ? (rgb + (width * height * 3) + lineStep) : rgb;
344 for (i = 0; i < height; ++i) {
345 unsigned char *line = src;
346 for (j = 0; j < width; ++j) {
355 #if defined(VISP_HAVE_SIMDLIB)
374 #if defined(VISP_HAVE_SIMDLIB)
375 SimdBgraToBgr(rgba, size, 1, size * 4, rgb, size * 3);
377 unsigned char *pt_input = rgba;
378 unsigned char *pt_end = rgba + (4 * size);
379 unsigned char *pt_output = rgb;
381 while (pt_input != pt_end) {
382 *(++pt_output) = *(++pt_input);
383 *(++pt_output) = *(++pt_input);
384 *(++pt_output) = *(++pt_input);
423 #if defined(VISP_HAVE_SIMDLIB)
425 SimdRgbToGray(rgb, width, height, width * 3, grey, width);
431 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
434 unsigned char *src = flip ? (rgb + (width * height * 3) + lineStep) : rgb;
441 for (i = 0; i < height; ++i) {
442 unsigned char *line = src;
443 for (j = 0; j < width; ++j) {
447 *grey++ =
static_cast<unsigned char>((0.2126 * r) + (0.7152 * g) + (0.0722 * b));
453 #if defined(VISP_HAVE_SIMDLIB)
480 #if defined(VISP_HAVE_SIMDLIB)
481 const int heightAsInt =
static_cast<int>(height);
484 omp_set_num_threads(
static_cast<int>(nThreads));
486 #pragma omp parallel for
488 for (
int i = 0; i < heightAsInt; ++i) {
489 SimdRgbaToGray(rgba + (i * width * 4), width, 1, width * 4, grey + (i * width), width);
515 #if defined(VISP_HAVE_SIMDLIB)
516 SimdRgbaToGray(rgba, size, 1, size * 4, grey, size);
518 const unsigned int val_2 = 2;
519 const unsigned int val_4 = 4;
520 unsigned char *pt_input = rgba;
521 unsigned char *pt_end = rgba + (size * 4);
522 unsigned char *pt_output = grey;
524 while (pt_input != pt_end) {
525 *pt_output =
static_cast<unsigned char>((0.2126 * (*pt_input)) + (0.7152 * (*(pt_input + 1))) + (0.0722 * (*(pt_input + val_2))));
545 #if defined(VISP_HAVE_SIMDLIB)
566 #if defined(VISP_HAVE_SIMDLIB)
569 const unsigned int val_2 = 2;
570 const unsigned int val_3 = 3;
571 const unsigned int val_4 = 4;
572 unsigned char *pt_input = grey;
573 unsigned char *pt_end = grey + size;
574 unsigned char *pt_output = rgba;
576 while (pt_input != pt_end) {
577 unsigned char p = *pt_input;
579 *(pt_output + 1) = p;
580 *(pt_output + val_2) = p;
601 #if defined(VISP_HAVE_SIMDLIB)
602 SimdGrayToBgr(grey, size, 1, size, rgb, size * 3);
604 const unsigned int val_2 = 2;
605 const unsigned int val_3 = 3;
606 unsigned char *pt_input = grey;
607 unsigned char *pt_end = grey + size;
608 unsigned char *pt_output = rgb;
610 while (pt_input != pt_end) {
611 unsigned char p = *pt_input;
613 *(pt_output + 1) = p;
614 *(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)
690 #if defined(VISP_HAVE_SIMDLIB)
692 SimdBgraToRgba(bgra, width, height, width * 4, rgba, width * 4);
698 const unsigned int val_2 = 2;
699 const unsigned int val_3 = 3;
700 const unsigned int val_4 = 4;
701 int lineStep = flip ? -
static_cast<int>(width * 4) :
static_cast<int>(width * 4);
704 unsigned char *src = flip ? (bgra + (width * height * val_4) + lineStep) : bgra;
706 for (
unsigned int i = 0; i < height; ++i) {
707 unsigned char *line = src;
708 for (
unsigned int j = 0; j < width; ++j) {
709 *rgba++ = *(line + val_2);
710 *rgba++ = *(line + 1);
711 *rgba++ = *(line + 0);
712 *rgba++ = *(line + val_3);
719 #if 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 SimdBgrToGray(bgr + (i * width * 3), width, 1, width * 3, grey + (i * width), width);
763 const unsigned int val_2 = 2;
764 const unsigned int val_3 = 3;
765 int lineStep = flip ? -
static_cast<int>(width * 3) :
static_cast<int>(width * 3);
768 unsigned char *src = flip ? (bgr + (width * height * 3) + lineStep) : bgr;
770 for (
unsigned int i = 0; i < height; ++i) {
771 unsigned char *line = src;
772 for (
unsigned int j = 0; j < width; ++j) {
773 *grey++ =
static_cast<unsigned int>((0.2126 * *(line + val_2)) + (0.7152 * *(line + 1)) + (0.0722 * *(line + 0)));
780 #if defined(VISP_HAVE_SIMDLIB)
783 #if !defined(VISP_HAVE_SIMDLIB) && defined(_OPENMP)
810 #if defined(VISP_HAVE_SIMDLIB)
812 const int heightAsInt =
static_cast<int>(height);
815 omp_set_num_threads(
static_cast<int>(nThreads));
817 #pragma omp parallel for
819 for (
int i = 0; i < heightAsInt; ++i) {
820 SimdBgraToGray(bgra + (i * width * 4), width, 1, width * 4, grey + (i * width), width);
827 const unsigned int val_2 = 2;
828 const unsigned int val_4 = 4;
829 int lineStep = flip ? -
static_cast<int>(width * 4) :
static_cast<int>(width * 4);
832 unsigned char *src = flip ? (bgra + (width * height * 4) + lineStep) : bgra;
834 for (
unsigned int i = 0; i < height; ++i) {
835 unsigned char *line = src;
836 for (
unsigned int j = 0; j < width; ++j) {
837 *grey++ =
static_cast<unsigned char>((0.2126 * *(line + val_2)) + (0.7152 * *(line + 1)) + (0.0722 * *(line + 0)));
844 #if defined(VISP_HAVE_SIMDLIB)
847 #if !defined(VISP_HAVE_SIMDLIB) && defined(_OPENMP)
855 void vpImageConvert::computeYCbCrLUT()
857 if (YCbCrLUTcomputed ==
false) {
858 const int val_256 = 256;
863 int aux = index - 128;
864 vpImageConvert::vpCrr[index] =
static_cast<int>((364.6610 * aux) / val_256);
865 vpImageConvert::vpCgb[index] =
static_cast<int>((-89.8779 * aux) / val_256);
866 vpImageConvert::vpCgr[index] =
static_cast<int>((-185.8154 * aux) / val_256);
867 vpImageConvert::vpCbb[index] =
static_cast<int>((460.5724 * aux) / val_256);
870 YCbCrLUTcomputed =
true;
897 const unsigned val_2 = 2;
898 const unsigned val_3 = 3;
899 const int val_255 = 255;
900 const unsigned int val_255u = 255u;
903 unsigned char *pt_ycbcr = ycbcr;
904 unsigned char *pt_rgb = rgb;
906 crv = pt_ycbcr + val_3;
908 vpImageConvert::computeYCbCrLUT();
913 int val_r, val_g, val_b;
914 if (!(col % val_2)) {
916 crv = pt_ycbcr + val_3;
919 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
920 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
921 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
923 *pt_rgb++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
924 *pt_rgb++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
925 *pt_rgb++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
959 const unsigned val_2 = 2;
960 const unsigned val_3 = 3;
961 const int val_255 = 255;
962 const unsigned int val_255u = 255u;
965 unsigned char *pt_ycbcr = ycbcr;
966 unsigned char *pt_rgba = rgba;
968 crv = pt_ycbcr + val_3;
970 vpImageConvert::computeYCbCrLUT();
975 int val_r, val_g, val_b;
976 if (!(col % val_2)) {
978 crv = pt_ycbcr + val_3;
981 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
982 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
983 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
985 *pt_rgba++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
986 *pt_rgba++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
987 *pt_rgba++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
1016 const unsigned val_2 = 2;
1017 const unsigned val_4 = 4;
1018 unsigned int i = 0, j = 0;
1019 const unsigned int doubleSize = size * 2;
1020 while (j < doubleSize) {
1021 grey[i++] = ycbcr[j];
1022 grey[i++] = ycbcr[j + val_2];
1050 const unsigned val_2 = 2;
1051 const unsigned val_3 = 3;
1052 const int val_255 = 255;
1053 const unsigned int val_255u = 255u;
1056 unsigned char *pt_ycbcr = ycrcb;
1057 unsigned char *pt_rgb = rgb;
1059 cbv = pt_ycbcr + val_3;
1061 vpImageConvert::computeYCbCrLUT();
1066 int val_r, val_g, val_b;
1067 if (!(col % val_2)) {
1069 cbv = pt_ycbcr + val_3;
1072 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
1073 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
1074 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
1076 *pt_rgb++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
1077 *pt_rgb++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
1078 *pt_rgb++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
1111 const unsigned val_2 = 2;
1112 const unsigned val_3 = 3;
1113 const int val_255 = 255;
1114 const unsigned int val_255u = 255u;
1117 unsigned char *pt_ycbcr = ycrcb;
1118 unsigned char *pt_rgba = rgba;
1120 cbv = pt_ycbcr + val_3;
1122 vpImageConvert::computeYCbCrLUT();
1127 int val_r, val_g, val_b;
1128 if (!(col % val_2)) {
1130 cbv = pt_ycbcr + val_3;
1133 val_r = *pt_ycbcr + vpImageConvert::vpCrr[*crv];
1134 val_g = *pt_ycbcr + vpImageConvert::vpCgb[*cbv] + vpImageConvert::vpCgr[*crv];
1135 val_b = *pt_ycbcr + vpImageConvert::vpCbb[*cbv];
1137 *pt_rgba++ = (val_r < 0) ? 0u : ((val_r > val_255) ? val_255u :
static_cast<unsigned char>(val_r));
1138 *pt_rgba++ = (val_g < 0) ? 0u : ((val_g > val_255) ? val_255u :
static_cast<unsigned char>(val_g));
1139 *pt_rgba++ = (val_b < 0) ? 0u : ((val_b > val_255) ? val_255u :
static_cast<unsigned char>(val_b));
1192 #if defined(VISP_HAVE_SIMDLIB)
1207 unsigned char *ptrR = pR ? pR->
bitmap :
new unsigned char[src.
getSize()];
1208 unsigned char *ptrG = pG ? pG->
bitmap :
new unsigned char[src.
getSize()];
1209 unsigned char *ptrB = pB ? pB->
bitmap :
new unsigned char[src.
getSize()];
1210 unsigned char *ptrA = pa ? pa->
bitmap :
new unsigned char[src.
getSize()];
1232 unsigned int width = src.
getWidth();
1233 unsigned char *input;
1235 const unsigned int index_0 = 0;
1236 const unsigned int index_1 = 1;
1237 const unsigned int index_2 = 2;
1238 const unsigned int index_3 = 3;
1242 tabChannel[index_0] = pR;
1243 tabChannel[index_1] = pG;
1244 tabChannel[index_2] = pB;
1245 tabChannel[index_3] = pa;
1248 const unsigned int val_3 = 3;
1249 const unsigned int val_4 = 4;
1250 for (
unsigned int j = 0; j < val_4; ++j) {
1251 if (tabChannel[j] !=
nullptr) {
1252 if ((tabChannel[j]->getHeight() != height) || (tabChannel[j]->getWidth() != width)) {
1253 tabChannel[j]->
resize(height, width);
1255 dst =
static_cast<unsigned char *
>(tabChannel[j]->
bitmap);
1257 input = (
unsigned char *)src.
bitmap + j;
1262 for (; i < n; i += val_4) {
1279 for (; i < n; ++i) {
1303 std::map<unsigned int, unsigned int> mapOfWidths, mapOfHeights;
1324 if ((mapOfWidths.size() == 1) && (mapOfHeights.size() == 1)) {
1325 unsigned int width = mapOfWidths.begin()->first;
1326 unsigned int height = mapOfHeights.begin()->first;
1328 RGBa.
resize(height, width);
1331 #if defined(VISP_HAVE_SIMDLIB)
1332 if ((R !=
nullptr) && (G !=
nullptr) && (B !=
nullptr) && (a !=
nullptr)) {
1333 SimdInterleaveBgra(R->
bitmap, width, G->
bitmap, width, B->
bitmap, width, a->
bitmap, width, width, height,
1334 reinterpret_cast<uint8_t *
>(RGBa.
bitmap), width *
sizeof(
vpRGBa));
1338 unsigned int size = width * height;
1339 for (
unsigned int i = 0; i < size; ++i) {
1356 #if defined(VISP_HAVE_SIMDLIB)
1377 const int val_256 = 256;
1378 int i = (
static_cast<int>(size) * 2) - 1;
1379 int j =
static_cast<int>(size) - 1;
1382 int y = grey16[i--];
1383 grey[j--] =
static_cast<unsigned char>((y + (grey16[i] * val_256)) / val_256);
1401 int i = (
static_cast<int>(size) * 2) - 1;
1402 int j = (
static_cast<int>(size) * 4) - 1;
1405 int y = grey16[i--];
1406 unsigned char v =
static_cast<unsigned char>((y + (grey16[i] * 256)) / 256);
1416 #ifndef VISP_SKIP_BAYER_CONVERSION
1430 unsigned int height,
unsigned int nThreads)
1432 demosaicBGGRToRGBaBilinearTpl(bggr, rgba, width, height, nThreads);
1448 unsigned int height,
unsigned int nThreads)
1450 demosaicBGGRToRGBaBilinearTpl(bggr, rgba, width, height, nThreads);
1466 unsigned int height,
unsigned int nThreads)
1468 demosaicGBRGToRGBaBilinearTpl(gbrg, rgba, width, height, nThreads);
1484 unsigned int height,
unsigned int nThreads)
1486 demosaicGBRGToRGBaBilinearTpl(gbrg, rgba, width, height, nThreads);
1502 unsigned int height,
unsigned int nThreads)
1504 demosaicGRBGToRGBaBilinearTpl(grbg, rgba, width, height, nThreads);
1520 unsigned int height,
unsigned int nThreads)
1522 demosaicGRBGToRGBaBilinearTpl(grbg, rgba, width, height, nThreads);
1538 unsigned int height,
unsigned int nThreads)
1540 demosaicRGGBToRGBaBilinearTpl(rggb, rgba, width, height, nThreads);
1556 unsigned int height,
unsigned int nThreads)
1558 demosaicRGGBToRGBaBilinearTpl(rggb, rgba, width, height, nThreads);
1576 unsigned int height,
unsigned int nThreads)
1578 demosaicBGGRToRGBaMalvarTpl(bggr, rgba, width, height, nThreads);
1594 unsigned int height,
unsigned int nThreads)
1596 demosaicBGGRToRGBaMalvarTpl(bggr, rgba, width, height, nThreads);
1612 unsigned int height,
unsigned int nThreads)
1614 demosaicGBRGToRGBaMalvarTpl(gbrg, rgba, width, height, nThreads);
1630 unsigned int height,
unsigned int nThreads)
1632 demosaicGBRGToRGBaMalvarTpl(gbrg, rgba, width, height, nThreads);
1648 unsigned int height,
unsigned int nThreads)
1650 demosaicGRBGToRGBaMalvarTpl(grbg, rgba, width, height, nThreads);
1666 unsigned int height,
unsigned int nThreads)
1668 demosaicGRBGToRGBaMalvarTpl(grbg, rgba, width, height, nThreads);
1684 unsigned int height,
unsigned int nThreads)
1686 demosaicRGGBToRGBaMalvarTpl(rggb, rgba, width, height, nThreads);
1702 unsigned int height,
unsigned int nThreads)
1704 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)
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.
unsigned char B
Blue component.
unsigned char R
Red component.
unsigned char G
Green component.
unsigned char A
Additionnal component.