/usr/include/crystalspace-2.0/csgfx/imagebase.h is in libcrystalspace-dev 2.0+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | /*
Copyright (C) 2005 by Jorrit Tyberghein
(C) 2005 by Frank Richter
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**\file
* Base class for iImage implementations. Cannot be instantiated itself.
*/
/**\addtogroup gfx
* @{
*/
#ifndef __CS_CSGFX_IMAGEBASE_H__
#define __CS_CSGFX_IMAGEBASE_H__
#include "csextern.h"
#include "csutil/util.h"
#include "csutil/databuf.h"
#include "csutil/scf_implementation.h"
#include "igraphic/image.h"
/**
* Base class for iImage implementations. Cannot be instantiated itself.
*/
class csImageBase :
public scfImplementation1<csImageBase, iImage>
{
protected:
/// Name of the image file.
char* fName;
/// Create new instance.
csImageBase() :
scfImplementationType (this, 0), fName(0)
{ }
public:
virtual ~csImageBase () { cs_free (fName); }
/* Commented out: should be implemented by all descendants.
virtual const void *GetImageData () { return 0; }
virtual int GetWidth () const { return 0; }
virtual int GetHeight () const { return 0; }
*/
// Most images are 2D, so provide a sensible default
virtual int GetDepth () const { return 1; }
virtual void SetName (const char* iName)
{
cs_free (fName); fName = CS::StrDup (iName);
}
virtual const char* GetName () const { return fName; }
/* Commented out: should be implemented by all descendants.
virtual int GetFormat () const { return 0; }
*/
virtual const csRGBpixel* GetPalette () { return 0; }
virtual const uint8* GetAlpha () { return 0; }
virtual bool HasKeyColor () const { return false; }
virtual void GetKeyColor (int & /*r*/, int & /*g*/, int & /*b*/) const { }
virtual uint HasMipmaps () const { return 0; }
virtual csRef<iImage> GetMipmap (uint num)
{ return (num == 0) ? this : 0; }
/* Commented out: should be implemented by all descendants.
virtual const char* GetRawFormat () const { return 0; }
virtual csRef<iDataBuffer> GetRawData () const { return 0; }
*/
virtual csImageType GetImageType () const { return csimg2D; }
virtual uint HasSubImages () const { return 0; }
virtual csRef<iImage> GetSubImage (uint num)
{ return (num == 0) ? this : 0; }
const char* GetCookedImageFormat () { return GetRawFormat(); }
csRef<iDataBuffer> GetCookedImageData () { return GetCookedImageData(); }
};
/** @} */
#endif // __CS_CSGFX_IMAGEBASE_H__
|