PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: ImageEffects.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_IMAGEEFFECTS_H__ 00024 #define __PLGRAPHICS_IMAGEEFFECTS_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLGraphics/Image/ImageEffectWrapper.h" 00032 #include "PLGraphics/Image/Effects/IEConvert.h" 00033 #include "PLGraphics/Image/Effects/IEFilter.h" 00034 #include "PLGraphics/Image/Effects/IEScale.h" 00035 #include "PLGraphics/Image/Effects/IEMonochrome.h" 00036 #include "PLGraphics/Image/Effects/IEColorKey.h" 00037 #include "PLGraphics/Image/Effects/IEFlipXAxis.h" 00038 #include "PLGraphics/Image/Effects/IEFlipYAxis.h" 00039 #include "PLGraphics/Image/Effects/IERemovePalette.h" 00040 00041 00042 //[-------------------------------------------------------] 00043 //[ Namespace ] 00044 //[-------------------------------------------------------] 00045 namespace PLGraphics { 00046 00047 00048 //[-------------------------------------------------------] 00049 //[ Forward declarations ] 00050 //[-------------------------------------------------------] 00051 class Color3; 00052 00053 00054 //[-------------------------------------------------------] 00055 //[ Classes ] 00056 //[-------------------------------------------------------] 00057 /** 00058 * @brief 00059 * Static image effects class 00060 */ 00061 class ImageEffects { 00062 00063 00064 //[-------------------------------------------------------] 00065 //[ Public static functions ] 00066 //[-------------------------------------------------------] 00067 public: 00068 /** 00069 * @brief 00070 * Create image effect dynamically 00071 * 00072 * @param[in] sEffect 00073 * Image effect class name 00074 * @param[in] sParameters 00075 * Image effect parameters 00076 * 00077 * @return 00078 * Image effect 00079 */ 00080 static inline ImageEffectWrapper Effect(const PLCore::String &sEffect, const PLCore::String &sParameters); 00081 00082 /** 00083 * @brief 00084 * Create image filter 00085 * 00086 * @return 00087 * Image filter 00088 */ 00089 static inline IEFilter Filter(); 00090 00091 /** 00092 * @brief 00093 * Create scale image effect 00094 * 00095 * @param[in] vNewSize 00096 * The new size 00097 * @param[in] bUseMipmaps 00098 * If there are mipmaps and one of them matches the new dimension... is it allowed to 00099 * just make this mipmap to the new base image and destroy the now unused other mipmaps? 00100 * (extremely fast 'scale', but no set filters are applied and may cause problems on 'none standard' 00101 * images) 00102 * 00103 * @return 00104 * Scale image effect 00105 */ 00106 static inline IEScale Scale(const PLMath::Vector3i &vNewSize, bool bUseMipmaps); 00107 00108 /** 00109 * @brief 00110 * Create image conversion effect 00111 * 00112 * @param[in] nDataFormat 00113 * Desired data format 00114 * @param[in] nColorFormat 00115 * Desired color format 00116 * 00117 * @return 00118 * Image conversion effect 00119 */ 00120 static inline IEConvert Convert(EDataFormat nDataFormat, EColorFormat nColorFormat); 00121 00122 /** 00123 * @brief 00124 * Create monochrome image effect 00125 * 00126 * @return 00127 * Monochrome image effect 00128 */ 00129 static inline IEMonochrome Monochrome(); 00130 00131 /** 00132 * @brief 00133 * Create color key image effect 00134 * 00135 * @param[in] cColor 00136 * Color 00137 * @param[in] fTolerance 00138 * Tolerance (0 .. 1) 00139 * 00140 * @return 00141 * Color key image effect 00142 */ 00143 static inline IEColorKey ColorKey(const Color3 &cColor, float fTolerance); 00144 00145 /** 00146 * @brief 00147 * Create flip the image around the x axis image effect 00148 * 00149 * @return 00150 * Flip the image around the x axis image effect 00151 */ 00152 static inline IEFlipXAxis FlipXAxis(); 00153 00154 /** 00155 * @brief 00156 * Create flip the image around the y axis image effect 00157 * 00158 * @return 00159 * Flip the image around the y axis image effect 00160 */ 00161 static inline IEFlipYAxis FlipYAxis(); 00162 00163 /** 00164 * @brief 00165 * Create remove palette image effect 00166 * 00167 * @return 00168 * Remove palette image effect 00169 */ 00170 static inline IERemovePalette RemovePalette(); 00171 00172 00173 }; 00174 00175 00176 //[-------------------------------------------------------] 00177 //[ Namespace ] 00178 //[-------------------------------------------------------] 00179 } // PLGraphics 00180 00181 00182 //[-------------------------------------------------------] 00183 //[ Implementation ] 00184 //[-------------------------------------------------------] 00185 #include "PLGraphics/Image/ImageEffects.inl" 00186 00187 00188 #endif // __PLGRAPHICS_IMAGEEFFECTS_H__
|