ScummVM API documentation
Sword25::VectorImage Class Reference

Eine Vektorgraphik. More...

#include <vectorimage.h>

Inheritance diagram for Sword25::VectorImage:
Sword25::Image

Public Member Functions

 VectorImage (const byte *pFileData, uint fileSize, bool &success, const Common::String &fname)
 
uint getElementCount () const
 
const VectorImageElementgetElement (uint elementNr) const
 
const Common::RectgetBoundingBox () const
 
int getWidth () const override
 Returns the width of the image in pixels.
 
int getHeight () const override
 Returns the height of the image in pixels.
 
bool fill (const Common::Rect *pFillRect=0, uint color=BS_RGB(0, 0, 0)) override
 fills a rectangular section of the image with a color. More...
 
void render (int width, int height)
 
uint getPixel (int x, int y) override
 Reads out a pixel of the image. More...
 
bool isBlitSource () const override
 Checks, if it is allowed to call BS_Image Blit(). More...
 
bool isBlitTarget () const override
 Checks, if the BS_Image can be a target image for a Blit call. More...
 
bool isScalingAllowed () const override
 Returns true, if the BS_Image is allowed to be scaled by a Blit() call.
 
bool isFillingAllowed () const override
 Returns true, if the BS_Image is allowed to be filled by a Fill() call.
 
bool isAlphaAllowed () const override
 Returns true, if the BS_Image is allowed to be displayed with an alpha value.
 
bool isColorModulationAllowed () const override
 Return true, if the BS_Image is allowed to be displayed with color modulation by a Blit() call.
 
bool isSetContentAllowed () const override
 Returns true, if the content of the BS_Image is allowed to be replaced by call of SetContent().
 
bool setContent (const byte *pixeldata, uint size, uint offset, uint stride) override
 Fills the content of the image with pixel data. More...
 
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) override
 renders the image in the framebuffer More...
 
- Public Member Functions inherited from Sword25::Image
virtual bool isSolid () const
 

Detailed Description

Eine Vektorgraphik.

Objekte dieser Klasse enthalten die Informationen eines SWF-Shapes.

Member Function Documentation

◆ fill()

bool Sword25::VectorImage::fill ( const Common::Rect pFillRect = 0,
uint  color = BS_RGB(0, 0, 0) 
)
overridevirtual

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.

Implements Sword25::Image.

◆ getPixel()

uint Sword25::VectorImage::getPixel ( int  x,
int  y 
)
overridevirtual

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..

Implements Sword25::Image.

◆ isBlitSource()

bool Sword25::VectorImage::isBlitSource ( ) const
inlineoverridevirtual

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

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

Implements Sword25::Image.

◆ isBlitTarget()

bool Sword25::VectorImage::isBlitTarget ( ) const
inlineoverridevirtual

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.

Implements Sword25::Image.

◆ setContent()

bool Sword25::VectorImage::setContent ( const byte *  pixeldata,
uint  size,
uint  offset,
uint  stride 
)
overridevirtual

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.

Implements Sword25::Image.

◆ blit()

bool Sword25::VectorImage::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 
)
overridevirtual

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()

Implements Sword25::Image.


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