LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Animation Class Reference

#include <Animation.hxx>

Collaboration diagram for Animation:
[legend]

Public Member Functions

 Animation ()
 
 Animation (const Animation &rAnimation)
 
 ~Animation ()
 
Animationoperator= (const Animation &rAnimation)
 
bool operator== (const Animation &rAnimation) const
 
bool operator!= (const Animation &rAnimation) const
 
void Clear ()
 
bool Start (OutputDevice &rOutDev, const Point &rDestPt, const Size &rDestSz, tools::Long nRendererId, OutputDevice *pFirstFrameOutDev)
 
void Stop (const OutputDevice *pOutDev=nullptr, tools::Long nRendererId=0)
 
void Draw (OutputDevice &rOutDev, const Point &rDestPt) const
 
void Draw (OutputDevice &rOutDev, const Point &rDestPt, const Size &rDestSz) const
 
bool IsInAnimation () const
 
bool IsTransparent () const
 
const SizeGetDisplaySizePixel () const
 
void SetDisplaySizePixel (const Size &rSize)
 
const BitmapExGetBitmapEx () const
 
void SetBitmapEx (const BitmapEx &rBmpEx)
 
sal_uInt32 GetLoopCount () const
 
void SetLoopCount (const sal_uInt32 nLoopCount)
 
void ResetLoopCount ()
 
void SetNotifyHdl (const Link< Animation *, void > &rLink)
 
const Link< Animation *, void > & GetNotifyHdl () const
 
std::vector< std::unique_ptr< AnimationFrame > > & GetAnimationFrames ()
 
size_t Count () const
 
bool Insert (const AnimationFrame &rAnimationFrame)
 
const AnimationFrameGet (sal_uInt16 nAnimation) const
 
void Replace (const AnimationFrame &rNewAnimationBmp, sal_uInt16 nAnimation)
 
sal_uLong GetSizeBytes () const
 
BitmapChecksum GetChecksum () const
 
void Convert (BmpConversion eConversion)
 
bool ReduceColors (sal_uInt16 nNewColorCount)
 
bool Invert ()
 
void Mirror (BmpMirrorFlags nMirrorFlags)
 
void Adjust (short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma=1.0, bool bInvert=false)
 
SAL_DLLPRIVATE sal_uLong ImplGetCurPos () const
 

Static Public Member Functions

static SAL_DLLPRIVATE void ImplIncAnimCount ()
 
static SAL_DLLPRIVATE void ImplDecAnimCount ()
 

Private Member Functions

SAL_DLLPRIVATE std::vector< std::unique_ptr< AnimationData > > CreateAnimationDataItems ()
 
SAL_DLLPRIVATE void PopulateRenderers ()
 
SAL_DLLPRIVATE void RenderNextFrameInAllRenderers ()
 
SAL_DLLPRIVATE void PruneMarkedRenderers ()
 
SAL_DLLPRIVATE bool IsAnyRendererActive ()
 
SAL_DLLPRIVATE void ImplRestartTimer (sal_uLong nTimeout)
 
 DECL_DLLPRIVATE_LINK (ImplTimeoutHdl, Timer *, void)
 

Private Attributes

std::vector< std::unique_ptr< AnimationFrame > > maFrames
 
std::vector< std::unique_ptr< AnimationRenderer > > maRenderers
 
Link< Animation *, void > maNotifyLink
 
BitmapEx maBitmapEx
 
Timer maTimer
 
Size maGlobalSize
 
sal_uInt32 mnLoopCount
 
sal_uInt32 mnLoops
 
size_t mnFrameIndex
 
bool mbIsInAnimation
 
bool mbLoopTerminated
 

Static Private Attributes

static SAL_DLLPRIVATE sal_uLong gAnimationRendererCount = 0
 

Friends

SvStreamReadAnimation (SvStream &rIStream, Animation &rAnimation)
 
SvStreamWriteAnimation (SvStream &rOStream, const Animation &rAnimation)
 

Detailed Description

Definition at line 33 of file Animation.hxx.

Constructor & Destructor Documentation

◆ Animation() [1/2]

Animation::Animation ( )

Definition at line 36 of file Animation.cxx.

References LINK, maTimer, mnLoopCount, and Timer::SetInvokeHandler().

◆ Animation() [2/2]

Animation::Animation ( const Animation rAnimation)

◆ ~Animation()

Animation::~Animation ( )

Definition at line 63 of file Animation.cxx.

References mbIsInAnimation, and Stop().

Member Function Documentation

◆ Adjust()

void Animation::Adjust ( short  nLuminancePercent,
short  nContrastPercent,
short  nChannelRPercent,
short  nChannelGPercent,
short  nChannelBPercent,
double  fGamma = 1.0,
bool  bInvert = false 
)

Definition at line 566 of file Animation.cxx.

References BitmapEx::Adjust(), i, IsInAnimation(), maBitmapEx, maFrames, n, and SAL_WARN_IF.

◆ Clear()

void Animation::Clear ( )

◆ Convert()

void Animation::Convert ( BmpConversion  eConversion)

Definition at line 467 of file Animation.cxx.

References BitmapEx::Convert(), i, IsInAnimation(), maBitmapEx, maFrames, n, and SAL_WARN_IF.

◆ Count()

size_t Animation::Count ( ) const
inline

◆ CreateAnimationDataItems()

std::vector< std::unique_ptr< AnimationData > > Animation::CreateAnimationDataItems ( )
private

Definition at line 285 of file Animation.cxx.

References maRenderers.

Referenced by PopulateRenderers().

◆ DECL_DLLPRIVATE_LINK()

Animation::DECL_DLLPRIVATE_LINK ( ImplTimeoutHdl  ,
Timer ,
void   
)
private

◆ Draw() [1/2]

void Animation::Draw ( OutputDevice rOutDev,
const Point rDestPt 
) const

Definition at line 238 of file Animation.cxx.

References Draw(), maGlobalSize, and OutputDevice::PixelToLogic().

Referenced by Draw(), and Start().

◆ Draw() [2/2]

void Animation::Draw ( OutputDevice rOutDev,
const Point rDestPt,
const Size rDestSz 
) const

◆ Get()

const AnimationFrame & Animation::Get ( sal_uInt16  nAnimation) const

Definition at line 434 of file Animation.cxx.

References maFrames, and SAL_WARN_IF.

Referenced by AnimationRenderer::draw(), and GraphicObject::GetTransformedGraphic().

◆ GetAnimationFrames()

std::vector< std::unique_ptr< AnimationFrame > > & Animation::GetAnimationFrames ( )
inline

Definition at line 70 of file Animation.hxx.

Referenced by BitmapFilter::Filter().

◆ GetBitmapEx()

const BitmapEx & Animation::GetBitmapEx ( ) const
inline

◆ GetChecksum()

BitmapChecksum Animation::GetChecksum ( ) const

◆ GetDisplaySizePixel()

const Size & Animation::GetDisplaySizePixel ( ) const
inline

◆ GetLoopCount()

sal_uInt32 Animation::GetLoopCount ( ) const
inline

Definition at line 63 of file Animation.hxx.

References mnLoopCount.

◆ GetNotifyHdl()

const Link< Animation *, void > & Animation::GetNotifyHdl ( ) const
inline

Definition at line 68 of file Animation.hxx.

◆ GetSizeBytes()

sal_uLong Animation::GetSizeBytes ( ) const

Definition at line 128 of file Animation.cxx.

References GetBitmapEx(), BitmapEx::GetSizeBytes(), and maFrames.

◆ ImplDecAnimCount()

static SAL_DLLPRIVATE void Animation::ImplDecAnimCount ( )
inlinestatic

Definition at line 94 of file Animation.hxx.

Referenced by AnimationRenderer::~AnimationRenderer().

◆ ImplGetCurPos()

SAL_DLLPRIVATE sal_uLong Animation::ImplGetCurPos ( ) const
inline

Definition at line 95 of file Animation.hxx.

Referenced by AnimationRenderer::AnimationRenderer().

◆ ImplIncAnimCount()

static SAL_DLLPRIVATE void Animation::ImplIncAnimCount ( )
inlinestatic

Definition at line 93 of file Animation.hxx.

Referenced by AnimationRenderer::AnimationRenderer().

◆ ImplRestartTimer()

void Animation::ImplRestartTimer ( sal_uLong  nTimeout)
private

Definition at line 279 of file Animation.cxx.

References maTimer, Timer::SetTimeout(), and Timer::Start().

Referenced by RenderNextFrameInAllRenderers(), and Start().

◆ Insert()

bool Animation::Insert ( const AnimationFrame rAnimationFrame)

◆ Invert()

bool Animation::Invert ( )

Definition at line 510 of file Animation.cxx.

References i, BitmapEx::Invert(), IsInAnimation(), maBitmapEx, maFrames, n, and SAL_WARN_IF.

◆ IsAnyRendererActive()

bool Animation::IsAnyRendererActive ( )
private

Definition at line 376 of file Animation.cxx.

References maRenderers.

◆ IsInAnimation()

bool Animation::IsInAnimation ( ) const
inline

Definition at line 54 of file Animation.hxx.

Referenced by Adjust(), Convert(), BitmapFilter::Filter(), Insert(), Invert(), Mirror(), and ReduceColors().

◆ IsTransparent()

bool Animation::IsTransparent ( ) const

Definition at line 109 of file Animation.cxx.

References BitmapEx::IsAlpha(), maBitmapEx, maFrames, and maGlobalSize.

◆ Mirror()

void Animation::Mirror ( BmpMirrorFlags  nMirrorFlags)

◆ operator!=()

bool Animation::operator!= ( const Animation rAnimation) const
inline

Definition at line 42 of file Animation.hxx.

◆ operator=()

Animation & Animation::operator= ( const Animation rAnimation)

◆ operator==()

bool Animation::operator== ( const Animation rAnimation) const

Definition at line 88 of file Animation.cxx.

References maBitmapEx, maFrames, and maGlobalSize.

◆ PopulateRenderers()

void Animation::PopulateRenderers ( )
private

◆ PruneMarkedRenderers()

void Animation::PruneMarkedRenderers ( )
private

Definition at line 364 of file Animation.cxx.

References maRenderers.

◆ ReduceColors()

bool Animation::ReduceColors ( sal_uInt16  nNewColorCount)

Definition at line 484 of file Animation.cxx.

References BitmapFilter::Filter(), i, IsInAnimation(), maBitmapEx, maFrames, n, and SAL_WARN_IF.

◆ RenderNextFrameInAllRenderers()

void Animation::RenderNextFrameInAllRenderers ( )
private

◆ Replace()

void Animation::Replace ( const AnimationFrame rNewAnimationBmp,
sal_uInt16  nAnimation 
)

◆ ResetLoopCount()

void Animation::ResetLoopCount ( )

Definition at line 461 of file Animation.cxx.

References mbLoopTerminated, mnLoopCount, and mnLoops.

Referenced by SetLoopCount().

◆ SetBitmapEx()

void Animation::SetBitmapEx ( const BitmapEx rBmpEx)
inline

Definition at line 61 of file Animation.hxx.

Referenced by BitmapFilter::Filter(), and TypeSerializer::readGraphic().

◆ SetDisplaySizePixel()

void Animation::SetDisplaySizePixel ( const Size rSize)
inline

Definition at line 58 of file Animation.hxx.

Referenced by GraphicObject::GetTransformedGraphic().

◆ SetLoopCount()

void Animation::SetLoopCount ( const sal_uInt32  nLoopCount)

Definition at line 455 of file Animation.cxx.

References mnLoopCount, and ResetLoopCount().

Referenced by GraphicObject::GetTransformedGraphic().

◆ SetNotifyHdl()

void Animation::SetNotifyHdl ( const Link< Animation *, void > &  rLink)
inline

Definition at line 67 of file Animation.hxx.

◆ Start()

bool Animation::Start ( OutputDevice rOutDev,
const Point rDestPt,
const Size rDestSz,
tools::Long  nRendererId,
OutputDevice pFirstFrameOutDev 
)

◆ Stop()

void Animation::Stop ( const OutputDevice pOutDev = nullptr,
tools::Long  nRendererId = 0 
)

Definition at line 222 of file Animation.cxx.

References maRenderers, maTimer, mbIsInAnimation, and Task::Stop().

Referenced by RenderNextFrameInAllRenderers(), and ~Animation().

Friends And Related Function Documentation

◆ ReadAnimation

SvStream & ReadAnimation ( SvStream rIStream,
Animation rAnimation 
)
friend

Definition at line 634 of file Animation.cxx.

◆ WriteAnimation

SvStream & WriteAnimation ( SvStream rOStream,
const Animation rAnimation 
)
friend

Definition at line 588 of file Animation.cxx.

Member Data Documentation

◆ gAnimationRendererCount

sal_uLong Animation::gAnimationRendererCount = 0
staticprivate

Definition at line 98 of file Animation.hxx.

◆ maBitmapEx

BitmapEx Animation::maBitmapEx
private

◆ maFrames

std::vector<std::unique_ptr<AnimationFrame> > Animation::maFrames
private

◆ maGlobalSize

Size Animation::maGlobalSize
private

Definition at line 106 of file Animation.hxx.

Referenced by Clear(), Draw(), GetChecksum(), Insert(), IsTransparent(), Mirror(), operator=(), and operator==().

◆ maNotifyLink

Link<Animation*, void> Animation::maNotifyLink
private

Definition at line 103 of file Animation.hxx.

◆ maRenderers

std::vector<std::unique_ptr<AnimationRenderer> > Animation::maRenderers
private

◆ maTimer

Timer Animation::maTimer
private

Definition at line 105 of file Animation.hxx.

Referenced by Animation(), Clear(), ImplRestartTimer(), Start(), and Stop().

◆ mbIsInAnimation

bool Animation::mbIsInAnimation
private

Definition at line 110 of file Animation.hxx.

Referenced by Clear(), Start(), Stop(), and ~Animation().

◆ mbLoopTerminated

bool Animation::mbLoopTerminated
private

◆ mnFrameIndex

size_t Animation::mnFrameIndex
private

Definition at line 109 of file Animation.hxx.

Referenced by Draw(), operator=(), RenderNextFrameInAllRenderers(), and Start().

◆ mnLoopCount

sal_uInt32 Animation::mnLoopCount
private

Definition at line 107 of file Animation.hxx.

Referenced by Animation(), operator=(), ResetLoopCount(), and SetLoopCount().

◆ mnLoops

sal_uInt32 Animation::mnLoops
private

Definition at line 108 of file Animation.hxx.

Referenced by Animation(), operator=(), RenderNextFrameInAllRenderers(), and ResetLoopCount().


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