| ## Public API Reference

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

- File List
- File Members

# csgfx/imagevolumemaker.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_IMAGEVOLUMEMAKER_H__
    00029 #define __CS_CSGFX_IMAGEVOLUMEMAKER_H__
    00030
    00031 #include "csextern.h"
    00032 #include "csutil/leakguard.h"
    00033 #include "csutil/refarr.h"
    00034 #include "imagebase.h"
    00035
    00040 class CS_CRYSTALSPACE_EXPORT csImageVolumeMaker :
    00041   public scfImplementationExt0<csImageVolumeMaker, csImageBase>
    00042 {
    00043 protected:
    00048   bool manualName;
    00053   csRefArray<iImage> pendingImages;
    00055   int Width;
    00057   int Height;
    00059   int Depth;
    00061   int Format;
    00062
    00064   void* data;
    00066   csRGBpixel* palette;
    00068   uint8* alpha;
    00069
    00071   void AppendPending ();
    00072 public:
    00073   CS_LEAKGUARD_DECLARE (csImageVolumeMaker);
    00074
    00080   csImageVolumeMaker (int format = -1, int width = -1, int height = -1);
    00084   csImageVolumeMaker (iImage* source);
    00085   virtual ~csImageVolumeMaker();
    00086
    00087   virtual const void *GetImageData ();
    00088   virtual int GetWidth () const { return Width > 0 ? Width : 0; }
    00089   virtual int GetHeight () const { return Height > 0 ? Height : 0; ; }
    00090   virtual int GetDepth () const { return Depth + (int)pendingImages.Length(); }
    00092   virtual void SetName (const char *iName);
    00099   virtual const char *GetName () const { return fName; }
    00100
    00101   virtual int GetFormat () const;
    00102   virtual const csRGBpixel* GetPalette ();
    00103   virtual const uint8* GetAlpha ();
    00104
    00105   virtual const char* GetRawFormat() const { return 0; }
    00106   virtual csRef<iDataBuffer> GetRawData() const { return 0; }
    00107   virtual csImageType GetImageType() const { return csimg3D; }
    00108
    00109   void AddImage (iImage* source);
    00110 };
    00111
    00114 #endif // __CS_CSGFX_IMAGEVOLUMEMAKER_H__