Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

LinearMinificationFilter.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Lamp : Open source game middleware
00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //------------------------------------------------------------------------------
00019 
00020 /** @file
00021  * 線形縮小フィルタヘッダ
00022  * @author Junpee
00023  */
00024 
00025 #ifndef LINEAR_MINIFICATION_FILTER_H_
00026 #define LINEAR_MINIFICATION_FILTER_H_
00027 
00028 namespace Lamp{
00029 
00030 //------------------------------------------------------------------------------
00031 /**
00032  * 線形縮小フィルタ
00033  */
00034 class LinearMinificationFilter{
00035 public:
00036     /**
00037      * 次のサイズ取得
00038      * @param nowSize 現在のサイズ
00039      * @return 次のサイズ
00040      */
00041     static DimensionI getNextSize(const DimensionI& nowSize){
00042         Assert((nowSize.width != 0) && (nowSize.height != 0));
00043         Assert((nowSize.width != 1) || (nowSize.height != 1));
00044         DimensionI result(nowSize.width / 2, nowSize.height / 2);
00045         if(result.width == 0){ result.width = 1; }
00046         if(result.height == 0){ result.height = 1; }
00047         return result;
00048     }
00049 
00050     /**
00051      * フィルタ
00052      * @param source ソースイメージ
00053      * @param sourceSize ソースイメージサイズ
00054      * @param destination デスティネーションイメージ
00055      * @param destinationSize デスティネーションイメージサイズ
00056      */
00057     static void filter(
00058         const Color3c* source, const DimensionI& sourceSize,
00059         Color3c* destination, const DimensionI destinationSize);
00060 
00061     /**
00062      * フィルタ
00063      * @param source ソースイメージ
00064      * @param sourceSize ソースイメージサイズ
00065      * @param destination デスティネーションイメージ
00066      * @param destinationSize デスティネーションイメージサイズ
00067      */
00068     static void filter(
00069         const Color4c* source, const DimensionI& sourceSize,
00070         Color4c* destination, const DimensionI destinationSize);
00071 
00072 private:
00073     // コンストラクタの隠蔽
00074     LinearMinificationFilter();
00075 
00076 };
00077 
00078 //------------------------------------------------------------------------------
00079 } // End of namespace Lamp
00080 #endif // End of LINEAR_MINIFICATION_FILTER_H_
00081 //------------------------------------------------------------------------------
00082 

Generated on Wed Mar 16 10:29:31 2005 for Lamp by doxygen 1.3.2