LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
GraphicFilter Class Reference

Class to import and export graphic formats. More...

#include <graphicfilter.hxx>

Collaboration diagram for GraphicFilter:
[legend]

Public Member Functions

 GraphicFilter (bool bUseConfig=true)
 
 ~GraphicFilter ()
 
sal_uInt16 GetImportFormatCount () const
 
sal_uInt16 GetImportFormatNumber (std::u16string_view rFormatName)
 
sal_uInt16 GetImportFormatNumberForShortName (std::u16string_view rShortName)
 
sal_uInt16 GetImportFormatNumberForTypeName (std::u16string_view rType)
 
OUString GetImportFormatName (sal_uInt16 nFormat)
 
OUString GetImportFormatTypeName (sal_uInt16 nFormat)
 
OUString GetImportFormatShortName (sal_uInt16 nFormat)
 
OUString GetImportWildcard (sal_uInt16 nFormat, sal_Int32 nEntry)
 
sal_uInt16 GetExportFormatCount () const
 
sal_uInt16 GetExportFormatNumber (std::u16string_view rFormatName)
 
sal_uInt16 GetExportFormatNumberForMediaType (std::u16string_view rShortName)
 
sal_uInt16 GetExportFormatNumberForShortName (std::u16string_view rShortName)
 
OUString GetExportInternalFilterName (sal_uInt16 nFormat)
 
sal_uInt16 GetExportFormatNumberForTypeName (std::u16string_view rType)
 
OUString GetExportFormatName (sal_uInt16 nFormat)
 
OUString GetExportFormatMediaType (sal_uInt16 nFormat)
 
OUString GetExportFormatShortName (sal_uInt16 nFormat)
 
OUString GetExportWildcard (sal_uInt16 nFormat)
 
bool IsExportPixelFormat (sal_uInt16 nFormat)
 
ErrCode ExportGraphic (const Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData=nullptr)
 
ErrCode ExportGraphic (const Graphic &rGraphic, const OUString &rPath, SvStream &rOStm, sal_uInt16 nFormat, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData=nullptr)
 
ErrCode CanImportGraphic (const INetURLObject &rPath, sal_uInt16 nFormat, sal_uInt16 *pDeterminedFormat)
 
ErrCode ImportGraphic (Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
 
ErrCode CanImportGraphic (const OUString &rPath, SvStream &rStream, sal_uInt16 nFormat, sal_uInt16 *pDeterminedFormat)
 
ErrCode ImportGraphic (Graphic &rGraphic, const OUString &rPath, SvStream &rStream, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE, WmfExternal const *pExtHeader=nullptr)
 
void ImportGraphics (std::vector< std::shared_ptr< Graphic > > &rGraphics, std::vector< std::unique_ptr< SvStream > > vStreams)
 Imports multiple graphics. More...
 
void MakeGraphicsAvailableThreaded (std::vector< Graphic * > &rGraphics)
 Tries to ensure all Graphic objects are available (Graphic::isAvailable()). More...
 
ErrCode ImportGraphic (Graphic &rGraphic, const OUString &rPath, SvStream &rStream, sal_uInt16 nFormat, sal_uInt16 *pDeterminedFormat, GraphicFilterImportFlags nImportFlags, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData, WmfExternal const *pExtHeader=nullptr)
 
Graphic ImportUnloadedGraphic (SvStream &rIStream, sal_uInt64 sizeLimit=0, const Size *pSizeHint=nullptr)
 
const FilterErrorExGetLastError () const
 
void ResetLastError ()
 
Link< ConvertData &, bool > GetFilterCallback () const
 
ErrCode compressAsPNG (const Graphic &rGraphic, SvStream &rOutputStream)
 

Static Public Member Functions

static GraphicFilterGetGraphicFilter ()
 
static ErrCode LoadGraphic (const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
 
static ErrCode readGIF (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType)
 
static ErrCode readPNG (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, std::unique_ptr< sal_uInt8[]> &rpGraphicContent, sal_Int32 &rGraphicContentSize)
 
static ErrCode readJPEG (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, GraphicFilterImportFlags nImportFlags)
 
static ErrCode readSVG (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, std::unique_ptr< sal_uInt8[]> &rpGraphicContent, sal_Int32 &rGraphicContentSize)
 
static ErrCode readXBM (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readXPM (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readWMF_EMF (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, WmfExternal const *pExtHeader, VectorGraphicDataType eType)
 
static ErrCode readWMF (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, WmfExternal const *pExtHeader)
 
static ErrCode readEMF (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, WmfExternal const *pExtHeader)
 
static ErrCode readPDF (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType)
 
static ErrCode readTIFF (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType)
 
static ErrCode readWithTypeSerializer (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType, OUString aFilterName)
 
static ErrCode readBMP (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType)
 
static ErrCode readTGA (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readPICT (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType)
 
static ErrCode readMET (SvStream &rStream, Graphic &rGraphic, GfxLinkType &rLinkType)
 
static ErrCode readRAS (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readPCX (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readEPS (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readPSD (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readPCD (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readPBM (SvStream &rStream, Graphic &rGraphic)
 
static ErrCode readDXF (SvStream &rStream, Graphic &rGraphic)
 

Private Member Functions

void ImplInit ()
 
ErrCode ImplSetError (ErrCode nError, const SvStream *pStm=nullptr)
 
ErrCode ImpTestOrFindFormat (const OUString &rPath, SvStream &rStream, sal_uInt16 &rFormat)
 
 DECL_LINK (FilterCallback, ConvertData &, bool)
 

Private Attributes

OUString aFilterPath
 
FilterConfigCachepConfig
 
std::unique_ptr< FilterErrorExpErrorEx
 
bool bUseConfig
 

Detailed Description

Class to import and export graphic formats.

Definition at line 268 of file graphicfilter.hxx.

Constructor & Destructor Documentation

GraphicFilter::GraphicFilter ( bool  bUseConfig = true)

Definition at line 320 of file graphicfilter.cxx.

References ImplInit().

GraphicFilter::~GraphicFilter ( )

Definition at line 326 of file graphicfilter.cxx.

References getListMutex(), pConfig, pErrorEx, and pFilterHdlList.

Member Function Documentation

ErrCode GraphicFilter::CanImportGraphic ( const INetURLObject rPath,
sal_uInt16  nFormat,
sal_uInt16 *  pDeterminedFormat 
)
ErrCode GraphicFilter::CanImportGraphic ( const OUString &  rPath,
SvStream rStream,
sal_uInt16  nFormat,
sal_uInt16 *  pDeterminedFormat 
)
ErrCode GraphicFilter::compressAsPNG ( const Graphic rGraphic,
SvStream rOutputStream 
)

Definition at line 1940 of file graphicfilter.cxx.

References ExportGraphic(), GetExportFormatNumberForShortName(), and u.

GraphicFilter::DECL_LINK ( FilterCallback  ,
ConvertData ,
bool   
)
private
ErrCode GraphicFilter::ExportGraphic ( const Graphic rGraphic,
const INetURLObject rPath,
sal_uInt16  nFormat,
const css::uno::Sequence< css::beans::PropertyValue > *  pFilterData = nullptr 
)
ErrCode GraphicFilter::ExportGraphic ( const Graphic rGraphic,
const OUString &  rPath,
SvStream rOStm,
sal_uInt16  nFormat,
const css::uno::Sequence< css::beans::PropertyValue > *  pFilterData = nullptr 
)
sal_uInt16 GraphicFilter::GetExportFormatCount ( ) const

Definition at line 424 of file graphicfilter.cxx.

References FilterConfigCache::GetExportFormatCount(), and pConfig.

Referenced by ExportGraphic().

OUString GraphicFilter::GetExportFormatMediaType ( sal_uInt16  nFormat)

Definition at line 459 of file graphicfilter.cxx.

References FilterConfigCache::GetExportFormatMediaType(), and pConfig.

OUString GraphicFilter::GetExportFormatName ( sal_uInt16  nFormat)

Definition at line 454 of file graphicfilter.cxx.

References FilterConfigCache::GetExportFormatName(), and pConfig.

sal_uInt16 GraphicFilter::GetExportFormatNumber ( std::u16string_view  rFormatName)

Definition at line 429 of file graphicfilter.cxx.

References FilterConfigCache::GetExportFormatNumber(), and pConfig.

sal_uInt16 GraphicFilter::GetExportFormatNumberForMediaType ( std::u16string_view  rShortName)
sal_uInt16 GraphicFilter::GetExportFormatNumberForShortName ( std::u16string_view  rShortName)
sal_uInt16 GraphicFilter::GetExportFormatNumberForTypeName ( std::u16string_view  rType)
OUString GraphicFilter::GetExportFormatShortName ( sal_uInt16  nFormat)

Definition at line 464 of file graphicfilter.cxx.

References FilterConfigCache::GetExportFormatShortName(), and pConfig.

OUString GraphicFilter::GetExportInternalFilterName ( sal_uInt16  nFormat)

Definition at line 444 of file graphicfilter.cxx.

References FilterConfigCache::GetExportInternalFilterName(), and pConfig.

OUString GraphicFilter::GetExportWildcard ( sal_uInt16  nFormat)

Definition at line 469 of file graphicfilter.cxx.

References FilterConfigCache::GetExportWildcard(), and pConfig.

Link< ConvertData &, bool > GraphicFilter::GetFilterCallback ( ) const

Definition at line 1815 of file graphicfilter.cxx.

References LINK.

GraphicFilter & GraphicFilter::GetGraphicFilter ( )
static
sal_uInt16 GraphicFilter::GetImportFormatCount ( ) const

Definition at line 377 of file graphicfilter.cxx.

References FilterConfigCache::GetImportFormatCount(), and pConfig.

Referenced by LoadGraphic().

OUString GraphicFilter::GetImportFormatName ( sal_uInt16  nFormat)

Definition at line 397 of file graphicfilter.cxx.

References FilterConfigCache::GetImportFormatName(), and pConfig.

sal_uInt16 GraphicFilter::GetImportFormatNumber ( std::u16string_view  rFormatName)

Definition at line 382 of file graphicfilter.cxx.

References FilterConfigCache::GetImportFormatNumber(), and pConfig.

Referenced by LoadGraphic().

sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName ( std::u16string_view  rShortName)
sal_uInt16 GraphicFilter::GetImportFormatNumberForTypeName ( std::u16string_view  rType)
OUString GraphicFilter::GetImportFormatShortName ( sal_uInt16  nFormat)

Definition at line 414 of file graphicfilter.cxx.

References FilterConfigCache::GetImportFormatShortName(), and pConfig.

OUString GraphicFilter::GetImportFormatTypeName ( sal_uInt16  nFormat)

Definition at line 402 of file graphicfilter.cxx.

References FilterConfigCache::GetImportFilterTypeName(), and pConfig.

OUString GraphicFilter::GetImportWildcard ( sal_uInt16  nFormat,
sal_Int32  nEntry 
)

Definition at line 419 of file graphicfilter.cxx.

References FilterConfigCache::GetImportWildcard(), and pConfig.

const FilterErrorEx& GraphicFilter::GetLastError ( ) const
inline

Definition at line 344 of file graphicfilter.hxx.

void GraphicFilter::ImplInit ( )
private

Definition at line 345 of file graphicfilter.cxx.

References aFilterPath, bUseConfig, getListMutex(), pConfig, pErrorEx, and pFilterHdlList.

Referenced by GraphicFilter().

ErrCode GraphicFilter::ImplSetError ( ErrCode  nError,
const SvStream pStm = nullptr 
)
private
ErrCode GraphicFilter::ImportGraphic ( Graphic rGraphic,
const INetURLObject rPath,
sal_uInt16  nFormat = GRFILTER_FORMAT_DONTKNOW,
sal_uInt16 *  pDeterminedFormat = nullptr,
GraphicFilterImportFlags  nImportFlags = GraphicFilterImportFlags::NONE 
)
ErrCode GraphicFilter::ImportGraphic ( Graphic rGraphic,
const OUString &  rPath,
SvStream rStream,
sal_uInt16  nFormat = GRFILTER_FORMAT_DONTKNOW,
sal_uInt16 *  pDeterminedFormat = nullptr,
GraphicFilterImportFlags  nImportFlags = GraphicFilterImportFlags::NONE,
WmfExternal const *  pExtHeader = nullptr 
)

Definition at line 524 of file graphicfilter.cxx.

References ImportGraphic().

ErrCode GraphicFilter::ImportGraphic ( Graphic rGraphic,
const OUString &  rPath,
SvStream rStream,
sal_uInt16  nFormat,
sal_uInt16 *  pDeterminedFormat,
GraphicFilterImportFlags  nImportFlags,
const css::uno::Sequence< css::beans::PropertyValue > *  pFilterData,
WmfExternal const *  pExtHeader = nullptr 
)
void GraphicFilter::ImportGraphics ( std::vector< std::shared_ptr< Graphic > > &  rGraphics,
std::vector< std::unique_ptr< SvStream > >  vStreams 
)
Graphic GraphicFilter::ImportUnloadedGraphic ( SvStream rIStream,
sal_uInt64  sizeLimit = 0,
const Size pSizeHint = nullptr 
)
ErrCode GraphicFilter::ImpTestOrFindFormat ( const OUString &  rPath,
SvStream rStream,
sal_uInt16 &  rFormat 
)
private
bool GraphicFilter::IsExportPixelFormat ( sal_uInt16  nFormat)

Definition at line 474 of file graphicfilter.cxx.

References FilterConfigCache::IsExportPixelFormat(), and pConfig.

ErrCode GraphicFilter::LoadGraphic ( const OUString &  rPath,
const OUString &  rFilter,
Graphic rGraphic,
GraphicFilter pFilter = nullptr,
sal_uInt16 *  pDeterminedFormat = nullptr 
)
static
void GraphicFilter::MakeGraphicsAvailableThreaded ( std::vector< Graphic * > &  rGraphics)

Tries to ensure all Graphic objects are available (Graphic::isAvailable()).

Only an optimization, may not process all items.

Definition at line 687 of file graphicfilter.cxx.

References assert(), graphic, i, ImportGraphics(), and NativeJpg.

ErrCode GraphicFilter::readBMP ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType 
)
static

Definition at line 1162 of file graphicfilter.cxx.

References BmpReader(), ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and NativeBmp.

Referenced by ImportGraphic().

ErrCode GraphicFilter::readDXF ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1258 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportDxfGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readEMF ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
WmfExternal const *  pExtHeader 
)
static

Definition at line 1114 of file graphicfilter.cxx.

References Emf, and readWMF_EMF().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readEPS ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1219 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportEpsGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readGIF ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType 
)
static

Definition at line 918 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, ImportGIF(), and NativeGif.

Referenced by ImportGraphic().

ErrCode GraphicFilter::readJPEG ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
GraphicFilterImportFlags  nImportFlags 
)
static
ErrCode GraphicFilter::readMET ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType 
)
static

Definition at line 1192 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, ImportMetGraphic(), and NativeMet.

Referenced by ImportGraphic().

ErrCode GraphicFilter::readPBM ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1250 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportPbmGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readPCD ( SvStream rStream,
Graphic rGraphic 
)
static
ErrCode GraphicFilter::readPCX ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1211 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportPcxGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readPDF ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType 
)
static

Definition at line 1119 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, vcl::ImportPDF(), and NativePdf.

Referenced by ImportGraphic().

ErrCode GraphicFilter::readPICT ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType 
)
static

Definition at line 1181 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, ImportPictGraphic(), and NativePct.

Referenced by ImportGraphic().

ErrCode GraphicFilter::readPNG ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
std::unique_ptr< sal_uInt8[]> &  rpGraphicContent,
sal_Int32 &  rGraphicContentSize 
)
static
ErrCode GraphicFilter::readPSD ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1227 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportPsdGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readRAS ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1203 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportRasGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readSVG ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
std::unique_ptr< sal_uInt8[]> &  rpGraphicContent,
sal_Int32 &  rGraphicContentSize 
)
static
ErrCode GraphicFilter::readTGA ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1173 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportTgaGraphic().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readTIFF ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType 
)
static
ErrCode GraphicFilter::readWithTypeSerializer ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
OUString  aFilterName 
)
static
ErrCode GraphicFilter::readWMF ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
WmfExternal const *  pExtHeader 
)
static

Definition at line 1109 of file graphicfilter.cxx.

References readWMF_EMF(), and Wmf.

Referenced by ImportGraphic().

ErrCode GraphicFilter::readWMF_EMF ( SvStream rStream,
Graphic rGraphic,
GfxLinkType rLinkType,
WmfExternal const *  pExtHeader,
VectorGraphicDataType  eType 
)
static
ErrCode GraphicFilter::readXBM ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1059 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportXBM().

Referenced by ImportGraphic().

ErrCode GraphicFilter::readXPM ( SvStream rStream,
Graphic rGraphic 
)
static

Definition at line 1067 of file graphicfilter.cxx.

References ERRCODE_GRFILTER_FILTERERROR, ERRCODE_NONE, and ImportXPM().

Referenced by ImportGraphic().

void GraphicFilter::ResetLastError ( )

Definition at line 1810 of file graphicfilter.cxx.

References ERRCODE_NONE, and pErrorEx.

Referenced by ExportGraphic(), ImportGraphic(), ImportGraphics(), and ImportUnloadedGraphic().

Member Data Documentation

OUString GraphicFilter::aFilterPath
private

Definition at line 387 of file graphicfilter.hxx.

Referenced by ImplInit().

bool GraphicFilter::bUseConfig
private

Definition at line 397 of file graphicfilter.hxx.

Referenced by ImplInit().

FilterConfigCache* GraphicFilter::pConfig
private
std::unique_ptr<FilterErrorEx> GraphicFilter::pErrorEx
private

Definition at line 396 of file graphicfilter.hxx.

Referenced by ImplInit(), ImplSetError(), ResetLastError(), and ~GraphicFilter().


The documentation for this class was generated from the following files: