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
d7fa73b2
Kaydet (Commit)
d7fa73b2
authored
Nis 09, 2013
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i113080 added test code (in debug mode), cleanedup a small inconsistency
üst
970ff93f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
converters.cxx
drawinglayer/source/tools/converters.cxx
+34
-16
No files found.
drawinglayer/source/tools/converters.cxx
Dosyayı görüntüle @
d7fa73b2
...
@@ -49,6 +49,9 @@ namespace drawinglayer
...
@@ -49,6 +49,9 @@ namespace drawinglayer
sal_uInt32
nMaxQuadratPixels
)
sal_uInt32
nMaxQuadratPixels
)
{
{
BitmapEx
aRetval
;
BitmapEx
aRetval
;
#ifdef DBG_UTIL
static
bool
bDoSaveForVisualControl
(
false
);
#endif
if
(
rSeq
.
hasElements
()
&&
nDiscreteWidth
&&
nDiscreteHeight
)
if
(
rSeq
.
hasElements
()
&&
nDiscreteWidth
&&
nDiscreteHeight
)
{
{
...
@@ -81,13 +84,14 @@ namespace drawinglayer
...
@@ -81,13 +84,14 @@ namespace drawinglayer
// prepare vdev
// prepare vdev
maContent
.
SetOutputSizePixel
(
aSizePixel
,
false
);
maContent
.
SetOutputSizePixel
(
aSizePixel
,
false
);
maContent
.
SetMapMode
(
aMapModePixel
);
maContent
.
SetMapMode
(
aMapModePixel
);
maContent
.
SetAntialiasing
(
true
);
// set to all white
// set to all white
maContent
.
SetBackground
(
Wallpaper
(
Color
(
COL_WHITE
)));
maContent
.
SetBackground
(
Wallpaper
(
Color
(
COL_WHITE
)));
maContent
.
Erase
();
maContent
.
Erase
();
// create pixel processor
// create pixel processor, also already takes care of AAing and
// checking the getOptionsDrawinglayer().IsAntiAliasing() switch. If
// not wanted, change after this call as needed
processor2d
::
BaseProcessor2D
*
pContentProcessor
=
processor2d
::
createPixelProcessor2DFromOutputDevice
(
processor2d
::
BaseProcessor2D
*
pContentProcessor
=
processor2d
::
createPixelProcessor2DFromOutputDevice
(
maContent
,
maContent
,
aViewInformation2D
);
aViewInformation2D
);
...
@@ -101,21 +105,29 @@ namespace drawinglayer
...
@@ -101,21 +105,29 @@ namespace drawinglayer
maContent
.
EnableMapMode
(
false
);
maContent
.
EnableMapMode
(
false
);
const
Bitmap
aContent
(
maContent
.
GetBitmap
(
aEmptyPoint
,
aSizePixel
));
const
Bitmap
aContent
(
maContent
.
GetBitmap
(
aEmptyPoint
,
aSizePixel
));
#ifdef DBG_UTIL
if
(
bDoSaveForVisualControl
)
{
SvFileStream
aNew
((
const
String
&
)
String
(
ByteString
(
"c:
\\
test_content.png"
),
RTL_TEXTENCODING_UTF8
),
STREAM_WRITE
|
STREAM_TRUNC
);
::
vcl
::
PNGWriter
aPNGWriter
(
aContent
);
aPNGWriter
.
Write
(
aNew
);
}
#endif
// prepare for mask creation
// prepare for mask creation
maContent
.
SetMapMode
(
aMapModePixel
);
maContent
.
SetMapMode
(
aMapModePixel
);
maContent
.
SetAntialiasing
(
true
);
// set alpha to all white (fully transparent)
// set alpha to all white (fully transparent)
maContent
.
Erase
();
maContent
.
Erase
();
// embed primitives to paint them black
// embed primitives to paint them black
static
basegfx
::
BColorModifyMode
aMode
=
basegfx
::
BCOLORMODIFYMODE_REPLACE
;
const
primitive2d
::
Primitive2DReference
xRef
(
const
primitive2d
::
Primitive2DReference
xRef
(
new
primitive2d
::
ModifiedColorPrimitive2D
(
new
primitive2d
::
ModifiedColorPrimitive2D
(
aSequence
,
aSequence
,
basegfx
::
BColorModifier
(
basegfx
::
BColorModifier
(
basegfx
::
BColor
(
0.0
,
0.0
,
0.0
),
basegfx
::
BColor
(
0.0
,
0.0
,
0.0
),
0.5
,
0.5
,
basegfx
::
BCOLORMODIFYMODE_REPLACE
)));
aMode
)));
const
primitive2d
::
Primitive2DSequence
xSeq
(
&
xRef
,
1
);
const
primitive2d
::
Primitive2DSequence
xSeq
(
&
xRef
,
1
);
// render
// render
...
@@ -124,22 +136,28 @@ namespace drawinglayer
...
@@ -124,22 +136,28 @@ namespace drawinglayer
// get alpha cahannel from vdev
// get alpha cahannel from vdev
maContent
.
EnableMapMode
(
false
);
maContent
.
EnableMapMode
(
false
);
const
AlphaMask
aAlphaMask
(
maContent
.
GetBitmap
(
aEmptyPoint
,
aSizePixel
));
const
Bitmap
aAlpha
(
maContent
.
GetBitmap
(
aEmptyPoint
,
aSizePixel
));
#ifdef DBG_UTIL
if
(
bDoSaveForVisualControl
)
{
SvFileStream
aNew
((
const
String
&
)
String
(
ByteString
(
"c:
\\
test_alpha.png"
),
RTL_TEXTENCODING_UTF8
),
STREAM_WRITE
|
STREAM_TRUNC
);
::
vcl
::
PNGWriter
aPNGWriter
(
aAlpha
);
aPNGWriter
.
Write
(
aNew
);
}
#endif
// create BitmapEx result
// create BitmapEx result
aRetval
=
BitmapEx
(
aContent
,
aAlphaMask
);
aRetval
=
BitmapEx
(
aContent
,
AlphaMask
(
aAlpha
));
}
}
#ifdef DBG_UTIL
#ifdef DBG_UTIL
static
bool
bDoSaveForVisualControl
(
false
);
if
(
bDoSaveForVisualControl
)
if
(
bDoSaveForVisualControl
)
{
{
SvFileStream
aNew
((
const
String
&
)
String
(
ByteString
(
"c:
\\
test_combined.png"
),
RTL_TEXTENCODING_UTF8
),
STREAM_WRITE
|
STREAM_TRUNC
);
SvFileStream
aNew
((
const
String
&
)
String
(
ByteString
(
"c:
\\
test.png"
),
RTL_TEXTENCODING_UTF8
),
STREAM_WRITE
|
STREAM_TRUNC
);
::
vcl
::
PNGWriter
aPNGWriter
(
aRetval
);
::
vcl
::
PNGWriter
aPNGWriter
(
aRetval
);
aPNGWriter
.
Write
(
aNew
);
aPNGWriter
.
Write
(
aNew
);
}
}
#endif
#endif
}
}
return
aRetval
;
return
aRetval
;
}
}
...
...
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