CrystalSpace

Public API Reference

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

image.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 1998 by Jorrit Tyberghein
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_IGRAPHIC_IMAGE_H__
00020 #define __CS_IGRAPHIC_IMAGE_H__
00021 
00031 #include "csutil/scf.h"
00032 #include "iutil/databuff.h"
00033 #include "csgfx/rgbpixel.h"
00034 
00035 /*
00036  * We can request to load image in one of several formats.
00037  * We can request from csImageLoader to load a image in several formats.
00038  * The format we should use depends on what we want to do with the image;
00039  * usually if we're going to use the image as a texture we the format we
00040  * should use is determined by querying the 3D rasterizer for the preferred
00041  * image format.
00042  */
00043 
00045 #define CS_IMGFMT_MASK          0x0000ffff
00046 
00047 #define CS_IMGFMT_NONE          0x00000000
00048 
00049 #define CS_IMGFMT_TRUECOLOR     0x00000001
00050 
00051 #define CS_IMGFMT_PALETTED8     0x00000002
00052 
00053 #define CS_IMGFMT_ANY           CS_IMGFMT_MASK
00054 
00055 #define CS_IMGFMT_ALPHA         0x00010000
00056 
00060 #define CS_IMGFMT_INVALID       0x80000000
00061 
00062 
00064 enum csImageType
00065 {
00067   csimg2D = 0,
00071   csimg3D,
00077   csimgCube
00078 };
00079 
00080 SCF_VERSION (iImage, 2, 0, 1);
00081 
00097 struct iImage : public iBase
00098 {
00106   virtual const void *GetImageData () = 0;
00108   virtual int GetWidth() const = 0;
00110   virtual int GetHeight() const = 0;
00112   virtual int GetDepth() const = 0;
00113 
00115   virtual void SetName (const char *iName) = 0;
00117   virtual const char *GetName () const = 0;
00118 
00120   virtual int GetFormat () const = 0;
00122   virtual const csRGBpixel* GetPalette () = 0;
00129   virtual const uint8* GetAlpha () = 0;
00130 
00132   virtual bool HasKeyColor () const = 0;
00133 
00138   CS_DEPRECATED_METHOD virtual bool HasKeycolor () const = 0;
00139 
00141   virtual void GetKeyColor (int &r, int &g, int &b) const = 0;
00142 
00147   CS_DEPRECATED_METHOD virtual void GetKeycolor (int &r, int &g, int &b) const = 0;
00148 
00154   virtual uint HasMipmaps () const = 0;
00160   virtual csRef<iImage> GetMipmap (uint num) = 0;
00161   
00166   virtual const char* GetRawFormat() const = 0;
00170   virtual csRef<iDataBuffer> GetRawData() const = 0;
00174   virtual csImageType  GetImageType() const = 0;
00179   virtual uint HasSubImages() const = 0;
00186   virtual csRef<iImage> GetSubImage (uint num) = 0;
00187 };
00188 
00191 #endif // __CS_IGRAPHIC_IMAGE_H__
00192 

Generated for Crystal Space by doxygen 1.3.9.1