CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

imagecubemapmaker.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005 by Jorrit Tyberghein
00003               (C) 2005 by Frank Richter
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 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     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00027 #ifndef __CS_CSGFX_IMAGECUBEMAPMAKER_H__
00028 #define __CS_CSGFX_IMAGECUBEMAPMAKER_H__
00029 
00030 #include "csextern.h"
00031 #include "csutil/leakguard.h"
00032 #include "imagebase.h"
00033 
00039 class CS_CRYSTALSPACE_EXPORT csImageCubeMapMaker : public csImageBase
00040 {
00041 protected:
00042   enum { NUM_FACES = 6 };
00044   csRef<iImage> cubeImages[NUM_FACES];
00049   bool manualName;
00050 
00052   void CheckImage (int index);
00054   void UpdateName ();
00055 public:
00056   SCF_DECLARE_IBASE;
00057   CS_LEAKGUARD_DECLARE (csImageCubeMapMaker);
00058 
00060   csImageCubeMapMaker();
00062   csImageCubeMapMaker (iImage* source);
00067   csImageCubeMapMaker (iImage* posX, iImage* negX, iImage* posY, 
00068     iImage* negY, iImage* posZ, iImage* negZ);
00069 
00070   virtual ~csImageCubeMapMaker();
00071 
00072   virtual const void *GetImageData ();
00073   virtual int GetWidth () const;
00074   virtual int GetHeight () const;
00076   virtual void SetName (const char *iName);
00084   virtual const char *GetName () const { return fName; }
00085 
00086   virtual int GetFormat () const;
00087   virtual const csRGBpixel* GetPalette ();
00088   virtual const uint8* GetAlpha ();
00089 
00090   virtual bool HasKeyColor () const { return false; }
00091   virtual void GetKeyColor (int & /*r*/, int & /*g*/, int & /*b*/) const { }
00092 
00093   virtual uint HasMipmaps () const;
00094   virtual csRef<iImage> GetMipmap (uint num);
00095 
00096   virtual const char* GetRawFormat() const;
00097   virtual csRef<iDataBuffer> GetRawData() const;
00098   virtual csImageType GetImageType() const { return csimgCube; }
00099   virtual uint HasSubImages() const { return (uint)(NUM_FACES - 1); }
00100   virtual csRef<iImage> GetSubImage (uint num);
00101   
00103   void SetSubImage (uint num, iImage* image);
00110   bool SubImageSet (uint num) 
00111   { return ((num < (uint)NUM_FACES) && (cubeImages[num].IsValid())); }
00112 };
00113 
00116 #endif // __CS_CSGFX_IMAGECUBEMAPMAKER_H__

Generated for Crystal Space by doxygen 1.4.4