CrystalSpace

Public API Reference

cstool/gentrtex.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2001 by W.C.A. Wijngaards
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of 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 GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_GENTERTEX_H__
00020 #define __CS_GENTERTEX_H__
00021 
00026 #include "csextern.h"
00027 
00028 #include "csgeom/vector2.h"
00029 #include "csutil/cscolor.h"
00030 #include "csutil/ref.h"
00031 #include "csutil/scf_interface.h"
00032 
00033 struct iImage;
00034 
00035 struct csRGBpixel;
00036 
00037 #include "csutil/win32/msvc_deprecated_warn_off.h"
00038 
00044 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageValue
00045 {
00046 public:
00048   virtual ~csGenerateImageValue() {}
00050   virtual float GetValue (float x, float y) = 0;
00051 };
00052 
00058 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageTexture
00059 {
00060 public:
00062   virtual ~csGenerateImageTexture() {}
00064   virtual void GetColor(csColor& col, float x, float y) = 0;
00065 };
00066 
00067 
00079 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImage
00080 {
00081 private:
00083   csGenerateImageTexture *tex;
00084 
00085 public:
00087   csGenerateImage();
00089   ~csGenerateImage();
00090 
00095   void SetTexture(csGenerateImageTexture *t) {tex = t;}
00096 
00104   iImage *Generate(int totalw, int totalh, int startx, int starty,
00105     int partw, int parth);
00106 };
00107 
00113 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageLayer
00114 {
00115 public:
00117   float value;
00119   csGenerateImageTexture *tex;
00121   csGenerateImageLayer *next;
00122 };
00123 
00128 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageTextureSolid : 
00129   public csGenerateImageTexture
00130 {
00131 public:
00133   csColor color;
00135   virtual ~csGenerateImageTextureSolid() {}
00137   virtual void GetColor(csColor& col, float, float) {col = color;}
00138 };
00139 
00144 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageTextureSingle : 
00145   public csGenerateImageTexture
00146 {
00147 public:
00149   csRef<iImage> image;
00151   csVector2 scale;
00153   csVector2 offset;
00154 
00156   virtual ~csGenerateImageTextureSingle();
00158   void SetImage(iImage *im);
00160   virtual void GetColor(csColor& col, float x, float y);
00162   void GetImagePixel(iImage *image, int x, int y, csRGBpixel& res);
00164   void ComputeLayerColor(const csVector2& pos, csColor& col);
00165 };
00166 
00172 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageTextureBlend : 
00173   public csGenerateImageTexture
00174 {
00175 public:
00177   csGenerateImageLayer *layers;
00179   csGenerateImageValue *valuefunc;
00181   csGenerateImageTextureBlend();
00183   virtual ~csGenerateImageTextureBlend();
00185   virtual void GetColor(csColor& col, float x, float y);
00187   void AddLayer(float value, csGenerateImageTexture *tex);
00188 };
00189 
00195 struct CS_DEPRECATED_TYPE iGenerateImageFunction : public virtual iBase
00196 {
00197   SCF_INTERFACE (iGenerateImageFunction, 2, 0, 0);
00199   virtual float GetValue (float dx, float dy) = 0;
00200 };
00201 
00202 
00208 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageValueFunc
00209         : public csGenerateImageValue
00210 {
00211 private:
00213   csRef<iGenerateImageFunction> heightfunc;
00214 
00215 public:
00216   csGenerateImageValueFunc () { }
00217   virtual ~csGenerateImageValueFunc ()
00218   {
00219   }
00220 
00222   virtual float GetValue(float x, float y)
00223   {
00224     return heightfunc->GetValue (x, y);
00225   }
00227   void SetFunction (iGenerateImageFunction* func)
00228   {
00229     heightfunc = func;
00230   }
00231 };
00232 
00237 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageValueFuncConst : 
00238   public csGenerateImageValue
00239 {
00240 public:
00242   float constant;
00244   virtual float GetValue(float, float){return constant;}
00245 };
00246 
00252 class CS_DEPRECATED_TYPE CS_CRYSTALSPACE_EXPORT csGenerateImageValueFuncTex : 
00253   public csGenerateImageValue
00254 {
00255 public:
00257   csGenerateImageTexture *tex;
00259   virtual ~csGenerateImageValueFuncTex();
00261   virtual float GetValue(float x, float y);
00262 };
00263 
00264 #include "csutil/win32/msvc_deprecated_warn_on.h"
00265 
00266 #endif // __CS_GENTERTEX_H__
00267 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3