PixelLightAPI  .
IEScale.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: IEScale.h                                      *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLGRAPHICS_IMAGEEFFECT_SCALE_H__
00024 #define __PLGRAPHICS_IMAGEEFFECT_SCALE_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLMath/Vector3i.h>
00032 #include "PLGraphics/Image/ImageEffect.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLGraphics {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Classes                                               ]
00043 //[-------------------------------------------------------]
00044 /**
00045 *  @brief
00046 *    Image effect: Apply scale
00047 *
00048 *  @note
00049 *    - The color format "ColorPalette" is not supported
00050 */
00051 class IEScale : public ImageEffect {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ RTTI interface                                        ]
00056     //[-------------------------------------------------------]
00057     pl_class(PLGRAPHICS_RTTI_EXPORT, IEScale, "PLGraphics", PLGraphics::ImageEffect, "Image effect: Apply scale")
00058     pl_class_end
00059 
00060 
00061     //[-------------------------------------------------------]
00062     //[ Public functions                                      ]
00063     //[-------------------------------------------------------]
00064     public:
00065         /**
00066         *  @brief
00067         *    Constructor
00068         *
00069         *  @param[in] vNewSize
00070         *    New size
00071         *  @param[in] bUseMipmaps
00072         *    If there are mipmaps and one of them matches the new dimension... is it allowed to
00073         *    just make this mipmap to the new base image and destroy the now unused other mipmaps?
00074         *    (extremely fast 'scale', but no set filters are applied and may cause problems on 'none standard'
00075         *    images)
00076         */
00077         PLGRAPHICS_API IEScale(const PLMath::Vector3i &vNewSize, bool bUseMipmaps);
00078 
00079         /**
00080         *  @brief
00081         *    Destructor
00082         */
00083         PLGRAPHICS_API virtual ~IEScale();
00084 
00085         /**
00086         *  @brief
00087         *    Get new size
00088         *
00089         *  @return
00090         *    New size
00091         */
00092         PLGRAPHICS_API PLMath::Vector3i GetNewSize() const;
00093 
00094         /**
00095         *  @brief
00096         *    Is it allowed to use existing mipmaps to scale down?
00097         *
00098         *  @return
00099         *    'true' if it's allowed to use existing mipmaps to scale down, else 'false'
00100         */
00101         PLGRAPHICS_API bool GetUseMipmaps() const;
00102 
00103 
00104     //[-------------------------------------------------------]
00105     //[ Public virtual ImageEffect functions                  ]
00106     //[-------------------------------------------------------]
00107     public:
00108         PLGRAPHICS_API virtual bool Apply(Image &cImage) const override;
00109         PLGRAPHICS_API virtual bool Apply(ImageBuffer &cBuffer) const override;
00110 
00111 
00112     //[-------------------------------------------------------]
00113     //[ Private data                                          ]
00114     //[-------------------------------------------------------]
00115     private:
00116         PLMath::Vector3i m_vNewSize;    /**< New size */
00117         bool             m_bUseMipmaps; /**< Is it allowed to use existing mipmaps to scale down? */
00118 
00119 
00120 };
00121 
00122 
00123 //[-------------------------------------------------------]
00124 //[ Namespace                                             ]
00125 //[-------------------------------------------------------]
00126 } // PLGraphics
00127 
00128 
00129 #endif // __PLGRAPHICS_IMAGEEFFECT_SCALE_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:56
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported