Visual Servoing Platform  version 3.6.1 under development (2024-09-07)
vpDisplayFactory Namespace Reference

Namespaces

 impl
 

Functions

vpDisplayallocateDisplay ()
 
template<typename T >
vpDisplayallocateDisplay (vpImage< T > &I, const int winx=-1, const int winy=-1, const std::string &title="", const vpDisplay::vpScaleType &scaleType=vpDisplay::SCALE_DEFAULT)
 
std::shared_ptr< vpDisplaycreateDisplay ()
 
template<typename T >
std::shared_ptr< vpDisplaycreateDisplay (vpImage< T > &I, const int winx=-1, const int winy=-1, const std::string &title="", const vpDisplay::vpScaleType &scaleType=vpDisplay::SCALE_DEFAULT)
 
template<typename... Args>
std::vector< std::shared_ptr< vpDisplay > > makeDisplayGrid (unsigned int rows, unsigned int cols, unsigned int startX, unsigned int startY, unsigned int paddingX, unsigned int paddingY, Args &... args)
 

Function Documentation

◆ allocateDisplay() [1/2]

vpDisplay* vpDisplayFactory::allocateDisplay ( )

Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.

Returns
A newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.
Examples
mbot-apriltag-ibvs.cpp, mbot-apriltag-pbvs.cpp, tutorial-draw-circle.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-v4l2-threaded.cpp, tutorial-video-reader.cpp, and tutorial-video-recorder.cpp.

Definition at line 63 of file vpDisplayFactory.h.

◆ allocateDisplay() [2/2]

template<typename T >
vpDisplay* vpDisplayFactory::allocateDisplay ( vpImage< T > &  I,
const int  winx = -1,
const int  winy = -1,
const std::string &  title = "",
const vpDisplay::vpScaleType scaleType = vpDisplay::SCALE_DEFAULT 
)

Return a newly allocated vpDisplay specialization initialized with I if a GUI library is available or nullptr otherwise.

Template Parameters
T: Any type that an image can handle and that can be displayed.
Parameters
[in]I: The image the display must be initialized with.
[in]winx: The horizontal position of the display on the screen.
[in]winy: The vertical position of the display on the screen.
[in]title: The title of the display.
[in]scaleType: If this parameter is set to:
Returns
A newly allocated vpDisplay specialization initialized with I if a GUI library is available or nullptr otherwise.
Warning
The user must free the memory when the display is not used anymore.

Definition at line 104 of file vpDisplayFactory.h.

◆ createDisplay() [1/2]

std::shared_ptr<vpDisplay> vpDisplayFactory::createDisplay ( )

Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.

Returns
A smart pointer pointing to a vpDisplay specialization if a GUI library is available or nullptr otherwise.
Examples
pf-nonlinear-example.cpp.

Definition at line 137 of file vpDisplayFactory.h.

Referenced by vpDisplayFactory::impl::makeDisplayGridHelper().

◆ createDisplay() [2/2]

template<typename T >
std::shared_ptr<vpDisplay> vpDisplayFactory::createDisplay ( vpImage< T > &  I,
const int  winx = -1,
const int  winy = -1,
const std::string &  title = "",
const vpDisplay::vpScaleType scaleType = vpDisplay::SCALE_DEFAULT 
)

Return a smart pointer vpDisplay specialization initialized with I if a GUI library is available or nullptr otherwise.

Template Parameters
T: Any type that an image can handle and that can be displayed.
Parameters
[in]I: The image the display must be initialized with.
[in]winx: The horizontal position of the display on the screen.
[in]winy: The vertical position of the display on the screen.
[in]title: The title of the display.
[in]scaleType: If this parameter is set to:
Returns
A smart pointer pointing to a vpDisplay specialization initialized with I if a GUI library is available or nullptr otherwise.

Definition at line 177 of file vpDisplayFactory.h.

◆ makeDisplayGrid()

template<typename... Args>
std::vector<std::shared_ptr<vpDisplay> > vpDisplayFactory::makeDisplayGrid ( unsigned int  rows,
unsigned int  cols,
unsigned int  startX,
unsigned int  startY,
unsigned int  paddingX,
unsigned int  paddingY,
Args &...  args 
)

Create a grid of displays, given a set of images. All the displays will be initialized in the correct location with the content of the associated image and name. All the images should have been initialized before with the correct resolution. The display creation and image association will follow a row major order.

Template Parameters
ArgsA sequence of display name (const std::string&) and ViSP image. The name should always come before the image. The image can be vpImage<unsigned char> or vpImage<vpRGBa>
Parameters
rowsNumber of rows in the grid
colsNumber of columns in the grid
startXThe starting left position of the grid
startYThe starting top localization of the grid
paddingXHorizontal padding between windows
paddingYVertical padding between windows
argsThe name => image => name sequence
Returns
std::vector<std::shared_ptr<vpDisplay>> The allocated displays.
Exceptions
Ifthe grid dimensions and number of images do not match

Definition at line 279 of file vpDisplayFactory.h.

References vpDisplayFactory::impl::GridSettings::cols, vpDisplayFactory::impl::GridSettings::paddingX, vpDisplayFactory::impl::GridSettings::paddingY, vpDisplayFactory::impl::GridSettings::rows, vpDisplayFactory::impl::GridSettings::startX, and vpDisplayFactory::impl::GridSettings::startY.