#include <stdlib.h>
#include <math.h>
#include <imagergba.h>
#include "framewk.h"
#include <iostream.h>
Go to the source code of this file.
Compounds | |
struct | Image |
Anonymous image struct. More... | |
Defines | |
#define | HAVE_GLCOPYTEXSUBIMAGE2D |
Functions | |
void | fwkPostRedisplayNoChange (void) |
Requests a redraw of the displayed image. | |
void | fwkWindowToImageCoordinates (int x, int y, float *ix, float *iy) |
Converts window to image coordinates. | |
void | fwkSetDisplayHotSpot (int x, int y) |
Sets the display hot spot. | |
bool | fwkUpdateRasterPos (void) |
unsigned | nextPowerOfTwo (unsigned x) |
void | fwkRedrawCB (void) |
void | fwkKeyboardCB (unsigned char key, int x, int y) |
void | fwkSpecialCB (int key, int x, int y) |
void | fwkMouseCB (int button, int state, int x, int y) |
void | fwkMotionCB (int x, int y) |
void | fwkPassiveMotionCB (int x, int y) |
void | fwkInit (int *argc, const char *argv[]) |
Initializes the exercise framework. | |
void | fwkMainLoop (void) |
Starts the application main-loop. | |
void | fwkSetDisplayImage (const void *img) |
Sets the currently displayed image. | |
float | fwkGetDisplayZoom (void) |
Gets the current zoom factor. | |
void | fwkSetDisplayZoom (float zoom) |
Sets the current zoom factor. | |
void | fwkPostRedisplay (void) |
Requests a redraw of the displayed image. | |
Variables | |
const Image * | displayImage = NULL |
GLdouble | displayZoom = 1.0 |
GLint | displayHotSpotX = 0 |
GLint | displayHotSpotY = 0 |
GLdouble | displayRasterX = 0 |
GLdouble | displayRasterY = 0 |
bool | displayChanged = true |
int | glutWindowId = -1 |
GLuint | imageTexID = 0 |
unsigned | texWidth = 0 |
unsigned | texHeight = 0 |
GLenum | texId = 0 |
|
Definition at line 66 of file framewk.cpp. |
|
Gets the current zoom factor.
Definition at line 410 of file framewk.cpp. References displayZoom. Referenced by keyboardCB(), and effect::useMenu(). |
|
Initializes the exercise framework. Initializes GLUT and opens a GLUT window. See pgdocFramework for more details.
Definition at line 342 of file framewk.cpp. References fwkKeyboardCB(), fwkMotionCB(), fwkMouseCB(), fwkPassiveMotionCB(), fwkRedrawCB(), fwkSpecialCB(), and glutWindowId. Referenced by main(). |
|
Definition at line 281 of file framewk.cpp. References fwkSetDisplayHotSpot(), fwkWindowToImageCoordinates(), and keyboardCB(). Referenced by fwkInit(). |
|
Starts the application main-loop. (Actually starts the GLUT main-loop.) See pgdocFramework for more details. Definition at line 379 of file framewk.cpp. Referenced by main(). |
|
Definition at line 314 of file framewk.cpp. References fwkSetDisplayHotSpot(), fwkWindowToImageCoordinates(), and motionCB(). Referenced by fwkInit(). |
|
Definition at line 303 of file framewk.cpp. References fwkSetDisplayHotSpot(), fwkWindowToImageCoordinates(), and mouseCB(). Referenced by fwkInit(). |
|
This callback function is called, when the mouse is moved without any mouse button pressed.
Definition at line 325 of file framewk.cpp. References fwkSetDisplayHotSpot(). Referenced by fwkInit(). |
|
Requests a redraw of the displayed image. Call this function if the image content has changed. Subsequent calls to fwkPostRedisplay() are cumulated. See fwUsageImageData for more details. Definition at line 446 of file framewk.cpp. References displayChanged. Referenced by idleCB(). |
|
Requests a redraw of the displayed image. In contrast to fwkPosyRedisplay() this function assumes that the image content did not change. Subsequent calls to fwkPostRedisplayNoChange() are cumulated. See fwUsageImageData for more details. Definition at line 457 of file framewk.cpp. Referenced by fwkSetDisplayHotSpot(), and fwkSetDisplayZoom(). |
|
Definition at line 148 of file framewk.cpp. References Image::bytesPerPixel, Image::data, displayChanged, displayRasterX, displayRasterY, displayZoom, fwkUpdateRasterPos(), Image::height, nextPowerOfTwo(), texHeight, texId, texWidth, and Image::width. Referenced by fwkInit(). |
|
Sets the display hot spot. The current image pixel will be centered around the display hot spot. Definition at line 424 of file framewk.cpp. References displayHotSpotX, displayHotSpotY, fwkPostRedisplayNoChange(), and fwkUpdateRasterPos(). Referenced by fwkKeyboardCB(), fwkMotionCB(), fwkMouseCB(), fwkPassiveMotionCB(), and fwkSpecialCB(). |
|
Sets the currently displayed image. img can be a pointer to an ImageGray or ImageRGBA struct, as well. If img was not displayed before, a fwkPostRedisplay() is implicitly called. See fwUsageImageData for more details.
Definition at line 390 of file framewk.cpp. References glutWindowId. Referenced by scroll::idleAction(), main(), and effect::refreshImage(). |
|
Sets the current zoom factor.
Definition at line 415 of file framewk.cpp. References displayZoom, and fwkPostRedisplayNoChange(). Referenced by keyboardCB(), and effect::useMenu(). |
|
Definition at line 292 of file framewk.cpp. References fwkSetDisplayHotSpot(), fwkWindowToImageCoordinates(), and specialCB(). Referenced by fwkInit(). |
|
Definition at line 68 of file framewk.cpp. References displayHotSpotX, displayHotSpotY, displayRasterX, displayRasterY, displayZoom, Image::height, and Image::width. Referenced by fwkRedrawCB(), and fwkSetDisplayHotSpot(). |
|
Converts window to image coordinates. The origin of the image coordinates is located at the top-left corner of the top-left pixel. The resultung image coordinates are written to *ix and *iy, respectively.
Definition at line 107 of file framewk.cpp. References displayRasterX, displayRasterY, and displayZoom. Referenced by fwkKeyboardCB(), fwkMotionCB(), fwkMouseCB(), and fwkSpecialCB(). |
|
Definition at line 131 of file framewk.cpp. Referenced by fwkRedrawCB(). |
|
Definition at line 42 of file framewk.cpp. Referenced by fwkPostRedisplay(), and fwkRedrawCB(). |
|
Definition at line 36 of file framewk.cpp. Referenced by fwkSetDisplayHotSpot(), and fwkUpdateRasterPos(). |
|
Definition at line 37 of file framewk.cpp. Referenced by fwkSetDisplayHotSpot(), and fwkUpdateRasterPos(). |
|
Definition at line 32 of file framewk.cpp. |
|
Definition at line 39 of file framewk.cpp. Referenced by fwkRedrawCB(), fwkUpdateRasterPos(), and fwkWindowToImageCoordinates(). |
|
Definition at line 40 of file framewk.cpp. Referenced by fwkRedrawCB(), fwkUpdateRasterPos(), and fwkWindowToImageCoordinates(). |
|
Definition at line 34 of file framewk.cpp. Referenced by fwkGetDisplayZoom(), fwkRedrawCB(), fwkSetDisplayZoom(), fwkUpdateRasterPos(), and fwkWindowToImageCoordinates(). |
|
Definition at line 44 of file framewk.cpp. Referenced by fwkInit(), and fwkSetDisplayImage(). |
|
Definition at line 129 of file framewk.cpp. |
|
Definition at line 144 of file framewk.cpp. Referenced by fwkRedrawCB(). |
|
Definition at line 145 of file framewk.cpp. Referenced by fwkRedrawCB(). |
|
Definition at line 143 of file framewk.cpp. Referenced by fwkRedrawCB(). |