2#include <visp3/core/vpConfig.h>
3#include <visp3/core/vpFont.h>
4#include <visp3/core/vpIoTools.h>
5#include <visp3/core/vpTime.h>
7#include <visp3/gui/vpDisplayFactory.h>
10#include <visp3/io/vpImageIo.h>
13#ifdef ENABLE_VISP_NAMESPACE
17int main(
int argc,
char **argv)
19#ifdef VISP_HAVE_DISPLAY
21 printf(
"Usage: %s <image name.[pgm,ppm,jpeg,png,tiff,bmp,ras,jp2]>\n", argv[0]);
34 std::cout <<
"Cannot read image \"" << argv[1] <<
"\"" << std::endl;
41#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
56 std::cout <<
"Right click to quit" << std::endl;
57 std::cout <<
"Left click to inspect pixel position (i,j) and RGBa values\n" << std::endl;
71 unsigned int i =
static_cast<unsigned int>(ip.
get_i());
72 unsigned int j =
static_cast<unsigned int>(ip.
get_j());
73 ss <<
i <<
" " <<
j <<
": " << I[
i][
j];
74 std::cout << ss.str() << std::endl;
84#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
89 std::cout <<
"Catch an exception: " <<
e << std::endl;
94 std::cout <<
"No display available!" << std::endl;
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.
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)