Main Page | Modules | Class List | File List | Class Members | File Members

Display Images using OpenGL
[Image Package]


Classes

struct  DisplayAssoc
struct  OpenGLTextureStruct
 Structure holding information on OpenGL textures. More...
struct  _Gan_GLExt_Function_Pointers
 Structure to hold ARB OpenGL extension function pointers. More...

Defines

#define QUIT   99
#define GL_GLEXT_PROTOTYPES   1
#define LARGEST_TEXTURE_TILE_SIZE   256
#define gan_texGetProcAddress(name)   (*glXGetProcAddressARB)(name)

Typedefs

typedef OpenGLTextureStruct Gan_OpenGLTextureStruct
 Structure holding information on OpenGL textures.
typedef _Gan_GLExt_Function_Pointers Gan_GLExt_Function_Pointers
 Structure to hold ARB OpenGL extension function pointers.

Functions

Gan_Bool gan_image_display (const Gan_Image *img)
 Displays an image using OpenGL.
Gan_Bool gan_display_new_window (int height, int width, double zoom, char *name, int offset_r, int offset_c, int *window_id)
 Creates an OpenGL display window.
Gan_Bool gan_display_new_window_array (int rows, int cols, int height, int width, double zoom, char *name, int offset_r, int offset_c, int *window_id, int **subwindow_id)
 Creates an OpenGL display window with subwindows.
void gan_image_display_free_windows (void)
 Frees image display stuff.
Gan_Bool gan_image_display_new_window (const Gan_Image *img, double zoom, char *name, int offset_r, int offset_c, int *window_idp)
 Displays an image using OpenGL.
void gan_initialise_glext_func_ptrs (Gan_GLExt_Function_Pointers *pExtFnPtrs)
 Initialise OpenGL extension function pointer structure.
int gan_check_glext_func_ptrs ()
 Return status of OpenGL extension function pointer structure, non-zero is error.
Gan_Bool gan_build_openGL_textures_for_image (Gan_Image *pgiImage, Gan_OpenGLTextureStruct *pOGLTexStruct)
 Build a set of OpenGL texture tiles for an image.
void gan_free_openGL_textures_for_image (Gan_OpenGLTextureStruct *pOGLTexStruct)
 Free OpenGL texture tiles for an image.
Gan_Bool gan_render_openGL_textures_for_image (Gan_OpenGLTextureStruct *pOGLTexStruct)
 Render OpenGL texture tiles for an image.

Variables

Gan_Listlist = NULL

Function Documentation

Gan_Bool gan_build_openGL_textures_for_image Gan_Image image,
Gan_OpenGLTextureStruct pOGLTexStruct
 

Build a set of OpenGL texture tiles for an image.

Returns:
GAN_TRUE on success, or GAN_FALSE on failure.

Gan_Bool gan_display_new_window int  height,
int  width,
double  zoom,
char *  name,
int  offset_r,
int  offset_c,
int *  window_id
 

Creates an OpenGL display window.

Parameters:
height The height images/graphics to be shown in the window
width The width of images/graphics to be shown in the window
zoom Zoom factor for image/graphics in the window
name A name for the window
offset_r Vertical offset of window from corner of screen
offset_c Horizontal offset of window from corner of screen
window_id Pointer to the OpenGL display window ID
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Creates a new OpenGL window, with the given dimensions, zoom factor, name and screen offsets. Upon success, the ID of the new OpenGL window is passed back in the window_id pointer.

See also:
gan_display_new_window_array().

Gan_Bool gan_display_new_window_array int  rows,
int  cols,
int  height,
int  width,
double  zoom,
char *  name,
int  offset_r,
int  offset_c,
int *  window_id,
int **  subwindow_id
 

Creates an OpenGL display window with subwindows.

Parameters:
rows Number of subwindows in window vertically
cols Number of subwindows in window horizontally
height The height images/graphics to be shown in the window
width The width of images/graphics to be shown in the window
zoom Zoom factor for image/graphics in the window
name A name for the window
offset_r Vertical offset of window from corner of screen
offset_c Horizontal offset of window from corner of screen
window_id Pointer to the main OpenGL display window ID
subwindow_id Pointer to the array of OpenGL subwindow IDs
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Creates a new OpenGL window with the given name and screen offsets, and containing subwindows, each with the given dimensions and zoom factor, in an array of rows by cols subwindows. Upon success, the ID of the main OpenGL window created is passed back in the window_id pointer, and an array of rows by cols OpenGL subwindow IDs is passed back in subwindow_id. (*subwindow_id)[0], (*subwindow_id)[cols-1], (*subwindow_id)[rows*(cols-1)] and (*subwindow_id)[rows*cols-1] are the IDs for the top-left, top-right, bottom-left and bottom-right subwindows respectively. The subwindow_id array is dynamically allocated using malloc().

See also:
gan_display_new_window().

Gan_Bool gan_image_display const Gan_Image img  ) 
 

Displays an image using OpenGL.

Parameters:
img The image to display
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Displays an image on the screen using the OpenGL function glDrawPixels(). Assumes that the graphics window has already been set up in a way similar to the procedure in gan_image_display_new_window().

See also:
gan_image_display_new_window().

void gan_image_display_free_windows void   ) 
 

Frees image display stuff.

Returns:
No value.
Call this function to free stored display images created by calls to gan_image_display_new_window(), just prior to exiting the program.

See also:
gan_image_display_new_window().

Gan_Bool gan_image_display_new_window const Gan_Image img,
double  zoom,
char *  name,
int  offset_r,
int  offset_c,
int *  window_id
 

Displays an image using OpenGL.

Parameters:
img The image to display
zoom Zoom factor
name A name for the window
offset_r Vertical offset of window from corner of screen
offset_c Horizontal offset of window from corner of screen
window_idp Pointer to the OpenGL display window ID
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Creates a new OpenGL window, with the given screen offset and zoom factor, and displays the provided image in the window. The image is copied, so this is not memory-efficient. Upon success, the ID of the new OpenGL window is passed back in the window_id pointer.

See also:
gan_image_display().


Generated on Fri Mar 17 12:45:01 2006 by  doxygen 1.3.9.1