Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Image.hh

00001 /*
00002 
00003     libpdf++: a C++ Free library to generate PDF file
00004     Copyright (C) 2002 Nestal Wan
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 2.1 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU Lesser General Public
00017     License along with this library; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 */
00027 #ifndef __IMAGE_IMAGE_HEADER_INCLUDED__
00028 #define __IMAGE_IMAGE_HEADER_INCLUDED__
00029 
00030 #ifndef __IMAGE_HEADER_HEADER_INCLUDED__
00031 #include "Header.hh"
00032 #endif
00033 
00034 #include <vector>
00035 
00036 namespace image {
00037 
00057 class CImage
00058 {
00059 public :
00061     typedef std::vector<unsigned char>  CPixelVec ;
00062 
00064     typedef CPixelVec::const_iterator   iterator ;
00065 
00066 private :
00068     CHeader     m_header ;
00069     
00071     CPixelVec   m_pixels ;
00072 
00073 public :
00074     CImage( ) ;
00075     CImage( const CHeader& header, const CPixelVec& pixels ) ;
00076     ~CImage( ) ;
00077     
00078     // change the image data without copying pixels
00079     void SwapAssign( const CHeader& header, CPixelVec& pixels ) ;
00080     void SwapPixels( CPixelVec& pixels ) ;
00081     
00082     // data access
00083     const CHeader& Header( ) const ;
00084     const CPixelVec& Pixels( ) const ;
00085     
00086     // STL style functions
00087     void Assign( const CHeader& header, const CPixelVec& pixels ) ;
00088     bool Empty( ) const ;
00089     void Clear( ) ;
00090     iterator Begin( ) const { return m_pixels.begin( ) ; }
00091     iterator End( ) const { return m_pixels.end( ) ; }
00092 
00093 private :
00094 #ifdef _DEBUG
00095     bool IsValid( ) const ;
00096 #endif
00097 } ;
00098 
00099 } // end of namespace
00100 
00101 #endif

Generated on Sun Feb 2 09:16:05 2003 for libpdf++ by doxygen1.2.16