colormap.h

00001
00002 /**************************************************************************
00003  *  colormap.h - colormap interface
00004  *
00005  *  Created: Sat Mar 29 12:45:29 2008
00006  *  Copyright  2005-2008  Tim Niemueller  [www.niemueller.de]
00007  *
00008  ***************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #ifndef __FIREVISION_FVUTILS_COLORMAP_COLORMAP_H_
00025 #define __FIREVISION_FVUTILS_COLORMAP_COLORMAP_H_
00026 
00027 #include <fvutils/base/types.h>
00028 #include <sys/types.h>
00029 #include <list>
00030
00031 class ColormapFileBlock;
00032
00033 class Colormap
00034 {
00035  public:
00036   virtual ~Colormap();
00037
00038   virtual color_t         determine(unsigned int y, unsigned int u, unsigned int v) const = 0;
00039   virtual void            set(unsigned int y, unsigned int u, unsigned int v, color_t c)  = 0;
00040
00041   virtual void            reset()                                                         = 0;
00042   virtual void            set(unsigned char *buffer)                                      = 0;
00043
00044   virtual size_t          size()                                                          = 0;
00045   virtual void            to_image(unsigned char *yuv422_planar_buffer,
00046                                    unsigned int level = 0);
00047
00048   virtual unsigned char * get_buffer() const                                              = 0;
00049
00050   virtual Colormap &      operator+=(const Colormap & cmlt)                               = 0;
00051   virtual Colormap &      operator+=(const char *filename)                                = 0;
00052
00053   virtual unsigned int    width() const                                                   = 0;
00054   virtual unsigned int    height() const                                                  = 0;
00055   virtual unsigned int    depth() const                                                   = 0;
00056   virtual unsigned int    deepness() const                                                = 0;
00057
00058   virtual std::list<ColormapFileBlock *>  get_blocks()                                    = 0;
00059 };
00060
00061 #endif