00001 // Copyright (C) 2006-2007 University of Louisiana at Lafayette 00002 // Authors: Christopher Mire, Daro Eghagha 00003 00004 #ifndef CAJUN_BITMAP_WINDOW_H 00005 #define CAJUN_BITMAP_WINDOW_H 00006 00007 #include <string> 00008 #include <GL/glu.h> 00009 00010 #include "data_queue.H" 00011 #include "data_type.H" 00012 00013 #include "world_state.H" 00014 00015 #include "image_interface.H" 00016 00017 namespace cajun 00018 { 00020 class bitmap_window_t 00021 { 00022 public: 00023 static bitmap_window_t * create_window (char const *conf_filename, 00024 char const *vision_file, 00025 world_state_t *ws_); 00026 ~bitmap_window_t (); 00027 void check_new_image (); 00028 void normalKey_callback (int key); 00029 bool check_display (); 00030 void load_BMP (const char *imageFileName); 00031 void display (); 00032 protected: 00033 private: 00035 enum {PPM, BMP, PGM}; 00036 bitmap_window_t (char const *conf_filename, char const *vision_file, 00037 world_state_t *ws_); 00038 bool init_image_loader (const char *filename_); 00039 00041 bool m_display; 00042 00044 image_interface_t *m_image; 00045 00047 image_pixel_t *m_image_pixels; 00048 00050 world_state_t *m_world_state; 00051 00053 int m_width; 00055 int m_height; 00056 00058 std::string m_datafile; 00060 int m_image_num; 00062 double m_image_tstamp; 00064 std::fstream inFile; 00066 image_data_t m_image_data; 00067 00069 static bitmap_window_t * bitmap_window_instance; 00070 }; 00071 }; 00072 #endif