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
6e1b091f
Kaydet (Commit)
6e1b091f
authored
Nis 07, 2018
tarafından
Ashod Nakashian
Kaydeden (comit)
Jan Holesovsky
Haz 07, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
svx: support importing PDF images
Change-Id: Id4524a30b8f9fa4228c4acb4bf8714700da3017c
üst
ddb881e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
2 deletions
+105
-2
dibtools.hxx
include/vcl/dibtools.hxx
+8
-0
svdpdf.cxx
svx/source/svdraw/svdpdf.cxx
+81
-2
dibtools.cxx
vcl/source/gdi/dibtools.cxx
+16
-0
No files found.
include/vcl/dibtools.hxx
Dosyayı görüntüle @
6e1b091f
...
...
@@ -23,6 +23,7 @@
#include <vcl/mapmod.hxx>
#include <vcl/region.hxx>
#include <vcl/alpha.hxx>
#include <vcl/salbtype.hxx>
// predefines
...
...
@@ -55,6 +56,13 @@ bool VCL_DLLPUBLIC ReadDIBV5(
AlphaMask
&
rTargetAlpha
,
SvStream
&
rIStm
);
bool
VCL_DLLPUBLIC
ReadRawDIB
(
Bitmap
&
rTarget
,
const
unsigned
char
*
pBuf
,
const
ScanlineFormat
nFormat
,
const
int
nHeight
,
const
int
nStride
);
bool
VCL_DLLPUBLIC
WriteDIB
(
const
Bitmap
&
rSource
,
...
...
svx/source/svdraw/svdpdf.cxx
Dosyayı görüntüle @
6e1b091f
...
...
@@ -77,7 +77,6 @@
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xfltrit.hxx>
#include <vcl/bitmapaccess.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflbstit.hxx>
#include <svx/svdpntv.hxx>
...
...
@@ -85,8 +84,14 @@
#include <svx/svditer.hxx>
#include <svx/svdogrp.hxx>
#include <vcl/BitmapTools.hxx>
#include <vcl/dibtools.hxx>
#include <com/sun/star/geometry/Matrix2D.hpp>
struct
FPDFBitmapDeleter
{
inline
void
operator
()(
FPDF_BITMAP
bitmap
)
{
FPDFBitmap_Destroy
(
bitmap
);
}
};
using
namespace
com
::
sun
::
star
;
ImpSdrPdfImport
::
ImpSdrPdfImport
(
SdrModel
&
rModel
,
SdrLayerID
nLay
,
const
tools
::
Rectangle
&
rRect
,
...
...
@@ -213,8 +218,82 @@ void ImpSdrPdfImport::DoLoopActions(SvdProgressInfo* pProgrInfo, sal_uInt32* pAc
SAL_WARN
(
"sd.filter"
,
"Got page object PATH"
);
break
;
case
FPDF_PAGEOBJ_IMAGE
:
{
SAL_WARN
(
"sd.filter"
,
"Got page object IMAGE"
);
break
;
std
::
unique_ptr
<
void
,
FPDFBitmapDeleter
>
bitmap
(
FPDFImageObj_GetBitmap
(
pPageObject
));
if
(
!
bitmap
)
{
SAL_WARN
(
"sd.filter"
,
"Failed to get IMAGE"
);
continue
;
}
const
int
format
=
FPDFBitmap_GetFormat
(
bitmap
.
get
());
if
(
format
==
FPDFBitmap_Unknown
)
{
SAL_WARN
(
"sd.filter"
,
"Failed to get IMAGE format"
);
continue
;
}
const
unsigned
char
*
pBuf
=
static_cast
<
const
unsigned
char
*>
(
FPDFBitmap_GetBuffer
(
bitmap
.
get
()));
const
int
nWidth
=
FPDFBitmap_GetWidth
(
bitmap
.
get
());
const
int
nHeight
=
FPDFBitmap_GetHeight
(
bitmap
.
get
());
const
int
nStride
=
FPDFBitmap_GetStride
(
bitmap
.
get
());
Bitmap
aBitmap
(
Size
(
nWidth
,
nHeight
),
24
);
switch
(
format
)
{
case
FPDFBitmap_Gray
:
SAL_WARN
(
"sd.filter"
,
"Got IMAGE width: "
<<
nWidth
<<
", height: "
<<
nHeight
<<
", stride: "
<<
nStride
<<
", format: Gray"
);
ReadRawDIB
(
aBitmap
,
pBuf
,
ScanlineFormat
::
N8BitTcMask
,
nHeight
,
nStride
);
break
;
case
FPDFBitmap_BGR
:
SAL_WARN
(
"sd.filter"
,
"Got IMAGE width: "
<<
nWidth
<<
", height: "
<<
nHeight
<<
", stride: "
<<
nStride
<<
", format: BGR"
);
ReadRawDIB
(
aBitmap
,
pBuf
,
ScanlineFormat
::
N24BitTcBgr
,
nHeight
,
nStride
);
break
;
case
FPDFBitmap_BGRx
:
SAL_WARN
(
"sd.filter"
,
"Got IMAGE width: "
<<
nWidth
<<
", height: "
<<
nHeight
<<
", stride: "
<<
nStride
<<
", format: BGRx"
);
ReadRawDIB
(
aBitmap
,
pBuf
,
ScanlineFormat
::
N32BitTcBgra
,
nHeight
,
nStride
);
break
;
case
FPDFBitmap_BGRA
:
SAL_WARN
(
"sd.filter"
,
"Got IMAGE width: "
<<
nWidth
<<
", height: "
<<
nHeight
<<
", stride: "
<<
nStride
<<
", format: BGRA"
);
ReadRawDIB
(
aBitmap
,
pBuf
,
ScanlineFormat
::
N32BitTcBgra
,
nHeight
,
nStride
);
break
;
default
:
SAL_WARN
(
"sd.filter"
,
"Got IMAGE width: "
<<
nWidth
<<
", height: "
<<
nHeight
<<
", stride: "
<<
nStride
<<
", format: "
<<
format
);
break
;
}
tools
::
Rectangle
aRect
(
Point
(
0
,
0
),
Size
(
nWidth
,
nHeight
));
// aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj
*
pGraf
=
new
SdrGrafObj
(
*
mpModel
,
Graphic
(
aBitmap
),
aRect
);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf
->
SetMergedItem
(
XLineStyleItem
(
drawing
::
LineStyle_NONE
));
pGraf
->
SetMergedItem
(
XFillStyleItem
(
drawing
::
FillStyle_NONE
));
InsertObj
(
pGraf
);
}
break
;
case
FPDF_PAGEOBJ_SHADING
:
SAL_WARN
(
"sd.filter"
,
"Got page object SHADING"
);
break
;
...
...
vcl/source/gdi/dibtools.cxx
Dosyayı görüntüle @
6e1b091f
...
...
@@ -1821,6 +1821,22 @@ bool ReadDIBV5(
return
ImplReadDIB
(
rTarget
,
&
rTargetAlpha
,
rIStm
,
true
);
}
bool
ReadRawDIB
(
Bitmap
&
rTarget
,
const
unsigned
char
*
pBuf
,
const
ScanlineFormat
nFormat
,
const
int
nHeight
,
const
int
nStride
)
{
BitmapScopedWriteAccess
pWriteAccess
(
rTarget
.
AcquireWriteAccess
(),
rTarget
);
for
(
int
nRow
=
0
;
nRow
<
nHeight
;
++
nRow
)
{
pWriteAccess
->
CopyScanline
(
nRow
,
pBuf
+
(
nStride
*
nRow
),
nFormat
,
nStride
);
}
return
true
;
}
bool
WriteDIB
(
const
Bitmap
&
rSource
,
SvStream
&
rOStm
,
...
...
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