|
Lynkeos
|
Class used for floating precision images. More...
#import <LynkeosStandardImageBuffer.h>


Instance Methods | |
| (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 | |
| (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 | _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. | |
Protected Attributes | |
| 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. | |
Related Functions | |
(Note that these are not member functions.) | |
| #define | stdColorValue(buf, prec, x, y, c) |
| Access to one color component of a pixel. More... | |
Class used for floating precision images.
For optimization purposes, the methods for accessing pixels value are implemented as macros
| - (void) add: | (LynkeosStandardImageBuffer*) | image | |
| withOffsets: | (const NSPoint*) | offsets | |
| withExpansion: | (u_short) | expand | |
Shifts another image and add it to this one.
| image | The other image to add |
| offsets | An array of offsets (one per plane) expressed in the coordinate system of "image". |
| expand | The pixel expansion of the resulting image |
Only images of the same size can be added (so far). The offsets array is required to have as many elements as image has planes.
References _data, _h, _nPlanes, _padw, _planes, _w, imageBufferWithData:copy:freeWhenDone:numberOfPlanes:width:paddedWidth:height:, and resetMinMax.
Referenced by MyChromaticAlignerView(Private)::applyOffsetsTo:.
| - (void *const *const) colorPlanes |
Access to the color planes.
References _planes.
Referenced by MyChromaticAlignerView::automaticOffsets:.
| - (void) divideBy: | (LynkeosStandardImageBuffer*) | denom | |
| result: | (LynkeosStandardImageBuffer*) | result | |
Division.
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.
| denom | Denominator of the division |
| result | where the result is stored, can be one of the terms |
References _div_one_image_line, _h, _nPlanes, _process_image, _process_image_selector, _w, resetMinMax, and ArithmeticOperand_t::term.
| - (void) getMinLevel: | (double*) | vmin | |
| maxLevel: | (double*) | vmax | |
Get the minimum and maximum pixels value.
| [out] | vmin | Minimum pixel value |
| [out] | vmax | Maximum pixel value |
References _h, _max, _min, _nPlanes, _w, and colorValue.
Referenced by filterImageForAnalysis(), and getMinLevel:maxLevel:forPlane:.
| - (void) getMinLevel: | (double*) | vmin | |
| maxLevel: | (double*) | vmax | |
| forPlane: | (u_short) | plane | |
Get the minimum and maximum pixels value for a given plane.
| [out] | vmin | Minimum pixel value |
| [out] | vmax | Maximum pixel value |
| plane | he plane for which min and max will be returned |
References _max, _min, and getMinLevel:maxLevel:.
| + (LynkeosStandardImageBuffer *) imageBufferWithData: | (void*) | data | |
| copy: | (BOOL) | copy | |
| freeWhenDone: | (BOOL) | freeWhenDone | |
| numberOfPlanes: | (u_short) | nPlanes | |
| width: | (u_short) | w | |
| paddedWidth: | (u_short) | padw | |
| height: | (u_short) | h | |
Convenience initialized image buffer creator.
| data | Image data |
| copy | Wether to copy the data |
| freeWhenDone | Whether to free the planes on dealloc (relevant only when copy is NO) |
| nPlanes | Number of color planes for this image |
| w | Image pixels width |
| padw | Padded width of the data |
| h | Image pixels height |
References <LynkeosImageBuffer>::height, <LynkeosImageBuffer>::numberOfPlanes, and <LynkeosImageBuffer>::width.
Referenced by add:withOffsets:withExpansion:, and MyChromaticAlignerView::automaticOffsets:.
| + (LynkeosStandardImageBuffer *) imageBufferWithNumberOfPlanes: | (u_short) | nPlanes | |
| width: | (u_short) | w | |
| height: | (u_short) | h | |
Convenience empty image buffer creator.
| nPlanes | Number of color planes for this image |
| w | Image pixels width |
| h | Image pixels height |
References <LynkeosImageBuffer>::height, and <LynkeosImageBuffer>::width.
Referenced by MyChromaticAlignerView(Private)::applyOffsetsTo:.
| - (id) initWithData: | (void*) | data | |
| copy: | (BOOL) | copy | |
| freeWhenDone: | (BOOL) | freeWhenDone | |
| numberOfPlanes: | (u_short) | nPlanes | |
| width: | (u_short) | w | |
| paddedWidth: | (u_short) | padw | |
| height: | (u_short) | h | |
Initialize a new buffer with preexisting data.
| data | Image data |
| copy | Whether to copy the data |
| freeWhenDone | Whether to free the planes on dealloc (relevant only when copy is NO) |
| nPlanes | Number of color planes for this image |
| w | Image pixels width |
| padw | Padded width of the data |
| h | Image pixels height |
References _data, _freeWhenDone, _h, _mul_one_image_line, _nPlanes, _padw, _planes, _scale_one_image_line, and _w.
| - (id) initWithNumberOfPlanes: | (u_short) | nPlanes | |
| width: | (u_short) | w | |
| height: | (u_short) | h | |
Allocates a new empty buffer.
| nPlanes | Number of color planes for this image |
| w | Image pixels width |
| h | Image pixels height |
References <LynkeosImageBuffer>::height, <LynkeosImageBuffer>::numberOfPlanes, and <LynkeosImageBuffer>::width.
| - (void) multiplyWith: | (LynkeosStandardImageBuffer*) | term | |
| result: | (LynkeosStandardImageBuffer*) | result | |
Multiplication.
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.
| term | other term |
| result | where the result is stored, can be one of the terms. |
References _h, _mul_one_image_line, _nPlanes, _process_image, _process_image_selector, _w, resetMinMax, and ArithmeticOperand_t::term.
Referenced by filterImageForAnalysis().
| - (void) multiplyWithScalar: | (double) | scalar |
Multiplication with a scalar.
| scalar | The scalar by wich all pixels are multiplied |
References _process_image, _process_image_selector, _scale_one_image_line, ArithmeticOperand_t::dscalar, and resetMinMax.
| - (void) setOperatorsStrategy: | (ImageOperatorsStrategy_t) | strategy |
Change the strategy of arithmetic operators.
The images are always created with the standard strategy (no parallelization).
| strategy | The new strategy |
References _process_image, _process_image_selector, ParallelizedStrategy, and StandardStrategy.
| - (void) substract: | (LynkeosStandardImageBuffer*) | image |
Substract an image from another.
| image | The other image to substract |
References _h, _nPlanes, _w, and colorValue.
| - (void) substractBias: | (double) | bias | |
| andScale: | (double) | scale | |
Substract and multiply with scalars.
| bias | The bias to substract |
| scale | The scalar by which all pixels are multiplied |
References _bias_scale_one_image_line, _process_image, _process_image_selector, ArithmeticOperand_t::dscalar, and resetMinMax.
Referenced by filterImageForAnalysis().
|
related |
Access to one color component of a pixel.
This method is implemented as a macro for speed purpose
| buf | An instance of LynkeosStandardImageBuffer |
| prec | The precision in which we are working |
| x | Pixel's x coordinate |
| y | Pixel's y coordinate |
| c | Color plane |
1.8.4