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 |
Size | aPixSize |
Size | aLogSize |
std::optional< Size > | maPreferredLogSize |
std::optional< MapMode > | maPreferredMapMode |
sal_uInt16 | nBitsPerPixel |
sal_uInt16 | nPlanes |
GraphicFileFormat | nFormat |
bool | bOwnStream |
sal_uInt8 | mnNumberOfImageComponents |
bool | bIsTransparent |
bool | bIsAlpha |
Definition at line 161 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 52 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 60 of file graphicfilter2.cxx.
References aPathExt, aURL, and ImpConstruct().
GraphicDescriptor::~GraphicDescriptor | ( | ) |
Definition at line 73 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 79 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 254 of file graphicfilter.hxx.
Referenced by unographic::GraphicDescriptor::implCreate().
|
inline |
Definition at line 233 of file graphicfilter.hxx.
Referenced by unographic::GraphicDescriptor::implCreate().
|
static |
|
inline |
Definition at line 257 of file graphicfilter.hxx.
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 245 of file graphicfilter.hxx.
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 251 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 239 of file graphicfilter.hxx.
Referenced by unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().
|
inline |
Definition at line 236 of file graphicfilter.hxx.
Referenced by unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().
|
private |
Definition at line 117 of file graphicfilter2.cxx.
References bIsAlpha, bIsTransparent, mnNumberOfImageComponents, nBitsPerPixel, nFormat, NOT, and nPlanes.
Referenced by GraphicDescriptor().
|
private |
Definition at line 127 of file graphicfilter2.cxx.
References aLogSize, aPixSize, BMP, Size::getHeight(), Size::getWidth(), Size::Height(), maPreferredLogSize, maPreferredMapMode, nBitsPerPixel, nFormat, NOT, nPlanes, Point, SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), SvStream::Tell(), and Size::Width().
Referenced by Detect().
|
private |
|
private |
Definition at line 1145 of file graphicfilter2.cxx.
References aLogSize, aPixSize, ZCodec::BeginCompression(), EMF, EMF_CHECK_SIZE, EMR_HEADER, ZCodec::EndCompression(), ENHMETA_SIGNATURE, ZCodec::IsZCompressed(), nFormat, ZCodec::Read(), SvStream::ReadInt32(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvMemoryStream::SetBuffer(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), SvStream::Tell(), and ZCODEC_DEFAULT_COMPRESSION.
Referenced by Detect().
|
private |
Definition at line 961 of file graphicfilter2.cxx.
References aPathExt, EPS, ImplSearchEntry(), nFormat, SvStream::ReadBytes(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 217 of file graphicfilter2.cxx.
References aPixSize, GIF, nBitsPerPixel, nFormat, SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 284 of file graphicfilter2.cxx.
References aLogSize, aMap, aPixSize, SvStream::GetError(), SvStream::good(), ImpDetectJPG_GetNextMarker(), JPG, OutputDevice::LogicToLogic(), mnNumberOfImageComponents, nBitsPerPixel, nFormat, nLength, nPlanes, 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 |
|
private |
Definition at line 815 of file graphicfilter2.cxx.
References aPathExt, nFormat, PBM, SvStream::ReadUChar(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 451 of file graphicfilter2.cxx.
References nFormat, PCD, SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 1003 of file graphicfilter2.cxx.
References aPathExt, isPCT(), nFormat, PCT, SvStream::remainingSize(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 478 of file graphicfilter2.cxx.
References aLogSize, aMap, aPixSize, OutputDevice::LogicToLogic(), nBitsPerPixel, nFormat, nPlanes, PCX, Point, SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 838 of file graphicfilter2.cxx.
References aPathExt, nFormat, PGM, SvStream::ReadUChar(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 555 of file graphicfilter2.cxx.
References aLogSize, aPixSize, bIsAlpha, bIsTransparent, SvStream::good(), Size::Height(), nBitsPerPixel, nFormat, nPlanes, PNG, SvStream::ReadUChar(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), SvStream::Tell(), and Size::Width().
Referenced by Detect().
|
private |
Definition at line 860 of file graphicfilter2.cxx.
References aPathExt, nFormat, PPM, SvStream::ReadUChar(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 907 of file graphicfilter2.cxx.
References aPixSize, nBitsPerPixel, nFormat, nVersion, PSD, SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 882 of file graphicfilter2.cxx.
References nFormat, RAS, SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SetEndian(), and SvStream::Tell().
Referenced by Detect().
|
private |
|
private |
Definition at line 1023 of file graphicfilter2.cxx.
References aLogSize, OutputDevice::LogicToLogic(), nFormat, TypeSerializer::readMapMode(), tools::GenericTypeSerializer::readSize(), SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), SVM, and SvStream::Tell().
Referenced by Detect().
|
private |
|
private |
Definition at line 668 of file graphicfilter2.cxx.
References aPixSize, DATA_SIZE, nBitsPerPixel, nCount, nFormat, SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), SvStream::Tell(), and TIF.
Referenced by Detect().
|
private |
Definition at line 1215 of file graphicfilter2.cxx.
References aPixSize, bIsAlpha, bIsTransparent, nBitsPerPixel, nFormat, SvStream::ReadUInt32(), ReadWebpInfo(), SvStream::Seek(), SvStream::SetEndian(), SvStream::Tell(), and WEBP.
Referenced by Detect().
|
private |
Definition at line 1099 of file graphicfilter2.cxx.
References ZCodec::BeginCompression(), ZCodec::EndCompression(), ZCodec::IsZCompressed(), nFormat, nVersion, PLACEABLE_SIGNATURE, ZCodec::Read(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), SvStream::Seek(), SvMemoryStream::SetBuffer(), SvStream::SetEndian(), SvStream::Tell(), WMF, WMF_CHECK_SIZE, and ZCODEC_DEFAULT_COMPRESSION.
Referenced by Detect().
|
private |
|
private |
|
inline |
Definition at line 263 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 260 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
privatedelete |
References Detect.
|
private |
Definition at line 167 of file graphicfilter.hxx.
Referenced by ImpDetectBMP(), ImpDetectEMF(), ImpDetectJPG(), ImpDetectPCX(), ImpDetectPNG(), and ImpDetectSVM().
|
private |
Definition at line 165 of file graphicfilter.hxx.
Referenced by GraphicDescriptor(), ImpDetectDXF(), ImpDetectEPS(), ImpDetectMET(), ImpDetectPBM(), ImpDetectPCT(), ImpDetectPGM(), ImpDetectPPM(), ImpDetectSVG(), ImpDetectTGA(), ImpDetectXBM(), and ImpDetectXPM().
|
private |
Definition at line 166 of file graphicfilter.hxx.
Referenced by ImpDetectBMP(), ImpDetectEMF(), ImpDetectGIF(), ImpDetectJPG(), ImpDetectPCX(), ImpDetectPNG(), ImpDetectPSD(), ImpDetectTIF(), and ImpDetectWEBP().
|
private |
Definition at line 176 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectPNG(), and ImpDetectWEBP().
|
private |
Definition at line 175 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectPNG(), and ImpDetectWEBP().
|
private |
Definition at line 173 of file graphicfilter.hxx.
Referenced by ~GraphicDescriptor().
|
private |
Definition at line 168 of file graphicfilter.hxx.
Referenced by ImpDetectBMP().
|
private |
Definition at line 169 of file graphicfilter.hxx.
Referenced by ImpDetectBMP().
|
private |
Definition at line 174 of file graphicfilter.hxx.
Referenced by ImpConstruct(), and ImpDetectJPG().
|
private |
Definition at line 170 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectBMP(), ImpDetectGIF(), ImpDetectJPG(), ImpDetectPCX(), ImpDetectPNG(), ImpDetectPSD(), ImpDetectTIF(), and ImpDetectWEBP().
|
private |
Definition at line 172 of file graphicfilter.hxx.
Referenced by GetImportFormatShortName(), 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 171 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectBMP(), ImpDetectJPG(), ImpDetectPCX(), and ImpDetectPNG().
|
private |
Definition at line 163 of file graphicfilter.hxx.
Referenced by Detect(), and ~GraphicDescriptor().