Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Image Class Referenceabstract
Inheritance diagram for Image:
Inheritance graph
[legend]
Collaboration diagram for Image:
Collaboration graph
[legend]

Public Types

enum  FitType {
  fit_None,
  fit_Height,
  fit_Width,
  fit_Inside,
  fit_Fill,
  fit_FillKeepProportions
}
 
enum  FilterType {
  filter_Box,
  filter_Normal,
  filter_Triangle,
  filter_Bell,
  filter_BSpline,
  filter_Mitchell,
  filter_Lanczos3,
  filter_Best = filter_Lanczos3
}
 
enum  ImageSerializationMode {
  ser_Nothing,
  ser_ByReference
}
 

Public Member Functions

virtual Rect getImageBounds ()
 
virtual Rect getImageBounds (Point &at)
 
virtual long getHeight ()
 
virtual long getWidth ()
 
virtual void setTransparentColor (Color rgb)=0
 
virtual Color getTransparentColor ()=0
 
virtual void setOpacity (uint8 opacity)=0
 
virtual uint8 getOpacity () const =0
 
virtual void setEdgeClamping (bool inUseEdgeClamp)=0
 
virtual void retainData ()=0
 
virtual void retainAlpha ()=0
 Retain the alpha channel even after the image has been prepared for rasterization.
 
virtual void prepareToRasterize ()=0
 
virtual void * getData ()=0
 
virtual uint8 getAlphaValue (int32 x, int32 y) const =0
 
virtual Color getPixel (int32 x, int32 y) const =0
 return the full color info, including alpha channel, for the pixel at the given location
 
virtual ImagegetSubsection (Rect &r)=0
 create a new image from a rectangular subsection of the current one
 
ImagegetSubsection (RotatedRect &rr)
 create a new image from a rectangular subsection of the current one
 
virtual ImagegetSubsection (Quad &quad)=0
 create a new image from an Quad subsection of the current one
 
virtual ImagecreateImageScaled (float xscale, float yscale, FilterType filterType=filter_Best)=0
 create a new image by scaling the current one by a specific scaling factor
 
virtual ImagecreateImageScaledToFit (Rect r, FitType fitType=fit_Fill, FilterType filterType=filter_Best)=0
 create a new image by scaling the current one to fit a new bounding rectangle
 
virtual PortsetPort (Port *newPort)
 control which port this image draws into
 
- Public Member Functions inherited from ISerializable
virtual uint32 getSerializedSize (ISerializer *serializer) const =0
 Get number of bytes needed to hold serialized state.
 
virtual void serialize (ISerializer *serializer) const =0
 Write self out to a serializer.
 
virtual void deserialize (IDeserializer *deserializer)=0
 Read self from a deserializer.
 
virtual uint32 getMyClassTag () const =0
 Get a tag value that uniquely represents this class.
 
 ISerializable ()
 
virtual ~ISerializable ()
 
- Public Member Functions inherited from RefCountedObj
virtual void addRef () const throw ()
 
virtual void release () const throw ()
 

Static Public Member Functions

static ImagecreateImageFromData (const char *imageName, char *imageData, long imageDataLen)
 
static ImagecreateImageFromFile (const char *imageFileName)
 
static int registerImageForSerialization (Image *img)
 
static bool setImageSerializationMode (ImageSerializationMode mode)
 

Friends

class Port
 
class ImageOpenGL
 
class Sprite
 

Detailed Description

Image A bit image that can be blitted onto the screen You cannot create images directly, they must be loaded by the Graphics Manager

Member Enumeration Documentation

enum FilterType
Enumerator:
filter_Box 
filter_Normal 
filter_Triangle 
filter_Bell 
filter_BSpline 
filter_Mitchell 
filter_Lanczos3 
filter_Best 
enum FitType
Enumerator:
fit_None 
fit_Height 
fit_Width 
fit_Inside 
fit_Fill 
fit_FillKeepProportions 
Enumerator:
ser_Nothing 
ser_ByReference 

Member Function Documentation

static Image* createImageFromData ( const char *  imageName,
char *  imageData,
long  imageDataLen 
)
static
static Image* createImageFromFile ( const char *  imageFileName)
static
virtual Image* createImageScaled ( float  xscale,
float  yscale,
FilterType  filterType = filter_Best 
)
pure virtual

create a new image by scaling the current one by a specific scaling factor

virtual Image* createImageScaledToFit ( Rect  r,
FitType  fitType = fit_Fill,
FilterType  filterType = filter_Best 
)
pure virtual

create a new image by scaling the current one to fit a new bounding rectangle

virtual uint8 getAlphaValue ( int32  x,
int32  y 
) const
pure virtual

If the image has alpha information it returns the alpha value (0 = transparent, 255 = opaque) If the image has no alpha information, then it returns getOpacity();

virtual void* getData ( )
pure virtual
virtual long getHeight ( )
virtual
virtual Rect getImageBounds ( )
virtual

convenient shortcuts to get the bounds of the image as a rectangle, offset by a point if desired if the image has multiple frames, it returns the bounds as the frame width, not the total width

Reimplemented in ImageStrip.

virtual Rect getImageBounds ( Point at)
virtual

Reimplemented in ImageStrip.

virtual uint8 getOpacity ( ) const
pure virtual
virtual Color getPixel ( int32  x,
int32  y 
) const
pure virtual

return the full color info, including alpha channel, for the pixel at the given location

virtual Image* getSubsection ( Rect r)
pure virtual

create a new image from a rectangular subsection of the current one

Image* getSubsection ( RotatedRect rr)

create a new image from a rectangular subsection of the current one

virtual Image* getSubsection ( Quad quad)
pure virtual

create a new image from an Quad subsection of the current one

virtual Color getTransparentColor ( )
pure virtual
virtual long getWidth ( )
virtual

Reimplemented in ImageStrip.

virtual void prepareToRasterize ( )
pure virtual

does whatever is necessary to put the image into the final state for rasterization On OpenGL this converts it into an OpenGL texture

static int registerImageForSerialization ( Image img)
static
virtual void retainAlpha ( )
pure virtual

Retain the alpha channel even after the image has been prepared for rasterization.

virtual void retainData ( )
pure virtual

By default, data is released as soon as the image has been prepared for rasterization Calling retainData() will retain the data for use even after that has happened

virtual void setEdgeClamping ( bool  inUseEdgeClamp)
pure virtual
static bool setImageSerializationMode ( ImageSerializationMode  mode)
static
virtual void setOpacity ( uint8  opacity)
pure virtual
virtual Port* setPort ( Port newPort)
virtual

control which port this image draws into

virtual void setTransparentColor ( Color  rgb)
pure virtual

Friends And Related Function Documentation

friend class ImageOpenGL
friend
friend class Port
friend
friend class Sprite
friend