diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-04-27 23:08:01 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-04-28 05:31:16 +0200 |
commit | 6bcc4cb109b4ab6ec194a04c53cf1d545a7a7dfd (patch) | |
tree | c89f80ddca6eb9dc4c118478e873bc46b7584f6c | |
parent | 9afa666120d8bb045f3569a77475a58c368c03a1 (diff) |
prefix member variables of AnimationBitmap
Change-Id: Ic84773399c95d61f843e4388fe01d00cd4facc5a
Reviewed-on: https://gerrit.libreoffice.org/71425
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 32 | ||||
-rw-r--r-- | filter/source/graphicfilter/egif/egif.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/etiff/etiff.cxx | 4 | ||||
-rw-r--r-- | include/vcl/animate/AnimationBitmap.hxx | 49 | ||||
-rw-r--r-- | sd/source/ui/dlg/animobjs.cxx | 22 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/gdimtftools.cxx | 34 | ||||
-rw-r--r-- | svx/source/dialog/_bmpmask.cxx | 12 | ||||
-rw-r--r-- | svx/source/dialog/_contdlg.cxx | 4 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 14 | ||||
-rw-r--r-- | vcl/source/animate/Animation.cxx | 90 | ||||
-rw-r--r-- | vcl/source/animate/AnimationBitmap.cxx | 16 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmapfilter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/igif/gifread.cxx | 30 | ||||
-rw-r--r-- | vcl/source/gdi/impanmvw.cxx | 18 | ||||
-rw-r--r-- | vcl/source/graphic/GraphicObject.cxx | 18 |
15 files changed, 181 insertions, 170 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 5ad8ad359c0c..76dce81832ba 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -114,13 +114,13 @@ namespace drawinglayer sal_uInt32 generateStepTime(sal_uInt32 nIndex) const { - const AnimationBitmap& rAnimBitmap = maAnimation.Get(sal_uInt16(nIndex)); - sal_uInt32 nWaitTime(rAnimBitmap.nWait * 10); + const AnimationBitmap& rAnimationBitmap = maAnimation.Get(sal_uInt16(nIndex)); + sal_uInt32 nWaitTime(rAnimationBitmap.mnWait * 10); // Take care of special value for MultiPage TIFFs. ATM these shall just // show their first page. Later we will offer some switching when object // is selected. - if (ANIMATION_TIMEOUT_ON_CLICK == rAnimBitmap.nWait) + if (ANIMATION_TIMEOUT_ON_CLICK == rAnimationBitmap.mnWait) { // ATM the huge value would block the timer, so // use a long time to show first page (whole day) @@ -233,14 +233,14 @@ namespace drawinglayer while (mnNextFrameToPrepare <= nTarget) { // prepare step - const AnimationBitmap& rAnimBitmap = maAnimation.Get(sal_uInt16(mnNextFrameToPrepare)); + const AnimationBitmap& rAnimationBitmap = maAnimation.Get(sal_uInt16(mnNextFrameToPrepare)); - switch (rAnimBitmap.eDisposal) + switch (rAnimationBitmap.meDisposal) { case Disposal::Not: { - maVirtualDevice->DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx); - Bitmap aMask = rAnimBitmap.aBmpEx.GetMask(); + maVirtualDevice->DrawBitmapEx(rAnimationBitmap.maPositionPixel, rAnimationBitmap.maBitmapEx); + Bitmap aMask = rAnimationBitmap.maBitmapEx.GetMask(); if (aMask.IsEmpty()) { @@ -252,7 +252,7 @@ namespace drawinglayer else { BitmapEx aExpandVisibilityMask = BitmapEx(aMask, aMask); - maVirtualDeviceMask->DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask); + maVirtualDeviceMask->DrawBitmapEx(rAnimationBitmap.maPositionPixel, aExpandVisibilityMask); } break; @@ -260,15 +260,15 @@ namespace drawinglayer case Disposal::Back: { // #i70772# react on no mask, for primitives, too. - const Bitmap aMask(rAnimBitmap.aBmpEx.GetMask()); - const Bitmap aContent(rAnimBitmap.aBmpEx.GetBitmap()); + const Bitmap aMask(rAnimationBitmap.maBitmapEx.GetMask()); + const Bitmap aContent(rAnimationBitmap.maBitmapEx.GetBitmap()); maVirtualDeviceMask->Erase(); - maVirtualDevice->DrawBitmap(rAnimBitmap.aPosPix, aContent); + maVirtualDevice->DrawBitmap(rAnimationBitmap.maPositionPixel, aContent); if (aMask.IsEmpty()) { - const ::tools::Rectangle aRect(rAnimBitmap.aPosPix, aContent.GetSizePixel()); + const ::tools::Rectangle aRect(rAnimationBitmap.maPositionPixel, aContent.GetSizePixel()); maVirtualDeviceMask->SetFillColor(COL_BLACK); maVirtualDeviceMask->SetLineColor(); maVirtualDeviceMask->DrawRect(aRect); @@ -276,16 +276,16 @@ namespace drawinglayer else { BitmapEx aExpandVisibilityMask = BitmapEx(aMask, aMask); - maVirtualDeviceMask->DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask); + maVirtualDeviceMask->DrawBitmapEx(rAnimationBitmap.maPositionPixel, aExpandVisibilityMask); } break; } case Disposal::Previous: { - maVirtualDevice->DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx); - BitmapEx aExpandVisibilityMask = BitmapEx(rAnimBitmap.aBmpEx.GetMask(), rAnimBitmap.aBmpEx.GetMask()); - maVirtualDeviceMask->DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask); + maVirtualDevice->DrawBitmapEx(rAnimationBitmap.maPositionPixel, rAnimationBitmap.maBitmapEx); + BitmapEx aExpandVisibilityMask = BitmapEx(rAnimationBitmap.maBitmapEx.GetMask(), rAnimationBitmap.maBitmapEx.GetMask()); + maVirtualDeviceMask->DrawBitmapEx(rAnimationBitmap.maPositionPixel, aExpandVisibilityMask); break; } } diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 394f48d4ab9a..42ad6ce71a64 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -212,10 +212,10 @@ void GIFWriter::WriteAnimation( const Animation& rAnimation ) for( sal_uInt16 i = 0; i < nCount; i++ ) { - const AnimationBitmap& rAnimBmp = rAnimation.Get( i ); + const AnimationBitmap& rAnimationBitmap = rAnimation.Get( i ); - WriteBitmapEx( rAnimBmp.aBmpEx, rAnimBmp.aPosPix, true, - rAnimBmp.nWait, rAnimBmp.eDisposal ); + WriteBitmapEx(rAnimationBitmap.maBitmapEx, rAnimationBitmap.maPositionPixel, true, + rAnimationBitmap.mnWait, rAnimationBitmap.meDisposal ); nMinPercent = nMaxPercent; nMaxPercent = static_cast<sal_uInt32>(nMaxPercent + fStep); } diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 004071496b1f..8e70295203e7 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -173,13 +173,13 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem const * pF aAnimation.Insert(AnimationBitmap(rGraphic.GetBitmapEx(), Point(), Size())); for (size_t i = 0; i < aAnimation.Count(); ++i) - mnSumOfAllPictHeight += aAnimation.Get(i).aBmpEx.GetSizePixel().Height(); + mnSumOfAllPictHeight += aAnimation.Get(i).maBitmapEx.GetSizePixel().Height(); for (size_t i = 0; mbStatus && i < aAnimation.Count(); ++i) { mnPalPos = 0; const AnimationBitmap& rAnimationBitmap = aAnimation.Get( i ); - Bitmap aBmp = rAnimationBitmap.aBmpEx.GetBitmap(); + Bitmap aBmp = rAnimationBitmap.maBitmapEx.GetBitmap(); mpAcc = aBmp.AcquireReadAccess(); if ( mpAcc ) { diff --git a/include/vcl/animate/AnimationBitmap.hxx b/include/vcl/animate/AnimationBitmap.hxx index 5b6be90ca2e5..8dd9a0272862 100644 --- a/include/vcl/animate/AnimationBitmap.hxx +++ b/include/vcl/animate/AnimationBitmap.hxx @@ -33,39 +33,44 @@ enum class Disposal struct VCL_DLLPUBLIC AnimationBitmap { - BitmapEx aBmpEx; - Point aPosPix; - Size aSizePix; - long nWait; - Disposal eDisposal; - bool bUserInput; + BitmapEx maBitmapEx; + Point maPositionPixel; + Size maSizePixel; + long mnWait; + Disposal meDisposal; + bool mbUserInput; AnimationBitmap() - : nWait(0) - , eDisposal(Disposal::Not) - , bUserInput(false) + : mnWait(0) + , meDisposal(Disposal::Not) + , mbUserInput(false) { } - AnimationBitmap(const BitmapEx& rBmpEx, const Point& rPosPix, const Size& rSizePix, - long _nWait = 0, Disposal _eDisposal = Disposal::Not) - : aBmpEx(rBmpEx) - , aPosPix(rPosPix) - , aSizePix(rSizePix) - , nWait(_nWait) - , eDisposal(_eDisposal) - , bUserInput(false) + AnimationBitmap(const BitmapEx& rBitmapEx, const Point& rPositionPixel, const Size& rSizePixel, + long nWait = 0, Disposal eDisposal = Disposal::Not) + : maBitmapEx(rBitmapEx) + , maPositionPixel(rPositionPixel) + , maSizePixel(rSizePixel) + , mnWait(nWait) + , meDisposal(eDisposal) + , mbUserInput(false) { } - bool operator==(const AnimationBitmap& rAnimBmp) const + bool operator==(const AnimationBitmap& rAnimationBitmap) const { - return (rAnimBmp.aBmpEx == aBmpEx && rAnimBmp.aPosPix == aPosPix - && rAnimBmp.aSizePix == aSizePix && rAnimBmp.nWait == nWait - && rAnimBmp.eDisposal == eDisposal && rAnimBmp.bUserInput == bUserInput); + return (rAnimationBitmap.maBitmapEx == maBitmapEx + && rAnimationBitmap.maPositionPixel == maPositionPixel + && rAnimationBitmap.maSizePixel == maSizePixel && rAnimationBitmap.mnWait == mnWait + && rAnimationBitmap.meDisposal == meDisposal + && rAnimationBitmap.mbUserInput == mbUserInput); } - bool operator!=(const AnimationBitmap& rAnimBmp) const { return !(*this == rAnimBmp); } + bool operator!=(const AnimationBitmap& rAnimationBitmap) const + { + return !(*this == rAnimationBitmap); + } BitmapChecksum GetChecksum() const; }; diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 8b26299b78ad..fd57e3f4cc14 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -723,7 +723,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) for( sal_uInt16 i = 0; i < nCount; i++ ) { - const AnimationBitmap& rAnimBmp = aAnimation.Get( i ); + const AnimationBitmap& rAnimationBitmap = aAnimation.Get( i ); // LoopCount if( i == 0 ) @@ -736,12 +736,12 @@ void AnimationWindow::AddObj (::sd::View& rView ) m_pLbLoopCount->SelectEntry(OUString::number( nLoopCount ) ); } - long nTime = rAnimBmp.nWait; + long nTime = rAnimationBitmap.mnWait; ::tools::Time aTime( 0, 0, nTime / 100, nTime % 100 ); size_t nIndex = m_nCurrentFrame + 1; m_FrameList.insert( m_FrameList.begin() + nIndex, - ::std::make_pair(rAnimBmp.aBmpEx, aTime)); + ::std::make_pair(rAnimationBitmap.maBitmapEx, aTime)); // increment => next one inserted after this one ++m_nCurrentFrame; @@ -958,21 +958,21 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) } // find LoopCount (number of passes) - AnimationBitmap aAnimBmp; + AnimationBitmap aAnimationBitmap; sal_uInt32 nLoopCount = 0; sal_Int32 nPos = m_pLbLoopCount->GetSelectedEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != m_pLbLoopCount->GetEntryCount() - 1 ) // endless nLoopCount = m_pLbLoopCount->GetSelectedEntry().toUInt32(); - aAnimBmp.aBmpEx = rBitmapEx; - aAnimBmp.aPosPix = aPt; - aAnimBmp.aSizePix = aBitmapSize; - aAnimBmp.nWait = nTime; - aAnimBmp.eDisposal = Disposal::Back; - aAnimBmp.bUserInput = false; + aAnimationBitmap.maBitmapEx = rBitmapEx; + aAnimationBitmap.maPositionPixel = aPt; + aAnimationBitmap.maSizePixel = aBitmapSize; + aAnimationBitmap.mnWait = nTime; + aAnimationBitmap.meDisposal = Disposal::Back; + aAnimationBitmap.mbUserInput = false; - aAnimation.Insert( aAnimBmp ); + aAnimation.Insert( aAnimationBitmap ); aAnimation.SetDisplaySizePixel( aMaxSizePix ); aAnimation.SetLoopCount( nLoopCount ); } diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index ef9f4df82aee..f3159a728475 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -293,14 +293,14 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, for( sal_uInt16 i=0, nCount=aAnimation.Count(); i<nCount; ++i ) { - const AnimationBitmap& rAnimBmp( aAnimation.Get(i) ); - switch(rAnimBmp.eDisposal) + const AnimationBitmap& rAnimationBitmap( aAnimation.Get(i) ); + switch(rAnimationBitmap.meDisposal) { case Disposal::Not: { - pVDev->DrawBitmapEx(rAnimBmp.aPosPix, - rAnimBmp.aBmpEx); - Bitmap aMask = rAnimBmp.aBmpEx.GetMask(); + pVDev->DrawBitmapEx(rAnimationBitmap.maPositionPixel, + rAnimationBitmap.maBitmapEx); + Bitmap aMask = rAnimationBitmap.maBitmapEx.GetMask(); if( aMask.IsEmpty() ) { @@ -314,8 +314,8 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, { BitmapEx aTmpMask = BitmapEx(aMask, aMask); - pVDevMask->DrawBitmapEx(rAnimBmp.aPosPix, - aTmpMask ); + pVDevMask->DrawBitmapEx(rAnimationBitmap.maPositionPixel, + aTmpMask ); } break; } @@ -323,32 +323,32 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, case Disposal::Back: { // #i70772# react on no mask - const Bitmap aMask(rAnimBmp.aBmpEx.GetMask()); - const Bitmap aContent(rAnimBmp.aBmpEx.GetBitmap()); + const Bitmap aMask(rAnimationBitmap.maBitmapEx.GetMask()); + const Bitmap aContent(rAnimationBitmap.maBitmapEx.GetBitmap()); pVDevMask->Erase(); - pVDev->DrawBitmap(rAnimBmp.aPosPix, aContent); + pVDev->DrawBitmap(rAnimationBitmap.maPositionPixel, aContent); if(aMask.IsEmpty()) { - const tools::Rectangle aRect(rAnimBmp.aPosPix, aContent.GetSizePixel()); + const tools::Rectangle aRect(rAnimationBitmap.maPositionPixel, aContent.GetSizePixel()); pVDevMask->SetFillColor( COL_BLACK); pVDevMask->SetLineColor(); pVDevMask->DrawRect(aRect); } else { - pVDevMask->DrawBitmap(rAnimBmp.aPosPix, aMask); + pVDevMask->DrawBitmap(rAnimationBitmap.maPositionPixel, aMask); } break; } case Disposal::Previous : { - pVDev->DrawBitmapEx(rAnimBmp.aPosPix, - rAnimBmp.aBmpEx); - pVDevMask->DrawBitmap(rAnimBmp.aPosPix, - rAnimBmp.aBmpEx.GetMask()); + pVDev->DrawBitmapEx(rAnimationBitmap.maPositionPixel, + rAnimationBitmap.maBitmapEx); + pVDevMask->DrawBitmap(rAnimationBitmap.maPositionPixel, + rAnimationBitmap.maBitmapEx.GetMask()); break; } } @@ -374,7 +374,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, // Take care of special value for MultiPage TIFFs. ATM these shall just // show their first page for _quite_ some time. - sal_Int32 nWaitTime100thSeconds( rAnimBmp.nWait ); + sal_Int32 nWaitTime100thSeconds(rAnimationBitmap.mnWait); if( ANIMATION_TIMEOUT_ON_CLICK == nWaitTime100thSeconds ) { // ATM the huge value would block the timer, so use a long diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 40ce126c1d3e..b0a7b7de8458 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -651,9 +651,9 @@ Animation SvxBmpMask::ImpMask( const Animation& rAnimation ) for( sal_uInt16 i = 0; i < nAnimationCount; i++ ) { - AnimationBitmap aAnimBmp( aAnimation.Get( i ) ); - aAnimBmp.aBmpEx = Mask( aAnimBmp.aBmpEx ).GetBitmapEx(); - aAnimation.Replace( aAnimBmp, i ); + AnimationBitmap aAnimationBitmap( aAnimation.Get( i ) ); + aAnimationBitmap.maBitmapEx = Mask(aAnimationBitmap.maBitmapEx).GetBitmapEx(); + aAnimation.Replace(aAnimationBitmap, i); } return aAnimation; @@ -921,9 +921,9 @@ Animation SvxBmpMask::ImpReplaceTransparency( const Animation& rAnim, const Colo for( sal_uInt16 i = 0; i < nAnimationCount; i++ ) { - AnimationBitmap aAnimBmp( aAnimation.Get( i ) ); - aAnimBmp.aBmpEx = ImpReplaceTransparency( aAnimBmp.aBmpEx, rColor ); - aAnimation.Replace( aAnimBmp, i ); + AnimationBitmap aAnimationBitmap(aAnimation.Get(i)); + aAnimationBitmap.maBitmapEx = ImpReplaceTransparency(aAnimationBitmap.maBitmapEx, rColor); + aAnimation.Replace(aAnimationBitmap, i); } return aAnimation; diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 7e1254899eb7..a63ee17c932b 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -126,9 +126,9 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic, // Push Polygon output to the right place; this is the // offset of the sub-image within the total animation - aTransMap.SetOrigin( Point( rStepBmp.aPosPix.X(), rStepBmp.aPosPix.Y() ) ); + aTransMap.SetOrigin( Point( rStepBmp.maPositionPixel.X(), rStepBmp.maPositionPixel.Y() ) ); pVDev->SetMapMode( aTransMap ); - pVDev->DrawPolyPolygon( CreateAutoContour( rStepBmp.aBmpEx, pRect ) ); + pVDev->DrawPolyPolygon( CreateAutoContour( rStepBmp.maBitmapEx, pRect ) ); } aTransMap.SetOrigin( Point() ); diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index be113900d941..decc1de34565 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -64,21 +64,21 @@ Animation XOutBitmap::MirrorAnimation( const Animation& rAnimation, bool bHMirr, for( sal_uInt16 i = 0, nCount = aNewAnim.Count(); i < nCount; i++ ) { - AnimationBitmap aAnimBmp( aNewAnim.Get( i ) ); + AnimationBitmap aAnimationBitmap( aNewAnim.Get( i ) ); // mirror the BitmapEx - aAnimBmp.aBmpEx.Mirror( nMirrorFlags ); + aAnimationBitmap.maBitmapEx.Mirror( nMirrorFlags ); // Adjust the positions inside the whole bitmap if( bHMirr ) - aAnimBmp.aPosPix.setX( rGlobalSize.Width() - aAnimBmp.aPosPix.X() - - aAnimBmp.aSizePix.Width() ); + aAnimationBitmap.maPositionPixel.setX(rGlobalSize.Width() - aAnimationBitmap.maPositionPixel.X() - + aAnimationBitmap.maSizePixel.Width()); if( bVMirr ) - aAnimBmp.aPosPix.setY( rGlobalSize.Height() - aAnimBmp.aPosPix.Y() - - aAnimBmp.aSizePix.Height() ); + aAnimationBitmap.maPositionPixel.setY(rGlobalSize.Height() - aAnimationBitmap.maPositionPixel.Y() - + aAnimationBitmap.maSizePixel.Height()); - aNewAnim.Replace( aAnimBmp, i ); + aNewAnim.Replace(aAnimationBitmap, i); } } diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index 12d9ae60d07c..c4c15584b050 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -126,10 +126,11 @@ bool Animation::IsTransparent() const // we need to be transparent, in order to be displayed correctly // as the application (?) does not invalidate on non-transparent // graphics due to performance reasons. - for (auto const& pAnimBmp : maList) + for (auto const& pAnimationBitmap : maList) { - if (Disposal::Back == pAnimBmp->eDisposal - && tools::Rectangle(pAnimBmp->aPosPix, pAnimBmp->aSizePix) != aRect) + if (Disposal::Back == pAnimationBitmap->meDisposal + && tools::Rectangle(pAnimationBitmap->maPositionPixel, pAnimationBitmap->maSizePixel) + != aRect) { bRet = true; break; @@ -146,9 +147,9 @@ sal_uLong Animation::GetSizeBytes() const { sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes(); - for (auto const& pAnimBmp : maList) + for (auto const& pAnimationBitmap : maList) { - nSizeBytes += pAnimBmp->aBmpEx.GetSizeBytes(); + nSizeBytes += pAnimationBitmap->maBitmapEx.GetSizeBytes(); } return nSizeBytes; @@ -186,7 +187,7 @@ bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDes if (!maList.empty()) { if ((pOut->GetOutDevType() == OUTDEV_WINDOW) && !mbLoopTerminated - && (ANIMATION_TIMEOUT_ON_CLICK != maList[mnPos]->nWait)) + && (ANIMATION_TIMEOUT_ON_CLICK != maList[mnPos]->mnWait)) { ImplAnimView* pView; ImplAnimView* pMatch = nullptr; @@ -225,7 +226,7 @@ bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDes if (!mbIsInAnimation) { - ImplRestartTimer(maList[mnPos]->nWait); + ImplRestartTimer(maList[mnPos]->mnWait); mbIsInAnimation = true; } } @@ -272,9 +273,9 @@ void Animation::Draw(OutputDevice* pOut, const Point& rDestPt, const Size& rDest AnimationBitmap* pObj = maList[std::min(mnPos, nCount - 1)].get(); if (pOut->GetConnectMetaFile() || (pOut->GetOutDevType() == OUTDEV_PRINTER)) - maList[0]->aBmpEx.Draw(pOut, rDestPt, rDestSz); - else if (ANIMATION_TIMEOUT_ON_CLICK == pObj->nWait) - pObj->aBmpEx.Draw(pOut, rDestPt, rDestSz); + maList[0]->maBitmapEx.Draw(pOut, rDestPt, rDestSz); + else if (ANIMATION_TIMEOUT_ON_CLICK == pObj->mnWait) + pObj->maBitmapEx.Draw(pOut, rDestPt, rDestSz); else { const size_t nOldPos = mnPos; @@ -362,7 +363,7 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer*, void) Stop(); mbLoopTerminated = true; mnPos = nAnimCount - 1; - maBitmapEx = maList[mnPos]->aBmpEx; + maBitmapEx = maList[mnPos]->maBitmapEx; return; } else @@ -396,7 +397,7 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer*, void) if (maViewList.empty()) Stop(); else - ImplRestartTimer(pStepBmp->nWait); + ImplRestartTimer(pStepBmp->mnWait); } } else @@ -412,12 +413,13 @@ bool Animation::Insert(const AnimationBitmap& rStepBmp) tools::Rectangle aGlobalRect(Point(), maGlobalSize); maGlobalSize - = aGlobalRect.Union(tools::Rectangle(rStepBmp.aPosPix, rStepBmp.aSizePix)).GetSize(); + = aGlobalRect.Union(tools::Rectangle(rStepBmp.maPositionPixel, rStepBmp.maSizePixel)) + .GetSize(); maList.emplace_back(new AnimationBitmap(rStepBmp)); // As a start, we make the first BitmapEx the replacement BitmapEx if (maList.size() == 1) - maBitmapEx = rStepBmp.aBmpEx; + maBitmapEx = rStepBmp.maBitmapEx; bRet = true; } @@ -442,7 +444,7 @@ void Animation::Replace(const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 n if ((!nAnimation && (!mbLoopTerminated || (maList.size() == 1))) || ((nAnimation == maList.size() - 1) && mbLoopTerminated)) { - maBitmapEx = rNewAnimationBitmap.aBmpEx; + maBitmapEx = rNewAnimationBitmap.maBitmapEx; } } @@ -469,7 +471,7 @@ void Animation::Convert(BmpConversion eConversion) bRet = true; for (size_t i = 0, n = maList.size(); (i < n) && bRet; ++i) - bRet = maList[i]->aBmpEx.Convert(eConversion); + bRet = maList[i]->maBitmapEx.Convert(eConversion); maBitmapEx.Convert(eConversion); } @@ -487,7 +489,7 @@ bool Animation::ReduceColors(sal_uInt16 nNewColorCount) for (size_t i = 0, n = maList.size(); (i < n) && bRet; ++i) { - bRet = BitmapFilter::Filter(maList[i]->aBmpEx, + bRet = BitmapFilter::Filter(maList[i]->maBitmapEx, BitmapColorQuantizationFilter(nNewColorCount)); } @@ -512,7 +514,7 @@ bool Animation::Invert() bRet = true; for (size_t i = 0, n = maList.size(); (i < n) && bRet; ++i) - bRet = maList[i]->aBmpEx.Invert(); + bRet = maList[i]->maBitmapEx.Invert(); maBitmapEx.Invert(); } @@ -537,16 +539,18 @@ void Animation::Mirror(BmpMirrorFlags nMirrorFlags) for (size_t i = 0, n = maList.size(); (i < n) && bRet; ++i) { AnimationBitmap* pStepBmp = maList[i].get(); - bRet = pStepBmp->aBmpEx.Mirror(nMirrorFlags); + bRet = pStepBmp->maBitmapEx.Mirror(nMirrorFlags); if (bRet) { if (nMirrorFlags & BmpMirrorFlags::Horizontal) - pStepBmp->aPosPix.setX(maGlobalSize.Width() - pStepBmp->aPosPix.X() - - pStepBmp->aSizePix.Width()); + pStepBmp->maPositionPixel.setX(maGlobalSize.Width() + - pStepBmp->maPositionPixel.X() + - pStepBmp->maSizePixel.Width()); if (nMirrorFlags & BmpMirrorFlags::Vertical) - pStepBmp->aPosPix.setY(maGlobalSize.Height() - pStepBmp->aPosPix.Y() - - pStepBmp->aSizePix.Height()); + pStepBmp->maPositionPixel.setY(maGlobalSize.Height() + - pStepBmp->maPositionPixel.Y() + - pStepBmp->maSizePixel.Height()); } } @@ -568,8 +572,9 @@ void Animation::Adjust(short nLuminancePercent, short nContrastPercent, short nC for (size_t i = 0, n = maList.size(); (i < n) && bRet; ++i) { - bRet = maList[i]->aBmpEx.Adjust(nLuminancePercent, nContrastPercent, nChannelRPercent, - nChannelGPercent, nChannelBPercent, fGamma, bInvert); + bRet = maList[i]->maBitmapEx.Adjust(nLuminancePercent, nContrastPercent, + nChannelRPercent, nChannelGPercent, + nChannelBPercent, fGamma, bInvert); } maBitmapEx.Adjust(nLuminancePercent, nContrastPercent, nChannelRPercent, nChannelGPercent, @@ -588,7 +593,7 @@ SvStream& WriteAnimation(SvStream& rOStm, const Animation& rAnimation) // If no BitmapEx was set we write the first Bitmap of // the Animation if (!rAnimation.GetBitmapEx().GetBitmap()) - WriteDIBBitmapEx(rAnimation.Get(0).aBmpEx, rOStm); + WriteDIBBitmapEx(rAnimation.Get(0).maBitmapEx, rOStm); else WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm); @@ -597,18 +602,19 @@ SvStream& WriteAnimation(SvStream& rOStm, const Animation& rAnimation) for (sal_uInt16 i = 0; i < nCount; i++) { - const AnimationBitmap& rAnimBmp = rAnimation.Get(i); + const AnimationBitmap& rAnimationBitmap = rAnimation.Get(i); const sal_uInt16 nRest = nCount - i - 1; // Write AnimationBitmap - WriteDIBBitmapEx(rAnimBmp.aBmpEx, rOStm); - WritePair(rOStm, rAnimBmp.aPosPix); - WritePair(rOStm, rAnimBmp.aSizePix); + WriteDIBBitmapEx(rAnimationBitmap.maBitmapEx, rOStm); + WritePair(rOStm, rAnimationBitmap.maPositionPixel); + WritePair(rOStm, rAnimationBitmap.maSizePixel); WritePair(rOStm, rAnimation.maGlobalSize); - rOStm.WriteUInt16((ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait) ? 65535 - : rAnimBmp.nWait); - rOStm.WriteUInt16(static_cast<sal_uInt16>(rAnimBmp.eDisposal)); - rOStm.WriteBool(rAnimBmp.bUserInput); + rOStm.WriteUInt16((ANIMATION_TIMEOUT_ON_CLICK == rAnimationBitmap.mnWait) + ? 65535 + : rAnimationBitmap.mnWait); + rOStm.WriteUInt16(static_cast<sal_uInt16>(rAnimationBitmap.meDisposal)); + rOStm.WriteBool(rAnimationBitmap.mbUserInput); rOStm.WriteUInt32(rAnimation.mnLoopCount); rOStm.WriteUInt32(nDummy32); // Unused rOStm.WriteUInt32(nDummy32); // Unused @@ -655,23 +661,23 @@ SvStream& ReadAnimation(SvStream& rIStm, Animation& rAnimation) // Read AnimationBitmaps if (bReadAnimations) { - AnimationBitmap aAnimBmp; + AnimationBitmap aAnimationBitmap; sal_uInt32 nTmp32; sal_uInt16 nTmp16; bool cTmp; do { - ReadDIBBitmapEx(aAnimBmp.aBmpEx, rIStm); - ReadPair(rIStm, aAnimBmp.aPosPix); - ReadPair(rIStm, aAnimBmp.aSizePix); + ReadDIBBitmapEx(aAnimationBitmap.maBitmapEx, rIStm); + ReadPair(rIStm, aAnimationBitmap.maPositionPixel); + ReadPair(rIStm, aAnimationBitmap.maSizePixel); ReadPair(rIStm, rAnimation.maGlobalSize); rIStm.ReadUInt16(nTmp16); - aAnimBmp.nWait = ((65535 == nTmp16) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16); + aAnimationBitmap.mnWait = ((65535 == nTmp16) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16); rIStm.ReadUInt16(nTmp16); - aAnimBmp.eDisposal = static_cast<Disposal>(nTmp16); + aAnimationBitmap.meDisposal = static_cast<Disposal>(nTmp16); rIStm.ReadCharAsBool(cTmp); - aAnimBmp.bUserInput = cTmp; + aAnimationBitmap.mbUserInput = cTmp; rIStm.ReadUInt32(rAnimation.mnLoopCount); rIStm.ReadUInt32(nTmp32); // Unused rIStm.ReadUInt32(nTmp32); // Unused @@ -679,7 +685,7 @@ SvStream& ReadAnimation(SvStream& rIStm, Animation& rAnimation) read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); // Unused rIStm.ReadUInt16(nTmp16); // The rest to read - rAnimation.Insert(aAnimBmp); + rAnimation.Insert(aAnimationBitmap); } while (nTmp16 && !rIStm.GetError()); rAnimation.ResetLoopCount(); diff --git a/vcl/source/animate/AnimationBitmap.cxx b/vcl/source/animate/AnimationBitmap.cxx index 963c921d8658..4747ce15ee13 100644 --- a/vcl/source/animate/AnimationBitmap.cxx +++ b/vcl/source/animate/AnimationBitmap.cxx @@ -24,28 +24,28 @@ BitmapChecksum AnimationBitmap::GetChecksum() const { - BitmapChecksum nCrc = aBmpEx.GetChecksum(); + BitmapChecksum nCrc = maBitmapEx.GetChecksum(); SVBT32 aBT32; - Int32ToSVBT32(aPosPix.X(), aBT32); + Int32ToSVBT32(maPositionPixel.X(), aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); - Int32ToSVBT32(aPosPix.Y(), aBT32); + Int32ToSVBT32(maPositionPixel.Y(), aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); - Int32ToSVBT32(aSizePix.Width(), aBT32); + Int32ToSVBT32(maSizePixel.Width(), aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); - Int32ToSVBT32(aSizePix.Height(), aBT32); + Int32ToSVBT32(maSizePixel.Height(), aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); - Int32ToSVBT32(nWait, aBT32); + Int32ToSVBT32(mnWait, aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); - UInt32ToSVBT32(o3tl::underlyingEnumValue(eDisposal), aBT32); + UInt32ToSVBT32(o3tl::underlyingEnumValue(meDisposal), aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); - UInt32ToSVBT32(sal_uInt32(bUserInput), aBT32); + UInt32ToSVBT32(sal_uInt32(mbUserInput), aBT32); nCrc = vcl_get_checksum(nCrc, aBT32, 4); return nCrc; diff --git a/vcl/source/bitmap/bitmapfilter.cxx b/vcl/source/bitmap/bitmapfilter.cxx index 347cfd069a6a..bd4079abf9e7 100644 --- a/vcl/source/bitmap/bitmapfilter.cxx +++ b/vcl/source/bitmap/bitmapfilter.cxx @@ -45,7 +45,7 @@ bool BitmapFilter::Filter(Animation& rAnimation, BitmapFilter const & rFilter) std::vector<std::unique_ptr<AnimationBitmap>>& aList = rAnimation.GetAnimationFrames(); for (size_t i = 0, n = aList.size(); (i < n) && bRet; ++i) { - bRet = BitmapFilter::Filter(aList[i]->aBmpEx, rFilter); + bRet = BitmapFilter::Filter(aList[i]->maBitmapEx, rFilter); } BitmapEx aBmpEx(rAnimation.GetBitmapEx()); diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index ad570125a2a6..6378e63ab021 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -644,38 +644,38 @@ void GIFReader::FillImages( const sal_uInt8* pBytes, sal_uLong nCount ) void GIFReader::CreateNewBitmaps() { - AnimationBitmap aAnimBmp; + AnimationBitmap aAnimationBitmap; pAcc8.reset(); if( bGCTransparent ) { pAcc1.reset(); - aAnimBmp.aBmpEx = BitmapEx( aBmp8, aBmp1 ); + aAnimationBitmap.maBitmapEx = BitmapEx( aBmp8, aBmp1 ); } else - aAnimBmp.aBmpEx = BitmapEx( aBmp8 ); + aAnimationBitmap.maBitmapEx = BitmapEx( aBmp8 ); - aAnimBmp.aPosPix = Point( nImagePosX, nImagePosY ); - aAnimBmp.aSizePix = Size( nImageWidth, nImageHeight ); - aAnimBmp.nWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK; - aAnimBmp.bUserInput = false; + aAnimationBitmap.maPositionPixel = Point( nImagePosX, nImagePosY ); + aAnimationBitmap.maSizePixel = Size( nImageWidth, nImageHeight ); + aAnimationBitmap.mnWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK; + aAnimationBitmap.mbUserInput = false; // tdf#104121 . Internet Explorer, Firefox, Chrome and Safari all set a minimum default playback speed. // IE10 Consumer Preview sets default of 100ms for rates less that 20ms. We do the same - if (aAnimBmp.nWait < 2) // 20ms, specified in 100's of a second - aAnimBmp.nWait = 10; + if (aAnimationBitmap.mnWait < 2) // 20ms, specified in 100's of a second + aAnimationBitmap.mnWait = 10; if( nGCDisposalMethod == 2 ) - aAnimBmp.eDisposal = Disposal::Back; + aAnimationBitmap.meDisposal = Disposal::Back; else if( nGCDisposalMethod == 3 ) - aAnimBmp.eDisposal = Disposal::Previous; + aAnimationBitmap.meDisposal = Disposal::Previous; else - aAnimBmp.eDisposal = Disposal::Not; + aAnimationBitmap.meDisposal = Disposal::Not; - nAnimationByteSize += aAnimBmp.aBmpEx.GetSizeBytes(); + nAnimationByteSize += aAnimationBitmap.maBitmapEx.GetSizeBytes(); nAnimationMinFileData += static_cast<sal_uInt64>(nImageWidth) * nImageHeight / 2560; - aAnimation.Insert( aAnimBmp ); + aAnimation.Insert(aAnimationBitmap); if( aAnimation.Count() == 1 ) { @@ -923,7 +923,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) if( aAnimation.Count() == 1 ) { - rGraphic = aAnimation.Get( 0 ).aBmpEx; + rGraphic = aAnimation.Get(0).maBitmapEx; if( nLogWidth100 && nLogHeight100 ) { diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 9b5a2de8acfd..00a658b9ed42 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -121,11 +121,11 @@ bool ImplAnimView::matches( OutputDevice* pOut, long nExtraData ) const return bRet; } -void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix ) +void ImplAnimView::getPosSize( const AnimationBitmap& rAnimationBitmap, Point& rPosPix, Size& rSizePix ) { const Size& rAnmSize = mpParent->GetDisplaySizePixel(); - Point aPt2( rAnm.aPosPix.X() + rAnm.aSizePix.Width() - 1, - rAnm.aPosPix.Y() + rAnm.aSizePix.Height() - 1 ); + Point aPt2( rAnimationBitmap.maPositionPixel.X() + rAnimationBitmap.maSizePixel.Width() - 1, + rAnimationBitmap.maPositionPixel.Y() + rAnimationBitmap.maSizePixel.Height() - 1 ); double fFactX, fFactY; // calculate x scaling @@ -140,8 +140,8 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size else fFactY = 1.0; - rPosPix.setX( FRound( rAnm.aPosPix.X() * fFactX ) ); - rPosPix.setY( FRound( rAnm.aPosPix.Y() * fFactY ) ); + rPosPix.setX( FRound( rAnimationBitmap.maPositionPixel.X() * fFactX ) ); + rPosPix.setY( FRound( rAnimationBitmap.maPositionPixel.Y() * fFactY ) ); aPt2.setX( FRound( aPt2.X() * fFactX ) ); aPt2.setY( FRound( aPt2.Y() * fFactY ) ); @@ -216,9 +216,9 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) Size aBmpSizePix; const sal_uLong nLastPos = mpParent->Count() - 1; mnActPos = std::min( nPos, nLastPos ); - const AnimationBitmap& rAnm = mpParent->Get( static_cast<sal_uInt16>( mnActPos ) ); + const AnimationBitmap& rAnimationBitmap = mpParent->Get( static_cast<sal_uInt16>( mnActPos ) ); - getPosSize( rAnm, aPosPix, aSizePix ); + getPosSize( rAnimationBitmap, aPosPix, aSizePix ); // Mirrored horizontally? if( mbHMirr ) @@ -271,7 +271,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) pDev->DrawOutDev( maRestPt, maRestSz, Point(), maRestSz, *mpRestore ); } - meLastDisposal = rAnm.eDisposal; + meLastDisposal = rAnimationBitmap.meDisposal; maRestPt = aPosPix; maRestSz = aSizePix; @@ -286,7 +286,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) mpRestore->DrawOutDev( Point(), maRestSz, aPosPix, aSizePix, *pDev ); } - pDev->DrawBitmapEx( aBmpPosPix, aBmpSizePix, rAnm.aBmpEx ); + pDev->DrawBitmapEx( aBmpPosPix, aBmpSizePix, rAnimationBitmap.maBitmapEx ); if( !pVDev ) { diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index bcfc50c849a1..be2dc76bd2a6 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -778,21 +778,21 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo for( size_t nFrame=0; nFrame<aAnim.Count(); ++nFrame ) { - AnimationBitmap aAnimBmp( aAnim.Get( nFrame ) ); + AnimationBitmap aAnimationBitmap( aAnim.Get( nFrame ) ); - if( !aCropRect.IsInside( tools::Rectangle(aAnimBmp.aPosPix, aAnimBmp.aSizePix) ) ) + if( !aCropRect.IsInside( tools::Rectangle(aAnimationBitmap.maPositionPixel, aAnimationBitmap.maSizePixel) ) ) { // setup actual cropping (relative to frame position) tools::Rectangle aCropRectRel( aCropRect ); - aCropRectRel.Move( -aAnimBmp.aPosPix.X(), - -aAnimBmp.aPosPix.Y() ); + aCropRectRel.Move( -aAnimationBitmap.maPositionPixel.X(), + -aAnimationBitmap.maPositionPixel.Y() ); // cropping affects this frame, apply it then // do _not_ apply enlargement, this is done below - ImplTransformBitmap( aAnimBmp.aBmpEx, rAttr, Size(), Size(), + ImplTransformBitmap( aAnimationBitmap.maBitmapEx, rAttr, Size(), Size(), aCropRectRel, rDestSize, false ); - aAnim.Replace( aAnimBmp, nFrame ); + aAnim.Replace( aAnimationBitmap, nFrame ); } // else: bitmap completely within crop area, // i.e. nothing is cropped away @@ -822,11 +822,11 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo for( size_t nFrame=0; nFrame<aAnim.Count(); ++nFrame ) { - AnimationBitmap aAnimBmp( aAnim.Get( nFrame ) ); + AnimationBitmap aAnimationBitmap( aAnim.Get( nFrame ) ); - aAnimBmp.aPosPix += aPosOffset; + aAnimationBitmap.maPositionPixel += aPosOffset; - aAnim.Replace( aAnimBmp, nFrame ); + aAnim.Replace( aAnimationBitmap, nFrame ); } } |