source: trunk/packages/vizservers/nanovis/ScreenSnapper.h @ 1703

Last change on this file since 1703 was 1510, checked in by gah, 15 years ago

Found memory leak in reset_patterns

File size: 1.4 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 * ScreenSnapper.h: ScreenSnapper class. It captures the render result
4 *                      and stores it in an array of chars or floats
5 *                      depending on chosen format.
6 *
7 * ======================================================================
8 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
9 *           Purdue Rendering and Perceptualization Lab (PURPL)
10 *
11 *  Copyright (c) 2004-2006  Purdue Research Foundation
12 *
13 *  See the file "license.terms" for information on usage and
14 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 * ======================================================================
16 */
17
18#ifndef _SCREEN_SNAPPER_H_
19#define _SCREEN_SNAPPER_H_
20
21#include "define.h"
22#include <GL/gl.h>
23#include <stdio.h>
24
25
26class ScreenSnapper
27{
28public:
29        int width, height;      //size of the screen
30        GLuint data_type;       //data type: GL_FLOAT or GL_UNSIGNED_BYTE
31        int n_channels_per_pixel; //RGB(3) or RGBA(4)
32       
33        void* data;  //storage array for the captured image. This array is "flat".
34                //It stores pixels in the order from lower-left corner to upper-right corner.
35                //[rgb][rgb][rgb]... or [rgba][rgba][rgba]...
36
37        ScreenSnapper(int width, int height, GLuint type, int channel_per_pixel);
38        ~ScreenSnapper();
39
40        void reset(char c);     //set every byte in the data array to c
41        void capture();
42        void print();
43};
44
45#endif
Note: See TracBrowser for help on using the repository browser.