Test image print.
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] = static_cast<int>(cpt);
I_uchar[i][j] = static_cast<char>(cpt);
I_char[i][j] = static_cast<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] = static_cast<float>(sqrt(static_cast<double>(cpt)));
I_double[i][j] = sqrt(static_cast<double>(cpt));
I_rgba[i][j] =
vpRGBa(
static_cast<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.