LibreOffice Module slideshow (master) 1
|
This class provides the sprite for animated shapes. More...
#include <animatedsprite.hxx>
Public Member Functions | |
AnimatedSprite (ViewLayerSharedPtr xViewLayer, const ::basegfx::B2DSize &rSpriteSizePixel, double nSpritePrio) | |
Create a new AnimatedSprite, for the given metafile shape. More... | |
AnimatedSprite (const AnimatedSprite &)=delete | |
AnimatedSprite & | operator= (const AnimatedSprite &)=delete |
void | resize (const ::basegfx::B2DSize &rSpriteSizePixel) |
Resize the sprite. More... | |
void | setPixelOffset (const ::basegfx::B2DSize &rPixelOffset) |
Set an offset for the content output in pixel. More... | |
void | show () |
Show the sprite. More... | |
void | hide () |
Hide the sprite. More... | |
::cppcanvas::CanvasSharedPtr | getContentCanvas () const |
Query the content canvas for the current sprite. More... | |
void | movePixel (const ::basegfx::B2DPoint &rNewPos) |
Move the sprite in device pixel space. More... | |
void | setAlpha (double rAlpha) |
Set the alpha value of the sprite. More... | |
void | clip (const ::basegfx::B2DPolyPolygon &rClip) |
Set a sprite clip in user coordinate space. More... | |
void | clip () |
Clears a sprite clip. More... | |
void | transform (const ::basegfx::B2DHomMatrix &rTransform) |
Set a sprite transformation. More... | |
Private Attributes | |
ViewLayerSharedPtr | mpViewLayer |
::cppcanvas::CustomSpriteSharedPtr | mpSprite |
::basegfx::B2DSize | maEffectiveSpriteSizePixel |
::basegfx::B2DSize | maContentPixelOffset |
double | mnSpritePrio |
double | mnAlpha |
::std::optional< ::basegfx::B2DPoint > | maPosPixel |
::std::optional< ::basegfx::B2DPolyPolygon > | maClip |
bool | mbSpriteVisible |
This class provides the sprite for animated shapes.
Besides encapsulating the Canvas sprite for animated shapes, this class also handles dynamic sprite resizing and all the gory details of offset calculations and rounding prevention.
Definition at line 45 of file animatedsprite.hxx.
slideshow::internal::AnimatedSprite::AnimatedSprite | ( | ViewLayerSharedPtr | xViewLayer, |
const ::basegfx::B2DSize & | rSpriteSizePixel, | ||
double | nSpritePrio | ||
) |
Create a new AnimatedSprite, for the given metafile shape.
rViewLayer | The destination view layer, on which the animation should appear |
rSpriteSizePixel | The overall size of the sprite in device coordinate space, sufficient to display all transformations, shape changes and clips. |
nSpritePrio | Priority of the sprite. Must remain static over the lifetime of this object |
Definition at line 40 of file animatedsprite.cxx.
References ENSURE_OR_THROW, maEffectiveSpriteSizePixel, mnSpritePrio, mpSprite, and mpViewLayer.
|
delete |
void slideshow::internal::AnimatedSprite::clip | ( | ) |
Clears a sprite clip.
If the sprite is not yet created, this method has no effect.
Definition at line 175 of file animatedsprite.cxx.
void slideshow::internal::AnimatedSprite::clip | ( | const ::basegfx::B2DPolyPolygon & | rClip | ) |
Set a sprite clip in user coordinate space.
If the sprite is not yet created, this method has no effect.
Definition at line 169 of file animatedsprite.cxx.
cppcanvas::CanvasSharedPtr slideshow::internal::AnimatedSprite::getContentCanvas | ( | ) | const |
Query the content canvas for the current sprite.
Note that this method must be called every time something is rendered to the sprite, because XCustomSprite does not guarantee the validity of the canvas after a render operation.
Furthermore, the view transformation on the returned canvas is already correctly setup, matching the associated destination canvas.
Definition at line 66 of file animatedsprite.cxx.
References ENSURE_OR_THROW, basegfx::Size2D< typename TYPE >::getHeight(), basegfx::Size2D< typename TYPE >::getWidth(), maContentPixelOffset, mpSprite, mpViewLayer, and basegfx::B2DHomMatrix::set().
void slideshow::internal::AnimatedSprite::hide | ( | ) |
Hide the sprite.
Definition at line 186 of file animatedsprite.cxx.
References mbSpriteVisible, and mpSprite.
void slideshow::internal::AnimatedSprite::movePixel | ( | const ::basegfx::B2DPoint & | rNewPos | ) |
Move the sprite in device pixel space.
If the sprite is not yet created, this method has no effect.
Definition at line 157 of file animatedsprite.cxx.
References maPosPixel, and mpSprite.
|
delete |
void slideshow::internal::AnimatedSprite::resize | ( | const ::basegfx::B2DSize & | rSpriteSizePixel | ) |
Resize the sprite.
rSpriteSizePixel | The new size in pixel |
Definition at line 91 of file animatedsprite.cxx.
References ENSURE_OR_THROW, basegfx::Size2D< typename TYPE >::getHeight(), basegfx::Size2D< typename TYPE >::getWidth(), maClip, maEffectiveSpriteSizePixel, maPosPixel, mbSpriteVisible, mnAlpha, mnSpritePrio, mpSprite, mpViewLayer, basegfx::Size2D< typename TYPE >::setHeight(), and basegfx::Size2D< typename TYPE >::setWidth().
void slideshow::internal::AnimatedSprite::setAlpha | ( | double | rAlpha | ) |
Set the alpha value of the sprite.
If the sprite is not yet created, this method has no effect.
Definition at line 163 of file animatedsprite.cxx.
void slideshow::internal::AnimatedSprite::setPixelOffset | ( | const ::basegfx::B2DSize & | rPixelOffset | ) |
Set an offset for the content output in pixel.
This method offsets the output on the sprite content canvas by the specified amount of device pixel (for subsequent render operations).
Definition at line 152 of file animatedsprite.cxx.
References maContentPixelOffset.
void slideshow::internal::AnimatedSprite::show | ( | ) |
Show the sprite.
Definition at line 192 of file animatedsprite.cxx.
References mbSpriteVisible, and mpSprite.
void slideshow::internal::AnimatedSprite::transform | ( | const ::basegfx::B2DHomMatrix & | rTransform | ) |
Set a sprite transformation.
If the sprite is not yet created, this method has no effect.
Definition at line 181 of file animatedsprite.cxx.
References mpSprite.
|
private |
Definition at line 148 of file animatedsprite.hxx.
|
private |
Definition at line 143 of file animatedsprite.hxx.
Referenced by getContentCanvas(), and setPixelOffset().
|
private |
Definition at line 142 of file animatedsprite.hxx.
Referenced by AnimatedSprite(), and resize().
|
private |
Definition at line 147 of file animatedsprite.hxx.
Referenced by movePixel(), and resize().
|
private |
Definition at line 150 of file animatedsprite.hxx.
|
private |
Definition at line 146 of file animatedsprite.hxx.
Referenced by resize(), and setAlpha().
|
private |
Definition at line 145 of file animatedsprite.hxx.
Referenced by AnimatedSprite(), and resize().
|
private |
Definition at line 141 of file animatedsprite.hxx.
Referenced by AnimatedSprite(), clip(), getContentCanvas(), hide(), movePixel(), resize(), setAlpha(), show(), and transform().
|
private |
Definition at line 139 of file animatedsprite.hxx.
Referenced by AnimatedSprite(), getContentCanvas(), and resize().