Lynkeos
Instance Methods | Class Methods | Public Attributes | Related Functions | List of all members
LynkeosFourierBuffer Class Reference

Class used to wrap the Fourier transform with FFTW library. More...

#import <LynkeosFourierBuffer.h>

Inheritance diagram for LynkeosFourierBuffer:
Inheritance graph
[legend]
Collaboration diagram for LynkeosFourierBuffer:
Collaboration graph
[legend]

Instance Methods

(id) - initWithNumberOfPlanes:width:height:withGoal:
 Allocates a new empty buffer. More...
 
(id) - initWithNumberOfPlanes:width:height:withGoal:isSpectrum:
 Allocates a new empty buffer. More...
 
(BOOL) - isSpectrum
 Tells whether the instance is a spectrum or an image. More...
 
(void) - directTransform
 Compute the direct transform. More...
 
(void) - inverseTransform
 Compute the inverse transform, normalize the result and returns the values extremes.
 
(void) - normalize
 Normalize the spectrum to a 1.0 continous level.
 
(void) - conjugate
 Transform the spectrum pixels into their conjugate.
 
(void) - multiplyWithConjugateOf:result:
 Multiplication with conjugate. More...
 
- Instance Methods inherited from LynkeosStandardImageBuffer
(id) - initWithNumberOfPlanes:width:height:
 Allocates a new empty buffer. More...
 
(id) - initWithData:copy:freeWhenDone:numberOfPlanes:width:paddedWidth:height:
 Initialize a new buffer with preexisting data. More...
 
(void) - setOperatorsStrategy:
 Change the strategy of arithmetic operators. More...
 
(void) - resetMinMax
 Reset the min and max to unset values.
 
(void) - getMinLevel:maxLevel:
 Get the minimum and maximum pixels value. More...
 
(void) - getMinLevel:maxLevel:forPlane:
 Get the minimum and maximum pixels value for a given plane. More...
 
(void *const *const) - colorPlanes
 Access to the color planes. More...
 
(void) - extractSample:atX:Y:withWidth:height:withPlanes:lineWidth:
 Extract a rectangle in the image.
 
(void) - substract:
 Substract an image from another. More...
 
(void) - add:withOffsets:withExpansion:
 Shifts another image and add it to this one. More...
 
(void) - multiplyWith:result:
 Multiplication. More...
 
(void) - substractBias:andScale:
 Substract and multiply with scalars. More...
 
(void) - multiplyWithScalar:
 Multiplication with a scalar. More...
 
(void) - divideBy:result:
 Division. More...
 
- Instance Methods inherited from <LynkeosImageBuffer>
(size_t) - memorySize
 The memory size occupied by this item. More...
 
(u_short) - width
 Get the image pixels width. More...
 
(u_short) - height
 Get the image pixels height. More...
 
(u_short) - numberOfPlanes
 Get the number of color planes. More...
 
(NSBitmapImageRep *) - getNSImageWithBlack:white:gamma:
 Retrieve a Cocoa 24 bits RGB bitmap representation. More...
 
(void) - add:
 Add another image buffer. More...
 
(void) - calibrateWithDarkFrame:flatField:atX:Y:
 Calibrate the image with the calibration images. More...
 
(void) - normalizeWithFactor:mono:
 Multiplies all values with a scalar. More...
 
(void) - convertToPlanar:withPrecision:withPlanes:lineWidth:
 Convert the image buffer data to a floating precision planar representation. More...
 
(void) - clear
 Clear the image contents ; all samples are zeroes.
 

Class Methods

(LynkeosFourierBuffer *) + fourierBufferWithNumberOfPlanes:width:height:withGoal:
 Allocates a new empty buffer. More...
 
- Class Methods inherited from LynkeosStandardImageBuffer
(LynkeosStandardImageBuffer *) + imageBufferWithNumberOfPlanes:width:height:
 Convenience empty image buffer creator. More...
 
(LynkeosStandardImageBuffer *) + imageBufferWithData:copy:freeWhenDone:numberOfPlanes:width:paddedWidth:height:
 Convenience initialized image buffer creator. More...
 

Public Attributes

u_short _halfw
 The spectrum has only half the image width (complex pixels)
 
u_short _spadw
 Spectrum padded width.
 
- Public Attributes inherited from LynkeosStandardImageBuffer
u_short _nPlanes
 Number of color planes.
 
u_short _w
 Image pixels width.
 
u_short _h
 Image pixels width.
 
u_short _padw
 Padded line width (>= width)
 
void * _data
 Pixel buffer, the planes are consecutive.
 

Related Functions

(Note that these are not member functions.)

#define stdColorComplexValue(buf, p, x, y, c)
 Access to the complex value of a pixel in the spectrum. More...
 

Additional Inherited Members

- Protected Attributes inherited from LynkeosStandardImageBuffer
void * _planes [3]
 Shortcuts to the color planes.
 
BOOL _freeWhenDone
 Whether to free the planes on dealloc.
 
double _min [4]
 The image minimum value.
 
double _max [4]
 The image maximum value.
 
ImageProcessOneLine_t _mul_one_image_line
 Strategy method for multiplying a line, with vectorization, or not.
 
ImageProcessOneLine_t _scale_one_image_line
 Strategy method for scaling a line, with vectorization, or not.
 
ImageProcessOneLine_t _div_one_image_line
 Strategy method for dividing a line, with vectorization, or not.
 
ImageProcessOneLine_t _bias_scale_one_image_line
 Strategy method for substract and multiply, with vectorization, or not.
 
SEL _process_image_selector
 Strategy method for processing an image, actually for debug.
 
void(* _process_image )(id, SEL, ArithmeticOperand_t *, LynkeosStandardImageBuffer *res, ImageProcessOneLine_t)
 Strategy method for processing an image, func pointer which is called.
 

Detailed Description

Class used to wrap the Fourier transform with FFTW library.

Method Documentation

- (void) directTransform

Compute the direct transform.

Returns
none

References FOR_DIRECT, and LynkeosStandardImageBuffer::resetMinMax.

Referenced by correlate(), and filterImageForAnalysis().

+ (LynkeosFourierBuffer *) fourierBufferWithNumberOfPlanes: (u_char)  nPlanes
width: (u_short)  w
height: (u_short)  h
withGoal: (u_char)  goal 

Allocates a new empty buffer.

Parameters
nPlanesNumber of color planes for this image
wImage pixels width
hImage pixels height
goalWhat kind of transform to prepare, direct, inverse or both.
Returns
The allocated and initialized buffer, ready for FFT.

References <LynkeosImageBuffer>::height, and <LynkeosImageBuffer>::width.

- (id) initWithNumberOfPlanes: (u_char)  nPlanes
width: (u_short)  w
height: (u_short)  h
withGoal: (u_char)  goal 

Allocates a new empty buffer.

Parameters
nPlanesNumber of color planes for this image
wImage pixels width
hImage pixels height
goalWhat kind of transform to prepare, direct, inverse or both.
Returns
The allocated and initialized buffer, ready for FFT.

References <LynkeosImageBuffer>::height, isSpectrum, and <LynkeosImageBuffer>::width.

- (id) initWithNumberOfPlanes: (u_char)  nPlanes
width: (u_short)  w
height: (u_short)  h
withGoal: (u_char)  goal
isSpectrum: (BOOL)  isSpectrum 

Allocates a new empty buffer.

Parameters
nPlanesNumber of color planes for this image
wImage pixels width
hImage pixels height
goalWhat kind of transform to prepare, direct, inverse or both.
isSpectrumWhether the initial data is a spectrum
Returns
The allocated and initialized buffer, ready for FFT.

References LynkeosStandardImageBuffer::_data, LynkeosStandardImageBuffer::_freeWhenDone, LynkeosStandardImageBuffer::_h, _halfw, LynkeosStandardImageBuffer::_nPlanes, LynkeosStandardImageBuffer::_padw, LynkeosStandardImageBuffer::_planes, _spadw, LynkeosStandardImageBuffer::_w, FOR_DIRECT, FOR_INVERSE, and isSpectrum.

- (BOOL) isSpectrum

Tells whether the instance is a spectrum or an image.

Returns
YES if the instance is a spectrum

Referenced by initWithNumberOfPlanes:width:height:withGoal:, and initWithNumberOfPlanes:width:height:withGoal:isSpectrum:.

- (void) multiplyWithConjugateOf: (LynkeosFourierBuffer*)  term
result: (LynkeosFourierBuffer*)  result 

Multiplication with conjugate.

term shall either have the same number of planes as the receiver or only one plane. In the latter case, the plane is applied to each planes of the receiver.

Parameters
termother term (shall be a spectrum)
resultwhere the result is stored, can be one of the terms

References LynkeosStandardImageBuffer::_h, LynkeosStandardImageBuffer::_nPlanes, LynkeosStandardImageBuffer::_process_image, LynkeosStandardImageBuffer::_process_image_selector, LynkeosStandardImageBuffer::_w, and ArithmeticOperand_t::term.

Referenced by correlate_spectrums().

Friends And Related Function Documentation

- (#define) stdColorComplexValue (   buf,
  p,
  x,
  y,
 
)
related
Value:
(p == SINGLE_PRECISION ? \
(((float _Complex*)(buf)->_data)[((y)+(c)*(buf)->_h)*(buf)->_spadw+(x)]) : \
(((double _Complex*)(buf)->_data)[((y)+(c)*(buf)->_h)*(buf)->_spadw+(x)]) )

Access to the complex value of a pixel in the spectrum.

This method is provided as a macro for speed purpose.

Parameters
bufThe fourier buffer
pThe processing precision
xThe X coordinate of the pixel
yThe Y coordinate of the pixel
cThe color plane

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