CrystalSpace

Public API Reference

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

igraphic/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 
00033 /*
00034  * We can request to load image in one of several formats.
00035  * We can request from csImageLoader to load a image in several formats.
00036  * The format we should use depends on what we want to do with the image;
00037  * usually if we're going to use the image as a texture we the format we
00038  * should use is determined by querying the 3D rasterizer for the preferred
00039  * image format.
00040  */
00041 
00043 #define CS_IMGFMT_MASK          0x0000ffff
00044 
00045 #define CS_IMGFMT_NONE          0x00000000
00046 
00047 #define CS_IMGFMT_TRUECOLOR     0x00000001
00048 
00049 #define CS_IMGFMT_PALETTED8     0x00000002
00050 
00051 #define CS_IMGFMT_ANY           CS_IMGFMT_MASK
00052 
00053 #define CS_IMGFMT_ALPHA         0x00010000
00054 
00058 #define CS_IMGFMT_INVALID       0x80000000
00059 
00060 
00061 struct csRGBpixel;
00062 
00063 SCF_VERSION (iImage, 1, 0, 3);
00064 
00071 struct iImage : public iBase
00072 {
00080   virtual void *GetImageData () = 0;
00082   virtual int GetWidth () = 0;
00084   virtual int GetHeight () = 0;
00086   virtual int GetSize () = 0;
00087 
00089   virtual void Rescale (int NewWidth, int NewHeight) = 0;
00090 
00101   virtual csPtr<iImage> MipMap (int step, csRGBpixel *transp) = 0;
00102 
00104   virtual void SetName (const char *iName) = 0;
00106   virtual const char *GetName () = 0;
00107 
00109   virtual int GetFormat () = 0;
00111   virtual csRGBpixel *GetPalette () = 0;
00118   virtual uint8 *GetAlpha () = 0;
00128   virtual void SetFormat (int iFormat) = 0;
00129 
00131   virtual csPtr<iImage> Clone () = 0;
00132 
00134   virtual csPtr<iImage> Crop (int x, int y, int width, int height) = 0;
00135 
00137   virtual void CheckAlpha () = 0;
00138 
00140   virtual bool HasKeycolor () = 0;
00141 
00143   virtual void GetKeycolor (int &r, int &g, int &b) = 0;
00144 
00151   virtual csPtr<iImage> Sharpen (csRGBpixel *transp, int strength) = 0;
00152 
00156   virtual int HasMipmaps () = 0;
00157 };
00158 
00161 #endif // __CS_IGRAPHIC_IMAGE_H__

Generated for Crystal Space by doxygen 1.2.18