UnitInResampleOut.h

00001 /***************************************************************************
00002  *   Copyright (c) 2008   Art Tevs                                         *
00003  *                                                                         *
00004  *   This library is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU Lesser General Public License as        *
00006  *   published by the Free Software Foundation; either version 3 of        *
00007  *   the License, or (at your option) any later version.                   *
00008  *                                                                         *
00009  *   This library is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU Lesse General Public License for more details.                    *
00013  *                                                                         *
00014  *   The full license is in LICENSE file included with this distribution.  *
00015  ***************************************************************************/
00016 
00017 #ifndef _C_UNIT_INRESAMPLEOUT_H_
00018 #define _C_UNIT_INRESAMPLEOUT_H_
00019 
00020 
00021 //-------------------------------------------------------------------------
00022 // Includes
00023 //-------------------------------------------------------------------------
00024 #include <osgPPU/Export.h>
00025 #include <osgPPU/UnitInOut.h>
00026 
00027 namespace osgPPU
00028 {
00029     //! Same as UnitInOut but do resampling inbetween
00030     /**
00031     * Resample the input. This PPU will 
00032     * render the input data resampled to the output. Next PPU will work 
00033     * on the resampled one. NOTE: You loose information in your data after 
00034     * appling this PPU.
00035     **/
00036     class OSGPPU_EXPORT UnitInResampleOut : public UnitInOut {
00037         public:
00038             META_Node(osgPPU,UnitInResampleOut);
00039         
00040             //! Create default ppfx 
00041             UnitInResampleOut();
00042             UnitInResampleOut(const UnitInResampleOut&, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
00043             
00044             //! Release it and used memory
00045             virtual ~UnitInResampleOut();
00046             
00047             //! Set resampling factor
00048             void setFactorX(float x);
00049     
00050             //! Set resampling factor
00051             void setFactorY(float Y);
00052     
00053             //! Get resampling factor
00054             float getFactorX() const { return mWidthFactor; }
00055     
00056             //! Get resampling factor
00057             float getFactorY() const { return mHeightFactor; }
00058     
00059             void init();
00060             void dirty();
00061 
00062         protected:
00063             float mWidthFactor, mHeightFactor;
00064             bool mDirtyFactor;
00065     };
00066 
00067 };
00068 
00069 #endif

Back to Homepage of osgPPU

Copyright (C) 2008 by Art Tevs (LGPL)