|
image.h00001 /* 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 __IGRAPHIC_IMAGE_H__ 00020 #define __IGRAPHIC_IMAGE_H__ 00021 00022 #include "csutil/scf.h" 00023 00024 /* 00025 * We can request to load image in one of several formats. 00026 * We can request from csImageLoader to load a image in several formats. 00027 * The format we should use depends on what we want to do with the image; 00028 * usually if we're going to use the image as a texture we the format we 00029 * should use is determined by querying the 3D rasterizer for the preferred 00030 * image format. 00031 */ 00032 00034 #define CS_IMGFMT_MASK 0x0000ffff 00035 00036 #define CS_IMGFMT_NONE 0x00000000 00037 00038 #define CS_IMGFMT_TRUECOLOR 0x00000001 00039 00040 #define CS_IMGFMT_PALETTED8 0x00000002 00041 00042 #define CS_IMGFMT_ANY CS_IMGFMT_MASK 00043 00044 #define CS_IMGFMT_ALPHA 0x00010000 00045 00049 #define CS_IMGFMT_INVALID 0x80000000 00050 00051 00052 struct csRGBpixel; 00053 00054 SCF_VERSION (iImage, 1, 0, 1); 00055 00062 struct iImage : public iBase 00063 { 00071 virtual void *GetImageData () = 0; 00073 virtual int GetWidth () = 0; 00075 virtual int GetHeight () = 0; 00077 virtual int GetSize () = 0; 00078 00080 virtual void Rescale (int NewWidth, int NewHeight) = 0; 00081 00091 virtual iImage *MipMap (int step, csRGBpixel *transp) = 0; 00092 00094 virtual void SetName (const char *iName) = 0; 00096 virtual const char *GetName () = 0; 00097 00099 virtual int GetFormat () = 0; 00101 virtual csRGBpixel *GetPalette () = 0; 00108 virtual uint8 *GetAlpha () = 0; 00118 virtual void SetFormat (int iFormat) = 0; 00119 00121 virtual iImage *Clone () = 0; 00122 00124 virtual iImage *Crop (int x, int y, int width, int height) = 0; 00125 00127 virtual void CheckAlpha () = 0; 00128 00130 virtual bool HasKeycolor () = 0; 00131 00133 virtual void GetKeycolor (int &r, int &g, int &b) = 0; 00134 }; 00135 00136 #endif // __IGRAPHIC_IMAGE_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |