libidxgui
/home/rex/ebltrunk/tools/libidxgui/include/gui.hpp
00001 /***************************************************************************
00002  *   Copyright (C) 2009 by Pierre Sermanet *
00003  *   pierre.sermanet@gmail.com *
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *     * Redistributions of source code must retain the above copyright
00008  *       notice, this list of conditions and the following disclaimer.
00009  *     * Redistributions in binary form must reproduce the above copyright
00010  *       notice, this list of conditions and the following disclaimer in the
00011  *       documentation and/or other materials provided with the distribution.
00012  *     * Redistribution under a license not approved by the Open Source
00013  *       Initiative (http://www.opensource.org) must display the
00014  *       following acknowledgement in all advertising material:
00015  *        This product includes software developed at the Courant
00016  *        Institute of Mathematical Sciences (http://cims.nyu.edu).
00017  *     * The names of the authors may not be used to endorse or promote products
00018  *       derived from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00021  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00022  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00023  * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY
00024  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00025  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00026  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00027  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00028  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  ***************************************************************************/
00031 
00032 #ifndef GUI_HPP_
00033 #define GUI_HPP_
00034 
00035 using namespace std;
00036 
00037 namespace ebl {
00038 
00039   template<class T>
00040   void draw_matrix(idx<T> &im, unsigned int h0, unsigned int w0, 
00041                    double zoomh, double zoomw, T minv, T maxv) {
00042     gui.draw_matrix(im, h0, w0, zoomh, zoomw, minv, maxv);
00043   }
00044 
00045   template<class T>
00046   void draw_matrix(idx<T> &im, unsigned int h0, unsigned int w0) {
00047     gui.draw_matrix(im, h0, w0);
00048   }
00049 
00050   template<class T>
00051   void draw_matrix(idx<T> &im, const char *str,
00052                    unsigned int h0, unsigned int w0, 
00053                    double zoomh, double zoomw, T minv, T maxv) {
00054     gui.draw_matrix(im, str, h0, w0, zoomh, zoomw, minv, maxv);
00055   }
00056 
00057   template<class T>
00058   void draw_matrix_frame(idx<T> &im, ubyte r, ubyte g, ubyte b,
00059                          unsigned int h0, unsigned int w0, 
00060                          double zoomh, double zoomw,
00061                          T minv, T maxv) {
00062     gui.draw_matrix_frame(im, r, g, b, h0, w0, zoomh, zoomw, minv, maxv);
00063   }
00064 
00065   template<class T>
00066   void draw_mask(idx<T> &im, uint h0, uint w0, double zoomh, double zoomw,
00067                  ubyte r, ubyte g, ubyte b, ubyte a, T threshold) {
00068     gui.draw_mask(im, h0, w0, zoomh, zoomw, r, g, b, a, threshold);
00069   }
00070   
00071 } // end namespace ebl
00072 
00073 #endif /* GUI_HPP_ */