Test image print.
#include <iostream>
#include <visp3/core/vpImage.h>
int main()
{
#ifdef ENABLE_VISP_NAMESPACE
#endif
unsigned int size = 16;
for (unsigned int i = 0, cpt = 0; i < size; i++) {
for (unsigned int j = 0; j < size; j++, cpt++) {
I_int[i][j] = (int)cpt;
I_uchar[i][j] = (unsigned char)cpt;
I_char[i][j] = (char)cpt;
}
}
size = 5;
for (unsigned int i = 0, cpt = 0; i < size; i++) {
for (unsigned int j = 0; j < size; j++, cpt++) {
I_float[i][j] = (float)sqrt((double)cpt);
I_double[i][j] = sqrt((double)cpt);
I_rgba[i][j] =
vpRGBa((
unsigned char)cpt);
}
}
std::cout << "I_int:\n" << I_int << std::endl;
std::cout << "\nI_uchar:\n" << I_uchar << std::endl;
std::cout << "\nI_char:\n" << I_char << std::endl;
std::cout << "\nI_float:\n" << I_float << std::endl;
std::cout << "\nI_double:\n" << I_double << std::endl;
std::cout << "\nI_rgba:\n" << I_rgba << std::endl;
return EXIT_SUCCESS;
}
Definition of the vpImage class member functions.