egami
C++ Image Processing program
/homes/esi30/DCS339/coursework/src/Processes/info.cpp
Go to the documentation of this file.
00001 #include <string>
00002 #include <sstream>
00003 
00004 #include <gtkmm/image.h>
00005 
00006 #include "../display_unit.hpp"
00007 #include "../processing_page.hpp"
00008 #include "../processing_unit.hpp"
00009 #include "../utils.hpp"
00010 
00011 namespace{
00012     Display_unit *impl(const Image_unit *in){
00013         std::stringstream text;
00014         text << "Filepath: " << in->get_path() << "\n";
00015         text << "Modifiable: " << std::boolalpha << in->modifiable() << "\n";
00016         text << "Height: " << in->height() << "\n";
00017         text << "Width: " << in->width() << "\n";
00018         text << "ROI: " << std::boolalpha << in->has_roi() << "\n";
00019         if(in->has_roi()){
00020             text << "ROI::True height: " << in->true_height() << "\n";
00021             text << "ROI::True width: " << in->true_height() << "\n";
00022             text << "ROI::Shift y: " << in->y_win() << "\n";
00023             text << "ROI::Shift x: " << in->x_win() << "\n";
00024         }
00025 
00026         return new Info_unit(text.str());
00027     }
00028 }
00029 
00030 namespace Processes{
00031     void info(){
00032         Gtk::Image icon(cmake_install_prefix+std::string("/share/egami/icons/info.png"));
00033         std::shared_ptr<Processing_unit> pu(new Processing_unit(Processing(&impl), "Info", icon, true));
00034         Processing_page::add_unit_to_page("Tools", pu);
00035     }
00036 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends