Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
GLImageWidget Class Reference

displays a color image (ColorImageRGB8) using OpenGL More...

#include <GLImageWidget.h>

List of all members.

Public Slots

void addVectorObject (VectorObject2D vectorObject)
 Adds a free form given by it's corner coordinates.
void clearForms ()
 Clear the list of painted boxes.
void saveImage (std::string filename)
void setAnaglyphImage (const puma2::GrayLevelImage8 *leftYImage, const puma2::GrayLevelImage8 *rightYImage, float aspect=1.0)
void setColorImage (const unsigned char *image, unsigned width, unsigned height, float aspect=1.0)
 Update the contents of the OpenGL Texture, clear the box list and render the image.
void setColorImage (const puma2::ColorImageRGB8 *image, float aspect=1.0)
void setColorImage (const puma2::GrayLevelImage8 *imageY, const puma2::ColorImageUV8 *imageUV, float aspect=1.0)
void setGrayLevelImage (const puma2::GrayLevelImage8 *image, float aspect=1.0)
void setPixelAspectRatio (float ratio)
 Set the pixel aspect ratio (width/height)
void setThermalImage (const puma2::GrayLevelImage8 *image, float roomTemp=30.0)
void zoom (float z)
 zoom into current shown image

Public Member Functions

 GLImageWidget (QGLWidget *parent=0)
 ~GLImageWidget ()

Protected Member Functions

void clearTexture ()
void initTexture (unsigned resolution, unsigned imageWidth, unsigned imageHeight, ImageGrabber::ColorFormat textureFormat)
void updateTexture (unsigned char *imageData, unsigned width, unsigned height, ImageGrabber::ColorFormat format)

Protected Attributes

unsigned m_ImageHeight
unsigned m_ImageWidth
QPoint m_MousePosOld
float m_PixelAspectRatio
float m_PosX
float m_PosY
unsigned int m_TextureByteSize
unsigned char * m_TextureData
ImageGrabber::ColorFormat m_TextureFormat
GLuint m_TextureId
unsigned m_TextureResolution
std::list< VectorObject2Dm_VectorObjects
unsigned m_ViewportHeight
unsigned m_ViewportWidth
float m_Zoom

Private Member Functions

int calcTextureSize (int width, int height)
void initializeGL ()
 set up OpenGL
void mouseDoubleClickEvent (QMouseEvent *event)
 resets the display
void mouseMoveEvent (QMouseEvent *event)
 if mouse button is pressed, move images
void mousePressEvent (QMouseEvent *event)
 called when a mouse button is pressed
void paintGL ()
 render image
void paintImage ()
 generate & display texture
void paintVectorObjects ()
 paint all registered boxes / lines / circles
void resizeGL (int w, int h)
 called when the window size changes
void wheelEvent (QWheelEvent *event)
 used to zoom the image

Detailed Description

displays a color image (ColorImageRGB8) using OpenGL

Author:
Unknown, David Gossow (RX)

Definition at line 32 of file GLImageWidget.h.


Constructor & Destructor Documentation

GLImageWidget::GLImageWidget ( QGLWidget *  parent = 0)

Member Function Documentation

void GLImageWidget::addVectorObject ( VectorObject2D  vectorObject) [slot]

Adds a free form given by it's corner coordinates.

int GLImageWidget::calcTextureSize ( int  width,
int  height 
) [private]
void GLImageWidget::clearForms ( ) [slot]

Clear the list of painted boxes.

void GLImageWidget::clearTexture ( ) [protected]
void GLImageWidget::initializeGL ( ) [private]

set up OpenGL

void GLImageWidget::initTexture ( unsigned  resolution,
unsigned  imageWidth,
unsigned  imageHeight,
ImageGrabber::ColorFormat  textureFormat 
) [protected]
void GLImageWidget::mouseDoubleClickEvent ( QMouseEvent *  event) [private]

resets the display

void GLImageWidget::mouseMoveEvent ( QMouseEvent *  event) [private]

if mouse button is pressed, move images

void GLImageWidget::mousePressEvent ( QMouseEvent *  event) [private]

called when a mouse button is pressed

void GLImageWidget::paintGL ( ) [private]

render image

void GLImageWidget::paintImage ( ) [private]

generate & display texture

paint all registered boxes / lines / circles

void GLImageWidget::resizeGL ( int  w,
int  h 
) [private]

called when the window size changes

void GLImageWidget::saveImage ( std::string  filename) [slot]
void GLImageWidget::setAnaglyphImage ( const puma2::GrayLevelImage8 leftYImage,
const puma2::GrayLevelImage8 rightYImage,
float  aspect = 1.0 
) [slot]
void GLImageWidget::setColorImage ( const unsigned char *  image,
unsigned  width,
unsigned  height,
float  aspect = 1.0 
) [slot]

Update the contents of the OpenGL Texture, clear the box list and render the image.

void GLImageWidget::setColorImage ( const puma2::ColorImageRGB8 image,
float  aspect = 1.0 
) [slot]
void GLImageWidget::setColorImage ( const puma2::GrayLevelImage8 imageY,
const puma2::ColorImageUV8 imageUV,
float  aspect = 1.0 
) [slot]
void GLImageWidget::setGrayLevelImage ( const puma2::GrayLevelImage8 image,
float  aspect = 1.0 
) [slot]
void GLImageWidget::setPixelAspectRatio ( float  ratio) [inline, slot]

Set the pixel aspect ratio (width/height)

Note:
Default value is 1.0 (quadratic pixels)
Values above 1 will display pixels horizontally stretched

Definition at line 55 of file GLImageWidget.h.

void GLImageWidget::setThermalImage ( const puma2::GrayLevelImage8 image,
float  roomTemp = 30.0 
) [slot]
void GLImageWidget::updateTexture ( unsigned char *  imageData,
unsigned  width,
unsigned  height,
ImageGrabber::ColorFormat  format 
) [protected]
void GLImageWidget::wheelEvent ( QWheelEvent *  event) [private]

used to zoom the image

void GLImageWidget::zoom ( float  z) [slot]

zoom into current shown image


Member Data Documentation

unsigned GLImageWidget::m_ImageHeight [protected]

Definition at line 119 of file GLImageWidget.h.

unsigned GLImageWidget::m_ImageWidth [protected]

Definition at line 118 of file GLImageWidget.h.

QPoint GLImageWidget::m_MousePosOld [protected]

Definition at line 112 of file GLImageWidget.h.

Definition at line 124 of file GLImageWidget.h.

float GLImageWidget::m_PosX [protected]

Definition at line 115 of file GLImageWidget.h.

float GLImageWidget::m_PosY [protected]

Definition at line 116 of file GLImageWidget.h.

unsigned int GLImageWidget::m_TextureByteSize [protected]

Definition at line 132 of file GLImageWidget.h.

unsigned char* GLImageWidget::m_TextureData [protected]

Definition at line 130 of file GLImageWidget.h.

Definition at line 131 of file GLImageWidget.h.

GLuint GLImageWidget::m_TextureId [protected]

Definition at line 129 of file GLImageWidget.h.

unsigned GLImageWidget::m_TextureResolution [protected]
Note:
the texture resolution is the next larger potency of 2 that the image fits into

Definition at line 127 of file GLImageWidget.h.

Definition at line 134 of file GLImageWidget.h.

unsigned GLImageWidget::m_ViewportHeight [protected]

Definition at line 122 of file GLImageWidget.h.

unsigned GLImageWidget::m_ViewportWidth [protected]

Definition at line 121 of file GLImageWidget.h.

float GLImageWidget::m_Zoom [protected]

Definition at line 114 of file GLImageWidget.h.


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


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43