LibreOffice Module vcl (master) 1
|
#include <graphicfilter.hxx>
Public Member Functions | |
GraphicDescriptor (const INetURLObject &rPath) | |
Ctor to set a filename. More... | |
GraphicDescriptor (SvStream &rInStream, const OUString *pPath) | |
Ctor using a stream. More... | |
~GraphicDescriptor () | |
bool | Detect (bool bExtendedInfo=false) |
starts the detection More... | |
GraphicFileFormat | GetFileFormat () const |
const Size & | GetSizePixel () const |
const Size & | GetSize_100TH_MM () const |
const std::optional< Size > & | GetPreferredLogSize () const |
Returns the logic size, according to the map mode available via GetPreferredMapMode(). More... | |
const std::optional< MapMode > & | GetPreferredMapMode () const |
If available, this returns the map mode the graphic prefers, which may be other than pixel or 100th mm. More... | |
sal_uInt16 | GetBitsPerPixel () const |
sal_uInt8 | GetNumberOfImageComponents () const |
bool | IsTransparent () const |
bool | IsAlpha () const |
Static Public Member Functions | |
static OUString | GetImportFormatShortName (GraphicFileFormat nFormat) |
Private Member Functions | |
void | ImpConstruct () |
bool | ImpDetectBMP (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectGIF (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectJPG (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPCD (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPCX (SvStream &rStm) |
bool | ImpDetectPNG (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectTIF (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectXBM (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectXPM (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPBM (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPGM (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPPM (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectRAS (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectTGA (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPSD (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectEPS (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectWEBP (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectDXF (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectMET (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectPCT (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectSVM (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectWMF (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectEMF (SvStream &rStm, bool bExtendedInfo) |
bool | ImpDetectSVG (SvStream &rStm, bool bExtendedInfo) |
GraphicDescriptor (const GraphicDescriptor &)=delete | |
GraphicDescriptor & | operator= (const GraphicDescriptor &)=delete |
Private Attributes | |
SvStream * | pFileStm |
OUString | aPathExt |
GraphicMetadata | aMetadata |
bool | bOwnStream |
Definition at line 129 of file graphicfilter.hxx.
|
privatedelete |
GraphicDescriptor::GraphicDescriptor | ( | const INetURLObject & | rPath | ) |
Ctor to set a filename.
Detect() must be called to identify the file If the file has no unique header (Mtf's), the format is determined from the extension
Definition at line 30 of file graphicfilter2.cxx.
References CreateStream(), ImpConstruct(), NONE, and READ.
GraphicDescriptor::GraphicDescriptor | ( | SvStream & | rInStream, |
const OUString * | pPath | ||
) |
Ctor using a stream.
Detect() must be called to identify the file As some formats (Mtf's) do not have a unique header, it makes sense to supply the file name (incl. ext.), so that the format can be derived from the extension
Definition at line 38 of file graphicfilter2.cxx.
References aPathExt, aURL, and ImpConstruct().
GraphicDescriptor::~GraphicDescriptor | ( | ) |
Definition at line 51 of file graphicfilter2.cxx.
References bOwnStream, and pFileStm.
bool GraphicDescriptor::Detect | ( | bool | bExtendedInfo = false | ) |
starts the detection
if bExtendedInfo == true the file header is used to derive as many properties as possible (size, color, etc.)
Definition at line 57 of file graphicfilter2.cxx.
References SvStream::GetEndian(), SvStream::GetError(), ImpDetectBMP(), ImpDetectDXF(), ImpDetectEMF(), ImpDetectEPS(), ImpDetectGIF(), ImpDetectJPG(), ImpDetectMET(), ImpDetectPBM(), ImpDetectPCD(), ImpDetectPCT(), ImpDetectPCX(), ImpDetectPGM(), ImpDetectPNG(), ImpDetectPPM(), ImpDetectPSD(), ImpDetectRAS(), ImpDetectSVG(), ImpDetectSVM(), ImpDetectTGA(), ImpDetectTIF(), ImpDetectWEBP(), ImpDetectWMF(), ImpDetectXBM(), ImpDetectXPM(), pFileStm, and SvStream::SetEndian().
Referenced by vcl::PDFExtOutDevData::HasAdequateCompression(), unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().
|
inline |
Definition at line 212 of file graphicfilter.hxx.
References GraphicMetadata::mnBitsPerPixel.
Referenced by unographic::GraphicDescriptor::implCreate().
|
inline |
Definition at line 191 of file graphicfilter.hxx.
References GraphicMetadata::mnFormat.
Referenced by unographic::GraphicDescriptor::implCreate().
|
static |
Definition at line 505 of file graphicfilter2.cxx.
References vcl::getImportFormatShortName().
|
inline |
Definition at line 215 of file graphicfilter.hxx.
References GraphicMetadata::mnNumberOfImageComponents.
Referenced by vcl::PDFExtOutDevData::HasAdequateCompression().
|
inline |
Returns the logic size, according to the map mode available via GetPreferredMapMode().
Prefer this size over GetSize_100TH_MM().
Definition at line 203 of file graphicfilter.hxx.
References GraphicMetadata::maPreferredLogSize.
Referenced by ImpGraphic::setPrepared().
|
inline |
If available, this returns the map mode the graphic prefers, which may be other than pixel or 100th mm.
Prefer this map mode over just assuming MapUnit::Map100thMM.
Definition at line 209 of file graphicfilter.hxx.
References GraphicMetadata::maPreferredMapMode.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 197 of file graphicfilter.hxx.
References GraphicMetadata::maLogSize.
Referenced by unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().
|
inline |
Definition at line 194 of file graphicfilter.hxx.
References GraphicMetadata::maPixSize.
Referenced by unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().
|
private |
Definition at line 95 of file graphicfilter2.cxx.
References aMetadata, GraphicMetadata::mbIsAlpha, GraphicMetadata::mbIsTransparent, GraphicMetadata::mnBitsPerPixel, GraphicMetadata::mnFormat, GraphicMetadata::mnNumberOfImageComponents, GraphicMetadata::mnPlanes, and NOT.
Referenced by GraphicDescriptor().
|
private |
Definition at line 105 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkBMP(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 433 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkDXF(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 478 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkEMF(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 424 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkEPS(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 114 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkGIF(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 149 of file graphicfilter2.cxx.
References aMap, aMetadata, SvStream::GetError(), SvStream::good(), ImpDetectJPG_GetNextMarker(), JPG, OutputDevice::LogicToLogic(), GraphicMetadata::maLogSize, GraphicMetadata::maPixSize, GraphicMetadata::mnBitsPerPixel, GraphicMetadata::mnFormat, GraphicMetadata::mnNumberOfImageComponents, GraphicMetadata::mnPlanes, nLength, SvStream::ReadInt32(), SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), SvStream::SetError(), Size::setHeight(), Size::setWidth(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 442 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkMET(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 370 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPBM(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 316 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPCD(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 451 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPCT(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 325 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPCX(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 379 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPGM(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 334 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPNG(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 388 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPPM(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 415 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkPSD(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 397 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkRAS(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 487 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkSVG(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 460 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkSVM(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 406 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkTGA(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 343 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkTIF(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 496 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkWEBP(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 469 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkWMF(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 352 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkXBM(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
private |
Definition at line 361 of file graphicfilter2.cxx.
References aMetadata, aPathExt, vcl::GraphicFormatDetector::checkXPM(), vcl::GraphicFormatDetector::detect(), and vcl::GraphicFormatDetector::getMetadata().
Referenced by Detect().
|
inline |
Definition at line 221 of file graphicfilter.hxx.
References GraphicMetadata::mbIsAlpha.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 218 of file graphicfilter.hxx.
References GraphicMetadata::mbIsTransparent.
Referenced by ImpGraphic::setPrepared().
|
privatedelete |
References Detect.
|
private |
Definition at line 133 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectBMP(), ImpDetectDXF(), ImpDetectEMF(), ImpDetectEPS(), ImpDetectGIF(), ImpDetectJPG(), ImpDetectMET(), ImpDetectPBM(), ImpDetectPCD(), ImpDetectPCT(), ImpDetectPCX(), ImpDetectPGM(), ImpDetectPNG(), ImpDetectPPM(), ImpDetectPSD(), ImpDetectRAS(), ImpDetectSVG(), ImpDetectSVM(), ImpDetectTGA(), ImpDetectTIF(), ImpDetectWEBP(), ImpDetectWMF(), ImpDetectXBM(), and ImpDetectXPM().
|
private |
Definition at line 132 of file graphicfilter.hxx.
Referenced by GraphicDescriptor(), ImpDetectBMP(), ImpDetectDXF(), ImpDetectEMF(), ImpDetectEPS(), ImpDetectGIF(), ImpDetectMET(), ImpDetectPBM(), ImpDetectPCD(), ImpDetectPCT(), ImpDetectPCX(), ImpDetectPGM(), ImpDetectPNG(), ImpDetectPPM(), ImpDetectPSD(), ImpDetectRAS(), ImpDetectSVG(), ImpDetectSVM(), ImpDetectTGA(), ImpDetectTIF(), ImpDetectWEBP(), ImpDetectWMF(), ImpDetectXBM(), and ImpDetectXPM().
|
private |
Definition at line 134 of file graphicfilter.hxx.
Referenced by ~GraphicDescriptor().
|
private |
Definition at line 131 of file graphicfilter.hxx.
Referenced by Detect(), and ~GraphicDescriptor().