Fawkes API Fawkes Development Version
image_display.h
1
2/***************************************************************************
3 * image_display.h - widget to display an image based on SDL
4 *
5 * Created: Mon Nov 05 13:49:20 2007
6 * Copyright 2007 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _FIREVISION_FVWIDGETS_IMAGE_DISPLAY_H_
25#define _FIREVISION_FVWIDGETS_IMAGE_DISPLAY_H_
26
27#include <fvutils/color/colorspaces.h>
28
29typedef struct SDL_Surface SDL_Surface;
30typedef struct SDL_Overlay SDL_Overlay;
31typedef struct SDL_Rect SDL_Rect;
32
33namespace firevision {
34
36{
37public:
38 ImageDisplay(unsigned int width, unsigned int height, const char *title = 0);
40
41 void show(colorspace_t colorspace, unsigned char *buffer);
42 void show(unsigned char *yuv422_planar_buffer);
43
44 void process_events(unsigned int max_num_events = 10);
45 void loop_until_quit();
46
47private:
48 SDL_Surface *_surface;
49 SDL_Overlay *_overlay;
50 SDL_Rect * _rect;
51
52 unsigned int _width;
53 unsigned int _height;
54};
55
56} // end namespace firevision
57
58#endif
Simple image display.
Definition: image_display.h:36
ImageDisplay(unsigned int width, unsigned int height, const char *title=0)
Constructor.
void loop_until_quit()
Process SDL events until quit.
void show(colorspace_t colorspace, unsigned char *buffer)
Show image from given colorspace.
void process_events(unsigned int max_num_events=10)
Process a few SDL events.