Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
699ba641
Kaydet (Commit)
699ba641
authored
Nis 20, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert ADJUSTMENT_ flags to scoped enum
Change-Id: I2b3d50eb7cbc3abc4cdc7e94219852f678b45e13
üst
24724aad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
34 deletions
+40
-34
grfmgr.hxx
include/svtools/grfmgr.hxx
+17
-11
grfmgr.cxx
svtools/source/graphic/grfmgr.cxx
+3
-3
grfmgr2.cxx
svtools/source/graphic/grfmgr2.cxx
+20
-20
No files found.
include/svtools/grfmgr.hxx
Dosyayı görüntüle @
699ba641
...
...
@@ -46,14 +46,20 @@ namespace o3tl
#define GRFMGR_AUTOSWAPSTREAM_NONE reinterpret_cast<SvStream*>(sal_IntPtr(-1))
// Adjustment defines
#define ADJUSTMENT_NONE 0x00000000UL
#define ADJUSTMENT_DRAWMODE 0x00000001UL
#define ADJUSTMENT_COLORS 0x00000002UL
#define ADJUSTMENT_MIRROR 0x00000004UL
#define ADJUSTMENT_ROTATE 0x00000008UL
#define ADJUSTMENT_TRANSPARENCY 0x00000010UL
#define ADJUSTMENT_ALL 0xFFFFFFFFUL
enum
class
GraphicAdjustmentFlags
{
NONE
=
0x00
,
DRAWMODE
=
0x01
,
COLORS
=
0x02
,
MIRROR
=
0x04
,
ROTATE
=
0x08
,
TRANSPARENCY
=
0x10
,
ALL
=
0x1f
,
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
GraphicAdjustmentFlags
>
:
is_typed_flags
<
GraphicAdjustmentFlags
,
0x1f
>
{};
}
enum
GraphicDrawMode
{
...
...
@@ -566,17 +572,17 @@ private:
static
void
SVT_DLLPRIVATE
ImplAdjust
(
BitmapEx
&
rBmpEx
,
const
GraphicAttr
&
rAttr
,
sal_uLong
nAdjustmentFlags
GraphicAdjustmentFlags
nAdjustmentFlags
);
static
void
SVT_DLLPRIVATE
ImplAdjust
(
GDIMetaFile
&
rMtf
,
const
GraphicAttr
&
rAttr
,
sal_uLong
nAdjustmentFlags
GraphicAdjustmentFlags
nAdjustmentFlags
);
static
void
SVT_DLLPRIVATE
ImplAdjust
(
Animation
&
rAnimation
,
const
GraphicAttr
&
rAttr
,
sal_uLong
nAdjustmentFlags
GraphicAdjustmentFlags
nAdjustmentFlags
);
static
void
SVT_DLLPRIVATE
ImplDraw
(
...
...
svtools/source/graphic/grfmgr.cxx
Dosyayı görüntüle @
699ba641
...
...
@@ -956,21 +956,21 @@ Graphic GraphicObject::GetTransformedGraphic( const GraphicAttr* pAttr ) const /
if
(
IsAnimated
()
)
{
Animation
aAnimation
(
maGraphic
.
GetAnimation
()
);
GraphicManager
::
ImplAdjust
(
aAnimation
,
aAttr
,
ADJUSTMENT_
ALL
);
GraphicManager
::
ImplAdjust
(
aAnimation
,
aAttr
,
GraphicAdjustmentFlags
::
ALL
);
aAnimation
.
SetLoopCount
(
mnAnimationLoopCount
);
aGraphic
=
aAnimation
;
}
else
{
BitmapEx
aBmpEx
(
maGraphic
.
GetBitmapEx
()
);
GraphicManager
::
ImplAdjust
(
aBmpEx
,
aAttr
,
ADJUSTMENT_
ALL
);
GraphicManager
::
ImplAdjust
(
aBmpEx
,
aAttr
,
GraphicAdjustmentFlags
::
ALL
);
aGraphic
=
aBmpEx
;
}
}
else
{
GDIMetaFile
aMtf
(
maGraphic
.
GetGDIMetaFile
()
);
GraphicManager
::
ImplAdjust
(
aMtf
,
aAttr
,
ADJUSTMENT_
ALL
);
GraphicManager
::
ImplAdjust
(
aMtf
,
aAttr
,
GraphicAdjustmentFlags
::
ALL
);
aGraphic
=
aMtf
;
}
}
...
...
svtools/source/graphic/grfmgr2.cxx
Dosyayı görüntüle @
699ba641
...
...
@@ -998,7 +998,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
{
// Attribute adjustment if necessary
if
(
rAttributes
.
IsSpecialDrawMode
()
||
rAttributes
.
IsAdjusted
()
||
rAttributes
.
IsTransparent
()
)
ImplAdjust
(
aOutBmpEx
,
rAttributes
,
ADJUSTMENT_DRAWMODE
|
ADJUSTMENT_COLORS
|
ADJUSTMENT_
TRANSPARENCY
);
ImplAdjust
(
aOutBmpEx
,
rAttributes
,
GraphicAdjustmentFlags
::
DRAWMODE
|
GraphicAdjustmentFlags
::
COLORS
|
GraphicAdjustmentFlags
::
TRANSPARENCY
);
// OutDev adjustment if necessary
if
(
pOutputDevice
->
GetOutDevType
()
!=
OUTDEV_PRINTER
&&
pOutputDevice
->
GetBitCount
()
<=
8
&&
aOutBmpEx
.
GetBitCount
()
>=
8
)
...
...
@@ -1388,7 +1388,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
if
(
nNumBitmaps
!=
1
||
bNonBitmapActionEncountered
)
{
if
(
rAttr
.
IsSpecialDrawMode
()
||
rAttr
.
IsAdjusted
()
||
rAttr
.
IsMirrored
()
||
rAttr
.
IsRotated
()
||
rAttr
.
IsTransparent
()
)
ImplAdjust
(
rOutMtf
,
rAttr
,
ADJUSTMENT_
ALL
);
ImplAdjust
(
rOutMtf
,
rAttr
,
GraphicAdjustmentFlags
::
ALL
);
ImplDraw
(
pOut
,
rPt
,
rSz
,
rOutMtf
,
rAttr
);
rOutBmpEx
=
BitmapEx
();
...
...
@@ -1397,11 +1397,11 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
return
true
;
}
void
GraphicManager
::
ImplAdjust
(
BitmapEx
&
rBmpEx
,
const
GraphicAttr
&
rAttr
,
sal_uLong
nAdjustmentFlags
)
void
GraphicManager
::
ImplAdjust
(
BitmapEx
&
rBmpEx
,
const
GraphicAttr
&
rAttr
,
GraphicAdjustmentFlags
nAdjustmentFlags
)
{
GraphicAttr
aAttr
(
rAttr
);
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
DRAWMODE
)
&&
aAttr
.
IsSpecialDrawMode
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
DRAWMODE
)
&&
aAttr
.
IsSpecialDrawMode
()
)
{
switch
(
aAttr
.
GetDrawMode
()
)
{
...
...
@@ -1425,24 +1425,24 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal
}
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
COLORS
)
&&
aAttr
.
IsAdjusted
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
COLORS
)
&&
aAttr
.
IsAdjusted
()
)
{
rBmpEx
.
Adjust
(
aAttr
.
GetLuminance
(),
aAttr
.
GetContrast
(),
aAttr
.
GetChannelR
(),
aAttr
.
GetChannelG
(),
aAttr
.
GetChannelB
(),
aAttr
.
GetGamma
(),
aAttr
.
IsInvert
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
MIRROR
)
&&
aAttr
.
IsMirrored
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
MIRROR
)
&&
aAttr
.
IsMirrored
()
)
{
rBmpEx
.
Mirror
(
aAttr
.
GetMirrorFlags
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
ROTATE
)
&&
aAttr
.
IsRotated
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
ROTATE
)
&&
aAttr
.
IsRotated
()
)
{
rBmpEx
.
Rotate
(
aAttr
.
GetRotation
(),
Color
(
COL_TRANSPARENT
)
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
TRANSPARENCY
)
&&
aAttr
.
IsTransparent
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
TRANSPARENCY
)
&&
aAttr
.
IsTransparent
()
)
{
AlphaMask
aAlpha
;
sal_uInt8
cTrans
=
aAttr
.
GetTransparency
();
...
...
@@ -1500,11 +1500,11 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal
}
}
void
GraphicManager
::
ImplAdjust
(
GDIMetaFile
&
rMtf
,
const
GraphicAttr
&
rAttr
,
sal_uLong
nAdjustmentFlags
)
void
GraphicManager
::
ImplAdjust
(
GDIMetaFile
&
rMtf
,
const
GraphicAttr
&
rAttr
,
GraphicAdjustmentFlags
nAdjustmentFlags
)
{
GraphicAttr
aAttr
(
rAttr
);
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
DRAWMODE
)
&&
aAttr
.
IsSpecialDrawMode
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
DRAWMODE
)
&&
aAttr
.
IsSpecialDrawMode
()
)
{
switch
(
aAttr
.
GetDrawMode
()
)
{
...
...
@@ -1528,34 +1528,34 @@ void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sa
}
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
COLORS
)
&&
aAttr
.
IsAdjusted
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
COLORS
)
&&
aAttr
.
IsAdjusted
()
)
{
rMtf
.
Adjust
(
aAttr
.
GetLuminance
(),
aAttr
.
GetContrast
(),
aAttr
.
GetChannelR
(),
aAttr
.
GetChannelG
(),
aAttr
.
GetChannelB
(),
aAttr
.
GetGamma
(),
aAttr
.
IsInvert
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
MIRROR
)
&&
aAttr
.
IsMirrored
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
MIRROR
)
&&
aAttr
.
IsMirrored
()
)
{
rMtf
.
Mirror
(
aAttr
.
GetMirrorFlags
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
ROTATE
)
&&
aAttr
.
IsRotated
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
ROTATE
)
&&
aAttr
.
IsRotated
()
)
{
rMtf
.
Rotate
(
aAttr
.
GetRotation
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
TRANSPARENCY
)
&&
aAttr
.
IsTransparent
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
TRANSPARENCY
)
&&
aAttr
.
IsTransparent
()
)
{
OSL_FAIL
(
"Missing implementation: Mtf-Transparency"
);
}
}
void
GraphicManager
::
ImplAdjust
(
Animation
&
rAnimation
,
const
GraphicAttr
&
rAttr
,
sal_uLong
nAdjustmentFlags
)
void
GraphicManager
::
ImplAdjust
(
Animation
&
rAnimation
,
const
GraphicAttr
&
rAttr
,
GraphicAdjustmentFlags
nAdjustmentFlags
)
{
GraphicAttr
aAttr
(
rAttr
);
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
DRAWMODE
)
&&
aAttr
.
IsSpecialDrawMode
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
DRAWMODE
)
&&
aAttr
.
IsSpecialDrawMode
()
)
{
switch
(
aAttr
.
GetDrawMode
()
)
{
...
...
@@ -1579,24 +1579,24 @@ void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr
}
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
COLORS
)
&&
aAttr
.
IsAdjusted
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
COLORS
)
&&
aAttr
.
IsAdjusted
()
)
{
rAnimation
.
Adjust
(
aAttr
.
GetLuminance
(),
aAttr
.
GetContrast
(),
aAttr
.
GetChannelR
(),
aAttr
.
GetChannelG
(),
aAttr
.
GetChannelB
(),
aAttr
.
GetGamma
(),
aAttr
.
IsInvert
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
MIRROR
)
&&
aAttr
.
IsMirrored
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
MIRROR
)
&&
aAttr
.
IsMirrored
()
)
{
rAnimation
.
Mirror
(
aAttr
.
GetMirrorFlags
()
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
ROTATE
)
&&
aAttr
.
IsRotated
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
ROTATE
)
&&
aAttr
.
IsRotated
()
)
{
OSL_FAIL
(
"Missing implementation: Animation-Rotation"
);
}
if
(
(
nAdjustmentFlags
&
ADJUSTMENT_
TRANSPARENCY
)
&&
aAttr
.
IsTransparent
()
)
if
(
(
nAdjustmentFlags
&
GraphicAdjustmentFlags
::
TRANSPARENCY
)
&&
aAttr
.
IsTransparent
()
)
{
OSL_FAIL
(
"Missing implementation: Animation-Transparency"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment