LibreOffice Module vcl (master) 1
Public Member Functions | Public Attributes | Private Member Functions | List of all members
vcl::GraphicFormatDetector Class Reference

#include <GraphicFormatDetector.hxx>

Collaboration diagram for vcl::GraphicFormatDetector:
[legend]

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

SvStreammrStream
 
OUString maExtension
 
std::vector< sal_uInt8maFirstBytes
 
sal_uInt32 mnFirstLong
 
sal_uInt32 mnSecondLong
 
sal_uInt64 mnStreamPosition
 
sal_uInt64 mnStreamLength
 
OUString msDetectedFormat
 

Private Member Functions

sal_uInt8checkAndUncompressBuffer (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...
 

Detailed Description

Definition at line 39 of file GraphicFormatDetector.hxx.

Constructor & Destructor Documentation

◆ GraphicFormatDetector()

vcl::GraphicFormatDetector::GraphicFormatDetector ( SvStream rStream,
OUString const &  rFormatExtension 
)

Definition at line 340 of file GraphicFormatDetector.cxx.

Member Function Documentation

◆ checkAndUncompressBuffer()

sal_uInt8 * vcl::GraphicFormatDetector::checkAndUncompressBuffer ( sal_uInt8 aUncompressedBuffer,
sal_uInt32  nSize,
sal_uInt64 &  nDecompressedSize 
)
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.

Parameters
aUncompressedBufferthe buffer to hold the uncompressed data
nSizethe amount of bytes to uncompress
nRetSizethe amount of bytes actually uncompressed
Returns
sal_uInt8* a pointer to maFirstBytes or aUncompressed buffer

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().

◆ checkBMP()

bool vcl::GraphicFormatDetector::checkBMP ( )

Definition at line 426 of file GraphicFormatDetector.cxx.

References maFirstBytes, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkDXF()

bool vcl::GraphicFormatDetector::checkDXF ( )

Definition at line 596 of file GraphicFormatDetector.cxx.

References i, maFirstBytes, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkEPS()

bool vcl::GraphicFormatDetector::checkEPS ( )

◆ checkGIF()

bool vcl::GraphicFormatDetector::checkGIF ( )

Definition at line 503 of file GraphicFormatDetector.cxx.

References maFirstBytes, mnFirstLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkJPG()

bool vcl::GraphicFormatDetector::checkJPG ( )

Definition at line 524 of file GraphicFormatDetector.cxx.

References maFirstBytes, mnFirstLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkMET()

bool vcl::GraphicFormatDetector::checkMET ( )

◆ checkMOV()

bool vcl::GraphicFormatDetector::checkMOV ( )

Definition at line 797 of file GraphicFormatDetector.cxx.

References maFirstBytes, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkPBMorPGMorPPM()

bool vcl::GraphicFormatDetector::checkPBMorPGMorPPM ( )

Definition at line 643 of file GraphicFormatDetector.cxx.

References maFirstBytes, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkPCD()

bool vcl::GraphicFormatDetector::checkPCD ( )

◆ checkPCT()

bool vcl::GraphicFormatDetector::checkPCT ( )

◆ checkPCX()

bool vcl::GraphicFormatDetector::checkPCX ( )

Definition at line 477 of file GraphicFormatDetector.cxx.

References maFirstBytes, msDetectedFormat, and nVersion.

Referenced by vcl::peekGraphicFormat().

◆ checkPDF()

bool vcl::GraphicFormatDetector::checkPDF ( )

Definition at line 810 of file GraphicFormatDetector.cxx.

References maFirstBytes, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkPNG()

bool vcl::GraphicFormatDetector::checkPNG ( )

Definition at line 514 of file GraphicFormatDetector.cxx.

References mnFirstLong, mnSecondLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkPSD()

bool vcl::GraphicFormatDetector::checkPSD ( )

Definition at line 568 of file GraphicFormatDetector.cxx.

References mnFirstLong, mnSecondLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkRAS()

bool vcl::GraphicFormatDetector::checkRAS ( )

Definition at line 668 of file GraphicFormatDetector.cxx.

References mnFirstLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkSVG()

bool vcl::GraphicFormatDetector::checkSVG ( )

◆ checkSVM()

bool vcl::GraphicFormatDetector::checkSVM ( )

Definition at line 536 of file GraphicFormatDetector.cxx.

References maFirstBytes, mnFirstLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkTGA()

bool vcl::GraphicFormatDetector::checkTGA ( )

◆ checkTIF()

bool vcl::GraphicFormatDetector::checkTIF ( )

Definition at line 493 of file GraphicFormatDetector.cxx.

References mnFirstLong, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkWEBP()

bool vcl::GraphicFormatDetector::checkWEBP ( )

Definition at line 821 of file GraphicFormatDetector.cxx.

References maFirstBytes, and msDetectedFormat.

Referenced by vcl::peekGraphicFormat().

◆ checkWMForEMF()

bool vcl::GraphicFormatDetector::checkWMForEMF ( )

◆ checkXBM()

bool vcl::GraphicFormatDetector::checkXBM ( )

◆ checkXPM()

bool vcl::GraphicFormatDetector::checkXPM ( )

◆ detect()

bool vcl::GraphicFormatDetector::detect ( )

Member Data Documentation

◆ maExtension

OUString vcl::GraphicFormatDetector::maExtension

Definition at line 43 of file GraphicFormatDetector.hxx.

Referenced by checkTGA().

◆ maFirstBytes

std::vector<sal_uInt8> vcl::GraphicFormatDetector::maFirstBytes

◆ mnFirstLong

sal_uInt32 vcl::GraphicFormatDetector::mnFirstLong

◆ mnSecondLong

sal_uInt32 vcl::GraphicFormatDetector::mnSecondLong

Definition at line 47 of file GraphicFormatDetector.hxx.

Referenced by checkAndUncompressBuffer(), checkPNG(), checkPSD(), and detect().

◆ mnStreamLength

sal_uInt64 vcl::GraphicFormatDetector::mnStreamLength

◆ mnStreamPosition

sal_uInt64 vcl::GraphicFormatDetector::mnStreamPosition

◆ mrStream

SvStream& vcl::GraphicFormatDetector::mrStream

◆ msDetectedFormat

OUString vcl::GraphicFormatDetector::msDetectedFormat

The documentation for this class was generated from the following files: