LibreOffice Module emfio (master) 1
|
#include <emfreader.hxx>
Public Member Functions | |
EmfReader (SvStream &rStreamWMF, GDIMetaFile &rGDIMetaFile) | |
~EmfReader () | |
bool | ReadEnhWMF () |
void | ReadGDIComment (sal_uInt32 nCommentId) |
void | ReadMultiformatsComment () |
Parses EMR_COMMENT_MULTIFORMATS. More... | |
void | SetSizeHint (const basegfx::B2DTuple &rSizeHint) |
void | SetEnableEMFPlus (bool bEnableEMFPlus) |
Public Member Functions inherited from emfio::MtfTools | |
void | SetDevByWin () |
void | SetDevOrg (const Point &rPoint) |
void | SetDevOrgOffset (sal_Int32 nXAdd, sal_Int32 nYAdd) |
void | SetDevExt (const Size &rSize, bool regular=true) |
void | ScaleDevExt (double fX, double fY) |
void | SetWinOrg (const Point &rPoint, bool bIsEMF=false) |
Point | GetWinOrg () |
void | SetWinOrgOffset (sal_Int32 nX, sal_Int32 nY) |
void | SetWinExt (const Size &rSize, bool bIsEMF=false) |
void | ScaleWinExt (double fX, double fY) |
void | SetrclBounds (const tools::Rectangle &rRect) |
void | SetrclFrame (const tools::Rectangle &rRect) |
void | SetRefPix (const Size &rSize) |
void | SetRefMill (const Size &rSize) |
void | SetMapMode (MappingMode mnMapMode) |
void | SetWorldTransform (const XForm &rXForm) |
void | ModifyWorldTransform (const XForm &rXForm, ModifyWorldTransformMode nMode) |
void | Push () |
void | Pop (const sal_Int32 nSavedDC=-1) |
WMFRasterOp | SetRasterOp (WMFRasterOp nRasterOp) |
void | StrokeAndFillPath (bool bStroke, bool bFill) |
void | SetArcDirection (bool bCounterClockWise) |
bool | IsArcDirectionClockWise () |
void | SetGfxMode (GraphicsMode nGfxMode) |
GraphicsMode | GetGfxMode () const |
void | SetBkMode (BackgroundMode nMode) |
void | SetBkColor (const Color &rColor) |
void | SetTextColor (const Color &rColor) |
void | SetTextAlign (sal_uInt32 nAlign) |
void | CreateObject (std::unique_ptr< GDIObj > pObject) |
void | CreateObjectIndexed (sal_uInt32 nIndex, std::unique_ptr< GDIObj > pObject) |
void | CreateObject () |
void | DeleteObject (sal_uInt32 nIndex) |
void | SelectObject (sal_uInt32 nIndex) |
rtl_TextEncoding | GetCharSet () const |
const vcl::Font & | GetFont () const |
void | SetTextLayoutMode (vcl::text::ComplexTextLayoutFlags nLayoutMode) |
void | ClearPath () |
void | ClosePath () |
const tools::PolyPolygon & | GetPathObj () const |
void | MoveTo (const Point &rPoint, bool bRecordPath=false) |
void | LineTo (const Point &rPoint, bool bRecordPath=false) |
void | DrawPixel (const Point &rSource, const Color &rColor) |
void | DrawRect (const tools::Rectangle &rRect, bool bEdge=true) |
void | DrawRectWithBGColor (const tools::Rectangle &rRect) |
void | DrawRoundRect (const tools::Rectangle &rRect, const Size &rSize) |
void | DrawEllipse (const tools::Rectangle &rRect) |
void | DrawArc (const tools::Rectangle &rRect, const Point &rStartAngle, const Point &rEndAngle, bool bDrawTo=false) |
void | DrawPie (const tools::Rectangle &rRect, const Point &rStartAngle, const Point &rEndAngle) |
void | DrawChord (const tools::Rectangle &rRect, const Point &rStartAngle, const Point &rEndAngle) |
void | DrawPolygon (tools::Polygon rPolygon, bool bRecordPath) |
void | DrawPolyPolygon (tools::PolyPolygon &rPolyPolygon, bool bRecordPath=false) |
void | DrawPolyLine (tools::Polygon rPolygon, bool bDrawTo=false, bool bRecordPath=false) |
void | DrawPolyBezier (tools::Polygon rPolygon, bool bDrawTo, bool bRecordPath) |
void | DrawText (Point &rPosition, OUString const &rString, KernArray *pDXArry=nullptr, tools::Long *pDYArry=nullptr, bool bRecordPath=false, GraphicsMode nGraphicsMode=GraphicsMode::GM_COMPATIBLE) |
void | ResolveBitmapActions (std::vector< BSaveStruct > &rSaveList) |
void | IntersectClipRect (const tools::Rectangle &rRect) |
void | ExcludeClipRect (const tools::Rectangle &rRect) |
void | MoveClipRegion (const Size &rSize) |
void | SetClipPath (const tools::PolyPolygon &rPolyPoly, RegionMode nClippingMode, bool bIsMapped) |
void | SetDefaultClipPath () |
void | UpdateClipRegion () |
void | AddFromGDIMetaFile (GDIMetaFile &rGDIMetaFile) |
void | PassEMFPlus (void const *pBuffer, sal_uInt32 nLength) |
void | PassEMFPlusHeaderInfo () |
Color | ReadColor () |
MtfTools (GDIMetaFile &rGDIMetaFile, SvStream &rStreamWMF) | |
~MtfTools () COVERITY_NOEXCEPT_FALSE | |
Private Member Functions | |
bool | ReadHeader () |
template<class T > | |
void | ReadAndDrawPolyPolygon (sal_uInt32 nNextPos) |
Reads a poly polygon from the WMF file and draws it. More... | |
template<class T > | |
void | ReadAndDrawPolyLine (sal_uInt32 nNextPos) |
Reads a polyline from the WMF file and draws it The <class T> parameter refers to the type of the points. More... | |
template<class T > | |
tools::Polygon | ReadPolygon (sal_uInt32 nStartIndex, sal_uInt32 nPoints, sal_uInt32 nNextPos) |
Reads polygons from the stream. More... | |
template<class T > | |
tools::Polygon | ReadPolygonWithSkip (const bool skipFirst, sal_uInt32 nNextPos) |
Reads polygons from the stream. More... | |
tools::Rectangle | ReadRectangle () |
void | ReadEMFPlusComment (sal_uInt32 length, bool &bHaveDC) |
Static Private Member Functions | |
static tools::Rectangle | ReadRectangle (sal_Int32, sal_Int32, sal_Int32, sal_Int32) |
Private Attributes | |
sal_uInt32 | mnRecordCount |
bool | mbRecordPath: 1 |
bool | mbEMFPlus: 1 |
bool | mbEMFPlusDualMode: 1 |
bool | mbReadOtherGraphicFormat = false |
Another format is read already, can ignore actual EMF data. More... | |
basegfx::B2DTuple | maSizeHint |
bool | mbEnableEMFPlus = true |
Definition at line 25 of file emfreader.hxx.
emfio::EmfReader::EmfReader | ( | SvStream & | rStreamWMF, |
GDIMetaFile & | rGDIMetaFile | ||
) |
Definition at line 402 of file emfreader.cxx.
emfio::EmfReader::~EmfReader | ( | ) |
Definition at line 411 of file emfreader.cxx.
|
private |
Reads a polyline from the WMF file and draws it The <class T> parameter refers to the type of the points.
(e.g. sal_uInt16 or sal_uInt32)
Definition at line 710 of file emfreader.cxx.
References emfio::MtfTools::DrawPolyLine(), SvStream::good(), i, mbRecordPath, emfio::MtfTools::mnEndPos, emfio::MtfTools::mpInputStream, nCount, SvStream::ReadUInt32(), SAL_INFO, SAL_MAX_UINT32, SvStream::SeekRel(), and SvStream::Tell().
|
private |
Reads a poly polygon from the WMF file and draws it.
The <class T> parameter refers to the type of the points. (e.g. sal_uInt16 or sal_uInt32)
Definition at line 757 of file emfreader.cxx.
References emfio::MtfTools::DrawPolyPolygon(), SvStream::good(), i, tools::PolyPolygon::Insert(), mbRecordPath, emfio::MtfTools::mnEndPos, emfio::MtfTools::mpInputStream, SvStream::ReadUInt32(), SAL_INFO, SAL_MAX_UINT32, SvStream::SeekRel(), and SvStream::Tell().
|
private |
Definition at line 554 of file emfreader.cxx.
References SvFileStream::Close(), SvStream::Flush(), length, mbEMFPlus, mbEMFPlusDualMode, emfio::MtfTools::mpInputStream, emfio::MtfTools::PassEMFPlus(), emfio::MtfTools::PassEMFPlusHeaderInfo(), pos, SvStream::ReadBytes(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SAL_INFO, SvStream::Seek(), SvStream::SeekRel(), size, SvStream::Tell(), type, and SvStream::WriteStream().
Referenced by ReadEnhWMF().
bool emfio::EmfReader::ReadEnhWMF | ( | ) |
Definition at line 818 of file emfreader.cxx.
References emfio::LOGFONTW::alfFaceName, emfio::ScaledFontDetectCorrectHelper::applyAlternativeFontScale(), ARCDIRECTION_CLOCKWISE, vcl::text::BiDiRtl, emfio::BS_HOLLOW, o3tl::checked_add(), o3tl::checked_sub(), emfio::MtfTools::ClearPath(), emfio::MtfTools::ClosePath(), emfio::MtfTools::CreateObjectIndexed(), Bitmap::Crop(), BitmapEx::Crop(), vcl::text::Default, emfio::MtfTools::DeleteObject(), emfio::MtfTools::DrawPixel(), emfio::MtfTools::DrawPolyBezier(), emfio::MtfTools::DrawPolygon(), emfio::MtfTools::DrawPolyLine(), emfio::MtfTools::DrawPolyPolygon(), emfio::MtfTools::DrawRectWithBGColor(), emfio::MtfTools::DrawText(), KernArray::empty(), EMR_ABORTPATH, EMR_ALPHABLEND, EMR_ALPHADIBBLEND, EMR_ANGLEARC, EMR_ARC, EMR_ARCTO, EMR_BEGINPATH, EMR_BITBLT, EMR_CHORD, EMR_CLOSEFIGURE, EMR_COLORCORRECTPALETTE, EMR_COMMENT, EMR_COMMENT_EMFPLUS, EMR_COMMENT_EMFSPOOL, EMR_COMMENT_PUBLIC, EMR_CREATEBRUSHINDIRECT, EMR_CREATECOLORSPACE, EMR_CREATEDIBPATTERNBRUSHPT, EMR_CREATEMONOBRUSH, EMR_CREATEPALETTE, EMR_CREATEPEN, EMR_DELETECOLORSPACE, EMR_DELETEOBJECT, EMR_DRAWESCAPE, EMR_ELLIPSE, EMR_ENDPATH, EMR_EOF, EMR_EXCLUDECLIPRECT, EMR_EXTCREATEFONTINDIRECTW, EMR_EXTCREATEPEN, EMR_EXTESCAPE, EMR_EXTFLOODFILL, EMR_EXTSELECTCLIPRGN, EMR_EXTTEXTOUTA, EMR_EXTTEXTOUTW, EMR_FILLPATH, EMR_FILLRGN, EMR_FLATTENPATH, EMR_FORCEUFIMAPPING, EMR_FRAMERGN, EMR_GLSBOUNDEDRECORD, EMR_GLSRECORD, EMR_GRADIENTFILL, EMR_HEADER, EMR_INTERSECTCLIPRECT, EMR_INVERTRGN, EMR_LINETO, EMR_MASKBLT, EMR_MODIFYWORLDTRANSFORM, EMR_MOVETOEX, EMR_NAMEDESCAPE, EMR_OFFSETCLIPRGN, EMR_PAINTRGN, EMR_PIE, EMR_PIXELFORMAT, EMR_PLGBLT, EMR_POLYBEZIER, EMR_POLYBEZIER16, EMR_POLYBEZIERTO, EMR_POLYBEZIERTO16, EMR_POLYDRAW, EMR_POLYDRAW16, EMR_POLYGON, EMR_POLYGON16, EMR_POLYLINE, EMR_POLYLINE16, EMR_POLYLINETO, EMR_POLYLINETO16, EMR_POLYPOLYGON, EMR_POLYPOLYGON16, EMR_POLYPOLYLINE, EMR_POLYPOLYLINE16, EMR_POLYTEXTOUTA, EMR_POLYTEXTOUTW, EMR_REALIZEPALETTE, EMR_RECTANGLE, EMR_RESIZEPALETTE, EMR_RESTOREDC, EMR_ROUNDRECT, EMR_SAVEDC, EMR_SCALEVIEWPORTEXTEX, EMR_SCALEWINDOWEXTEX, EMR_SELECTCLIPPATH, EMR_SELECTOBJECT, EMR_SELECTPALETTE, EMR_SETARCDIRECTION, EMR_SETBKCOLOR, EMR_SETBKMODE, EMR_SETBRUSHORGEX, EMR_SETCOLORADJUSTMENT, EMR_SETCOLORSPACE, EMR_SETDIBITSTODEVICE, EMR_SETICMMODE, EMR_SETICMPROFILEA, EMR_SETICMPROFILEW, EMR_SETLINKEDUFIS, EMR_SETMAPMODE, EMR_SETMAPPERFLAGS, EMR_SETMETARGN, EMR_SETMITERLIMIT, EMR_SETPALETTEENTRIES, EMR_SETPIXELV, EMR_SETPOLYFILLMODE, EMR_SETROP2, EMR_SETSTRETCHBLTMODE, EMR_SETTEXTALIGN, EMR_SETTEXTCOLOR, EMR_SETTEXTJUSTIFICATION, EMR_SETVIEWPORTEXTEX, EMR_SETVIEWPORTORGEX, EMR_SETWINDOWEXTEX, EMR_SETWINDOWORGEX, EMR_SETWORLDTRANSFORM, EMR_SMALLTEXTOUT, EMR_STARTDOC, EMR_STRETCHBLT, EMR_STRETCHDIBITS, EMR_STROKEANDFILLPATH, EMR_STROKEPATH, EMR_TRANSPARENTBLT, EMR_TRANSPARENTDIB, EMR_WIDENPATH, emfio::ENHMETA_STOCK_OBJECT, emfio::ETO_CLIPPED, emfio::ETO_GLYPH_INDEX, emfio::ETO_NO_RECT, emfio::ETO_OPAQUE, emfio::ETO_PDY, emfio::ETO_RTLREADING, KernArray::get(), emfio::MtfTools::GetCharSet(), getDIBV5HeaderSize(), emfio::MtfTools::GetPathObj(), Bitmap::GetSizePixel(), BitmapEx::GetSizePixel(), emfio::MtfTools::GetWinOrg(), SvStream::good(), h, Size::Height(), i, emfio::MtfTools::IntersectClipRect(), emfio::MtfTools::IsArcDirectionClockWise(), BitmapEx::IsEmpty(), length, emfio::LF_FACESIZE, emfio::LOGFONTW::lfCharSet, emfio::LOGFONTW::lfClipPrecision, emfio::LOGFONTW::lfEscapement, emfio::LOGFONTW::lfHeight, emfio::LOGFONTW::lfItalic, emfio::LOGFONTW::lfOrientation, emfio::LOGFONTW::lfOutPrecision, emfio::LOGFONTW::lfPitchAndFamily, emfio::LOGFONTW::lfQuality, emfio::LOGFONTW::lfStrikeOut, emfio::LOGFONTW::lfUnderline, emfio::LOGFONTW::lfWeight, emfio::LOGFONTW::lfWidth, emfio::MtfTools::LineTo(), emfio::MtfTools::maActPos, emfio::MtfTools::maBmpSaveList, emfio::MtfTools::maScaledFontHelper, mbEMFPlus, mbEMFPlusDualMode, mbEnableEMFPlus, mbReadOtherGraphicFormat, mbRecordPath, emfio::MtfTools::mnBkMode, emfio::MtfTools::mnEndPos, mnRecordCount, emfio::MtfTools::mnStartPos, emfio::MtfTools::ModifyWorldTransform(), emfio::MtfTools::MoveClipRegion(), emfio::MtfTools::MoveTo(), emfio::MtfTools::mpInputStream, nIndex, SvMemoryStream::ObjectOwnsMemory(), tools::Polygon::Optimize(), emfio::MtfTools::Pop(), emfio::PS_COSMETIC, emfio::PS_GEOMETRIC, emfio::PS_INSIDEFRAME, emfio::PS_STYLE_MASK, emfio::MtfTools::Push(), read_uInt16s_ToOUString(), SvStream::ReadBytes(), emfio::MtfTools::ReadColor(), ReadDIB(), ReadDIBV5(), ReadEMFPlusComment(), SvStream::ReadFloat(), ReadGDIComment(), ReadHeader(), SvStream::ReadInt32(), ReadRectangle(), SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::remainingSize(), KernArray::resize(), emfio::MtfTools::ResolveBitmapActions(), emfio::RGN_COPY, SAL_INFO, SAL_INFO_IF, SAL_MAX_INT32, SAL_MAX_UINT32, SAL_MIN_INT32, SAL_WARN, SAL_WARN_IF, o3tl::saturating_add(), tools::Rectangle::SaturatingSetSize(), emfio::MtfTools::ScaleDevExt(), emfio::MtfTools::ScaleWinExt(), SvStream::Seek(), SvStream::SeekRel(), emfio::MtfTools::SelectObject(), KernArray::set(), emfio::MtfTools::SetArcDirection(), emfio::MtfTools::SetBkColor(), emfio::MtfTools::SetBkMode(), emfio::MtfTools::SetClipPath(), emfio::MtfTools::SetDefaultClipPath(), emfio::MtfTools::SetDevExt(), emfio::MtfTools::SetDevOrg(), emfio::MtfTools::SetMapMode(), emfio::MtfTools::SetRasterOp(), emfio::MtfTools::SetTextAlign(), emfio::MtfTools::SetTextColor(), emfio::MtfTools::SetTextLayoutMode(), emfio::MtfTools::SetWinExt(), emfio::MtfTools::SetWinOrg(), emfio::MtfTools::SetWorldTransform(), emfio::SRCAND, emfio::SRCINVERT, emfio::MtfTools::StrokeAndFillPath(), SvStream::Tell(), vcl::text::TextOriginLeft, emfio::Transparent, w, Size::Width(), vcl::PngImageWriter::write(), SvStream::WriteUChar(), SvStream::WriteUInt16(), and SvStream::WriteUInt32().
void emfio::EmfReader::ReadGDIComment | ( | sal_uInt32 | nCommentId | ) |
Definition at line 420 of file emfreader.cxx.
References bottom, emfio::EMR_COMMENT_BEGINGROUP, emfio::EMR_COMMENT_ENDGROUP, emfio::EMR_COMMENT_MULTIFORMATS, emfio::EMR_COMMENT_WINDOWS_METAFILE, i, left, emfio::MtfTools::mpInputStream, ReadMultiformatsComment(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), right, SAL_INFO, SAL_WARN, and top.
Referenced by ReadEnhWMF().
|
private |
Definition at line 2210 of file emfreader.cxx.
References checkSeek(), emfio::MtfTools::mnEndPos, mnRecordCount, emfio::MtfTools::mnStartPos, emfio::MtfTools::mpInputStream, nType, nVersion, SvStream::ReadInt32(), ReadRectangle(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::remainingSize(), SAL_INFO, SAL_WARN, SvStream::SeekRel(), emfio::MtfTools::SetrclBounds(), emfio::MtfTools::SetrclFrame(), emfio::MtfTools::SetRefMill(), emfio::MtfTools::SetRefPix(), and SvStream::Tell().
Referenced by ReadEnhWMF().
void emfio::EmfReader::ReadMultiformatsComment | ( | ) |
Parses EMR_COMMENT_MULTIFORMATS.
Definition at line 477 of file emfreader.cxx.
References Graphic::GetBitmapEx(), Graphic::getVectorGraphicData(), SvStream::good(), vcl::ImportPDF(), emfio::MtfTools::maBmpSaveList, maSizeHint, mbReadOtherGraphicFormat, emfio::MtfTools::mpInputStream, nVersion, PDF_SIGNATURE, SvStream::ReadBytes(), ReadRectangle(), SvStream::ReadUInt32(), SvStream::remainingSize(), SvStream::Seek(), emfio::SRCCOPY, and SvStream::WriteBytes().
Referenced by ReadGDIComment().
|
private |
Reads polygons from the stream.
The <class T> parameter is for the type of the points nStartIndex: which is the starting index in the polygon of the first point read nPoints: number of points mpInputStream: the stream containing the polygons
Definition at line 667 of file emfreader.cxx.
References SvStream::good(), i, emfio::MtfTools::mpInputStream, SvStream::remainingSize(), SAL_INFO, SAL_MAX_UINT16, SAL_WARN, SAL_WARN_IF, tools::Polygon::SetSize(), and SvStream::Tell().
|
private |
Reads polygons from the stream.
The <class T> parameter is for the type of the points (sal_uInt32 or sal_uInt16). skipFirst: if the first point read is the 0th point or the 1st point in the array.
Definition at line 645 of file emfreader.cxx.
References emfio::MtfTools::mpInputStream, SvStream::ReadUInt32(), and SvStream::SeekRel().
|
private |
Definition at line 2319 of file emfreader.cxx.
References emfio::MtfTools::mpInputStream, tools::Rectangle::Normalize(), SvStream::ReadInt32(), SAL_INFO, and SAL_WARN.
Referenced by ReadEnhWMF(), ReadHeader(), and ReadMultiformatsComment().
|
staticprivate |
Definition at line 2337 of file emfreader.cxx.
|
inline |
Definition at line 51 of file emfreader.hxx.
References mbEnableEMFPlus.
|
inline |
Definition at line 50 of file emfreader.hxx.
References maSizeHint.
|
private |
Definition at line 35 of file emfreader.hxx.
Referenced by ReadMultiformatsComment(), and SetSizeHint().
|
private |
Definition at line 31 of file emfreader.hxx.
Referenced by ReadEMFPlusComment(), and ReadEnhWMF().
|
private |
Definition at line 32 of file emfreader.hxx.
Referenced by ReadEMFPlusComment(), and ReadEnhWMF().
|
private |
Definition at line 36 of file emfreader.hxx.
Referenced by ReadEnhWMF(), and SetEnableEMFPlus().
|
private |
Another format is read already, can ignore actual EMF data.
Definition at line 34 of file emfreader.hxx.
Referenced by ReadEnhWMF(), and ReadMultiformatsComment().
|
private |
Definition at line 30 of file emfreader.hxx.
Referenced by ReadAndDrawPolyLine(), ReadAndDrawPolyPolygon(), and ReadEnhWMF().
|
private |
Definition at line 28 of file emfreader.hxx.
Referenced by ReadEnhWMF(), and ReadHeader().