LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
GraphicDescriptor Class Referencefinal

#include <graphicfilter.hxx>

Collaboration diagram for GraphicDescriptor:
[legend]

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 SizeGetSizePixel () const
 
const SizeGetSize_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
 
GraphicDescriptoroperator= (const GraphicDescriptor &)=delete
 

Private Attributes

SvStreampFileStm
 
OUString aPathExt
 
GraphicMetadata aMetadata
 
bool bOwnStream
 

Detailed Description

Definition at line 128 of file graphicfilter.hxx.

Constructor & Destructor Documentation

◆ GraphicDescriptor() [1/3]

GraphicDescriptor::GraphicDescriptor ( const GraphicDescriptor )
privatedelete

◆ GraphicDescriptor() [2/3]

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 45 of file graphicfilter2.cxx.

References CreateStream(), ImpConstruct(), NONE, and READ.

◆ GraphicDescriptor() [3/3]

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 53 of file graphicfilter2.cxx.

References aPathExt, aURL, and ImpConstruct().

◆ ~GraphicDescriptor()

GraphicDescriptor::~GraphicDescriptor ( )

Definition at line 66 of file graphicfilter2.cxx.

References bOwnStream, and pFileStm.

Member Function Documentation

◆ Detect()

bool GraphicDescriptor::Detect ( bool  bExtendedInfo = false)

◆ GetBitsPerPixel()

sal_uInt16 GraphicDescriptor::GetBitsPerPixel ( ) const
inline
Returns
bits/pixel or 0

Definition at line 211 of file graphicfilter.hxx.

References GraphicMetadata::mnBitsPerPixel.

Referenced by unographic::GraphicDescriptor::implCreate().

◆ GetFileFormat()

GraphicFileFormat GraphicDescriptor::GetFileFormat ( ) const
inline
Returns
the file format, GraphicFileFormat::NOT if no format was recognized

Definition at line 190 of file graphicfilter.hxx.

References GraphicMetadata::mnFormat.

Referenced by unographic::GraphicDescriptor::implCreate().

◆ GetImportFormatShortName()

OUString GraphicDescriptor::GetImportFormatShortName ( GraphicFileFormat  nFormat)
static
Returns
filter number that is needed by the GraphFilter to read this format

Definition at line 520 of file graphicfilter2.cxx.

References vcl::getImportFormatShortName().

◆ GetNumberOfImageComponents()

sal_uInt8 GraphicDescriptor::GetNumberOfImageComponents ( ) const
inline
Returns
number of color channels

Definition at line 214 of file graphicfilter.hxx.

References GraphicMetadata::mnNumberOfImageComponents.

Referenced by vcl::PDFExtOutDevData::HasAdequateCompression().

◆ GetPreferredLogSize()

const std::optional< Size > & GraphicDescriptor::GetPreferredLogSize ( ) const
inline

Returns the logic size, according to the map mode available via GetPreferredMapMode().

Prefer this size over GetSize_100TH_MM().

Definition at line 202 of file graphicfilter.hxx.

References GraphicMetadata::maPreferredLogSize.

Referenced by ImpGraphic::setPrepared().

◆ GetPreferredMapMode()

const std::optional< MapMode > & GraphicDescriptor::GetPreferredMapMode ( ) const
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 208 of file graphicfilter.hxx.

References GraphicMetadata::maPreferredMapMode.

Referenced by ImpGraphic::setPrepared().

◆ GetSize_100TH_MM()

const Size & GraphicDescriptor::GetSize_100TH_MM ( ) const
inline
Returns
the logical graphic size in 1/100mm or 0 size

Definition at line 196 of file graphicfilter.hxx.

References GraphicMetadata::maLogSize.

Referenced by unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().

◆ GetSizePixel()

const Size & GraphicDescriptor::GetSizePixel ( ) const
inline
Returns
graphic size in pixels or 0 size

Definition at line 193 of file graphicfilter.hxx.

References GraphicMetadata::maPixSize.

Referenced by unographic::GraphicDescriptor::implCreate(), and ImpGraphic::setPrepared().

◆ ImpConstruct()

void GraphicDescriptor::ImpConstruct ( )
private

◆ ImpDetectBMP()

bool GraphicDescriptor::ImpDetectBMP ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectDXF()

bool GraphicDescriptor::ImpDetectDXF ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectEMF()

bool GraphicDescriptor::ImpDetectEMF ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectEPS()

bool GraphicDescriptor::ImpDetectEPS ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectGIF()

bool GraphicDescriptor::ImpDetectGIF ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectJPG()

bool GraphicDescriptor::ImpDetectJPG ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectMET()

bool GraphicDescriptor::ImpDetectMET ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPBM()

bool GraphicDescriptor::ImpDetectPBM ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPCD()

bool GraphicDescriptor::ImpDetectPCD ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPCT()

bool GraphicDescriptor::ImpDetectPCT ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPCX()

bool GraphicDescriptor::ImpDetectPCX ( SvStream rStm)
private

◆ ImpDetectPGM()

bool GraphicDescriptor::ImpDetectPGM ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPNG()

bool GraphicDescriptor::ImpDetectPNG ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPPM()

bool GraphicDescriptor::ImpDetectPPM ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectPSD()

bool GraphicDescriptor::ImpDetectPSD ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectRAS()

bool GraphicDescriptor::ImpDetectRAS ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectSVG()

bool GraphicDescriptor::ImpDetectSVG ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectSVM()

bool GraphicDescriptor::ImpDetectSVM ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectTGA()

bool GraphicDescriptor::ImpDetectTGA ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectTIF()

bool GraphicDescriptor::ImpDetectTIF ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectWEBP()

bool GraphicDescriptor::ImpDetectWEBP ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectWMF()

bool GraphicDescriptor::ImpDetectWMF ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectXBM()

bool GraphicDescriptor::ImpDetectXBM ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ ImpDetectXPM()

bool GraphicDescriptor::ImpDetectXPM ( SvStream rStm,
bool  bExtendedInfo 
)
private

◆ IsAlpha()

bool GraphicDescriptor::IsAlpha ( ) const
inline
Returns
whether image supports alpha values for translucent colours

Definition at line 220 of file graphicfilter.hxx.

References GraphicMetadata::mbIsAlpha.

Referenced by ImpGraphic::setPrepared().

◆ IsTransparent()

bool GraphicDescriptor::IsTransparent ( ) const
inline
Returns
whether image supports transparency

Definition at line 217 of file graphicfilter.hxx.

References GraphicMetadata::mbIsTransparent.

Referenced by ImpGraphic::setPrepared().

◆ operator=()

GraphicDescriptor & GraphicDescriptor::operator= ( const GraphicDescriptor )
privatedelete

References Detect.

Member Data Documentation

◆ aMetadata

GraphicMetadata GraphicDescriptor::aMetadata
private

◆ aPathExt

OUString GraphicDescriptor::aPathExt
private

◆ bOwnStream

bool GraphicDescriptor::bOwnStream
private

Definition at line 133 of file graphicfilter.hxx.

Referenced by ~GraphicDescriptor().

◆ pFileStm

SvStream* GraphicDescriptor::pFileStm
private

Definition at line 130 of file graphicfilter.hxx.

Referenced by Detect(), and ~GraphicDescriptor().


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