#include <visp3/core/vpConfig.h>
#include <visp3/core/vpFont.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/core/vpTime.h>
#include <visp3/gui/vpDisplayFactory.h>
#include <visp3/io/vpImageIo.h>
#ifdef ENABLE_VISP_NAMESPACE
#endif
int main(int argc, char **argv)
{
#ifdef VISP_HAVE_DISPLAY
if (argc != 2) {
printf("Usage: %s <image name.[pgm,ppm,jpeg,png,tiff,bmp,ras,jp2]>\n", argv[0]);
return EXIT_FAILURE;
}
try {
}
catch (...) {
std::cout << "Cannot read image \"" << argv[1] << "\"" << std::endl;
return EXIT_FAILURE;
}
try {
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
#else
#endif
std::cout << "Right click to quit" << std::endl;
std::cout << "Left click to inspect pixel position (i,j) and RGBa values\n" << std::endl;
bool quit = false;
while (!quit) {
quit = true;
}
else {
std::stringstream ss;
unsigned int i =
static_cast<unsigned int>(ip.
get_i());
unsigned int j =
static_cast<unsigned int>(ip.
get_j());
ss << i << " " << j << ": " << I[i][j];
std::cout << ss.str() << std::endl;
}
}
}
#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
delete pdisp;
#endif
}
std::cout << "Catch an exception: " << e << std::endl;
}
#else
(void)argc;
(void)argv;
std::cout << "No display available!" << std::endl;
#endif
}
static const vpColor white
Class that defines generic functionalities for display.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
static void flush(const vpImage< unsigned char > &I)
unsigned int getDownScalingFactor()
error that can be emitted by ViSP classes.
Font drawing functions for image.
bool drawText(vpImage< unsigned char > &I, const std::string &text, const vpImagePoint &position, unsigned char color) const
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.
VISP_EXPORT void sleepMs(double t)