LibreOffice Module vcl (master) 1
Animation.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <algorithm>
21#include <sal/config.h>
22
23#include <tools/stream.hxx>
25#include <sal/log.hxx>
26
28#include <vcl/outdev.hxx>
29#include <vcl/dibtools.hxx>
31
33
35
37 : maTimer("vcl::Animation")
38 , mnLoopCount(0)
39 , mnLoops(0)
40 , mnPos(0)
41 , mbIsInAnimation(false)
42 , mbLoopTerminated(false)
43{
44 maTimer.SetInvokeHandler(LINK(this, Animation, ImplTimeoutHdl));
45}
46
48 : maBitmapEx(rAnimation.maBitmapEx)
49 , maTimer("vcl::Animation")
50 , maGlobalSize(rAnimation.maGlobalSize)
51 , mnLoopCount(rAnimation.mnLoopCount)
52 , mnPos(rAnimation.mnPos)
53 , mbIsInAnimation(false)
54 , mbLoopTerminated(rAnimation.mbLoopTerminated)
55{
56 for (auto const& rFrame : rAnimation.maFrames)
57 maFrames.emplace_back(new AnimationFrame(*rFrame));
58
59 maTimer.SetInvokeHandler(LINK(this, Animation, ImplTimeoutHdl));
61}
62
64{
66 Stop();
67}
68
70{
71 if (this != &rAnimation)
72 {
73 Clear();
74
75 for (auto const& i : rAnimation.maFrames)
76 maFrames.emplace_back(new AnimationFrame(*i));
77
78 maGlobalSize = rAnimation.maGlobalSize;
79 maBitmapEx = rAnimation.maBitmapEx;
80 mnLoopCount = rAnimation.mnLoopCount;
81 mnPos = rAnimation.mnPos;
84 }
85 return *this;
86}
87
88bool Animation::operator==(const Animation& rAnimation) const
89{
90 return maFrames.size() == rAnimation.maFrames.size() && maBitmapEx == rAnimation.maBitmapEx
91 && maGlobalSize == rAnimation.maGlobalSize
92 && std::equal(maFrames.begin(), maFrames.end(), rAnimation.maFrames.begin(),
93 [](const std::unique_ptr<AnimationFrame>& pAnim1,
94 const std::unique_ptr<AnimationFrame>& pAnim2) -> bool {
95 return *pAnim1 == *pAnim2;
96 });
97}
98
100{
101 maTimer.Stop();
102 mbIsInAnimation = false;
103 maGlobalSize = Size();
105 maFrames.clear();
106 maRenderers.clear();
107}
108
110{
112
113 // If some small bitmap needs to be replaced by the background,
114 // we need to be transparent, in order to be displayed correctly
115 // as the application (?) does not invalidate on non-transparent
116 // graphics due to performance reasons.
117
118 return maBitmapEx.IsAlpha()
119 || std::any_of(maFrames.begin(), maFrames.end(),
120 [&aRect](const std::unique_ptr<AnimationFrame>& pAnim) -> bool {
121 return pAnim->meDisposal == Disposal::Back
122 && tools::Rectangle{ pAnim->maPositionPixel,
123 pAnim->maSizePixel }
124 != aRect;
125 });
126}
127
129{
130 sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
131
132 for (auto const& pAnimationFrame : maFrames)
133 {
134 nSizeBytes += pAnimationFrame->maBitmapEx.GetSizeBytes();
135 }
136
137 return nSizeBytes;
138}
139
141{
142 SVBT32 aBT32;
145
146 UInt32ToSVBT32(maFrames.size(), aBT32);
147 nCrc = vcl_get_checksum(nCrc, aBT32, 4);
148
149 Int32ToSVBT32(maGlobalSize.Width(), aBT32);
150 nCrc = vcl_get_checksum(nCrc, aBT32, 4);
151
152 Int32ToSVBT32(maGlobalSize.Height(), aBT32);
153 nCrc = vcl_get_checksum(nCrc, aBT32, 4);
154
155 for (auto const& i : maFrames)
156 {
157 BCToBCOA(i->GetChecksum(), aBCOA);
158 nCrc = vcl_get_checksum(nCrc, aBCOA, BITMAP_CHECKSUM_SIZE);
159 }
160
161 return nCrc;
162}
163
164bool Animation::Start(OutputDevice& rOut, const Point& rDestPt, const Size& rDestSz,
165 tools::Long nRendererId, OutputDevice* pFirstFrameOutDev)
166{
167 bool bRet = false;
168
169 if (!maFrames.empty())
170 {
173 {
174 bool differs = true;
175
176 auto itAnimView = std::find_if(
177 maRenderers.begin(), maRenderers.end(),
178 [&rOut, nRendererId](const std::unique_ptr<AnimationRenderer>& pAnimView) -> bool {
179 return pAnimView->matches(&rOut, nRendererId);
180 });
181
182 if (itAnimView != maRenderers.end())
183 {
184 if ((*itAnimView)->getOriginPosition() == rDestPt
185 && (*itAnimView)->getOutSizePix() == rOut.LogicToPixel(rDestSz))
186 {
187 (*itAnimView)->repaint();
188 differs = false;
189 }
190 else
191 maRenderers.erase(itAnimView);
192 }
193
194 if (maRenderers.empty())
195 {
196 maTimer.Stop();
197 mbIsInAnimation = false;
198 mnPos = 0;
199 }
200
201 if (differs)
202 maRenderers.emplace_back(new AnimationRenderer(this, &rOut, rDestPt, rDestSz,
203 nRendererId, pFirstFrameOutDev));
204
205 if (!mbIsInAnimation)
206 {
208 mbIsInAnimation = true;
209 }
210 }
211 else
212 Draw(rOut, rDestPt, rDestSz);
213
214 bRet = true;
215 }
216
217 return bRet;
218}
219
220void Animation::Stop(const OutputDevice* pOut, tools::Long nRendererId)
221{
222 maRenderers.erase(
223 std::remove_if(maRenderers.begin(), maRenderers.end(),
224 [=](const std::unique_ptr<AnimationRenderer>& pAnimView) -> bool {
225 return pAnimView->matches(pOut, nRendererId);
226 }),
227 maRenderers.end());
228
229 if (maRenderers.empty())
230 {
231 maTimer.Stop();
232 mbIsInAnimation = false;
233 }
234}
235
236void Animation::Draw(OutputDevice& rOut, const Point& rDestPt) const
237{
238 Draw(rOut, rDestPt, rOut.PixelToLogic(maGlobalSize));
239}
240
241void Animation::Draw(OutputDevice& rOut, const Point& rDestPt, const Size& rDestSz) const
242{
243 const size_t nCount = maFrames.size();
244
245 if (!nCount)
246 return;
247
248 AnimationFrame* pObj = maFrames[std::min(mnPos, nCount - 1)].get();
249
250 if (rOut.GetConnectMetaFile() || (rOut.GetOutDevType() == OUTDEV_PRINTER))
251 {
252 maFrames[0]->maBitmapEx.Draw(&rOut, rDestPt, rDestSz);
253 }
254 else if (ANIMATION_TIMEOUT_ON_CLICK == pObj->mnWait)
255 {
256 pObj->maBitmapEx.Draw(&rOut, rDestPt, rDestSz);
257 }
258 else
259 {
260 const size_t nOldPos = mnPos;
262 const_cast<Animation*>(this)->mnPos = nCount - 1;
263
264 {
265 AnimationRenderer{ const_cast<Animation*>(this), &rOut, rDestPt, rDestSz, 0 };
266 }
267
268 const_cast<Animation*>(this)->mnPos = nOldPos;
269 }
270}
271
272namespace
273{
274constexpr sal_uLong constMinTimeout = 2;
275}
276
278{
279 maTimer.SetTimeout(std::max(nTimeout, constMinTimeout) * 10);
280 maTimer.Start();
281}
282
283IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer*, void)
284{
285 const size_t nAnimCount = maFrames.size();
286
287 if (nAnimCount)
288 {
289 bool bGlobalPause = false;
290
291 if (maNotifyLink.IsSet())
292 {
293 std::vector<std::unique_ptr<AnimationData>> aDataItems;
294 // create AnimationData-List
295 for (auto const& i : maRenderers)
296 aDataItems.emplace_back(i->createAnimationData());
297
298 maNotifyLink.Call(this);
299
300 // set view state from AnimationData structure
301 for (auto& pDataItem : aDataItems)
302 {
303 AnimationRenderer* pRenderer = nullptr;
304 if (!pDataItem->mpRendererData)
305 {
306 pRenderer = new AnimationRenderer(
307 this, pDataItem->mpRenderContext, pDataItem->maOriginStartPt,
308 pDataItem->maStartSize, pDataItem->mnRendererId);
309
310 maRenderers.push_back(std::unique_ptr<AnimationRenderer>(pRenderer));
311 }
312 else
313 {
314 pRenderer = static_cast<AnimationRenderer*>(pDataItem->mpRendererData);
315 }
316
317 pRenderer->pause(pDataItem->mbIsPaused);
318 pRenderer->setMarked(true);
319 }
320
321 // delete all unmarked views
322 auto removeStart
323 = std::remove_if(maRenderers.begin(), maRenderers.end(),
324 [](const auto& pRenderer) { return !pRenderer->isMarked(); });
325 maRenderers.erase(removeStart, maRenderers.cend());
326
327 // check if every remaining view is paused
328 bGlobalPause = std::all_of(maRenderers.cbegin(), maRenderers.cend(),
329 [](const auto& pRenderer) { return pRenderer->isPaused(); });
330
331 // reset marked state
332 std::for_each(maRenderers.cbegin(), maRenderers.cend(),
333 [](const auto& pRenderer) { pRenderer->setMarked(false); });
334 }
335
336 if (maRenderers.empty())
337 {
338 Stop();
339 }
340 else if (bGlobalPause)
341 {
342 ImplRestartTimer(10);
343 }
344 else
345 {
346 AnimationFrame* pStepBmp
347 = (++mnPos < maFrames.size()) ? maFrames[mnPos].get() : nullptr;
348
349 if (!pStepBmp)
350 {
351 if (mnLoops == 1)
352 {
353 Stop();
354 mbLoopTerminated = true;
355 mnPos = nAnimCount - 1;
356 maBitmapEx = maFrames[mnPos]->maBitmapEx;
357 return;
358 }
359 else
360 {
361 if (mnLoops)
362 mnLoops--;
363
364 mnPos = 0;
365 pStepBmp = maFrames[mnPos].get();
366 }
367 }
368
369 // Paint all views.
370 std::for_each(maRenderers.cbegin(), maRenderers.cend(),
371 [this](const auto& pRenderer) { pRenderer->draw(mnPos); });
372 /*
373 * If a view is marked, remove the view, because
374 * area of output lies out of display area of window.
375 * Mark state is set from view itself.
376 */
377 auto removeStart
378 = std::remove_if(maRenderers.begin(), maRenderers.end(),
379 [](const auto& pRenderer) { return pRenderer->isMarked(); });
380 maRenderers.erase(removeStart, maRenderers.cend());
381
382 // stop or restart timer
383 if (maRenderers.empty())
384 Stop();
385 else
386 ImplRestartTimer(pStepBmp->mnWait);
387 }
388 }
389 else
390 Stop();
391}
392
394{
395 bool bRet = false;
396
397 if (!IsInAnimation())
398 {
399 tools::Rectangle aGlobalRect(Point(), maGlobalSize);
400
402 = aGlobalRect.Union(tools::Rectangle(rStepBmp.maPositionPixel, rStepBmp.maSizePixel))
403 .GetSize();
404 maFrames.emplace_back(new AnimationFrame(rStepBmp));
405
406 // As a start, we make the first BitmapEx the replacement BitmapEx
407 if (maFrames.size() == 1)
408 maBitmapEx = rStepBmp.maBitmapEx;
409
410 bRet = true;
411 }
412
413 return bRet;
414}
415
416const AnimationFrame& Animation::Get(sal_uInt16 nAnimation) const
417{
418 SAL_WARN_IF((nAnimation >= maFrames.size()), "vcl", "No object at this position");
419 return *maFrames[nAnimation];
420}
421
422void Animation::Replace(const AnimationFrame& rNewAnimationFrame, sal_uInt16 nAnimation)
423{
424 SAL_WARN_IF((nAnimation >= maFrames.size()), "vcl", "No object at this position");
425
426 maFrames[nAnimation].reset(new AnimationFrame(rNewAnimationFrame));
427
428 // If we insert at first position we also need to
429 // update the replacement BitmapEx
430 if ((!nAnimation && (!mbLoopTerminated || (maFrames.size() == 1)))
431 || ((nAnimation == maFrames.size() - 1) && mbLoopTerminated))
432 {
433 maBitmapEx = rNewAnimationFrame.maBitmapEx;
434 }
435}
436
437void Animation::SetLoopCount(const sal_uInt32 nLoopCount)
438{
439 mnLoopCount = nLoopCount;
441}
442
444{
446 mbLoopTerminated = false;
447}
448
450{
451 SAL_WARN_IF(IsInAnimation(), "vcl", "Animation modified while it is animated");
452
453 bool bRet;
454
455 if (!IsInAnimation() && !maFrames.empty())
456 {
457 bRet = true;
458
459 for (size_t i = 0, n = maFrames.size(); (i < n) && bRet; ++i)
460 bRet = maFrames[i]->maBitmapEx.Convert(eConversion);
461
462 maBitmapEx.Convert(eConversion);
463 }
464}
465
466bool Animation::ReduceColors(sal_uInt16 nNewColorCount)
467{
468 SAL_WARN_IF(IsInAnimation(), "vcl", "Animation modified while it is animated");
469
470 bool bRet;
471
472 if (!IsInAnimation() && !maFrames.empty())
473 {
474 bRet = true;
475
476 for (size_t i = 0, n = maFrames.size(); (i < n) && bRet; ++i)
477 {
479 BitmapColorQuantizationFilter(nNewColorCount));
480 }
481
483 }
484 else
485 {
486 bRet = false;
487 }
488
489 return bRet;
490}
491
493{
494 SAL_WARN_IF(IsInAnimation(), "vcl", "Animation modified while it is animated");
495
496 bool bRet;
497
498 if (!IsInAnimation() && !maFrames.empty())
499 {
500 bRet = true;
501
502 for (size_t i = 0, n = maFrames.size(); (i < n) && bRet; ++i)
503 bRet = maFrames[i]->maBitmapEx.Invert();
504
506 }
507 else
508 bRet = false;
509
510 return bRet;
511}
512
514{
515 SAL_WARN_IF(IsInAnimation(), "vcl", "Animation modified while it is animated");
516
517 bool bRet;
518
519 if (IsInAnimation() || maFrames.empty())
520 return;
521
522 bRet = true;
523
524 if (nMirrorFlags == BmpMirrorFlags::NONE)
525 return;
526
527 for (size_t i = 0, n = maFrames.size(); (i < n) && bRet; ++i)
528 {
529 AnimationFrame* pStepBmp = maFrames[i].get();
530 bRet = pStepBmp->maBitmapEx.Mirror(nMirrorFlags);
531 if (bRet)
532 {
533 if (nMirrorFlags & BmpMirrorFlags::Horizontal)
534 pStepBmp->maPositionPixel.setX(maGlobalSize.Width() - pStepBmp->maPositionPixel.X()
535 - pStepBmp->maSizePixel.Width());
536
537 if (nMirrorFlags & BmpMirrorFlags::Vertical)
538 pStepBmp->maPositionPixel.setY(maGlobalSize.Height() - pStepBmp->maPositionPixel.Y()
539 - pStepBmp->maSizePixel.Height());
540 }
541 }
542
543 maBitmapEx.Mirror(nMirrorFlags);
544}
545
546void Animation::Adjust(short nLuminancePercent, short nContrastPercent, short nChannelRPercent,
547 short nChannelGPercent, short nChannelBPercent, double fGamma, bool bInvert)
548{
549 SAL_WARN_IF(IsInAnimation(), "vcl", "Animation modified while it is animated");
550
551 bool bRet;
552
553 if (IsInAnimation() || maFrames.empty())
554 return;
555
556 bRet = true;
557
558 for (size_t i = 0, n = maFrames.size(); (i < n) && bRet; ++i)
559 {
560 bRet = maFrames[i]->maBitmapEx.Adjust(nLuminancePercent, nContrastPercent, nChannelRPercent,
561 nChannelGPercent, nChannelBPercent, fGamma, bInvert);
562 }
563
564 maBitmapEx.Adjust(nLuminancePercent, nContrastPercent, nChannelRPercent, nChannelGPercent,
565 nChannelBPercent, fGamma, bInvert);
566}
567
568SvStream& WriteAnimation(SvStream& rOStm, const Animation& rAnimation)
569{
570 const sal_uInt16 nCount = rAnimation.Count();
571
572 if (nCount)
573 {
574 const sal_uInt32 nDummy32 = 0;
575
576 // If no BitmapEx was set we write the first Bitmap of
577 // the Animation
578 if (rAnimation.GetBitmapEx().GetBitmap().IsEmpty())
579 WriteDIBBitmapEx(rAnimation.Get(0).maBitmapEx, rOStm);
580 else
581 WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm);
582
583 // Write identifier ( SDANIMA1 )
584 rOStm.WriteUInt32(0x5344414e).WriteUInt32(0x494d4931);
585
586 for (sal_uInt16 i = 0; i < nCount; i++)
587 {
588 const AnimationFrame& rAnimationFrame = rAnimation.Get(i);
589 const sal_uInt16 nRest = nCount - i - 1;
590
591 // Write AnimationFrame
592 WriteDIBBitmapEx(rAnimationFrame.maBitmapEx, rOStm);
593 tools::GenericTypeSerializer aSerializer(rOStm);
594 aSerializer.writePoint(rAnimationFrame.maPositionPixel);
595 aSerializer.writeSize(rAnimationFrame.maSizePixel);
596 aSerializer.writeSize(rAnimation.maGlobalSize);
597 rOStm.WriteUInt16((ANIMATION_TIMEOUT_ON_CLICK == rAnimationFrame.mnWait)
598 ? 65535
599 : rAnimationFrame.mnWait);
600 rOStm.WriteUInt16(static_cast<sal_uInt16>(rAnimationFrame.meDisposal));
601 rOStm.WriteBool(rAnimationFrame.mbUserInput);
602 rOStm.WriteUInt32(rAnimation.mnLoopCount);
603 rOStm.WriteUInt32(nDummy32); // Unused
604 rOStm.WriteUInt32(nDummy32); // Unused
605 rOStm.WriteUInt32(nDummy32); // Unused
607 rOStm.WriteUInt16(nRest); // Count of remaining structures
608 }
609 }
610
611 return rOStm;
612}
613
615{
616 sal_uLong nStmPos;
617 sal_uInt32 nAnimMagic1, nAnimMagic2;
618 SvStreamEndian nOldFormat = rIStm.GetEndian();
619 bool bReadAnimations = false;
620
621 rIStm.SetEndian(SvStreamEndian::LITTLE);
622 nStmPos = rIStm.Tell();
623 rIStm.ReadUInt32(nAnimMagic1).ReadUInt32(nAnimMagic2);
624
625 rAnimation.Clear();
626
627 // If the BitmapEx at the beginning have already been read (by Graphic)
628 // we can start reading the AnimationFrames right away
629 if ((nAnimMagic1 == 0x5344414e) && (nAnimMagic2 == 0x494d4931) && !rIStm.GetError())
630 bReadAnimations = true;
631 // Else, we try reading the Bitmap(-Ex)
632 else
633 {
634 rIStm.Seek(nStmPos);
635 ReadDIBBitmapEx(rAnimation.maBitmapEx, rIStm);
636 nStmPos = rIStm.Tell();
637 rIStm.ReadUInt32(nAnimMagic1).ReadUInt32(nAnimMagic2);
638
639 if ((nAnimMagic1 == 0x5344414e) && (nAnimMagic2 == 0x494d4931) && !rIStm.GetError())
640 bReadAnimations = true;
641 else
642 rIStm.Seek(nStmPos);
643 }
644
645 // Read AnimationFrames
646 if (bReadAnimations)
647 {
648 AnimationFrame aAnimationFrame;
649 sal_uInt32 nTmp32;
650 sal_uInt16 nTmp16;
651 bool cTmp;
652
653 do
654 {
655 ReadDIBBitmapEx(aAnimationFrame.maBitmapEx, rIStm);
656 tools::GenericTypeSerializer aSerializer(rIStm);
657 aSerializer.readPoint(aAnimationFrame.maPositionPixel);
658 aSerializer.readSize(aAnimationFrame.maSizePixel);
659 aSerializer.readSize(rAnimation.maGlobalSize);
660 rIStm.ReadUInt16(nTmp16);
661 aAnimationFrame.mnWait = ((65535 == nTmp16) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16);
662 rIStm.ReadUInt16(nTmp16);
663 aAnimationFrame.meDisposal = static_cast<Disposal>(nTmp16);
664 rIStm.ReadCharAsBool(cTmp);
665 aAnimationFrame.mbUserInput = cTmp;
666 rIStm.ReadUInt32(rAnimation.mnLoopCount);
667 rIStm.ReadUInt32(nTmp32); // Unused
668 rIStm.ReadUInt32(nTmp32); // Unused
669 rIStm.ReadUInt32(nTmp32); // Unused
671 rIStm.ReadUInt16(nTmp16); // The rest to read
672
673 rAnimation.Insert(aAnimationFrame);
674 } while (nTmp16 && !rIStm.GetError());
675
676 rAnimation.ResetLoopCount();
677 }
678
679 rIStm.SetEndian(nOldFormat);
680
681 return rIStm;
682}
683
685 : mpRenderContext(nullptr)
686 , mpRendererData(nullptr)
687 , mnRendererId(0)
688 , mbIsPaused(false)
689{
690}
691
692/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Disposal
SvStream & ReadAnimation(SvStream &rIStm, Animation &rAnimation)
Definition: Animation.cxx:614
SvStream & WriteAnimation(SvStream &rOStm, const Animation &rAnimation)
Definition: Animation.cxx:568
IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer *, void)
Definition: Animation.cxx:283
#define ANIMATION_TIMEOUT_ON_CLICK
Definition: Animation.hxx:28
#define BITMAP_CHECKSUM_SIZE
Definition: checksum.hxx:28
sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE]
Definition: checksum.hxx:31
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
void BCToBCOA(BitmapChecksum n, BitmapChecksumOctetArray p)
Definition: checksum.hxx:34
BitmapChecksum vcl_get_checksum(BitmapChecksum Checksum, const void *Data, sal_uInt32 DatLen)
Definition: checksum.hxx:72
void setMarked(bool bIsMarked)
void pause(bool bIsPaused)
void Replace(const AnimationFrame &rNewAnimationBmp, sal_uInt16 nAnimation)
Definition: Animation.cxx:422
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
Definition: Animation.cxx:236
const BitmapEx & GetBitmapEx() const
Definition: Animation.hxx:59
bool IsTransparent() const
Definition: Animation.cxx:109
static SAL_DLLPRIVATE sal_uLong mnAnimCount
Definition: Animation.hxx:97
size_t mnPos
Definition: Animation.hxx:108
void Convert(BmpConversion eConversion)
Definition: Animation.cxx:449
size_t Count() const
Definition: Animation.hxx:70
bool ReduceColors(sal_uInt16 nNewColorCount)
Definition: Animation.cxx:466
std::vector< std::unique_ptr< AnimationRenderer > > maRenderers
Definition: Animation.hxx:100
bool mbIsInAnimation
Definition: Animation.hxx:109
sal_uInt32 mnLoopCount
Definition: Animation.hxx:106
void Clear()
Definition: Animation.cxx:99
BitmapEx maBitmapEx
Definition: Animation.hxx:103
Timer maTimer
Definition: Animation.hxx:104
void Mirror(BmpMirrorFlags nMirrorFlags)
Definition: Animation.cxx:513
void SetLoopCount(const sal_uInt32 nLoopCount)
Definition: Animation.cxx:437
Animation & operator=(const Animation &rAnimation)
Definition: Animation.cxx:69
const AnimationFrame & Get(sal_uInt16 nAnimation) const
Definition: Animation.cxx:416
bool operator==(const Animation &rAnimation) const
Definition: Animation.cxx:88
Size maGlobalSize
Definition: Animation.hxx:105
bool mbLoopTerminated
Definition: Animation.hxx:110
void Adjust(short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma=1.0, bool bInvert=false)
Definition: Animation.cxx:546
bool Insert(const AnimationFrame &rAnimationFrame)
Definition: Animation.cxx:393
sal_uLong GetSizeBytes() const
Definition: Animation.cxx:128
std::vector< std::unique_ptr< AnimationFrame > > maFrames
Definition: Animation.hxx:99
SAL_DLLPRIVATE void ImplRestartTimer(sal_uLong nTimeout)
Definition: Animation.cxx:277
sal_uInt32 mnLoops
Definition: Animation.hxx:107
bool IsInAnimation() const
Definition: Animation.hxx:53
void ResetLoopCount()
Definition: Animation.cxx:443
BitmapChecksum GetChecksum() const
Definition: Animation.cxx:140
bool Invert()
Definition: Animation.cxx:492
bool Start(OutputDevice &rOutDev, const Point &rDestPt, const Size &rDestSz, tools::Long nRendererId, OutputDevice *pFirstFrameOutDev)
Definition: Animation.cxx:164
void Stop(const OutputDevice *pOutDev=nullptr, tools::Long nRendererId=0)
Definition: Animation.cxx:220
bool Invert()
Perform the Invert operation on every pixel.
Definition: BitmapEx.cxx:249
sal_Int64 GetSizeBytes() const
Definition: BitmapEx.cxx:220
bool Convert(BmpConversion eConversion)
Convert bitmap format.
Definition: BitmapEx.cxx:374
bool IsAlpha() const
Definition: BitmapEx.cxx:193
BitmapChecksum GetChecksum() const
Definition: BitmapEx.cxx:230
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
Definition: BitmapEx.cxx:259
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Definition: BitmapEx.cxx:203
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: BitmapEx.cxx:500
bool Adjust(short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma=1.0, bool bInvert=false, bool msoBrightness=false)
Change various global color characteristics.
Definition: BitmapEx.cxx:491
void SetEmpty()
Definition: BitmapEx.cxx:182
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
bool IsEmpty() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
GDIMetaFile * GetConnectMetaFile() const
Definition: outdev.hxx:286
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1169
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:938
OutDevType GetOutDevType() const
Definition: outdev.hxx:407
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvStream & ReadCharAsBool(bool &rBool)
sal_uInt64 Tell() const
void SetEndian(SvStreamEndian SvStreamEndian)
SvStream & WriteBool(bool b)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
SvStreamEndian GetEndian() const
sal_uInt64 Seek(sal_uInt64 nPos)
ErrCode GetError() const
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
void Stop()
Definition: scheduler.cxx:590
Definition: timer.hxx:27
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:90
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: timer.cxx:83
void readPoint(Point &rPoint)
void writePoint(const Point &rPoint)
void readSize(Size &rSize)
void writeSize(const Size &rSize)
constexpr Size GetSize() const
tools::Rectangle & Union(const tools::Rectangle &rRect)
int nCount
bool WriteDIBBitmapEx(const BitmapEx &rSource, SvStream &rOStm)
Definition: dibtools.cxx:1849
bool ReadDIBBitmapEx(BitmapEx &rTarget, SvStream &rIStm, bool bFileHeader, bool bMSOFormat)
Definition: dibtools.cxx:1718
aCursorMoveIdle Stop()
BmpMirrorFlags
::std::size_t mnLoopCount
sal_Int64 n
#define SAL_WARN_IF(condition, area, stream)
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
@ OUTDEV_WINDOW
Definition: outdev.hxx:144
@ OUTDEV_PRINTER
Definition: outdev.hxx:144
sal_uInt8 SVBT32[4]
sal_uIntPtr sal_uLong
OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream &rStrm)
SvStreamEndian
TOOLS_DLLPUBLIC std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream &rStrm, std::string_view rStr)
tools::Long mnWait