• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

cimg_library::CImgDisplay

cimg_library::CImgDisplay Struct Reference

#include <CImg.h>

List of all members.


Detailed Description

This class represents a window which can display CImg images and handles mouse and keyboard events.

Creating a CImgDisplay instance opens a window that can be used to display a CImg<T> image of a CImgList<T> image list inside. When a display is created, associated window events (such as mouse motion, keyboard and window size changes) are handled and can be easily detected by testing specific CImgDisplay data fields. See cimg_displays for a complete tutorial on using the CImgDisplay class.

Definition at line 7016 of file CImg.h.


Public Member Functions

CImgDisplay & assign (const CImgDisplay &disp)
template<typename T>
CImgDisplay & assign (const CImgList< T > &list, const char *title=0, const unsigned int normalization_type=3, const bool fullscreen_flag=false, const bool closed_flag=false)
template<typename T>
CImgDisplay & assign (const CImg< T > &img, const char *title=0, const unsigned int normalization_type=3, const bool fullscreen_flag=false, const bool closed_flag=false)
CImgDisplay & assign (const unsigned int dimw, const unsigned int dimh, const char *title=0, const unsigned int normalization_type=3, const bool fullscreen_flag=false, const bool closed_flag=false)
CImgDisplay & assign ()
 CImgDisplay (const CImgDisplay &disp)
template<typename T>
 CImgDisplay (const CImgList< T > &list, const char *title=0, const unsigned int normalization_type=3, const bool fullscreen_flag=false, const bool closed_flag=false)
template<typename T>
 CImgDisplay (const CImg< T > &img, const char *title=0, const unsigned int normalization_type=3, const bool fullscreen_flag=false, const bool closed_flag=false)
 CImgDisplay (const unsigned int dimw, const unsigned int dimh, const char *title=0, const unsigned int normalization_type=3, const bool fullscreen_flag=false, const bool closed_flag=false)
 CImgDisplay ()
CImgDisplay & close ()
int dimx () const
int dimy () const
template<typename T>
CImgDisplay & display (const CImg< T > &img)
template<typename T>
CImgDisplay & display (const CImgList< T > &list, const char axe='x', const char align='c')
template<typename tp, typename tf>
CImgDisplay & display_object3d (const tp &points, const CImgList< tf > &primitives, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float specular_light=0.2f, const float specular_shine=0.1f, const bool display_axes=true, float *const pose_matrix=0, const float opacity=1.0f)
template<typename tp, typename tf, typename tc>
CImgDisplay & display_object3d (const tp &points, const CImgList< tf > &primitives, const CImgList< tc > &colors, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float specular_light=0.2f, const float specular_shine=0.1f, const bool display_axes=true, float *const pose_matrix=0, const float opacity=1.0f)
template<typename tp, typename tf, typename tc, typename to>
CImgDisplay & display_object3d (const tp &points, const CImgList< tf > &primitives, const CImgList< tc > &colors, const to &opacities, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float specular_light=0.2f, const float specular_shine=0.1f, const bool display_axes=true, float *const pose_matrix=0)
CImgDisplay & flush ()
float frames_per_second ()
CImgDisplay & fullscreen (const bool redraw=true)
CImgDisplay & hide_mouse ()
bool is_empty () const
bool is_key (const unsigned int *const keyseq, const unsigned int N, const bool remove=true)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const unsigned int key4, const unsigned int key5, const unsigned int key6, const unsigned int key7, const unsigned int key8, const unsigned int key9, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const unsigned int key4, const unsigned int key5, const unsigned int key6, const unsigned int key7, const unsigned int key8, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const unsigned int key4, const unsigned int key5, const unsigned int key6, const unsigned int key7, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const unsigned int key4, const unsigned int key5, const unsigned int key6, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const unsigned int key4, const unsigned int key5, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const unsigned int key4, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const unsigned int key3, const bool remove)
bool is_key (const unsigned int key1, const unsigned int key2, const bool remove)
bool is_key (const unsigned int key1, const bool remove)
bool is_key (const bool remove=false)
CImgDisplay & move (const int posx, const int posy)
CImgDisplay & normalscreen (const bool redraw=true)
 operator bool () const
template<typename T>
CImgDisplay & operator<< (const CImgList< T > &list)
template<typename T>
CImgDisplay & operator<< (const CImg< T > &img)
CImgDisplay & operator= (const CImgDisplay &disp)
CImgDisplay & paint ()
template<typename T>
CImgDisplay & render (const CImg< T > &img)
CImgDisplay & resize (const int width, const int height, const bool redraw=true)
CImgDisplay & resize (const bool redraw=true)
CImgDisplay & resize (const CImgDisplay &disp, const bool redraw=true)
template<typename T>
CImgDisplay & resize (const CImg< T > &img, const bool redraw=true)
CImgDisplay & set_mouse (const int posx, const int posy)
CImgDisplay & set_title (const char *format,...)
CImgDisplay & show ()
CImgDisplay & show_mouse ()
template<typename T>
const CImgDisplay & snapshot (CImg< T > &img) const
CImgDisplay & toggle_fullscreen (const bool redraw=true)
void update_iskey (const unsigned int key, const bool pressed=true)
CImgDisplay & wait ()
CImgDisplay & wait (const unsigned int milliseconds)
int window_dimx () const
int window_dimy () const
int window_posx () const
int window_posy () const
 ~CImgDisplay ()

Static Public Member Functions

static unsigned int _fitscreen (const unsigned int dx, const unsigned int dy=1, const unsigned int dz=1, const bool return_last=false)
template<typename t, typename T>
static void _render_resize (const T *ptrs, const unsigned int ws, const unsigned int hs, t *ptrd, const unsigned int wd, const unsigned int hd)
static int screen_dimx ()
static int screen_dimy ()
static void wait (CImgDisplay &disp1, CImgDisplay &disp2, CImgDisplay &disp3, CImgDisplay &disp4)
static void wait (CImgDisplay &disp1, CImgDisplay &disp2, CImgDisplay &disp3)
static void wait (CImgDisplay &disp1, CImgDisplay &disp2)
static void wait (CImgDisplay &disp1)
static void wait_all ()

Public Attributes

volatile unsigned int & button
volatile unsigned int buttons [512]
float fps_fps
unsigned long fps_frames
unsigned long fps_timer
unsigned int height
volatile bool is_closed
volatile bool is_event
bool is_fullscreen
volatile bool is_key0
volatile bool is_key1
volatile bool is_key2
volatile bool is_key3
volatile bool is_key4
volatile bool is_key5
volatile bool is_key6
volatile bool is_key7
volatile bool is_key8
volatile bool is_key9
volatile bool is_keyA
volatile bool is_keyALTGR
volatile bool is_keyAPPLEFT
volatile bool is_keyAPPRIGHT
volatile bool is_keyARROWDOWN
volatile bool is_keyARROWLEFT
volatile bool is_keyARROWRIGHT
volatile bool is_keyARROWUP
volatile bool is_keyB
volatile bool is_keyBACKSPACE
volatile bool is_keyC
volatile bool is_keyCAPSLOCK
volatile bool is_keyCTRLLEFT
volatile bool is_keyCTRLRIGHT
volatile bool is_keyD
volatile bool is_keyDELETE
volatile bool is_keyE
volatile bool is_keyEND
volatile bool is_keyENTER
volatile bool is_keyESC
volatile bool is_keyF
volatile bool is_keyF1
volatile bool is_keyF10
volatile bool is_keyF11
volatile bool is_keyF12
volatile bool is_keyF2
volatile bool is_keyF3
volatile bool is_keyF4
volatile bool is_keyF5
volatile bool is_keyF6
volatile bool is_keyF7
volatile bool is_keyF8
volatile bool is_keyF9
volatile bool is_keyG
volatile bool is_keyH
volatile bool is_keyHOME
volatile bool is_keyI
volatile bool is_keyINSERT
volatile bool is_keyJ
volatile bool is_keyK
volatile bool is_keyL
volatile bool is_keyM
volatile bool is_keyMENU
volatile bool is_keyN
volatile bool is_keyO
volatile bool is_keyP
volatile bool is_keyPAD0
volatile bool is_keyPAD1
volatile bool is_keyPAD2
volatile bool is_keyPAD3
volatile bool is_keyPAD4
volatile bool is_keyPAD5
volatile bool is_keyPAD6
volatile bool is_keyPAD7
volatile bool is_keyPAD8
volatile bool is_keyPAD9
volatile bool is_keyPADADD
volatile bool is_keyPADDIV
volatile bool is_keyPADMUL
volatile bool is_keyPADSUB
volatile bool is_keyPAGEDOWN
volatile bool is_keyPAGEUP
volatile bool is_keyPAUSE
volatile bool is_keyQ
volatile bool is_keyR
volatile bool is_keyS
volatile bool is_keySHIFTLEFT
volatile bool is_keySHIFTRIGHT
volatile bool is_keySPACE
volatile bool is_keyT
volatile bool is_keyTAB
volatile bool is_keyU
volatile bool is_keyV
volatile bool is_keyW
volatile bool is_keyX
volatile bool is_keyY
volatile bool is_keyZ
volatile bool is_moved
volatile bool is_resized
volatile unsigned int & key
volatile unsigned int keys [512]
float max
float min
volatile int mouse_x
volatile int mouse_y
unsigned int normalization
volatile unsigned int & released_key
volatile unsigned int released_keys [512]
unsigned long timer
char * title
volatile int wheel
unsigned int width
volatile unsigned int window_height
volatile unsigned int window_width
volatile int window_x
volatile int window_y

Constructor & Destructor Documentation

cimg_library::CImgDisplay::CImgDisplay (  )  [inline]

Create an empty display window.

Definition at line 7199 of file CImg.h.

cimg_library::CImgDisplay::CImgDisplay ( const unsigned int  dimw,
const unsigned int  dimh,
const char *  title = 0,
const unsigned int  normalization_type = 3,
const bool  fullscreen_flag = false,
const bool  closed_flag = false 
) [inline]

Create a display window with a specified size pwidth x height.

Parameters:
dimw Width of the display window.
dimh Height of the display window.
title Title of the display window.
normalization_type Normalization type of the display window (0=none, 1=always, 2=once).
fullscreen_flag : Fullscreen mode.
closed_flag : Initially visible mode. A black image will be initially displayed in the display window.

Definition at line 7215 of file CImg.h.

template<typename T>
cimg_library::CImgDisplay::CImgDisplay ( const CImg< T > &  img,
const char *  title = 0,
const unsigned int  normalization_type = 3,
const bool  fullscreen_flag = false,
const bool  closed_flag = false 
) [inline]

Create a display window from an image.

Parameters:
img : Image that will be used to create the display window.
title : Title of the display window
normalization_type : Normalization type of the display window.
fullscreen_flag : Fullscreen mode.
closed_flag : Initially visible mode.

Definition at line 7234 of file CImg.h.

template<typename T>
cimg_library::CImgDisplay::CImgDisplay ( const CImgList< T > &  list,
const char *  title = 0,
const unsigned int  normalization_type = 3,
const bool  fullscreen_flag = false,
const bool  closed_flag = false 
) [inline]

Create a display window from an image list.

Parameters:
list : The list of images to display.
title : Title of the display window
normalization_type : Normalization type of the display window.
fullscreen_flag : Fullscreen mode.
closed_flag : Initially visible mode.

Definition at line 7252 of file CImg.h.

cimg_library::CImgDisplay::CImgDisplay ( const CImgDisplay &  disp  )  [inline]

Create a display window by copying another one.

Parameters:
disp : Display window to copy.

Definition at line 7266 of file CImg.h.

cimg_library::CImgDisplay::~CImgDisplay (  )  [inline]

Destructor.

Definition at line 7275 of file CImg.h.


Member Function Documentation

static unsigned int cimg_library::CImgDisplay::_fitscreen ( const unsigned int  dx,
const unsigned int  dy = 1,
const unsigned int  dz = 1,
const bool  return_last = false 
) [inline, static]

Definition at line 7642 of file CImg.h.

template<typename t, typename T>
static void cimg_library::CImgDisplay::_render_resize ( const T *  ptrs,
const unsigned int  ws,
const unsigned int  hs,
t *  ptrd,
const unsigned int  wd,
const unsigned int  hd 
) [inline, static]

Definition at line 7478 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::assign ( const CImgDisplay &  disp  )  [inline]

In-place version of the previous constructor.

Definition at line 7706 of file CImg.h.

template<typename T>
CImgDisplay& cimg_library::CImgDisplay::assign ( const CImgList< T > &  list,
const char *  title = 0,
const unsigned int  normalization_type = 3,
const bool  fullscreen_flag = false,
const bool  closed_flag = false 
) [inline]

In-place version of the previous constructor.

Definition at line 7698 of file CImg.h.

template<typename T>
CImgDisplay& cimg_library::CImgDisplay::assign ( const CImg< T > &  img,
const char *  title = 0,
const unsigned int  normalization_type = 3,
const bool  fullscreen_flag = false,
const bool  closed_flag = false 
) [inline]

In-place version of the previous constructor.

Definition at line 7690 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::assign ( const unsigned int  dimw,
const unsigned int  dimh,
const char *  title = 0,
const unsigned int  normalization_type = 3,
const bool  fullscreen_flag = false,
const bool  closed_flag = false 
) [inline]

In-place version of the previous constructor.

Definition at line 7681 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::assign (  )  [inline]

In-place version of the destructor.

Definition at line 7676 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::close (  )  [inline]

Close a visible display.

Definition at line 7728 of file CImg.h.

int cimg_library::CImgDisplay::dimx (  )  const [inline]

Return display width.

Definition at line 7295 of file CImg.h.

int cimg_library::CImgDisplay::dimy (  )  const [inline]

Return display height.

Definition at line 7300 of file CImg.h.

template<typename T>
CImgDisplay& cimg_library::CImgDisplay::display ( const CImg< T > &  img  )  [inline]

Display an image in a window.

Definition at line 7761 of file CImg.h.

template<typename T>
CImgDisplay& cimg_library::CImgDisplay::display ( const CImgList< T > &  list,
const char  axe = 'x',
const char  align = 'c' 
) [inline]

Display an image list CImgList<T> into a display window.

First, all images of the list are appended into a single image used for visualization, then this image is displayed in the current display window.

Parameters:
list : The list of images to display.
axe : The axe used to append the image for visualization. Can be 'x' (default),'y','z' or 'v'.
align : Defines the relative alignment of images when displaying images of different sizes. Can be 'c' (centered, which is the default), 'p' (top alignment) and 'n' (bottom aligment).

Definition at line 7381 of file CImg.h.

template<typename tp, typename tf>
CImgDisplay& cimg_library::CImgDisplay::display_object3d ( const tp &  points,
const CImgList< tf > &  primitives,
const bool  centering = true,
const int  render_static = 4,
const int  render_motion = 1,
const bool  double_sided = false,
const float  focale = 500.0f,
const float  specular_light = 0.2f,
const float  specular_shine = 0.1f,
const bool  display_axes = true,
float *const   pose_matrix = 0,
const float  opacity = 1.0f 
) [inline]

Display a 3D object.

Definition at line 7450 of file CImg.h.

template<typename tp, typename tf, typename tc>
CImgDisplay& cimg_library::CImgDisplay::display_object3d ( const tp &  points,
const CImgList< tf > &  primitives,
const CImgList< tc > &  colors,
const bool  centering = true,
const int  render_static = 4,
const int  render_motion = 1,
const bool  double_sided = false,
const float  focale = 500.0f,
const float  specular_light = 0.2f,
const float  specular_shine = 0.1f,
const bool  display_axes = true,
float *const   pose_matrix = 0,
const float  opacity = 1.0f 
) [inline]

Display a 3D object.

Definition at line 7433 of file CImg.h.

template<typename tp, typename tf, typename tc, typename to>
CImgDisplay& cimg_library::CImgDisplay::display_object3d ( const tp &  points,
const CImgList< tf > &  primitives,
const CImgList< tc > &  colors,
const to &  opacities,
const bool  centering = true,
const int  render_static = 4,
const int  render_motion = 1,
const bool  double_sided = false,
const float  focale = 500.0f,
const float  specular_light = 0.2f,
const float  specular_shine = 0.1f,
const bool  display_axes = true,
float *const   pose_matrix = 0 
) [inline]

Display a 3d object.

Definition at line 7417 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::flush (  )  [inline]

Clear all events of the current display.

Definition at line 7501 of file CImg.h.

float cimg_library::CImgDisplay::frames_per_second (  )  [inline]

Return the frame per second rate.

Definition at line 7361 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::fullscreen ( const bool  redraw = true  )  [inline]

Set fullscreen mode.

Definition at line 7466 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::hide_mouse (  )  [inline]

Hide mouse pointer.

Definition at line 7744 of file CImg.h.

bool cimg_library::CImgDisplay::is_empty (  )  const [inline]

Return true is display is empty.

Definition at line 7285 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int *const   keyseq,
const unsigned int  N,
const bool  remove = true 
) [inline]

Test if a key sequence has been typed.

Definition at line 7622 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const unsigned int  key4,
const unsigned int  key5,
const unsigned int  key6,
const unsigned int  key7,
const unsigned int  key8,
const unsigned int  key9,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7614 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const unsigned int  key4,
const unsigned int  key5,
const unsigned int  key6,
const unsigned int  key7,
const unsigned int  key8,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7606 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const unsigned int  key4,
const unsigned int  key5,
const unsigned int  key6,
const unsigned int  key7,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7598 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const unsigned int  key4,
const unsigned int  key5,
const unsigned int  key6,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7591 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const unsigned int  key4,
const unsigned int  key5,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7584 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const unsigned int  key4,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7577 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const unsigned int  key3,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7571 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const unsigned int  key2,
const bool  remove 
) [inline]

Test if a key sequence has been typed.

Definition at line 7565 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const unsigned int  key1,
const bool  remove 
) [inline]

Test if a key has been pressed.

Definition at line 7559 of file CImg.h.

bool cimg_library::CImgDisplay::is_key ( const bool  remove = false  )  [inline]

Test if any key has been pressed.

Definition at line 7553 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::move ( const int  posx,
const int  posy 
) [inline]

Move window.

Definition at line 7733 of file CImg.h.

CImgDisplay& cimg_library::CImgDisplay::normalscreen ( const bool  redraw = true  )  [inline]

Set normal screen mode.

Definition at line 7472 of file CImg.h.

cimg_library::CImgDisplay::operator bool (  )&