Lynkeos
|
Generic image management. More...
#import <LynkeosImageBuffer.h>
Instance Methods | |
(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. | |
Generic image management.
- (void) add: | (id< LynkeosImageBuffer >) | image |
Add another image buffer.
The image to add shall be an instance of the same class as self and have the same size (method implementation can rely on this).
image | The image to add |
- (void) calibrateWithDarkFrame: | (id< LynkeosImageBuffer >) | darkFrame | |
flatField: | (id< LynkeosImageBuffer >) | flatField | |
atX: | (u_short) | ox | |
Y: | (u_short) | oy | |
Calibrate the image with the calibration images.
darkFrame and flatField, when present, are instances of the same class as self. They are "full sensor" images.
The darkFrame, if any, shall be substracted from the image and the result shall be divided by the flatField, if any.
The coordinates are specified using the same orientation as in LynkeosFileReader
darkFrame | The dark frame image, nil if not present |
flatField | The flat field image, nil if not present |
ox | The X origin of our image in the full sensor frame. |
oy | The Y origin of our image in the full sensor frame. |
- (void) convertToPlanar: | (void *const *const) | planes | |
withPrecision: | (floating_precision_t) | precision | |
withPlanes: | (u_short) | nPlanes | |
lineWidth: | (u_short) | lineW | |
Convert the image buffer data to a floating precision planar representation.
The pixels ordering is the same as in LynkeosFileReader.
planes | The color planes to fill with the image data. There are as many planes as there are in this instance and their size is the same as this instance's image. |
nPlanes | Number of planes in the output buffer. |
precision | The floating precision of pixels in the output buffer. |
lineW | The line width of the output buffer (may be larger than this instance's image width). |
- (NSBitmapImageRep*) getNSImageWithBlack: | (double *) | black | |
white: | (double *) | white | |
gamma: | (double *) | gamma | |
Retrieve a Cocoa 24 bits RGB bitmap representation.
The black, white and gamma are arrays of values for each plane, and a last "global" value that is applied equally on each plane.
black | Black level for conversion for each plane |
white | White level for conversion for each plane |
gamma | Gamma correction exponent for each plane (ie: 1 = no correction) |
- (u_short) height |
Get the image pixels height.
Referenced by MyChromaticAlignerView(Private)::applyOffsetsTo:, LynkeosFourierBuffer::fourierBufferWithNumberOfPlanes:width:height:withGoal:, LynkeosStandardImageBuffer::imageBufferWithData:copy:freeWhenDone:numberOfPlanes:width:paddedWidth:height:, LynkeosStandardImageBuffer::imageBufferWithNumberOfPlanes:width:height:, LynkeosStandardImageBuffer::initWithNumberOfPlanes:width:height:, and LynkeosFourierBuffer::initWithNumberOfPlanes:width:height:withGoal:.
- (size_t) memorySize |
The memory size occupied by this item.
The object shall use class_getInstanceSize and add the size of any aggregated objects and "mallocated" buffers.
- (void) normalizeWithFactor: | (double) | factor | |
mono: | (BOOL) | mono | |
Multiplies all values with a scalar.
factor | The value by which each pixel is multiplied. If 0, the factor is taken as to set the maximum value of the resulting image to 1.0 |
mono | If true and factor is zero, the color planes are leveled to obtain a non color biased image |
- (u_short) numberOfPlanes |
Get the number of color planes.
Referenced by LynkeosStandardImageBuffer::imageBufferWithData:copy:freeWhenDone:numberOfPlanes:width:paddedWidth:height:, and LynkeosStandardImageBuffer::initWithNumberOfPlanes:width:height:.
- (u_short) width |
Get the image pixels width.
Referenced by MyChromaticAlignerView(Private)::applyOffsetsTo:, LynkeosFourierBuffer::fourierBufferWithNumberOfPlanes:width:height:withGoal:, LynkeosStandardImageBuffer::imageBufferWithData:copy:freeWhenDone:numberOfPlanes:width:paddedWidth:height:, LynkeosStandardImageBuffer::imageBufferWithNumberOfPlanes:width:height:, LynkeosStandardImageBuffer::initWithNumberOfPlanes:width:height:, and LynkeosFourierBuffer::initWithNumberOfPlanes:width:height:withGoal:.