The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fib::cDomainIntegerBit Class Reference

#include <cDomainIntegerBit.h>

Inheritance diagram for fib::cDomainIntegerBit:
Collaboration diagram for fib::cDomainIntegerBit:

List of all members.

Public Member Functions

 cDomainIntegerBit (unsignedIntFib iBits)
 cDomainIntegerBit (unsignedIntFib iBits, doubleFib dScalingFactor)
 cDomainIntegerBit (const cDomainIntegerBit &domain)
virtual string getType () const
virtual bool isElement (const doubleFib dValue) const
virtual bool isInBoundaries (const doubleFib dValue) const
virtual doubleFib round (const doubleFib dValue) const
doubleFib getMaximum () const
virtual doubleFib getMinimum () const
virtual doubleFib getNull () const
virtual bool isUnscaledElement (const longFib lValue) const
virtual longFib roundUnscaled (const longFib lValue) const
virtual longFib getMaximumUnscaled () const
virtual longFib getMinimumUnscaled () const
virtual longFib getNullUnscaled () const
virtual cDomainIntegerBitclone () const
virtual bool operator== (const cDomain &domain) const
virtual unsignedIntFib getCompressedSize () const
virtual unsignedIntFib getCompressedSizeForValue () const
virtual bool storeXml (ostream &ostream) const
virtual intFib restoreXml (const TiXmlElement *pXmlElement)
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual intFib restore (cReadBits &iBitStream)
virtual bool storeValue (doubleFib dValue, ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual bool storeUnscaledValue (longFib lValue, ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual longFib restoreIntegerValue (cReadBits &iBitStream, intFib &outStatus) const
- Public Member Functions inherited from fib::cDomainIntegerBasis
doubleFib getScalingFactor () const
doubleFib scale (const longFib lValue) const
virtual doubleFib restoreValue (cReadBits &iBitStream, intFib &outStatus) const
- Public Member Functions inherited from fib::cDomainSingle
virtual bool isScalar () const
virtual bool isVector () const
- Public Member Functions inherited from fib::cDomain
virtual ~cDomain ()=0
virtual bool isReference () const
virtual bool equal (const cDomain &domain) const

Protected Attributes

cDomainNaturalNumberBit domainNaturalNumberBit
longFib lMaxNumber
longFib lMinNumber
longFib lNumberOfValues
- Protected Attributes inherited from fib::cDomainIntegerBasis
doubleFib dScalingFactor

Additional Inherited Members

- Static Public Member Functions inherited from fib::cDomainIntegerBasis
static cDomainIntegerBasiscreateGoodDomain (const list< longFib > &liValues)
- Static Public Member Functions inherited from fib::cDomainSingle
static cDomainSinglecreateGoodDomain (list< doubleFib > &liValues)
- Static Public Member Functions inherited from fib::cDomain
static cDomainrestoreXml (const TiXmlElement *pXmlElement, intFib &outStatus)
static cDomainrestore (cReadBits &iBitStream, intFib &outStatus)
- Protected Member Functions inherited from fib::cDomainIntegerBasis
 cDomainIntegerBasis (const doubleFib dInScalingFactor)
unsigned int getCompressedSizeForScalingFactor () const
bool storeScalingFactor (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
intFib restoreScalingFactor (cReadBits &iBitStream)
doubleFib setXmlScaling (const char *szXmlScalingFactor)

Detailed Description

Definition at line 56 of file cDomainIntegerBit.h.


Constructor & Destructor Documentation

fib::cDomainIntegerBit::cDomainIntegerBit ( unsignedIntFib  iBits)

The constructor for unscaled integer numer domains. If iBits is number of bits per number of the domain {-(2^(iBits-1)), ..., (2^(iBits-1)-1)} is the domain.

Parameters:
iBitsbits to use for numbers of the domain
fib::cDomainIntegerBit::cDomainIntegerBit ( unsignedIntFib  iBits,
doubleFib  dScalingFactor 
)

The constructor for scaled integer numer domains. If iBits is number of bits per number of the domain { -(2^(B-1)) * dScalingFactor, ..., (2^(B-1)-1) * dScalingFactor} is the scaled domain. ({-(2^(iBits-1)), ..., (2^(iBits-1)-1)} is the unscaled domain)

Parameters:
iBitsbits to use for numbers of the domain
dScalingFactorthe scaling factor of the domain the scaling factor has to be greater 0.0
fib::cDomainIntegerBit::cDomainIntegerBit ( const cDomainIntegerBit domain)

The copyconstructor for integer numer domains.

Parameters:
domainthe integer number domain to copy

Member Function Documentation

virtual cDomainIntegerBit* fib::cDomainIntegerBit::clone ( ) const
virtual

This Method clones this object.

Returns:
a clone of this object

Implements fib::cDomainIntegerBasis.

virtual unsignedIntFib fib::cDomainIntegerBit::getCompressedSize ( ) const
virtual

This method evaluades the size of the domain in bits in the compressed file form.

See also:
store()
Returns:
the size of the domain in bits in the compressed form

Implements fib::cDomain.

virtual unsignedIntFib fib::cDomainIntegerBit::getCompressedSizeForValue ( ) const
virtual

This method evaluades the size of values in the domain in bits in the compressed file form.

See also:
store()
Returns:
the size of the domain in bits in the compressed form

Implements fib::cDomainSingle.

doubleFib fib::cDomainIntegerBit::getMaximum ( ) const
virtual

This method returns the biggest value in the domain.

Returns:
the biggest value in the domain

Implements fib::cDomainSingle.

virtual longFib fib::cDomainIntegerBit::getMaximumUnscaled ( ) const
virtual

This method returns the biggest value in the unscaled domain.

Returns:
the biggest value in the unscaled domain

Implements fib::cDomainIntegerBasis.

virtual doubleFib fib::cDomainIntegerBit::getMinimum ( ) const
virtual

This method returns the smalest value in the domain.

Returns:
the smalest value in the domain

Implements fib::cDomainSingle.

virtual longFib fib::cDomainIntegerBit::getMinimumUnscaled ( ) const
virtual

This method returns the smalest value in the unscaled domain.

Returns:
the smalest value in the unscaled domain

Implements fib::cDomainIntegerBasis.

virtual doubleFib fib::cDomainIntegerBit::getNull ( ) const
virtual

This method returns the nullvalue of the domain. The nullvalue is the value 0 rounded to an value in the domain.

Returns:
the nullvalue of the domain

Implements fib::cDomainSingle.

virtual longFib fib::cDomainIntegerBit::getNullUnscaled ( ) const
virtual

This method returns the nullvalue of the unscaled domain. The nullvalue is the value 0 rounded to an value in the unscaled domain.

Returns:
the nullvalue of the domain

Implements fib::cDomainIntegerBasis.

virtual string fib::cDomainIntegerBit::getType ( ) const
virtual
Returns:
the type of the domain as an string

Implements fib::cDomain.

virtual bool fib::cDomainIntegerBit::isElement ( const doubleFib  dValue) const
virtual

This method checks if the given value is an element of the domain. If the value dValue is an element of the domain true is returned, else false.

Parameters:
dValuethe value for which to check, if it is an element of the domain
Returns:
if the value dValue is an element of the domain true true is returned, else false

Implements fib::cDomainSingle.

virtual bool fib::cDomainIntegerBit::isInBoundaries ( const doubleFib  dValue) const
virtual

This method checks if the given value is inside the domain boundaries. If the value dValue is inside of the domain boundaries true is returned, else false. A value is inside of the vector domain boudaries, if it is greater than the minimum value minus the scaling factor and lower than the maximum value plus the scaling factor.

Parameters:
dValuethe value for which to check, if it is inside of the domain boundaries
Returns:
if the vector dValue is inside of the domain boundaries true is returned, else false

Implements fib::cDomainSingle.

virtual bool fib::cDomainIntegerBit::isUnscaledElement ( const longFib  lValue) const
virtual

This method checks if the given value is an element of the unscaled domain. If the value lValue is an element of the unscaled domain true is returned, else false.

Parameters:
lValuethe value for which to check, if it is an element of the unscaled domain
Returns:
if the value dValue is an element of the unscaled domain true true is returned, else false

Implements fib::cDomainIntegerBasis.

virtual bool fib::cDomainIntegerBit::operator== ( const cDomain domain) const
virtual

This Method checks if the given domain is equal to this domain.

Parameters:
domainthe domain which should be equal to this domain
Returns:
true if the given domain is equal to this domain, else false

Reimplemented from fib::cDomainIntegerBasis.

virtual intFib fib::cDomainIntegerBit::restore ( cReadBits iBitStream)
virtual

This method restores a domain from a bitstream, wher it is stored in the compressed fib -format.

See also:
store
Parameters:
iBitStreamthe stream where the domain is stored in, because the stream is an cReadBits, any number of bits can be readed from it
Returns:
an integervalue with the errorvalue possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid pXmlElement
  • -2 loading error, invalid data in pXmlElement
  • 1 loading warning, invalid data in pXmlElement, error could be corrected
  • 2 loading warning, invalid data in pXmlElement, maybe the loaded object is wrong

Implements fib::cDomain.

virtual longFib fib::cDomainIntegerBit::restoreIntegerValue ( cReadBits iBitStream,
intFib outStatus 
) const
virtual

This method restores the a unscaled integer value of the domain from the stream iBitStream, wher it is stored in the compressed fib -format.

See also:
storeValue
restoreValue
storeUnscaledValue
cFibElement::restore
Parameters:
iBitStreamthe stream where this value is stored to in, because this stream is an cReadBits, any number of bits can be readed from it
outStatusAn reference to an integervalue where the errorvalue can be stored to. If the pointer is NULL no errorvalue will be given back. possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid stream
  • -2 loading error, invalid data in stream
  • 1 loading warning, invalid data in stream, error could be corrected
  • 2 loading warning, invalid data in stream, maybe the loaded object is wrong
Returns:
the unscaled restored value

Implements fib::cDomainIntegerBasis.

virtual intFib fib::cDomainIntegerBit::restoreXml ( const TiXmlElement *  pXmlElement)
virtual

This method restores a domain in the XML -format from an TinyXml element.

Parameters:
pXmlNodea pointer to the TinyXml node wher the domain is stored in
Returns:
an integervalue with the errorvalue possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid pXmlElement
  • -2 loading error, invalid data in pXmlElement
  • 1 loading warning, invalid data in pXmlElement, error could be corrected
  • 2 loading warning, invalid data in pXmlElement, maybe the loaded object is wrong

Implements fib::cDomain.

virtual doubleFib fib::cDomainIntegerBit::round ( const doubleFib  dValue) const
virtual

This method round the given value dValue to an value in the domain of this object. The rounded vale will be the value with the minimal distance to the given value dValue. If more of these exists the smales will be returned.

Parameters:
dValuethe value which should be rounded
Returns:
the rounded value of dValue

Implements fib::cDomainSingle.

virtual longFib fib::cDomainIntegerBit::roundUnscaled ( const longFib  lValue) const
virtual

This method round the given value dValue to an value in the unscaled domain of this object. The rounded vale will be the unscaled value with the minimal distance to the given value lValue. If more of these exists the smales will be returned.

Parameters:
lValuethe value which should be rounded
Returns:
the rounded unscaled value of lValue

Implements fib::cDomainIntegerBasis.

virtual bool fib::cDomainIntegerBit::store ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
virtual

This method stores this domain in the compressed fib -format into the given stream. It is needed because the stream can yust store byts but the size of fib -elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the fib -elements.

See also:
cFibElement::store
Parameters:
streamthe stream where this domain should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
Returns:
true if the domain is stored, else false

Implements fib::cDomain.

virtual bool fib::cDomainIntegerBit::storeUnscaledValue ( longFib  lValue,
ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
virtual

This method stores the given unscaled value lValue in the compressed fib -format for the domain into the given stream. It is needed because the stream can yust store byts but the size of fib -elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the fib -elements.

See also:
cFibElement::store
Parameters:
lValuethe value to store
streamthe stream where this domain should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
Returns:
true if the domain is stored, else false

Implements fib::cDomainIntegerBasis.

virtual bool fib::cDomainIntegerBit::storeValue ( doubleFib  dValue,
ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
virtual

This method stores the given value dValue in the compressed fib -format for the domain into the given stream. It is needed because the stream can yust store byts but the size of fib -elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the fib -elements.

See also:
cFibElement::store
Parameters:
dValuethe value to store
streamthe stream where this domain should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
Returns:
true if the domain is stored, else false

Implements fib::cDomainSingle.

virtual bool fib::cDomainIntegerBit::storeXml ( ostream &  ostream) const
virtual

This method stores this domain in the XML -format into the given stream.

Parameters:
ostreamthe stream where domains should be stored to
Returns:
true if this domain are stored, else false

Implements fib::cDomain.


Member Data Documentation

cDomainNaturalNumberBit fib::cDomainIntegerBit::domainNaturalNumberBit
protected

The cDomainIntegerBit uses a cDomainNaturalNumberBit domain for storing values.

Definition at line 63 of file cDomainIntegerBit.h.

longFib fib::cDomainIntegerBit::lMaxNumber
protected

The maximal unscaled number of the integer numbers in this domain.

Definition at line 68 of file cDomainIntegerBit.h.

longFib fib::cDomainIntegerBit::lMinNumber
protected

The minimal unscaled number of the integer numbers in this domain.

Definition at line 73 of file cDomainIntegerBit.h.

longFib fib::cDomainIntegerBit::lNumberOfValues
protected

The number of the integer numbers in this domain.

Definition at line 78 of file cDomainIntegerBit.h.


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