|
| #define | ARGUS_PIXELS_X 8 |
| | The device pixel field size in x direction (long edge).
|
| |
| #define | ARGUS_PIXELS_Y 4 |
| | The device pixel field size in y direction (short edge).
|
| |
| #define | ARGUS_PIXELS ((ARGUS_PIXELS_X)*(ARGUS_PIXELS_Y)) |
| | The total device pixel count.
|
| |
| #define | PIXEL_XY2CH(x, y) |
| | Macro to determine the pixel ADC channel number from the x-z-indices.
|
| |
| #define | PIXEL_CH2X(c) |
| | Macro to determine the pixel x-index from the ADC channel number.
|
| |
| #define | PIXEL_CH2Y(c) |
| | Macro to determine the pixel y-index from the ADC channel number.
|
| |
| #define | PIXEL_XY2N(x, y) |
| | Macro to determine the n-index from the x-y-indices.
|
| |
| #define | PIXEL_N2X(n) |
| | Macro to determine the pixel x-index from the n-index.
|
| |
| #define | PIXEL_N2Y(n) |
| | Macro to determine the pixel y-index from the n-index.
|
| |
| #define | PIXEL_N2CH(n) |
| | Macro to determine the pixel n-index from the ADC channel number.
|
| |
| #define | PIXEL_CH2N(c) |
| | Macro to determine the pixel.
|
| |
| #define | PIXELN_MASK(n) |
| | Macro to create a pixel mask given by the pixels n-index.
|
| |
| #define | PIXELN_ISENABLED(msk, n) |
| | Macro to determine if a pixel given by the n-index is enabled in a pixel mask.
|
| |
| #define | PIXELN_ENABLE(msk, n) |
| | Macro to enable a pixel given by the n-index in a pixel mask.
|
| |
| #define | PIXELN_DISABLE(msk, n) |
| | Macro disable a pixel given by the n-index in a pixel mask.
|
| |
| #define | PIXELCH_MASK(c) |
| | Macro to create a pixel mask given by the pixels ADC channel number.
|
| |
| #define | PIXELCH_ISENABLED(msk, c) |
| | Macro to determine if an ADC pixel channel is enabled from a pixel mask.
|
| |
| #define | PIXELCH_ENABLE(msk, c) |
| | Macro to enable an ADC pixel channel in a pixel mask.
|
| |
| #define | PIXELCH_DISABLE(msk, c) |
| | Macro to disable an ADC pixel channel in a pixel mask.
|
| |
| #define | PIXELXY_MASK(x, y) |
| | Macro to create a pixel mask given by the pixel x-y-indices.
|
| |
| #define | PIXELXY_ISENABLED(msk, x, y) |
| | Macro to determine if a pixel given by the x-y-indices is enabled in a pixel mask.
|
| |
| #define | PIXELXY_ENABLE(msk, x, y) |
| | Macro to enable a pixel given by the x-y-indices in a pixel mask.
|
| |
| #define | PIXELXY_DISABLE(msk, x, y) |
| | Macro disable a pixel given by the x-y-indices in a pixel mask.
|
| |
| #define | CHANNELN_ISENABLED(msk, ch) |
| | Macro to determine if an ADC channel is enabled in a channel mask.
|
| |
| #define | CHANNELN_ENABLE(msk, ch) |
| | Macro to determine if an ADC channel is enabled in a channel mask.
|
| |
| #define | CHANNELN_DISABLE(msk, ch) |
| | Macro to determine if an ADC channel is disabled in a channel mask.
|
| |
| #define | PIXEL_COUNT(pxmsk) |
| | Macro to determine the number of enabled pixel/channels in a mask via a popcount algorithm.
|
| |
| #define | CHANNEL_COUNT(pxmsk, chmsk) |
| | Macro to determine the number of enabled channels via a popcount algorithm.
|
| |
|
| static uint32_t | ChannelToPixelMask (uint32_t msk) |
| | Converts a raw ADC channel mask to a x-y-sorted pixel mask.
|
| |
| static uint32_t | PixelToChannelMask (uint32_t msk) |
| | Converts a x-y-sorted pixel mask to a raw ADC channel mask.
|
| |
| static uint32_t | ShiftSelectedPixels (const uint32_t pixel_mask, const int8_t dx, const int8_t dy, const uint8_t center_y) |
| | Shifts a pixel mask by a given offset.
|
| |
| static uint32_t | FillPixelMask (uint32_t pixel_mask, const uint8_t pixel_count, const uint8_t center_x, const uint8_t center_y) |
| | Fills a pixel mask to a specified number of pixels around a center pixel.
|
| |
| static uint32_t | GetAdjacentPixelsMask (const uint_fast8_t x, const uint_fast8_t y) |
| | Fills a pixel mask with the direct neighboring pixels around a pixel.
|
| |
Pixel Channel Mapping.
The ADC Channels of each pixel or auxiliary channel on the device are numbered in a way that is convenient on the chip architecture. The macros in this module are defined in order to map between the chip internal channel number (ch) to the two-dimensional x-y-indices or one-dimensional n-index representation.
| static uint32_t FillPixelMask |
( |
uint32_t | pixel_mask, |
|
|
const uint8_t | pixel_count, |
|
|
const uint8_t | center_x, |
|
|
const uint8_t | center_y ) |
|
inlinestatic |
Fills a pixel mask to a specified number of pixels around a center pixel.
The pixel mask is iteratively filled with the nearest pixel to a specified center pixel until a specified number of pixels is achieved. The distance between two pixel is determined via a quadratic metric, i.e. dx^2 + dy^2. Pixels towards the lower x indices are preferred.
Note that the distance of only calculated approximately, e.g. the y distance of pixels is considered to be 2 instead of cos(60)*2.
Nothing is done if the number of pixels already exceeds the specified /p pixel_count parameter.
- See also
- Please also refer to the function Argus_GetCalibrationGoldenPixel to obtain the current Golden Pixel location.
- Parameters
-
| pixel_mask | The x-y-sorted pixel mask to be filled with pixels. |
| pixel_count | The final number of pixels in the pixel mask. |
| center_x | The center pixel x-index. |
| center_y | The center pixel y-index. |
- Returns
- The filled pixel mask with at least /p pixel_count pixels selected.
| static uint32_t ShiftSelectedPixels |
( |
const uint32_t | pixel_mask, |
|
|
const int8_t | dx, |
|
|
const int8_t | dy, |
|
|
const uint8_t | center_y ) |
|
inlinestatic |
Shifts a pixel mask by a given offset.
This moves the selected pixel pattern by a specified number of pixels in x and y direction. If the shift in y direction is odd (e.g +1), the pattern will be shifted by +0.5 or -0.5 in x direction due to the hexagonal shape of the pixel field. Thus, a center pixel (usually the Golden Pixel) is determined that is used to determine if the pattern is shifted by +0.5 or -0.5 pixels in x direction. The center pixel is then always shifted without changing the x index and the surrounding pixels are adopting its x index accordingly.
Example: Consider the flower pattern, i.e. the Golden Pixel (e.g. 5/2) is selected and all is direct neighbors (i.e. 5/1, 6/1, 6/2, 6/3, 5/3, 4/2). If the pattern is shifted by -1 in y direction, the new Golden Pixel would be 5/1. Now all surrounding pixels are selected, namely 4/0, 4/1, 4/2, 5/0, 5/2, 6/1). This yields again the flower around the Golden Pixel.
Thus, the pixels can not all be shifted by the same dx/dy values due to the hexagonal shape of the pixel field, e.g. the upper right neighbor of 5/2 is 5/1 but the upper right neighbor of 5/1 is NOT 5/0 but 4/0! This happens only if the shift in y direction is an odd number. The algorithm to determine new indices is as follows:
- If the shift in y direction is even (e.g. +2, -2), no compensation of the hexagonal shape is needed; skip compensation, simply add/subtract indices.
- If the center pixel y index is even, pixels that will have even y index after the shift will be additionally shifted by -1 in x direction.
- If the center pixel y index is odd, pixel that will have odd y index after the shift will be additionally shifted by +1 in x direction.
- See also
- Please also refer to the function Argus_GetCalibrationGoldenPixel to obtain the current Golden Pixel location.
- Parameters
-
| pixel_mask | The x-y-sorted pixel mask to be shifted. |
| dx | The number of pixel to shift in x direction. |
| dy | The number of pixel to shift in y direction. |
| center_y | The center y index of the pattern that is shifted. |
- Returns
- The shifted pixel mask.