MeVisLab Toolbox Reference
View2DIcons Class Reference

Defines and implements a class to store multiple images and draw them via OpenGL. More...

#include <View2DIcons.h>

Public Member Functions

 View2DIcons ()
 Constructor and destructor. More...
 
 ~View2DIcons ()
 
void drawIcon (int idx, float dx1, float dy1, float dx2, float dy2)
 draw the icon at index i More...
 
void drawIconAsBorderImage (int idx, float dx1, float dy1, float dx2, float dy2, float borderWidth, float borderHeight)
 draws the given icon from dx1,dy1 to dx2,dy2 using 3x3 quads (the corners/border regions defined by borderWidth and borderHeight (in texels) are not stretched while the rest of the image is stretched to fill the box) For example usages, google for "css border-image". More...
 
bool addIcon (const char *filename)
 add icon from file More...
 
bool addIcons (const char *filename, int width, int height)
 add icons from file by splitting the file into width x height blocks More...
 
View2DTexturegetIcon (int index)
 get icon at index More...
 
int numIcons ()
 get number of icons More...
 
void removeIcon (int index)
 remove an icon More...
 
void clearIcons ()
 clear all icons More...
 

Detailed Description

Defines and implements a class to store multiple images and draw them via OpenGL.

Defines and implements a class to store multiple images and draw them via OpenGL.

Definition at line 23 of file View2DIcons.h.

Constructor & Destructor Documentation

◆ View2DIcons()

View2DIcons::View2DIcons ( )

Constructor and destructor.

◆ ~View2DIcons()

View2DIcons::~View2DIcons ( )

Member Function Documentation

◆ addIcon()

bool View2DIcons::addIcon ( const char *  filename)

add icon from file

◆ addIcons()

bool View2DIcons::addIcons ( const char *  filename,
int  width,
int  height 
)

add icons from file by splitting the file into width x height blocks

◆ clearIcons()

void View2DIcons::clearIcons ( )

clear all icons

◆ drawIcon()

void View2DIcons::drawIcon ( int  idx,
float  dx1,
float  dy1,
float  dx2,
float  dy2 
)

draw the icon at index i

◆ drawIconAsBorderImage()

void View2DIcons::drawIconAsBorderImage ( int  idx,
float  dx1,
float  dy1,
float  dx2,
float  dy2,
float  borderWidth,
float  borderHeight 
)

draws the given icon from dx1,dy1 to dx2,dy2 using 3x3 quads (the corners/border regions defined by borderWidth and borderHeight (in texels) are not stretched while the rest of the image is stretched to fill the box) For example usages, google for "css border-image".

NOTE: This method only supports textures that are smaller than the maximum GL texture size.

◆ getIcon()

View2DTexture* View2DIcons::getIcon ( int  index)

get icon at index

◆ numIcons()

int View2DIcons::numIcons ( )

get number of icons

◆ removeIcon()

void View2DIcons::removeIcon ( int  index)

remove an icon


The documentation for this class was generated from the following file: