12 #ifndef IW_DAFF_READERIMPL 13 #define IW_DAFF_READERIMPL 81 int getRecordCoords(
int iRecordIndex,
int iView,
float& fAngle1,
float& fAngle2)
const;
82 void getNearestNeighbour(
int iView,
float fAngle1Deg,
float fAngle2Deg,
int& iRecordIndex)
const;
83 void getNearestNeighbour(
int iView,
float fAngle1Deg,
float fAngle2Deg,
int& iRecordIndex,
bool& bOutOfBounds)
const;
84 void getCell(
int iView,
float fAngle1,
float fAngle2,
DAFFQuad& qIndices)
const;
85 void transformAnglesD2O(
float fAlpha,
float fBeta,
float& fAzimuth,
float& fElevation)
const;
86 void transformAnglesO2D(
float fAzimuth,
float fElevation,
float& fAlpha,
float& fBeta)
const;
92 int getFilterCoeffs(
int iRecordIndex,
int iChannel,
float* pfDest,
float fGain=1.0F)
const;
93 int addFilterCoeffs(
int iRecordIndex,
int iChannel,
float* pfDest,
float fGain=1.0F)
const;
106 int getMagnitudes(
int iRecordIndex,
int iChannel,
float* pfData)
const;
107 int getMagnitude(
int iRecordIndex,
int iChannel,
int iFreqIndex,
float& fMag)
const;
111 int getPhases(
int iRecordIndex,
int iChannel,
float* pfData)
const;
112 int getPhase(
int iRecordIndex,
int iChannel,
int iFreqIndex,
float& fPhase)
const;
125 int getDFTCoeff(
int iRecordIndex,
int iChannel,
int iDFTCoeff,
float& fReal,
float& fImag)
const;
126 int getDFTCoeffs(
int iRecordIndex,
int iChannel,
float* pfDest)
const;
129 bool m_bDAFFObjectValid;
130 bool m_bDAFFObjectFromFileValid;
131 std::string m_sFilePath;
138 void* m_pContentHeader;
139 void* m_pRecordDescriptorBlock;
141 int m_iRecordChannelDescSize;
148 std::vector< float > m_vfFreqs;
151 std::vector< DAFFMetadataImpl* > m_vpMetadata;
153 bool m_bOverallPeakInitialized;
154 float m_fOverallPeak;
159 float m_fAlphaResolution;
160 float m_fBetaResolution;
167 int loadFileHeader();
173 int loadFileBlockTable();
179 int loadMainHeader();
185 int loadContentHeader();
191 int loadRecordDescriptor();
197 int loadRecordData();
203 int loadMetadata(
char* );
209 void fixAngleRanges();
218 int getFileBlocksByID(
int iID, std::vector< DAFFFileBlockEntry* >& vpfDest )
const;
221 void* getRecordChannelDescPtr(
int iRecord,
int iChannel )
const;
224 int* getRecordMetadataIndexPtr(
int iRecord )
const;
230 #endif // IW_DAFF_READERIMPL int getNumberOfRecords() const
Returns the overall number of records.
int getPhases(int iRecordIndex, int iChannel, float *pfData) const
Retrieves phase coefficients.
float getBetaResolution() const
float getAlphaEnd() const
void getDefaultOrientation(DAFFOrientationYPR &o) const
Returns the default orientation as stored in the file.
Reader interface for DAFF files.
int getRecordCoords(int iRecordIndex, int iView, float &fAngle1, float &fAngle2) const
Determines the spherical coordinates of a record (grid point on spherical regular grid) ...
int getQuantization() const
Returns the quantization of the data elements.
void closeFile()
Closes an opened DAFF file.
std::string getChannelLabel(int iChannel) const
Returns the label of a channel.
bool coversFullAlphaRange() const
Indicates whether the data covers the full alpha range [0°, 360°)
void transformAnglesD2O(float fAlpha, float fBeta, float &fAzimuth, float &fElevation) const
Transforms data spherical coordinates into object spherical coordinates.
int getPhase(int iRecordIndex, int iChannel, int iFreqIndex, float &fPhase) const
Retrieves a single phase coefficient.
Common content interface.
Magnitude spectrum content interface.
Pure data class that describes the points of a quad by their indices and coordinates.
int addFilterCoeffs(int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
Adds filter coefficients for record and channel to a given buffer.
Phase spectrum content interface.
int getMinEffectiveFilterOffset() const
Returns the minimal effective filter offset over all records.
int getFilterLength() const
Returns the number of filter coefficients.
void setDefaultOrientation()
Sets/alters the default orientation manually.
float getOverallMagnitudeMaximum() const
Returns the overall greatest magnitude value.
int getMagnitudes(int iRecordIndex, int iChannel, float *pfData) const
Retrieves magnitude coefficients.
int getNumberOfChannels() const
Returns the number of channels.
int getEffectiveFilterBounds(int iRecordIndex, int iChannel, int &iOffset, int &iLength) const
Retrieves the offset and length of the effective part of a filter.
int getTransformSize() const
Returns the size of the transform (number of overall DFT coefficients)
int openFile(const std::string &)
Opens a DAFF file for reading.
int getFileFormatVersion() const
Returns the DAFF version of the file format.
const DAFFMetadata * getRecordMetadata(int iRecordIndex) const
Returns the metadata of a record.
int getAlphaPoints() const
int getMaxEffectiveFilterLength() const
Returns the maximum effective filter length over all records.
void transformAnglesO2D(float fAzimuth, float fElevation, float &fAlpha, float &fBeta) const
Transforms object spherical coordinates into data spherical coordinates.
Magnitude-phase spectrum content interface.
int getEffectiveFilterCoeffs(int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
Retrieves effective filter coefficients for record and channel.
double getSamplerate() const
Returns the correspondig sampling rate [in Hertz].
float getAlphaStart() const
void getNearestNeighbour(int iView, float fAngle1Deg, float fAngle2Deg, int &iRecordIndex) const
Determine the nearest neighbour record and return its index.
int getDFTCoeffs(int iRecordIndex, int iChannel, float *pfDest) const
Retrieves magnitude coefficients.
int deserialize(char *pDAFFDataBuffer)
Deserializes DAFF content from a byte buffer.
int getNumFrequencies() const
Returns the number of support points (frequencies)
float getOverallPeak()
Get overall peak value.
std::string toString() const
Returns string with information about the reader.
std::string getFilename() const
Returns the name of the opened DAFF file.
float getBetaSpan() const
bool isSymmetric() const
Returns whether the spectrum is complex-conjugated symmetric.
float getBetaStart() const
int getBetaPoints() const
bool isFileOpened() const
Returns whether a file is opened.
Impulse response content interface.
const std::vector< float > & getFrequencies() const
Retrieves the frequencies [in Hertz] at which values are defined.
double getFrequencyBandwidth() const
Returns the frequency resolution [in Hertz].
const DAFFMetadata * getMetadata() const
Returns the metadata.
int getMagnitude(int iRecordIndex, int iChannel, int iFreqIndex, float &fMag) const
Retrieves a single magnitude coefficient.
int getCoefficientsRI(int iRecordIndex, int iChannel, float *pfDest) const
Retrieves coefficients in cartesian form.
float getAlphaResolution() const
Discrete Fourier spectrum content interface.
int getNumDFTCoeffs() const
Returns the number of DFT coefficients.
DAFFProperties * getProperties() const
Returns the properties of the file.
Properties of a DAFF file that uses regular sphere grids (or parts of a regular grid) ...
int getContentType() const
Returns the content type.
int getCoefficientsMP(int iRecordIndex, int iChannel, float *pfDest) const
Retrieves coefficients in polar form.
void setOrientation(const DAFFOrientationYPR &o)
Sets the current orientation of the object view.
int getFilterCoeffs(int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
Retrieves filter coefficients for record and channel.
int getDFTCoeff(int iRecordIndex, int iChannel, int iDFTCoeff, float &fReal, float &fImag) const
Retrieve a single magnitude coefficient.
DAFFContent * getContent() const
Returns the content.
float getAlphaSpan() const
void getCell(int iView, float fAngle1, float fAngle2, DAFFQuad &qIndices) const
Determines the cell of a given direction on the sphere grid and delivers its surrounding record indic...
Data class for orientations in yaw-pitch-roll (YPR) angles (right-handed OpenGL coordinate system) ...
bool coversFullSphere() const
Indicates whether the data covers the full sphere.
DAFFReader * getParent() const
Returns the parent reader.
void getOrientation(DAFFOrientationYPR &o) const
Returns the current orientation of the object view.
int addEffectiveFilterCoeffs(int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
Adds effective filter coefficients for record and channel to a given buffer.
bool coversFullBetaRange() const
Indicates whether the data covers the full beta range [0°, 180°].