dip::viewer::Window class

Simple GL window

Contents

Derived classes

class dip::viewer::Viewer abstract
A Window for viewing a dip::Image

Functions

void refresh()
Refresh window contents.
void destroy()
Marks the window for destruction.
auto destroyed() const -> bool
Returns whether the window is marked for destruction. more...
auto drawString(char const* string) -> dip::uint
Draw a string onto the window. more...
auto width() const -> int
Returns the window’s width.
auto height() const -> int
Returns the window’s height.
void setPosition(int x, int y)
Set the window’s screen position.
void setSize(int width, int height)
Set the window’s size.
auto manager() -> dip::viewer::Manager* protected
Returns the dip::viewer::Manager that manages this window.
auto id() -> void* protected
Returns the window’s identity.
void title(char const* name) protected
Sets the window’s title. more...
void swap() protected
Swaps display buffers. more...
void requestSize(dip::uint width, dip::uint height) protected
Suggests a window’s size. more...
void release() protected virtual
Release any resources held or referenced by this window.
void draw() protected virtual
Overridable callback that draws the visualization.
void idle() protected virtual
Overridable callback that is called periodically to allow for animation.
void reshape(int , int ) protected virtual
Overridable callback that is called when the window shape is changed.
void visible(int ) protected virtual
Overridable callback that is called when the window visibility changes.
void create() protected virtual
Overridable callback that is called when the window is created.
void close() protected virtual
Overridable callback that is called when the window is closed.
void key(unsigned char k, int x, int y, int mods) protected virtual
Overridable callback that is called when a key is pressed.
void click(int , int , int , int , int ) protected virtual
Overridable callback that is called when a mouse button is clicked.
void motion(int , int ) protected virtual
Overridable callback that is called when the mouse is moved while a button is clicked.
void manager(dip::viewer::Manager* _manager) private
Sets the window’s manager.
void id(void* _id) private
Sets the window’s identity. more...
void resize(int width, int height) private
Sets the window’s size. more...

Function documentation

bool destroyed() const

Returns whether the window is marked for destruction.

This is set either from a callback, or by calling dip::viewer::Window::destroy.

dip::uint drawString(char const* string)

Draw a string onto the window.

Must be called from a callback.

void title(char const* name) protected

Sets the window’s title.

Must be called from a callback.

void swap() protected

Swaps display buffers.

Must be called from a callback.

void requestSize(dip::uint width, dip::uint height) protected

Suggests a window’s size.

Note that this function must be called before the dip::viewer::Window::create callback is called.

void id(void* _id) private

Sets the window’s identity.

This should be called by the window’s manager in order to set a unique identifier that can be used to determine the window context.

void resize(int width, int height) private

Sets the window’s size.

Note that this does not actually resize the window!