|  | 
| #define | ARGUS_PIXELS_X   8 | 
|  | The device pixel field size in x direction (long edge).  More... 
 | 
|  | 
| #define | ARGUS_PIXELS_Y   4 | 
|  | The device pixel field size in y direction (short edge).  More... 
 | 
|  | 
| #define | ARGUS_PIXELS   ((ARGUS_PIXELS_X)*(ARGUS_PIXELS_Y)) | 
|  | The total device pixel count.  More... 
 | 
|  | 
| #define | PIXEL_XY2CH(x,  y)   ((((y) << 3U) & 0x10U) | (((x) ^ 0x07U) << 1U) | ((y) & 0x01U)) | 
|  | Macro to determine the pixel ADC channel number from the x-z-indices.  More... 
 | 
|  | 
| #define | PIXEL_CH2X(c)   ((((c) >> 1U) ^ 0x07U) & 0x07U) | 
|  | Macro to determine the pixel x-index from the ADC channel number.  More... 
 | 
|  | 
| #define | PIXEL_CH2Y(c)   ((((c) >> 3U) & 0x02U) | ((c) & 0x01U)) | 
|  | Macro to determine the pixel y-index from the ADC channel number.  More... 
 | 
|  | 
| #define | PIXEL_XY2N(x,  y)   (((x) << 2U) | (y)) | 
|  | Macro to determine the n-index from the x-y-indices.  More... 
 | 
|  | 
| #define | PIXEL_N2X(n)   ((n) >> 2U) | 
|  | Macro to determine the pixel x-index from the n-index.  More... 
 | 
|  | 
| #define | PIXEL_N2Y(n)   ((n) & 0x03U) | 
|  | Macro to determine the pixel y-index from the n-index.  More... 
 | 
|  | 
| #define | PIXEL_N2CH(n)   ((((n) << 3U) & 0x10U) | ((((n) >> 1U) ^ 0x0EU) & 0x0EU) | ((n) & 0x01U)) | 
|  | Macro to determine the pixel n-index from the ADC channel number.  More... 
 | 
|  | 
| #define | PIXEL_CH2N(c)   (((((c) << 1U) ^ 0x1CU) & 0x1CU) | (((c) >> 3U) & 0x02U) | ((c) & 0x01U)) | 
|  | Macro to determine the pixel.  More... 
 | 
|  | 
| #define | PIXELN_MASK(n)   (0x01U << (n)) | 
|  | Macro to create a pixel mask given by the pixels n-index.  More... 
 | 
|  | 
| #define | PIXELN_ISENABLED(msk,  n)   (((msk) >> (n)) & 0x01U) | 
|  | Macro to determine if a pixel given by the n-index is enabled in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELN_ENABLE(msk,  n)   ((msk) |= (PIXELN_MASK(n))) | 
|  | Macro to enable a pixel given by the n-index in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELN_DISABLE(msk,  n)   ((msk) &= (~PIXELN_MASK(n))) | 
|  | Macro disable a pixel given by the n-index in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELCH_MASK(c)   (0x01U << (PIXEL_CH2N(c))) | 
|  | Macro to create a pixel mask given by the pixels ADC channel number.  More... 
 | 
|  | 
| #define | PIXELCH_ISENABLED(msk,  c)   (PIXELN_ISENABLED(msk, PIXEL_CH2N(c))) | 
|  | Macro to determine if an ADC pixel channel is enabled from a pixel mask.  More... 
 | 
|  | 
| #define | PIXELCH_ENABLE(msk,  c)   (PIXELN_ENABLE(msk, PIXEL_CH2N(c))) | 
|  | Macro to enable an ADC pixel channel in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELCH_DISABLE(msk,  c)   (PIXELN_DISABLE(msk, PIXEL_CH2N(c))) | 
|  | Macro to disable an ADC pixel channel in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELXY_MASK(x,  y)   (0x01U << (PIXEL_XY2N(x, y))) | 
|  | Macro to create a pixel mask given by the pixel x-y-indices.  More... 
 | 
|  | 
| #define | PIXELXY_ISENABLED(msk,  x,  y)   (PIXELN_ISENABLED(msk, PIXEL_XY2N(x, y))) | 
|  | Macro to determine if a pixel given by the x-y-indices is enabled in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELXY_ENABLE(msk,  x,  y)   (PIXELN_ENABLE(msk, PIXEL_XY2N(x, y))) | 
|  | Macro to enable a pixel given by the x-y-indices in a pixel mask.  More... 
 | 
|  | 
| #define | PIXELXY_DISABLE(msk,  x,  y)   (PIXELN_DISABLE(msk, PIXEL_XY2N(x, y))) | 
|  | Macro disable a pixel given by the x-y-indices in a pixel mask.  More... 
 | 
|  | 
| #define | CHANNELN_ISENABLED(msk,  ch)   (((msk) >> ((ch) - 32U)) & 0x01U) | 
|  | Macro to determine if an ADC channel is enabled in a channel mask.  More... 
 | 
|  | 
| #define | CHANNELN_ENABLE(msk,  ch)   ((msk) |= (0x01U << ((ch) - 32U))) | 
|  | Macro to determine if an ADC channel is enabled in a channel mask.  More... 
 | 
|  | 
| #define | CHANNELN_DISABLE(msk,  ch)   ((msk) &= (~(0x01U << ((ch) - 32U)))) | 
|  | Macro to determine if an ADC channel is disabled in a channel mask.  More... 
 | 
|  | 
| #define | PIXEL_COUNT(pxmsk)   popcount(pxmsk) | 
|  | Macro to determine the number of enabled pixel/channels in a mask via a popcount algorithm.  More... 
 | 
|  | 
| #define | CHANNEL_COUNT(pxmsk,  chmsk)   (popcount(pxmsk) + popcount(chmsk)) | 
|  | Macro to determine the number of enabled channels via a popcount algorithm.  More... 
 | 
|  | 
|  | 
| static uint32_t | ChannelToPixelMask (uint32_t msk) | 
|  | Converts a raw ADC channel mask to a x-y-sorted pixel mask.  More... 
 | 
|  | 
| static uint32_t | PixelToChannelMask (uint32_t msk) | 
|  | Converts a x-y-sorted pixel mask to a raw ADC channel mask.  More... 
 | 
|  | 
| 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.  More... 
 | 
|  | 
| 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.  More... 
 | 
|  | 
| 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.  More... 
 | 
|  | 
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 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.