20#ifndef INCLUDED_VCL_GRAPHICFILTER_HXX
21#define INCLUDED_VCL_GRAPHICFILTER_HXX
43#define ERRCODE_GRFILTER_OPENERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 1)
44#define ERRCODE_GRFILTER_IOERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 2)
45#define ERRCODE_GRFILTER_FORMATERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 3)
46#define ERRCODE_GRFILTER_VERSIONERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 4)
47#define ERRCODE_GRFILTER_FILTERERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 5)
48#define ERRCODE_GRFILTER_TOOBIG ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 7)
50#define GRFILTER_OUTHINT_GREY 1
52#define GRFILTER_FORMAT_NOTFOUND (sal_uInt16(0xFFFF))
53#define GRFILTER_FORMAT_DONTKNOW (sal_uInt16(0xFFFF))
70#define IMP_BMP "SVBMP"
71#define IMP_MOV "SVMOV"
72#define IMP_SVMETAFILE "SVMETAFILE"
73#define IMP_WMF "SVWMF"
74#define IMP_WMZ "SVWMZ"
75#define IMP_EMF "SVEMF"
76#define IMP_EMZ "SVEMZ"
77#define IMP_GIF "SVIGIF"
78#define IMP_PNG "SVIPNG"
79#define IMP_JPEG "SVIJPEG"
80#define IMP_XBM "SVIXBM"
81#define IMP_XPM "SVIXPM"
82#define IMP_SVG "SVISVG"
83#define IMP_SVGZ "SVISVGZ"
84#define IMP_PDF "SVIPDF"
85#define IMP_TIFF "SVTIFF"
86#define IMP_TGA "SVTGA"
87#define IMP_PICT "SVPICT"
88#define IMP_MET "SVMET"
89#define IMP_RAS "SVRAS"
90#define IMP_PCX "SVPCX"
91#define IMP_EPS "SVIEPS"
92#define IMP_PSD "SVPSD"
93#define IMP_PCD "SVPCD"
94#define IMP_PBM "SVPBM"
95#define IMP_DXF "SVDXF"
96#define IMP_WEBP "SVIWEBP"
98#define EXP_BMP "SVBMP"
99#define EXP_SVMETAFILE "SVMETAFILE"
100#define EXP_WMF "SVWMF"
101#define EXP_WMZ "SVWMZ"
102#define EXP_EMF "SVEMF"
103#define EXP_EMZ "SVEMZ"
104#define EXP_JPEG "SVEJPEG"
105#define EXP_SVG "SVESVG"
106#define EXP_SVGZ "SVESVGZ"
107#define EXP_PDF "SVEPDF"
108#define EXP_PNG "SVEPNG"
109#define EXP_TIFF "SVTIFF"
110#define EXP_EPS "SVEEPS"
111#define EXP_GIF "SVEGIF"
112#define EXP_WEBP "SVEWEBP"
138 bool ImpDetectBMP(
SvStream& rStm,
bool bExtendedInfo );
139 bool ImpDetectGIF(
SvStream& rStm,
bool bExtendedInfo );
140 bool ImpDetectJPG(
SvStream& rStm,
bool bExtendedInfo );
141 bool ImpDetectPCD(
SvStream& rStm,
bool bExtendedInfo );
142 bool ImpDetectPCX(
SvStream& rStm );
143 bool ImpDetectPNG(
SvStream& rStm,
bool bExtendedInfo );
144 bool ImpDetectTIF(
SvStream& rStm,
bool bExtendedInfo );
145 bool ImpDetectXBM(
SvStream& rStm,
bool bExtendedInfo );
146 bool ImpDetectXPM(
SvStream& rStm,
bool bExtendedInfo );
147 bool ImpDetectPBM(
SvStream& rStm,
bool bExtendedInfo );
148 bool ImpDetectPGM(
SvStream& rStm,
bool bExtendedInfo );
149 bool ImpDetectPPM(
SvStream& rStm,
bool bExtendedInfo );
150 bool ImpDetectRAS(
SvStream& rStm,
bool bExtendedInfo );
151 bool ImpDetectTGA(
SvStream& rStm,
bool bExtendedInfo );
152 bool ImpDetectPSD(
SvStream& rStm,
bool bExtendedInfo );
153 bool ImpDetectEPS(
SvStream& rStm,
bool bExtendedInfo );
154 bool ImpDetectWEBP(
SvStream& rStm,
bool bExtendedInfo );
155 bool ImpDetectDXF(
SvStream& rStm,
bool bExtendedInfo );
156 bool ImpDetectMET(
SvStream& rStm,
bool bExtendedInfo );
157 bool ImpDetectPCT(
SvStream& rStm,
bool bExtendedInfo );
158 bool ImpDetectSVM(
SvStream& rStm,
bool bExtendedInfo );
159 bool ImpDetectWMF(
SvStream& rStm,
bool bExtendedInfo );
160 bool ImpDetectEMF(
SvStream& rStm,
bool bExtendedInfo );
161 bool ImpDetectSVG(
SvStream& rStm,
bool bExtendedInfo );
188 bool Detect(
bool bExtendedInfo =
false );
234 sal_uInt16 GetImportFormatCount()
const;
235 sal_uInt16 GetImportFormatNumber( std::u16string_view rFormatName );
236 sal_uInt16 GetImportFormatNumberForShortName( std::u16string_view rShortName );
237 sal_uInt16 GetImportFormatNumberForTypeName( std::u16string_view rType );
238 OUString GetImportFormatName( sal_uInt16 nFormat );
239 OUString GetImportFormatTypeName( sal_uInt16 nFormat );
241 OUString GetImportFormatMediaType( sal_uInt16 nFormat );
243 OUString GetImportFormatShortName( sal_uInt16 nFormat );
244 OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
246 sal_uInt16 GetExportFormatCount()
const;
247 sal_uInt16 GetExportFormatNumber( std::u16string_view rFormatName );
248 sal_uInt16 GetExportFormatNumberForMediaType( std::u16string_view rShortName );
249 sal_uInt16 GetExportFormatNumberForShortName( std::u16string_view rShortName );
250 OUString GetExportInternalFilterName( sal_uInt16 nFormat );
251 sal_uInt16 GetExportFormatNumberForTypeName( std::u16string_view rType );
252 OUString GetExportFormatName( sal_uInt16 nFormat );
253 OUString GetExportFormatMediaType( sal_uInt16 nFormat );
254 OUString GetExportFormatShortName( sal_uInt16 nFormat );
255 OUString GetExportWildcard( sal_uInt16 nFormat );
256 bool IsExportPixelFormat( sal_uInt16 nFormat );
260 const css::uno::Sequence< css::beans::PropertyValue >* pFilterData =
nullptr );
261 ErrCode ExportGraphic(
const Graphic& rGraphic, std::u16string_view rPath,
262 SvStream& rOStm, sal_uInt16 nFormat,
263 const css::uno::Sequence< css::beans::PropertyValue >* pFilterData =
nullptr );
267 sal_uInt16 * pDeterminedFormat);
273 ErrCode CanImportGraphic( std::u16string_view rPath,
SvStream& rStream,
275 sal_uInt16 * pDeterminedFormat);
277 ErrCode ImportGraphic(
Graphic& rGraphic, std::u16string_view rPath,
285 void ImportGraphics(std::vector< std::shared_ptr<Graphic> >& rGraphics, std::vector< std::unique_ptr<SvStream> > vStreams);
291 void MakeGraphicsAvailableThreaded(std::vector< Graphic* >& rGraphics);
294 Graphic ImportUnloadedGraphic(
SvStream& rIStream, sal_uInt64 sizeLimit = 0,
const Size* pSizeHint =
nullptr);
297 void ResetLastError();
301 static ErrCode LoadGraphic(
const OUString& rPath,
const OUString& rFilter,
304 sal_uInt16* pDeterminedFormat =
nullptr );
344 ErrCode ImpTestOrFindFormat( std::u16string_view rPath,
SvStream& rStream, sal_uInt16& rFormat );
Container for the binary data, whose responsibility is to manage the make it as simple as possible to...
Cache to keep list of graphic filters + the filters themselves.
const std::optional< MapMode > & GetPreferredMapMode() const
If available, this returns the map mode the graphic prefers, which may be other than pixel or 100th m...
sal_uInt8 GetNumberOfImageComponents() const
sal_uInt16 GetBitsPerPixel() const
GraphicDescriptor(const GraphicDescriptor &)=delete
GraphicDescriptor & operator=(const GraphicDescriptor &)=delete
const std::optional< Size > & GetPreferredLogSize() const
Returns the logic size, according to the map mode available via GetPreferredMapMode().
const Size & GetSize_100TH_MM() const
GraphicMetadata aMetadata
bool IsTransparent() const
GraphicFileFormat GetFileFormat() const
const Size & GetSizePixel() const
Class to import and export graphic formats.
FilterConfigCache * pConfig
std::optional< ErrCode > mxErrorEx
Information about errors during the GraphicFilter operation.
const ErrCode & GetLastError() const
DECL_DLLPRIVATE_LINK(FilterCallback, ConvertData &, bool)
GfxLinkType
GfxLink graphic types that are supported by GfxLink.
constexpr OUStringLiteral SVG_SHORTNAME
#define GRFILTER_FORMAT_DONTKNOW
constexpr OUStringLiteral MET_SHORTNAME
constexpr OUStringLiteral PCT_SHORTNAME
constexpr OUStringLiteral GIF_SHORTNAME
constexpr OUStringLiteral WEBP_SHORTNAME
constexpr OUStringLiteral TIF_SHORTNAME
constexpr OUStringLiteral WMF_SHORTNAME
constexpr OUStringLiteral BMP_SHORTNAME
@ UseExistingBitmap
Read pixel data into an existing bitmap.
@ OnlyCreateBitmap
Only create a bitmap, do not read pixel data.
constexpr OUStringLiteral JPG_SHORTNAME
constexpr OUStringLiteral EMF_SHORTNAME
constexpr OUStringLiteral PDF_SHORTNAME
constexpr OUStringLiteral PNG_SHORTNAME
constexpr OUStringLiteral SVM_SHORTNAME