VedaLibImageJPEG/ImageJPEG.h

Go to the documentation of this file.
00001 /*! \file 
00002     \author victorien ferry & www.m4nkind.com 
00003     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00004 */
00005 #ifndef COM_M4NKIND_ImageJPEG_H
00006 #define COM_M4NKIND_ImageJPEG_H
00007 
00008 #include "VirtualImage.h"
00009 #include "PackResource.h"
00010 #include "PackULong_Flags.h"
00011 #include "PackObjectReference.h"
00012 
00013 /*!
00014     \class  ImageJPEG
00015     \ingroup BaseObjectInherited_VedaLibImageJPEG
00016     \brief  Use JPEG file format to manage an image.
00017 */
00018 
00019 class ImageJPEG : public VirtualImage
00020 {
00021 /*==================================================================
00022                                 PUBLIC
00023 ==================================================================*/
00024 public:
00025     /*!
00026         \brief  Constructor. There should only be members initialisation there.
00027     */
00028     ImageJPEG(void);
00029     
00030     /*!
00031         \brief  Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp
00032     */
00033     BASEOBJECT_DEFINE_CLASS(ImageJPEG);
00034 
00035     /*!
00036         \brief  Return the number of byte component for one pixel.
00037             This one is no more a virtual method.
00038     */
00039     virtual unsigned int    GetByteDepth();
00040 
00041     /*!
00042         \brief  Return the pixel width of the image
00043     */
00044     virtual unsigned int    GetPixelWidth();
00045     /*!
00046         \brief  Return the pixel height of the image
00047     */
00048     virtual unsigned int    GetPixelHeight();
00049 
00050 /*==================================================================
00051                                 PROTECTED
00052 ==================================================================*/
00053 protected:
00054     //! resource file:
00055     PackResource    mSer_JPEGFile;
00056     //! flags for alpha management.
00057     enum {
00058         b_LumToAlpha=1,
00059         b_GreyOnly=2,
00060     };
00061     //! flags for alpha management.
00062     PackULong_Flags mSer_Flags;
00063 
00064     //! optionnal alpha layer
00065     PackObjectReference mSer_ReferenceAlpha;
00066     //! the pixel size, computed from file:
00067     unsigned int        m_PixelWidth;
00068     //! the pixel size, computed from file:
00069     unsigned int        m_PixelHeight;
00070 /*!
00071     \brief  Method that really build the object using the serializable parameters.
00072             Close() should close everything opened by Create().
00073             Mix one or more GreyImage into a RGBA bitmap.
00074         \return false if creation failed.
00075 */
00076     virtual bool CreateInternal(void);
00077 
00078 };
00079 
00080 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/