LibreOffice Module vcl (master) 1
|
#include <GraphicFormatDetector.hxx>
Public Member Functions | |
GraphicFormatDetector (SvStream &rStream, OUString const &rFormatExtension) | |
bool | detect () |
bool | checkMET () |
bool | checkBMP () |
bool | checkWMForEMF () |
bool | checkPCX () |
bool | checkTIF () |
bool | checkGIF () |
bool | checkPNG () |
bool | checkJPG () |
bool | checkSVM () |
bool | checkPCD () |
bool | checkPSD () |
bool | checkEPS () |
bool | checkDXF () |
bool | checkPCT () |
bool | checkPBMorPGMorPPM () |
bool | checkRAS () |
bool | checkXPM () |
bool | checkXBM () |
bool | checkSVG () |
bool | checkTGA () |
bool | checkMOV () |
bool | checkPDF () |
bool | checkWEBP () |
Public Attributes | |
SvStream & | mrStream |
OUString | maExtension |
std::vector< sal_uInt8 > | maFirstBytes |
sal_uInt32 | mnFirstLong |
sal_uInt32 | mnSecondLong |
sal_uInt64 | mnStreamPosition |
sal_uInt64 | mnStreamLength |
OUString | msDetectedFormat |
Private Member Functions | |
sal_uInt8 * | checkAndUncompressBuffer (sal_uInt8 *aUncompressedBuffer, sal_uInt32 nSize, sal_uInt64 &nDecompressedSize) |
Checks whether mrStream needs to be uncompressed and returns a pointer to the to aUncompressedBuffer or a pointer to maFirstBytes if it doesn't need to be uncompressed. More... | |
Definition at line 39 of file GraphicFormatDetector.hxx.
vcl::GraphicFormatDetector::GraphicFormatDetector | ( | SvStream & | rStream, |
OUString const & | rFormatExtension | ||
) |
Definition at line 340 of file GraphicFormatDetector.cxx.
|
private |
Checks whether mrStream needs to be uncompressed and returns a pointer to the to aUncompressedBuffer or a pointer to maFirstBytes if it doesn't need to be uncompressed.
aUncompressedBuffer | the buffer to hold the uncompressed data |
nSize | the amount of bytes to uncompress |
nRetSize | the amount of bytes actually uncompressed |
Definition at line 833 of file GraphicFormatDetector.cxx.
References ZCodec::BeginCompression(), ZCodec::EndCompression(), i, ZCodec::IsZCompressed(), maFirstBytes, mnFirstLong, mnSecondLong, mnStreamPosition, mrStream, ZCodec::Read(), SvStream::Seek(), and ZCODEC_DEFAULT_COMPRESSION.
Referenced by checkSVG(), and checkWMForEMF().
bool vcl::GraphicFormatDetector::checkBMP | ( | ) |
Definition at line 426 of file GraphicFormatDetector.cxx.
References maFirstBytes, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkDXF | ( | ) |
Definition at line 596 of file GraphicFormatDetector.cxx.
References i, maFirstBytes, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkEPS | ( | ) |
Definition at line 578 of file GraphicFormatDetector.cxx.
References vcl::checkArrayForMatchingStrings(), maFirstBytes, mnFirstLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkGIF | ( | ) |
Definition at line 503 of file GraphicFormatDetector.cxx.
References maFirstBytes, mnFirstLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkJPG | ( | ) |
Definition at line 524 of file GraphicFormatDetector.cxx.
References maFirstBytes, mnFirstLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkMET | ( | ) |
Definition at line 396 of file GraphicFormatDetector.cxx.
References SvStream::GetError(), i, maFirstBytes, mnStreamLength, mnStreamPosition, mrStream, msDetectedFormat, nMagic, SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), and SvStream::Tell().
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkMOV | ( | ) |
Definition at line 797 of file GraphicFormatDetector.cxx.
References maFirstBytes, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPBMorPGMorPPM | ( | ) |
Definition at line 643 of file GraphicFormatDetector.cxx.
References maFirstBytes, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPCD | ( | ) |
Definition at line 552 of file GraphicFormatDetector.cxx.
References mnStreamLength, mnStreamPosition, mrStream, msDetectedFormat, SvStream::ReadBytes(), and SvStream::Seek().
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPCT | ( | ) |
Definition at line 633 of file GraphicFormatDetector.cxx.
References isPCT(), mnStreamLength, mnStreamPosition, mrStream, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPCX | ( | ) |
Definition at line 477 of file GraphicFormatDetector.cxx.
References maFirstBytes, msDetectedFormat, and nVersion.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPDF | ( | ) |
Definition at line 810 of file GraphicFormatDetector.cxx.
References maFirstBytes, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPNG | ( | ) |
Definition at line 514 of file GraphicFormatDetector.cxx.
References mnFirstLong, mnSecondLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkPSD | ( | ) |
Definition at line 568 of file GraphicFormatDetector.cxx.
References mnFirstLong, mnSecondLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkRAS | ( | ) |
Definition at line 668 of file GraphicFormatDetector.cxx.
References mnFirstLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkSVG | ( | ) |
Definition at line 707 of file GraphicFormatDetector.cxx.
References checkAndUncompressBuffer(), vcl::checkArrayForMatchingStrings(), mnStreamLength, mnStreamPosition, mrStream, msDetectedFormat, SvStream::ReadBytes(), SvStream::Seek(), and SVG_CHECK_SIZE.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkSVM | ( | ) |
Definition at line 536 of file GraphicFormatDetector.cxx.
References maFirstBytes, mnFirstLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkTGA | ( | ) |
Definition at line 771 of file GraphicFormatDetector.cxx.
References maExtension, mnStreamLength, mrStream, msDetectedFormat, SvStream::ReadBytes(), SAL_N_ELEMENTS, SvStream::Seek(), SvStream::SeekRel(), and STREAM_SEEK_TO_END.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkTIF | ( | ) |
Definition at line 493 of file GraphicFormatDetector.cxx.
References mnFirstLong, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkWEBP | ( | ) |
Definition at line 821 of file GraphicFormatDetector.cxx.
References maFirstBytes, and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkWMForEMF | ( | ) |
Definition at line 455 of file GraphicFormatDetector.cxx.
References checkAndUncompressBuffer(), mnFirstLong, mnStreamLength, msDetectedFormat, and WMF_EMF_CHECK_SIZE.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkXBM | ( | ) |
Definition at line 689 of file GraphicFormatDetector.cxx.
References vcl::checkArrayForMatchingStrings(), mnStreamLength, mnStreamPosition, mrStream, msDetectedFormat, SvStream::ReadBytes(), and SvStream::Seek().
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::checkXPM | ( | ) |
Definition at line 678 of file GraphicFormatDetector.cxx.
References maFirstBytes, vcl::matchArrayWithString(), and msDetectedFormat.
Referenced by vcl::peekGraphicFormat().
bool vcl::GraphicFormatDetector::detect | ( | ) |
Definition at line 350 of file GraphicFormatDetector.cxx.
References SvStream::GetError(), SvStream::GetLockBytes(), i, maFirstBytes, mnFirstLong, mnSecondLong, mnStreamLength, mnStreamPosition, mrStream, SvStream::ReadBytes(), SvStream::remainingSize(), SvLockBytes::SetSynchronMode(), and SvStream::Tell().
Referenced by vcl::peekGraphicFormat().
OUString vcl::GraphicFormatDetector::maExtension |
Definition at line 43 of file GraphicFormatDetector.hxx.
Referenced by checkTGA().
std::vector<sal_uInt8> vcl::GraphicFormatDetector::maFirstBytes |
Definition at line 45 of file GraphicFormatDetector.hxx.
Referenced by checkAndUncompressBuffer(), checkBMP(), checkDXF(), checkEPS(), checkGIF(), checkJPG(), checkMET(), checkMOV(), checkPBMorPGMorPPM(), checkPCX(), checkPDF(), checkSVM(), checkWEBP(), checkXPM(), and detect().
sal_uInt32 vcl::GraphicFormatDetector::mnFirstLong |
Definition at line 46 of file GraphicFormatDetector.hxx.
Referenced by checkAndUncompressBuffer(), checkEPS(), checkGIF(), checkJPG(), checkPNG(), checkPSD(), checkRAS(), checkSVM(), checkTIF(), checkWMForEMF(), and detect().
sal_uInt32 vcl::GraphicFormatDetector::mnSecondLong |
Definition at line 47 of file GraphicFormatDetector.hxx.
Referenced by checkAndUncompressBuffer(), checkPNG(), checkPSD(), and detect().
sal_uInt64 vcl::GraphicFormatDetector::mnStreamLength |
Definition at line 50 of file GraphicFormatDetector.hxx.
Referenced by checkMET(), checkPCD(), checkPCT(), checkSVG(), checkTGA(), checkWMForEMF(), checkXBM(), and detect().
sal_uInt64 vcl::GraphicFormatDetector::mnStreamPosition |
Definition at line 49 of file GraphicFormatDetector.hxx.
Referenced by checkAndUncompressBuffer(), checkMET(), checkPCD(), checkPCT(), checkSVG(), checkXBM(), and detect().
SvStream& vcl::GraphicFormatDetector::mrStream |
Definition at line 42 of file GraphicFormatDetector.hxx.
Referenced by checkAndUncompressBuffer(), checkMET(), checkPCD(), checkPCT(), checkSVG(), checkTGA(), checkXBM(), and detect().
OUString vcl::GraphicFormatDetector::msDetectedFormat |
Definition at line 52 of file GraphicFormatDetector.hxx.
Referenced by checkBMP(), checkDXF(), checkEPS(), checkGIF(), checkJPG(), checkMET(), checkMOV(), checkPBMorPGMorPPM(), checkPCD(), checkPCT(), checkPCX(), checkPDF(), checkPNG(), checkPSD(), checkRAS(), checkSVG(), checkSVM(), checkTGA(), checkTIF(), checkWEBP(), checkWMForEMF(), checkXBM(), checkXPM(), and vcl::peekGraphicFormat().