The PixelInformationType struct contains the information related to a pixel.
Definition at line 325 of file Bitmap.h.
◆ NextPixelMaximum()
- Description:
- Compute the index of next pixel to visit, choosing the one with the maximum probability.
If all neighbours have probability zero, the function returns UINT_FAST_32_MAX:
- Parameters
-
CurrentGenerator | Reference to the random number generator. |
RepulsionPointer | Array of the repulsion value for each pixel. |
- Exceptions
-
- Returns
- IndexType The index of next pixel.
- Note
- If RepulsionPointer is not a pointer to an array of at least BitmapSize elements, the behavior is undefined.
-
The returned value is the index of the pixel with the maximum probability among neighbours; if two or more pixels have the same probability, the random number generator is used to randomly choose one.
-
A bit of loop unrolling helps generating faster code.
- See also
- NUMBER_OF_NEIGHBOURS
-
UINT_FAST_32_MAX
Definition at line 74 of file Bitmap.cpp.
◆ NextPixelRandom()
- Description:
- Compute the index of next pixel to visit, choosing at random, accordingly with the probability distribution. If all neighbours have probability zero, the function returns UINT_FAST_32_MAX:
- Parameters
-
CurrentGenerator | Reference to the random number generator. |
RepulsionPointer | Array of the repulsion value for each pixel. |
- Exceptions
-
- Returns
- IndexType The index of next pixel.
- Note
- If RepulsionPointer is not a pointer to an array of at least BitmapSize elements, the behavior is undefined.
-
The returned value is randomly chosen among neighbours, considering the probability distribution of the pixels.
-
A bit of loop unrolling helps generating faster code.
- See also
- NUMBER_OF_NEIGHBOURS
-
UINT_MAX
-
UINT_FAST_32_MAX
Definition at line 217 of file Bitmap.cpp.
◆ SetAttraction()
void GraphicSpace::Bitmap::PixelInformationType::SetAttraction |
( |
register const Bitmap & |
Image, |
|
|
register const uint8_t * |
ColorPointer, |
|
|
register IndexType |
PixelIndex, |
|
|
register const uint_least32_t |
OrthogonalAttraction[UINT8_MAX+1], |
|
|
register const uint_least32_t |
DiagonalAttraction[UINT8_MAX+1] |
|
) |
| |
|
inlinenoexcept |
- Description:
- Set the attraction to the neighbouhhood of a pixel.
- Parameters
-
Image | Reference to the Bitmap containing the pixel. |
ColorPointer | Pointer to the array that contains the the bitmap of the color. |
PixelIndex | Index of the pixel. |
OrthogonalAttraction | Array of attraction factor for orthogonal neighbours. |
DiagonalAttraction | Array of attraction factor for diagonal neighbours. |
- Exceptions
-
- Returns
- none.
- Note
- The index in OrthogonalAttraction and DiagonalAttraction is the absolute difference of intensity and the corresponding value is the attraction factor, scaled by ATTRACTION_SCALE.
- See also
- UINT8_MAX
Definition at line 113 of file Bitmap.inl.
References GraphicSpace::Bitmap::PixelInformationType::NeighbourType::Index, GraphicSpace::Bitmap::IsOrthogonal(), Neighbour, and NumberOfNeighbours.
◆ SetLinks()
void GraphicSpace::Bitmap::PixelInformationType::SetLinks |
( |
const Bitmap & |
Image, |
|
|
unsigned int |
Row, |
|
|
unsigned int |
Column |
|
) |
| |
|
inlinenoexcept |
- Description:
- Set the links to the neighbourhood of a pixel.
- Parameters
-
Image | Reference to the Bitmap containing the pixel. |
Row | Row index. |
Column | Column index. |
- Exceptions
-
- Returns
- none.
- Note
- When computing the row and colum indices of a neighbour, the function exploits the modular properties of unsigned arithmetic, so subtracting 1 from a 0 index generates a large value, which is greater than the number of rows and columns.
Definition at line 64 of file Bitmap.inl.
◆ Neighbour
◆ NumberOfNeighbours
unsigned int GraphicSpace::Bitmap::PixelInformationType::NumberOfNeighbours |
The documentation for this struct was generated from the following files: