PSPFImage Class Reference

#include <PSPFImage.h>

Inherits PSPFGraphic.

List of all members.

Public Member Functions

 PSPFImage (int width, int height, short format, char *filename)
 PSPFImage.
virtual ~PSPFImage ()
 ~PSPFImage
void setFormatSheet (int width, int height)
 setFormatSheet
void setFrameSheet (int frame)
 setFrameSheet
OSL_IMAGE * getImage ()
 getImage
void Mirror ()
 Mirror.
void setPos (int pX, int pY)
 setPos
void setScale (int sX, int sY)
 setScale
void setPivot (int pX, int pY)
 setPivot
void setAngle (int ang)
 setAngle
void Draw ()
 Draw.
void DrawXY (int pX, int pY)
 DrawXY.
int getPosX ()
 getPosX
int getPosY ()
 getPosY
int getSizeX ()
 getSizeX
int getSizeY ()
 getSizeY
int getPivotX ()
 getPivotX
int getPivotY ()
 getPivotY
int getAngle ()
 getAngle
int getScaleX ()
 getScaleX
int getScaleY ()
 getScaleY


Constructor & Destructor Documentation

PSPFImage::PSPFImage ( int  width,
int  height,
short  format,
char *  filename 
)

PSPFImage.

Load a image for a memory, so that this can be manipulated. Is possiple load JPG, GIF, PNG e BMP.

Parameters:
width Image width in pixels.
height Image heigth in pixels.
format Pixel Format. It is used to describe the format of the colors of each pixel. In PSP there is 6 main pixelformats, some of them are only used in certain circumstances:
  • OSL_PF_8888: 32 bits per pixel, 8 bits for red, green, blue and alpha. The alpha component is used to define the opacity of a pixel (255=opaque, 0=transparent).
  • OSL_PF_5650: 16 bits per pixel, 5 bits for red, 6 bits for green, 5 bits for blue and 0 for the alpha value. These images should not be used for sprites or maps, because they can't have any transparent part because there is not a alpha channel.
  • OSL_PF_5551: 16 bits per pixel, 5 bits for red, 5 bits for green, 5 bits for blue, and 1 bit for the alpha component, it just show you if the pixel is transparent or displayed. Useful for simple sprites.
  • OSL_PF_4444: 16 bits per pixel, 4 bits for red, green, blue and alpha components. These images have a limited amount of colors (4096), but they can define 16 levels of transparency for each pixel.
  • OSL_PF_8BIT: 8 bits per pixel, indexed on a palette.
  • OSL_PF_4BIT: 4 bits per pixel, indexed on a palette.
filename Caminho e nome do arquivo da imagem a ser carregada.

virtual PSPFImage::~PSPFImage (  )  [virtual]

~PSPFImage

Destroy the image. Delete object class and unload images from memory


Member Function Documentation

void PSPFImage::setFormatSheet ( int  width,
int  height 
)

setFormatSheet

define the cell's size of drawing of the image, to be used in Draw. It is of obligatory use in the class PSPFAnimationSheet.

Parameters:
width Cell's wedth.
height Cell's height.

void PSPFImage::setFrameSheet ( int  frame  ) 

setFrameSheet

Define which the cell of the sheet is active. This will be the cell drawn in the method Draw, if the method setFormatSheet have been used.

Parameters:
frame define the active cell.
See also:
setFormatSheet Function that define the cell's size.

OSL_IMAGE* PSPFImage::getImage (  ) 

getImage

Retorn the image allocated in the memory.

Returns:
The image, in the format of OSLib.

void PSPFImage::Mirror (  ) 

Mirror.

It executes a mirror in the image, through a horizontal FLIP.

See also:
Draw draw the image in the screen.

void PSPFImage::setPos ( int  pX,
int  pY 
) [virtual]

setPos

permit to define the position of the graphc pivot. Should be specified the coordinates X and Y as parameters. The screen of PSP possesses the resolution of 480x272. The position is used to draw the graphic in the screen.

Parameters:
pX Pivot position in X.
pY Pivot position in Y.
See also:
getPosX Function that return the position X of the graph.

getPosY Function that return the position Y of the graph.

Reimplemented from PSPFGraphic.

void PSPFImage::setScale ( int  sX,
int  sY 
) [virtual]

setScale

This method permits the graphic to be scale. enough to inform the new sizes. The original size won't be altered, just as it will be drawn.

Parameters:
sX Size in X.
sY Size in Y.
See also:
getScaleX Function that return the image size scaled in X.

getScaleY Function that return the image size scaled in Y.

Reimplemented from PSPFGraphic.

void PSPFImage::setPivot ( int  pX,
int  pY 
) [virtual]

setPivot

Define the graphc pivot. The pivot and the point of graphc reference. This point is used for the displacement operations and graphc rotation. Its is relative the position (0,0) of the graph.

Parameters:
pX Pivot Position X.
pY Pivot Position Y.
See also:
getPivotX Function that return the pivot position in X.

getPivotY Function that return the pivot position in Y.

Reimplemented from PSPFGraphic.

void PSPFImage::setAngle ( int  ang  )  [virtual]

setAngle

This function defines the grephc angle. Positive values rotate the graph in the counterclockwise sense, and value negative in the hourly sense.

Parameters:
ang Angle of graphc rotation.
See also:
getAngle Function tha return teh rotation angle of graphic.

Reimplemented from PSPFGraphic.

void PSPFImage::Draw (  )  [virtual]

Draw.

This function draws the graph in the screen, in agreement with the defined values previously.

See also:
DrawXY Function that allows to make the draw, specifying the graphc position.

Reimplemented from PSPFGraphic.

void PSPFImage::DrawXY ( int  pX,
int  pY 
) [virtual]

DrawXY.

draw the graph in the screen, in the informed position for the parameters. Just the attribute of class position and ignored.

Parameters:
pX Position X
pY Position Y
See also:
Draw Funcao que permite desenhar o grafico.

Reimplemented from PSPFGraphic.

int PSPFImage::getPosX (  )  [virtual]

getPosX

Function to get the graphc position in X.

Returns:
the position in X.
See also:
setPos Function that difine the graphc position.

Reimplemented from PSPFGraphic.

int PSPFImage::getPosY (  )  [virtual]

getPosY

Function to get the graphc position in Y.

Returns:
the position in Y.
See also:
setPos Function that difine the graphc position.

Reimplemented from PSPFGraphic.

int PSPFImage::getSizeX (  )  [virtual]

getSizeX

Function to get the graphc size in X. The size returned, is the size. real graphc

Returns:
real graphc width

Reimplemented from PSPFGraphic.

int PSPFImage::getSizeY (  )  [virtual]

getSizeY

Function to get the graphc size in Y. The size returned, is the size. real graphc

Returns:
real graphc width

Reimplemented from PSPFGraphic.

int PSPFImage::getPivotX (  )  [virtual]

getPivotX

Return the pivot position in X, graphc relative.

Returns:
pivot in X.
See also:
setPivot Define the pivot position.

Reimplemented from PSPFGraphic.

int PSPFImage::getPivotY (  )  [virtual]

getPivotY

Return the pivot position in Y, graphc relative.

Returns:
pivot in Y.
See also:
setPivot Define the pivot position.

Reimplemented from PSPFGraphic.

int PSPFImage::getAngle (  )  [virtual]

getAngle

Return the angle of graphc rotation.

Returns:
the graphc angle.
See also:
setAngle define the graphc angle.

Reimplemented from PSPFGraphic.

int PSPFImage::getScaleX (  )  [virtual]

getScaleX

Return the graphc size to be scale in X. This function doesn't return the real size.

Returns:
the size graph to be scale in X
See also:
setScale Graphc scale

Reimplemented from PSPFGraphic.

int PSPFImage::getScaleY (  )  [virtual]

getScaleY

Return the graphc size to be scale in Y. This function doesn't return the real size.

Returns:
the size graph to be scale in Y
See also:
setScale Graphc scale

Reimplemented from PSPFGraphic.


The documentation for this class was generated from the following file:
Generated on Sat Oct 27 20:25:29 2007 for PSPFramework by  doxygen 1.5.3