image_display.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_FVWIDGETS_IMAGE_DISPLAY_H_
00025 #define __FIREVISION_FVWIDGETS_IMAGE_DISPLAY_H_
00026
00027 #include <fvutils/color/colorspaces.h>
00028
00029 typedef struct SDL_Surface SDL_Surface;
00030 typedef struct SDL_Overlay SDL_Overlay;
00031 typedef struct SDL_Rect SDL_Rect;
00032
00033 class ImageDisplay
00034 {
00035 public:
00036 ImageDisplay(unsigned int width, unsigned int height, const char* title = 0);
00037 ~ImageDisplay();
00038
00039 void show(colorspace_t colorspace, unsigned char *buffer);
00040 void show(unsigned char *yuv422_planar_buffer);
00041
00042 void process_events(unsigned int max_num_events = 10);
00043 void loop_until_quit();
00044
00045 private:
00046 SDL_Surface *_surface;
00047 SDL_Overlay *_overlay;
00048 SDL_Rect *_rect;
00049
00050 unsigned int _width;
00051 unsigned int _height;
00052 };
00053
00054 #endif