20 #ifndef INCLUDED_VCL_GRAPHICFILTER_HXX
21 #define INCLUDED_VCL_GRAPHICFILTER_HXX
42 #define ERRCODE_GRFILTER_OPENERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 1)
43 #define ERRCODE_GRFILTER_IOERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 2)
44 #define ERRCODE_GRFILTER_FORMATERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 3)
45 #define ERRCODE_GRFILTER_VERSIONERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 4)
46 #define ERRCODE_GRFILTER_FILTERERROR ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 5)
47 #define ERRCODE_GRFILTER_TOOBIG ErrCode(ErrCodeArea::Vcl, ErrCodeClass::General, 7)
49 #define GRFILTER_OUTHINT_GREY 1
51 #define GRFILTER_FORMAT_NOTFOUND (sal_uInt16(0xFFFF))
52 #define GRFILTER_FORMAT_DONTKNOW (sal_uInt16(0xFFFF))
69 #define IMP_BMP "SVBMP"
70 #define IMP_MOV "SVMOV"
71 #define IMP_SVMETAFILE "SVMETAFILE"
72 #define IMP_WMF "SVWMF"
73 #define IMP_EMF "SVEMF"
74 #define IMP_GIF "SVIGIF"
75 #define IMP_PNG "SVIPNG"
76 #define IMP_JPEG "SVIJPEG"
77 #define IMP_XBM "SVIXBM"
78 #define IMP_XPM "SVIXPM"
79 #define IMP_SVG "SVISVG"
80 #define IMP_PDF "SVIPDF"
81 #define IMP_TIFF "SVTIFF"
82 #define IMP_TGA "SVTGA"
83 #define IMP_PICT "SVPICT"
84 #define IMP_MET "SVMET"
85 #define IMP_RAS "SVRAS"
86 #define IMP_PCX "SVPCX"
87 #define IMP_EPS "SVIEPS"
88 #define IMP_PSD "SVPSD"
89 #define IMP_PCD "SVPCD"
90 #define IMP_PBM "SVPBM"
91 #define IMP_DXF "SVDXF"
93 #define EXP_BMP "SVBMP"
94 #define EXP_SVMETAFILE "SVMETAFILE"
95 #define EXP_WMF "SVWMF"
96 #define EXP_EMF "SVEMF"
97 #define EXP_JPEG "SVEJPEG"
98 #define EXP_SVG "SVESVG"
99 #define EXP_PDF "SVEPDF"
100 #define EXP_PNG "SVEPNG"
101 #define EXP_TIFF "SVTIFF"
102 #define EXP_EPS "SVEEPS"
103 #define EXP_GIF "SVEGIF"
106 #define BMP_SHORTNAME u"BMP"
107 #define GIF_SHORTNAME u"GIF"
108 #define JPG_SHORTNAME u"JPG"
109 #define MET_SHORTNAME u"MET"
110 #define PCT_SHORTNAME u"PCT"
111 #define PNG_SHORTNAME u"PNG"
112 #define SVM_SHORTNAME u"SVM"
113 #define TIF_SHORTNAME u"TIF"
114 #define WMF_SHORTNAME u"WMF"
115 #define EMF_SHORTNAME u"EMF"
116 #define SVG_SHORTNAME u"SVG"
117 #define PDF_SHORTNAME u"PDF"
171 bool ImpDetectBMP(
SvStream& rStm,
bool bExtendedInfo );
172 bool ImpDetectGIF(
SvStream& rStm,
bool bExtendedInfo );
173 bool ImpDetectJPG(
SvStream& rStm,
bool bExtendedInfo );
174 bool ImpDetectPCD(
SvStream& rStm,
bool bExtendedInfo );
175 bool ImpDetectPCX(
SvStream& rStm );
176 bool ImpDetectPNG(
SvStream& rStm,
bool bExtendedInfo );
177 bool ImpDetectTIF(
SvStream& rStm,
bool bExtendedInfo );
178 bool ImpDetectXBM(
SvStream& rStm,
bool bExtendedInfo );
179 bool ImpDetectXPM(
SvStream& rStm,
bool bExtendedInfo );
180 bool ImpDetectPBM(
SvStream& rStm,
bool bExtendedInfo );
181 bool ImpDetectPGM(
SvStream& rStm,
bool bExtendedInfo );
182 bool ImpDetectPPM(
SvStream& rStm,
bool bExtendedInfo );
183 bool ImpDetectRAS(
SvStream& rStm,
bool bExtendedInfo );
184 bool ImpDetectTGA(
SvStream& rStm,
bool bExtendedInfo );
185 bool ImpDetectPSD(
SvStream& rStm,
bool bExtendedInfo );
186 bool ImpDetectEPS(
SvStream& rStm,
bool bExtendedInfo );
187 bool ImpDetectDXF(
SvStream& rStm,
bool bExtendedInfo );
188 bool ImpDetectMET(
SvStream& rStm,
bool bExtendedInfo );
189 bool ImpDetectPCT(
SvStream& rStm,
bool bExtendedInfo );
190 bool ImpDetectSVM(
SvStream& rStm,
bool bExtendedInfo );
191 bool ImpDetectWMF(
SvStream& rStm,
bool bExtendedInfo );
192 bool ImpDetectEMF(
SvStream& rStm,
bool bExtendedInfo );
193 bool ImpDetectSVG(
SvStream& rStm,
bool bExtendedInfo );
220 bool Detect(
bool bExtendedInfo =
false );
274 sal_uInt16 GetImportFormatCount()
const;
275 sal_uInt16 GetImportFormatNumber( std::u16string_view rFormatName );
276 sal_uInt16 GetImportFormatNumberForShortName( std::u16string_view rShortName );
277 sal_uInt16 GetImportFormatNumberForTypeName( std::u16string_view rType );
278 OUString GetImportFormatName( sal_uInt16 nFormat );
279 OUString GetImportFormatTypeName( sal_uInt16 nFormat );
281 OUString GetImportFormatMediaType( sal_uInt16 nFormat );
283 OUString GetImportFormatShortName( sal_uInt16 nFormat );
284 OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
286 sal_uInt16 GetExportFormatCount()
const;
287 sal_uInt16 GetExportFormatNumber( std::u16string_view rFormatName );
288 sal_uInt16 GetExportFormatNumberForMediaType( std::u16string_view rShortName );
289 sal_uInt16 GetExportFormatNumberForShortName( std::u16string_view rShortName );
290 OUString GetExportInternalFilterName( sal_uInt16 nFormat );
291 sal_uInt16 GetExportFormatNumberForTypeName( std::u16string_view rType );
292 OUString GetExportFormatName( sal_uInt16 nFormat );
293 OUString GetExportFormatMediaType( sal_uInt16 nFormat );
294 OUString GetExportFormatShortName( sal_uInt16 nFormat );
295 OUString GetExportWildcard( sal_uInt16 nFormat );
296 bool IsExportPixelFormat( sal_uInt16 nFormat );
300 const css::uno::Sequence< css::beans::PropertyValue >* pFilterData =
nullptr );
301 ErrCode ExportGraphic(
const Graphic& rGraphic,
const OUString& rPath,
302 SvStream& rOStm, sal_uInt16 nFormat,
303 const css::uno::Sequence< css::beans::PropertyValue >* pFilterData =
nullptr );
307 sal_uInt16 * pDeterminedFormat);
315 sal_uInt16 * pDeterminedFormat);
326 void ImportGraphics(std::vector< std::shared_ptr<Graphic> >& rGraphics, std::vector< std::unique_ptr<SvStream> > vStreams);
332 void MakeGraphicsAvailableThreaded(std::vector< Graphic* >& rGraphics);
338 const css::uno::Sequence< css::beans::PropertyValue >* pFilterData,
342 Graphic ImportUnloadedGraphic(
SvStream& rIStream, sal_uInt64 sizeLimit = 0,
const Size* pSizeHint =
nullptr);
345 void ResetLastError();
349 static ErrCode LoadGraphic(
const OUString& rPath,
const OUString& rFilter,
352 sal_uInt16* pDeterminedFormat =
nullptr );
358 std::unique_ptr<
sal_uInt8[]> & rpGraphicContent, sal_Int32& rGraphicContentSize);
362 std::unique_ptr<
sal_uInt8[]> & rpGraphicContent, sal_Int32& rGraphicContentSize);
391 ErrCode ImpTestOrFindFormat(
const OUString& rPath,
SvStream& rStream, sal_uInt16& rFormat );
399 #endif // INCLUDED_VCL_GRAPHICFILTER_HXX
Only create a bitmap, do not read pixel data.
Read pixel data into an existing bitmap.
const FilterErrorEx & GetLastError() const
std::optional< Size > GetPreferredLogSize() const
Returns the logic size, according to the map mode available via GetPreferredMapMode().
#define DECL_LINK(Member, ArgType, RetType)
sal_uInt16 GetBitsPerPixel() const
Class to import and export graphic formats.
Information about errors during the GraphicFilter operation.
GfxLinkType
GfxLink graphic types that are supported by GfxLink.
std::optional< Size > maPreferredLogSize
sal_uInt8 mnNumberOfImageComponents
const Size & GetSize_100TH_MM() const
Cache to keep list of graphic filters + the filters themselves.
const Size & GetSizePixel() const
sal_uInt8 GetNumberOfImageComponents() const
std::unique_ptr< FilterErrorEx > pErrorEx
FilterConfigCache * pConfig
#define GRFILTER_FORMAT_DONTKNOW
std::optional< MapMode > GetPreferredMapMode() const
If available, this returns the map mode the graphic prefers, which may be other than pixel or 100th m...
GraphicFileFormat nFormat
bool IsTransparent() const
GraphicFileFormat GetFileFormat() const
std::optional< MapMode > maPreferredMapMode