CodeVis.com SourceForge.net Logo

CVImageGrey.h

Go to the documentation of this file.
00001 
00002 
00003 // Written by Michael Ellison
00004 //-------------------------------------------------------------------------
00005 //                      CodeVis's Free License
00006 //                         www.codevis.com
00007 //
00008 // Copyright (c) 2003 by Michael Ellison (mike@codevis.com)
00009 // All rights reserved.
00010 //
00011 // You may use this software in source and/or binary form, with or without
00012 // modification, for commercial or non-commercial purposes, provided that 
00013 // you comply with the following conditions:
00014 //
00015 // * Redistributions of source code must retain the above copyright notice,
00016 //   this list of conditions and the following disclaimer. 
00017 //
00018 // * Redistributions of modified source must be clearly marked as modified,
00019 //   and due notice must be placed in the modified source indicating the
00020 //   type of modification(s) and the name(s) of the person(s) performing
00021 //   said modification(s).
00022 //
00023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00024 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00025 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00026 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00027 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00028 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
00029 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
00030 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
00031 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
00032 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
00033 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 //
00035 //---------------------------------------------------------------------------
00036 // Modifications:
00037 //
00038 //---------------------------------------------------------------------------
00039 //
00051 
00052 #ifndef _CVImageGrey_H_
00053 #define _CVImageGrey_H_
00054 
00055 #include "CVResImage.h"
00056 #include "CVImage.h"
00057 
00058 #ifdef WIN32
00059    #include <windows.h> // For SetFromWin32Bmp
00060 #endif
00061 
00062 class CVImageRGB24;
00063 
00064 class CVImageGrey : public CVImage
00065 {
00066    // Allow CVImage to use our constructor
00067    friend CVImage;
00068 
00069    public:                             
00070       //---------------------------------------------------------------------
00071       // Overridden functions
00072       //---------------------------------------------------------------------
00078       virtual int GetNumChannels() const;
00079 
00085       virtual int GetBytesPerPixel() const;
00086 
00091       virtual CVIMAGE_TYPE   GetImageType   () const;
00092       
00099       virtual const char *GetPNMExtension() const;
00100 
00106       virtual char GetPNMMagicVal() const;
00107       
00118       virtual CVRES GetMaxPixelValue(float& maxValue) const;
00119 
00138       virtual CVRES GetPixel( int      x,
00139                               int      y,
00140                               float&   r,
00141                               float&   g,
00142                               float&   b) const;
00143 
00169       virtual CVRES SetPixel       (   int      x,
00170                                        int      y,
00171                                        float    r,
00172                                        float    g,
00173                                        float    b);
00174 
00175 
00176    protected:
00177 #ifdef WIN32
00189       virtual CVRES SetFromWin32Bmp(  const BITMAPINFOHEADER* bmih, 
00190                                       const unsigned char*    data);
00191 #endif // WIN32
00192 
00193       //---------------------------------------------------------------------
00194    protected:
00196       CVImageGrey();
00198       virtual ~CVImageGrey();
00199 };
00200 
00201 #endif // _CVImageGrey_H_
00202 

Generated on Mon Mar 1 13:27:11 2004 for VidCapture Library by doxygen 1.3.3
CodeVis VidCapture 0.2 Copyright © 2003-2004 by Michael Ellison.