| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# csgfx/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
    00028 #ifndef __CS_CSGFX_IMAGECUBEMAPMAKER_H__
    00029 #define __CS_CSGFX_IMAGECUBEMAPMAKER_H__
    00030
    00031 #include "csextern.h"
    00032 #include "csutil/leakguard.h"
    00033 #include "imagebase.h"
    00034
    00041 class CS_CRYSTALSPACE_EXPORT csImageCubeMapMaker :
    00042   public scfImplementationExt0<csImageCubeMapMaker, csImageBase>
    00043 {
    00044 protected:
    00045   enum
    00046   {
    00048     NUM_FACES = 6
    00049   };
    00051   csRef<iImage> cubeImages[NUM_FACES];
    00056   bool manualName;
    00057
    00059   void CheckImage (int index);
    00061   void UpdateName ();
    00062 public:
    00063   CS_LEAKGUARD_DECLARE (csImageCubeMapMaker);
    00064
    00066   csImageCubeMapMaker();
    00068   csImageCubeMapMaker (iImage* source);
    00073   csImageCubeMapMaker (iImage* posX, iImage* negX, iImage* posY,
    00074     iImage* negY, iImage* posZ, iImage* negZ);
    00075
    00076   virtual ~csImageCubeMapMaker();
    00077
    00078   virtual const void *GetImageData ();
    00079   virtual int GetWidth () const;
    00080   virtual int GetHeight () const;
    00082   virtual void SetName (const char *iName);
    00090   virtual const char *GetName () const { return fName; }
    00091
    00092   virtual int GetFormat () const;
    00093   virtual const csRGBpixel* GetPalette ();
    00094   virtual const uint8* GetAlpha ();
    00095
    00096   virtual bool HasKeyColor () const { return false; }
    00097   virtual void GetKeyColor (int & /*r*/, int & /*g*/, int & /*b*/) const { }
    00098
    00099   virtual uint HasMipmaps () const;
    00100   virtual csRef<iImage> GetMipmap (uint num);
    00101
    00102   virtual const char* GetRawFormat() const;
    00103   virtual csRef<iDataBuffer> GetRawData() const;
    00104   virtual csImageType GetImageType() const { return csimgCube; }
    00105   virtual uint HasSubImages() const { return (uint)(NUM_FACES - 1); }
    00106   virtual csRef<iImage> GetSubImage (uint num);
    00107
    00109   void SetSubImage (uint num, iImage* image);
    00116   bool SubImageSet (uint num)
    00117   { return ((num < (uint)NUM_FACES) && (cubeImages[num].IsValid())); }
    00118 };
    00119
    00122 #endif // __CS_CSGFX_IMAGECUBEMAPMAKER_H__