ULIS  dev4.0.7
Utility Library for Imaging Systems
Public Member Functions | Protected Member Functions | List of all members
IHasFormat Class Reference

The IHasFormat class provides an interface for accessing format informations for image related classes that have a format. More...

Inheritance diagram for IHasFormat:

Public Member Functions

 ~IHasFormat ()
 
uint8 AlphaIndex () const
 
uint8 BytesPerPixel () const
 
uint8 BytesPerSample () const
 
uint8 DefaultProfileCode () const
 
eFormat Format () const
 
const FFormatMetricsFormatMetrics () const
 
bool HasAlpha () const
 
const uint8IndexTable () const
 
bool Linear () const
 
eColorModel Model () const
 
uint8 NumColorChannels () const
 
bool Planar () const
 
bool Premultiplied () const
 
uint8 RedirectedIndex (uint8 iIndex) const
 
bool Reversed () const
 
uint8 SamplesPerPixel () const
 
bool Swapped () const
 
eType Type () const
 

Protected Member Functions

 IHasFormat (eFormat iFormat)
 
void ReinterpretFormat (eFormat iFormat)
 

Detailed Description

The IHasFormat class provides acces to a FFormatMetrics and interfaces for easy access to format information.

See also
FFormatMetrics

Constructor & Destructor Documentation

◆ IHasFormat()

IHasFormat::IHasFormat ( eFormat  iFormat)
inlineprotected

Constructor from eFormat.

◆ ~IHasFormat()

IHasFormat::~IHasFormat ( )
inline

Destructor.

Member Function Documentation

◆ AlphaIndex()

uint8 IHasFormat::AlphaIndex ( ) const
inline

Return the redirected index of the alpha channel.

◆ BytesPerPixel()

uint8 IHasFormat::BytesPerPixel ( ) const
inline

Return the number of bytes per pixel. For eFormat::Format_RGBA8, this value is 4.

◆ BytesPerSample()

uint8 IHasFormat::BytesPerSample ( ) const
inline

Return the number of bytes per sample ( per channel ). For eFormat::Format_RGBA8, this value is 1.

◆ DefaultProfileCode()

uint8 IHasFormat::DefaultProfileCode ( ) const
inline

Return wether the format default profile identifier.

◆ Format()

eFormat IHasFormat::Format ( ) const
inline

Return the underlying eFormat value.

◆ FormatMetrics()

const FFormatMetrics& IHasFormat::FormatMetrics ( ) const
inline

Return the underlying FFormatMetrics struct.

◆ HasAlpha()

bool IHasFormat::HasAlpha ( ) const
inline

Return wether the format has an extra alpha channel.

◆ IndexTable()

const uint8* IHasFormat::IndexTable ( ) const
inline

Return the redirection table for models layout indexes.

Models have intrinsic indices associated with the channels components, for example RGB models associate indexes with channels this way: ( ( R, 0 ), ( G, 1 ), ( B, 2 ) )

For eFormat::Format_RGBA8, the index table might look like this: [0,1,2,3]

For eFormat::Format_ABGR8, the index table might look like this: [3,2,1,0]

For eFormat::Format_BGRA8, the index table might look like this: [2,1,0,3]

◆ Linear()

bool IHasFormat::Linear ( ) const
inline

Return wether the format is linear or not.

◆ Model()

eColorModel IHasFormat::Model ( ) const
inline

Return the extrapolated eColorModel model.

◆ NumColorChannels()

uint8 IHasFormat::NumColorChannels ( ) const
inline

Return the number of color channels, alpha is not part of the color channels. For RGB, this value is 3.

◆ Planar()

bool IHasFormat::Planar ( ) const
inline

Return wether the format is planar or not.

◆ Premultiplied()

bool IHasFormat::Premultiplied ( ) const
inline

Return wether the format is premultiplied or not.

◆ RedirectedIndex()

uint8 IHasFormat::RedirectedIndex ( uint8  iIndex) const
inline

Return the redirected index for the given "natural" index.

See also
IndexTable()

◆ ReinterpretFormat()

void IHasFormat::ReinterpretFormat ( eFormat  iFormat)
inlineprotected

Reinterpret the format by changing the value and extrapolating and caching the values again.

This is not part of the public interface because there are strict constraints and circumstances under which and format reinterpretation is allowed. These circumstances are defined by the child classes.

◆ Reversed()

bool IHasFormat::Reversed ( ) const
inline

Return wether the layout is reversed or not.

◆ SamplesPerPixel()

uint8 IHasFormat::SamplesPerPixel ( ) const
inline

Return the number of samples or channels, alpha is taken into account. For eFormat::Format_RGBA8, this value is 4.

◆ Swapped()

bool IHasFormat::Swapped ( ) const
inline

Return wether the layout is swapped or not.

◆ Type()

eType IHasFormat::Type ( ) const
inline

Return the extrapolated eType type.