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 |
std::optional< Size > | GetPreferredLogSize () const |
Returns the logic size, according to the map mode available via GetPreferredMapMode(). More... | |
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 | 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 152 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 32 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 40 of file graphicfilter2.cxx.
References aPathExt, aURL, INetURLObject::GetFileExtension(), and ImpConstruct().
GraphicDescriptor::~GraphicDescriptor | ( | ) |
Definition at line 53 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 59 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(), ImpDetectWMF(), ImpDetectXBM(), ImpDetectXPM(), pFileStm, and SvStream::SetEndian().
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 244 of file graphicfilter.hxx.
|
inline |
Definition at line 223 of file graphicfilter.hxx.
|
static |
|
inline |
Definition at line 247 of file graphicfilter.hxx.
|
inline |
Returns the logic size, according to the map mode available via GetPreferredMapMode().
Prefer this size over GetSize_100TH_MM().
Definition at line 235 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 241 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 229 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 226 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
private |
Definition at line 96 of file graphicfilter2.cxx.
References bIsAlpha, bIsTransparent, mnNumberOfImageComponents, nBitsPerPixel, nFormat, NOT, and nPlanes.
Referenced by GraphicDescriptor().
|
private |
Definition at line 106 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 1087 of file graphicfilter2.cxx.
References aLogSize, aPixSize, EMF, nFormat, SvStream::ReadInt32(), SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SetEndian(), Size::setHeight(), Size::setWidth(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 940 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 196 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 263 of file graphicfilter2.cxx.
References aLogSize, aMap, aPixSize, SvStream::GetError(), MapMode::GetMapUnit(), 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(), MapMode::SetMapUnit(), MapMode::SetScaleX(), MapMode::SetScaleY(), Size::setWidth(), and SvStream::Tell().
Referenced by Detect().
|
private |
|
private |
Definition at line 794 of file graphicfilter2.cxx.
References aPathExt, nFormat, PBM, SvStream::ReadUChar(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 430 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 982 of file graphicfilter2.cxx.
References aPathExt, isPCT(), nFormat, PCT, SvStream::remainingSize(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 457 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 817 of file graphicfilter2.cxx.
References aPathExt, nFormat, PGM, SvStream::ReadUChar(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 534 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 839 of file graphicfilter2.cxx.
References aPathExt, nFormat, PPM, SvStream::ReadUChar(), SvStream::Seek(), and SvStream::Tell().
Referenced by Detect().
|
private |
Definition at line 886 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 861 of file graphicfilter2.cxx.
References nFormat, RAS, SvStream::ReadUInt32(), SvStream::Seek(), SvStream::SetEndian(), and SvStream::Tell().
Referenced by Detect().
|
private |
|
private |
Definition at line 1002 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 647 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 |
|
private |
|
private |
|
inline |
Definition at line 253 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
inline |
Definition at line 250 of file graphicfilter.hxx.
Referenced by ImpGraphic::setPrepared().
|
privatedelete |
|
private |
Definition at line 158 of file graphicfilter.hxx.
Referenced by ImpDetectBMP(), ImpDetectEMF(), ImpDetectJPG(), ImpDetectPCX(), ImpDetectPNG(), and ImpDetectSVM().
|
private |
Definition at line 156 of file graphicfilter.hxx.
Referenced by GraphicDescriptor(), ImpDetectDXF(), ImpDetectEPS(), ImpDetectMET(), ImpDetectPBM(), ImpDetectPCT(), ImpDetectPGM(), ImpDetectPPM(), ImpDetectSVG(), ImpDetectTGA(), ImpDetectWMF(), ImpDetectXBM(), and ImpDetectXPM().
|
private |
Definition at line 157 of file graphicfilter.hxx.
Referenced by ImpDetectBMP(), ImpDetectEMF(), ImpDetectGIF(), ImpDetectJPG(), ImpDetectPCX(), ImpDetectPNG(), ImpDetectPSD(), and ImpDetectTIF().
|
private |
Definition at line 167 of file graphicfilter.hxx.
Referenced by ImpConstruct(), and ImpDetectPNG().
|
private |
Definition at line 166 of file graphicfilter.hxx.
Referenced by ImpConstruct(), and ImpDetectPNG().
|
private |
Definition at line 164 of file graphicfilter.hxx.
Referenced by ~GraphicDescriptor().
|
private |
Definition at line 159 of file graphicfilter.hxx.
Referenced by ImpDetectBMP().
|
private |
Definition at line 160 of file graphicfilter.hxx.
Referenced by ImpDetectBMP().
|
private |
Definition at line 165 of file graphicfilter.hxx.
Referenced by ImpConstruct(), and ImpDetectJPG().
|
private |
Definition at line 161 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectBMP(), ImpDetectGIF(), ImpDetectJPG(), ImpDetectPCX(), ImpDetectPNG(), ImpDetectPSD(), and ImpDetectTIF().
|
private |
Definition at line 163 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(), ImpDetectWMF(), ImpDetectXBM(), and ImpDetectXPM().
|
private |
Definition at line 162 of file graphicfilter.hxx.
Referenced by ImpConstruct(), ImpDetectBMP(), ImpDetectJPG(), ImpDetectPCX(), and ImpDetectPNG().
|
private |
Definition at line 154 of file graphicfilter.hxx.
Referenced by Detect(), and ~GraphicDescriptor().