class
#include <diplib/viewer/image.h>
ImageViewer Non-interactive 2D RGB image viewer.
Contents
Base classes
- class Viewer
- A Window for viewing a
dip::
Image
Public functions
- auto options() -> ViewingOptions& override
- Returns the
Viewer
's model. -
auto image() -> const dip::
Image& override - Returns the
dip::
being visualized, converted to real valued.Image -
auto original() -> const dip::
Image& override - Returns the
dip::
being visualized.Image -
void setImage(const dip::
Image& image) override - Sets the image to be visualized.
Public static functions
-
static auto Create(const dip::
Image& image, std::string name = "ImageViewer", size_t width = 0, size_t height = 0) -> Ptr - Construct a new ImageViewer.
Protected functions
Function documentation
ViewingOptions& dip:: viewer:: ImageViewer:: options() override
Returns the Viewer
's model.
Only call or change this under lock.
Example usage:
{ dip::viewer::Viewer::Guard(*viewer); viewer->options().mapping_range_.first = 0; }
const dip:: Image& dip:: viewer:: ImageViewer:: image() override
Returns the dip::
being visualized, converted to real valued.
Only call this under lock.
Example usage:
{ dip::viewer::Viewer::Guard(*viewer); dip::Image image = viewer->image(); }
const dip:: Image& dip:: viewer:: ImageViewer:: original() override
Returns the dip::
being visualized.
Only call this under lock.
Example usage:
{ dip::viewer::Viewer::Guard(*viewer); dip::Image image = viewer->original(); }
void dip:: viewer:: ImageViewer:: setImage(const dip:: Image& image) override
Sets the image to be visualized.
Only call this under lock.
Example usage:
{ dip::viewer::Viewer::Guard(*viewer); viewer->setImage(image); }
static Ptr dip:: viewer:: ImageViewer:: Create(const dip:: Image& image,
std::string name = "ImageViewer",
size_t width = 0,
size_t height = 0)
Construct a new ImageViewer.
As the constructor is protected, this is the only way to create an ImageViewer. Note that the ImageViewer only supports 8-bit 2D RGB images.
If either width
or height
is 0, it is computed from the other value so as to preserve the image's aspect ratio. If both are zero, the image is displayed in its natural size (one image pixel to one screen pixel) but scaled down if otherwise the window would exceed 512 pixels along either dimension.
Example usage:
manager.createWindow( dip::viewer::ImageViewer::Create( image ));