31 #ifndef SWORD25_VECTORIMAGE_H 32 #define SWORD25_VECTORIMAGE_H 38 #include "sword25/kernel/common.h" 39 #include "sword25/gfx/image/image.h" 40 #include "common/rect.h" 58 _vec(vec), _lineStyle(lineStyle), _fillStyle0(fillStyle0), _fillStyle1(fillStyle1), _len(len) {}
61 _lineStyle = _fillStyle0 = _fillStyle1 = _len = 0;
68 int getVecLen()
const {
71 uint getLineStyle()
const {
74 uint getFillStyle0()
const {
77 uint getFillStyle1()
const {
96 uint getPathCount()
const {
97 return _pathInfos.size();
100 assert(pathNr < getPathCount());
101 return _pathInfos[pathNr];
104 double getLineStyleWidth(uint lineStyle)
const {
105 assert(lineStyle < _lineStyles.size());
106 return _lineStyles[lineStyle].width;
109 uint getLineStyleCount()
const {
110 return _lineStyles.size();
113 uint32 getLineStyleColor(uint lineStyle)
const {
114 assert(lineStyle < _lineStyles.size());
115 return _lineStyles[lineStyle].color;
118 uint getFillStyleCount()
const {
119 return _fillStyles.size();
122 uint32 getFillStyleColor(uint fillStyle)
const {
123 assert(fillStyle < _fillStyles.size());
124 return _fillStyles[fillStyle];
132 struct LineStyleType {
133 LineStyleType(
double width_, uint32 color_) : width(width_), color(color_) {}
160 uint getElementCount()
const {
161 return _elements.size();
164 assert(elementNr < _elements.size());
165 return _elements[elementNr];
175 return _boundingBox.width();
178 return _boundingBox.height();
180 bool fill(
const Common::Rect *pFillRect = 0, uint color = BS_RGB(0, 0, 0))
override;
182 void render(
int width,
int height);
184 uint getPixel(
int x,
int y)
override;
206 bool setContent(
const byte *pixeldata, uint size, uint offset, uint stride)
override;
207 bool blit(
int posX = 0,
int posY = 0,
208 int flipping = Graphics::FLIP_NONE,
210 uint color = BS_ARGB(255, 255, 255, 255),
211 int width = -1,
int height = -1,
217 bool parseDefineShape(uint shapeType, SWFBitStream &bs);
218 bool parseStyles(uint shapeType, SWFBitStream &bs, uint &numFillBits, uint &numLineBits);
220 ArtBpath *storeBez(
ArtBpath *bez,
int lineStyle,
int fillStyle0,
int fillStyle1,
int *bezNodes,
int *bezAllocated);
bool isBlitSource() const override
Checks, if it is allowed to call BS_Image Blit().
Definition: vectorimage.h:185
int getWidth() const override
Returns the width of the image in pixels.
Definition: vectorimage.h:174
bool isScalingAllowed() const override
Returns true, if the BS_Image is allowed to be scaled by a Blit() call.
Definition: vectorimage.h:191
Eine Vektorgraphik.
Definition: vectorimage.h:155
Definition: microtiles.h:38
bool isColorModulationAllowed() const override
Return true, if the BS_Image is allowed to be displayed with color modulation by a Blit() call...
Definition: vectorimage.h:200
Pfadinformationen zu BS_VectorImageElement Objekten.
Definition: vectorimage.h:55
Ein Element eines Vektorbild. Ein BS_VectorImage besteht aus diesen Elementen, die jeweils einen Teil...
Definition: vectorimage.h:93
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: movie_decoder.h:32
bool isSetContentAllowed() const override
Returns true, if the content of the BS_Image is allowed to be replaced by call of SetContent()...
Definition: vectorimage.h:203
bool isBlitTarget() const override
Checks, if the BS_Image can be a target image for a Blit call.
Definition: vectorimage.h:188
bool isAlphaAllowed() const override
Returns true, if the BS_Image is allowed to be displayed with an alpha value.
Definition: vectorimage.h:197
bool isFillingAllowed() const override
Returns true, if the BS_Image is allowed to be filled by a Fill() call.
Definition: vectorimage.h:194
int getHeight() const override
Returns the height of the image in pixels.
Definition: vectorimage.h:177