## Public API Reference

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

- File List
- File Members

# 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 struct iDataBuffer;
    00034 struct csRGBpixel;
    00035
    00043
    00044 #define CS_IMGFMT_MASK (0x0000ffff)
    00045
    00046 #define CS_IMGFMT_NONE (0x00000000)
    00047
    00048 #define CS_IMGFMT_TRUECOLOR (0x00000001)
    00049
    00050 #define CS_IMGFMT_PALETTED8 (0x00000002)
    00051
    00052 #define CS_IMGFMT_ANY (CS_IMGFMT_MASK)
    00053
    00054 #define CS_IMGFMT_ALPHA (0x00010000)
    00055
    00059 #define CS_IMGFMT_INVALID (0x80000000)
    00060
    00063 enum csImageType
    00064 {
    00066   csimg2D = 0,
    00070   csimg3D,
    00076   csimgCube
    00077 };
    00078
    00093 struct iImage : public virtual iBase
    00094 {
    00095   SCF_INTERFACE (iImage, 3, 0, 0);
    00096
    00104   virtual const void *GetImageData () = 0;
    00106   virtual int GetWidth() const = 0;
    00108   virtual int GetHeight() const = 0;
    00110   virtual int GetDepth() const = 0;
    00111
    00113   virtual void SetName (const char *iName) = 0;
    00115   virtual const char *GetName () const = 0;
    00116
    00118   virtual int GetFormat () const = 0;
    00120   virtual const csRGBpixel* GetPalette () = 0;
    00127   virtual const uint8* GetAlpha () = 0;
    00128
    00130   virtual bool HasKeyColor () const = 0;
    00131
    00136   CS_DEPRECATED_METHOD virtual bool HasKeycolor () const = 0;
    00137
    00139   virtual void GetKeyColor (int &r, int &g, int &b) const = 0;
    00140
    00145   CS_DEPRECATED_METHOD virtual void GetKeycolor (int &r, int &g, int &b)
    00146         const = 0;
    00147
    00153   virtual uint HasMipmaps () const = 0;
    00159   virtual csRef<iImage> GetMipmap (uint num) = 0;
    00160
    00165   virtual const char* GetRawFormat() const = 0;
    00169   virtual csRef<iDataBuffer> GetRawData() const = 0;
    00173   virtual csImageType  GetImageType() const = 0;
    00178   virtual uint HasSubImages() const = 0;
    00185   virtual csRef<iImage> GetSubImage (uint num) = 0;
    00186 };
    00187
    00190 #endif // __CS_IGRAPHIC_IMAGE_H__
    00191