ScummVM API documentation
Sword25::Image Class Referenceabstract
Inheritance diagram for Sword25::Image:
Sword25::RenderedImage Sword25::SWImage Sword25::VectorImage

Public Member Functions

Accessor methods
virtual int getWidth () const =0
 Returns the width of the image in pixels.
 
virtual int getHeight () const =0
 Returns the height of the image in pixels.
 
Render methodes
virtual bool blit (int posX=0, int posY=0, int flipping=Graphics::FLIP_NONE, Common::Rect *pPartRect=NULL, uint color=BS_ARGB(255, 255, 255, 255), int width=-1, int height=-1, RectangleList *updateRects=0)=0
 renders the image in the framebuffer More...
 
virtual bool fill (const Common::Rect *pFillRect=0, uint color=BS_RGB(0, 0, 0))=0
 fills a rectangular section of the image with a color. More...
 
virtual bool setContent (const byte *pixeldata, uint size, uint offset, uint stride)=0
 Fills the content of the image with pixel data. More...
 
virtual uint getPixel (int x, int y)=0
 Reads out a pixel of the image. More...
 
Information methodes
virtual bool isBlitSource () const =0
 Checks, if it is allowed to call BS_Image Blit(). More...
 
virtual bool isBlitTarget () const =0
 Checks, if the BS_Image can be a target image for a Blit call. More...
 
virtual bool isScalingAllowed () const =0
 Returns true, if the BS_Image is allowed to be scaled by a Blit() call.
 
virtual bool isFillingAllowed () const =0
 Returns true, if the BS_Image is allowed to be filled by a Fill() call.
 
virtual bool isAlphaAllowed () const =0
 Returns true, if the BS_Image is allowed to be displayed with an alpha value.
 
virtual bool isColorModulationAllowed () const =0
 Return true, if the BS_Image is allowed to be displayed with color modulation by a Blit() call.
 
virtual bool isSetContentAllowed () const =0
 Returns true, if the content of the BS_Image is allowed to be replaced by call of SetContent().
 
virtual bool isSolid () const
 

Member Function Documentation

◆ blit()

virtual bool Sword25::Image::blit ( int  posX = 0,
int  posY = 0,
int  flipping = Graphics::FLIP_NONE,
Common::Rect pPartRect = NULL,
uint  color = BS_ARGB(255, 255, 255, 255),
int  width = -1,
int  height = -1,
RectangleList updateRects = 0 
)
pure virtual

renders the image in the framebuffer

Parameters
pDesta pointer to the target image. In most cases this is the framebuffer.
PosXthe position on the X-axis in the target image in pixels where the image is supposed to be rendered.
The default value is 0.
PosYthe position on the Y-axis in the target image in pixels where the image is supposed to be rendered.
The default value is 0.
Flippinghow the image should be flipped.
The default value is Graphics::FLIP_NONE (no flipping)
pSrcPartRectPointer on Common::Rect which specifies the section to be rendered. If the whole image has to be rendered the Pointer is NULL.
This referes to the unflipped and unscaled image.
The default value is NULL.
Coloran ARGB color value, which determines the parameters for the color modulation und alpha blending.
The alpha component of the color determines the alpha blending parameter (0 = no covering, 255 = full covering).
The color components determines the color for color modulation.
The default value is BS_ARGB(255, 255, 255, 255) (full covering, no color modulation). The macros BS_RGB and BS_ARGB can be used for the creation of the color value.
Widththe output width of the screen section. The images will be scaled if the output width of the screen section differs from the image section.
The value -1 determines that the image should not be scaled.
The default value is -1.
Widththe output height of the screen section. The images will be scaled if the output width of the screen section differs from the image section.
The value -1 determines that the image should not be scaled.
The default value is -1.
Returns
returns false if the rendering failed.
Remarks
Not all blitting operations of all BS_Image classes are supported.
More information can be find in the class description of BS_Image and the following methodes:
  • IsBlitTarget()
  • IsScalingAllowed()
  • IsFillingAllowed()
  • IsAlphaAllowed()
  • IsColorModulationAllowed()
  • IsSetContentAllowed()

Implemented in Sword25::VectorImage, Sword25::RenderedImage, and Sword25::SWImage.

◆ fill()

virtual bool Sword25::Image::fill ( const Common::Rect pFillRect = 0,
uint  color = BS_RGB(0, 0, 0) 
)
pure virtual

fills a rectangular section of the image with a color.

Parameters
pFillRectPointer on Common::Rect which specifies the section of the image which is supposed to be filled. If the whole image has to be filled this value is NULL.
The default value is NULL.
Colorthe 32 Bit color value for filling the image section.
Remarks
It is possible to create transparent rectangulars by using a color with alpha value not equal to 255.
Independent from the color format of the image, it must be given a 32 bit color value. The macros BS_RGB and BS_ARGB can be used for the creation of the color value.
If the rectangular is not completely inside the screen area, it will be automatically trimmed.

Implemented in Sword25::VectorImage, Sword25::RenderedImage, and Sword25::SWImage.

◆ setContent()

virtual bool Sword25::Image::setContent ( const byte *  pixeldata,
uint  size,
uint  offset,
uint  stride 
)
pure virtual

Fills the content of the image with pixel data.

Parameters
Pixeldataa vector which cotains the pixel data. They must be present in the color format of the image and there must be enough data available for filling the whole image.
Offsetthe offset in Byte in Pixeldata-Vector on which the first pixel to write is located.
The default value is 0.
Stridethe distance in Byte between the end of line and the beginning of a new line in Pixeldata-Vector.
The default value is 0.
Returns
returns false, if the call failed.
Remarks
A call of this methode is only allowd if IsSetContentAllowed() returns true.

Implemented in Sword25::VectorImage, Sword25::RenderedImage, and Sword25::SWImage.

◆ getPixel()

virtual uint Sword25::Image::getPixel ( int  x,
int  y 
)
pure virtual

Reads out a pixel of the image.

Parameters
Xthe X-coordinate of the pixel.
Ythe y-coordinate of the pixel.
Returns
Returns the 32-bit color value of the pixel at the given position.
Remarks
This methode should not be used in no way to read out bigger parts of the image because the method is very slow. The method is rather intended for reading out single pixels of the image..

Implemented in Sword25::VectorImage, Sword25::RenderedImage, and Sword25::SWImage.

◆ isBlitSource()

virtual bool Sword25::Image::isBlitSource ( ) const
pure virtual

Checks, if it is allowed to call BS_Image Blit().

Returns
Returns false, if a Blit() call is not allowed at this object.

Implemented in Sword25::VectorImage, Sword25::RenderedImage, and Sword25::SWImage.

◆ isBlitTarget()

virtual bool Sword25::Image::isBlitTarget ( ) const
pure virtual

Checks, if the BS_Image can be a target image for a Blit call.

Returns
Returns false, if a Blit() call with this object as a target is not allowed.

Implemented in Sword25::VectorImage, Sword25::RenderedImage, and Sword25::SWImage.


The documentation for this class was generated from the following file: