STE-Industries: utilities testing
GraphicSpace::Bitmap::PixelInformationType Struct Reference
Collaboration diagram for GraphicSpace::Bitmap::PixelInformationType:
Collaboration graph

Classes

struct  NeighbourType
 

Public Member Functions

IndexType NextPixelMaximum (RandomGenerator &CurrentGenerator, register const RepulsionType *RepulsionPointer) const noexcept
 
IndexType NextPixelRandom (RandomGenerator &CurrentGenerator, register const RepulsionType *RepulsionPointer) const noexcept
 
void 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]) noexcept
 
void SetLinks (const Bitmap &Image, unsigned int Row, unsigned int Colum) noexcept
 

Public Attributes

NeighbourType Neighbour [NUMBER_OF_NEIGHBOURS]
 
unsigned int NumberOfNeighbours
 

Detailed Description

The PixelInformationType struct contains the information related to a pixel.

Definition at line 325 of file Bitmap.h.

Member Function Documentation

◆ NextPixelMaximum()

Bitmap::IndexType GraphicSpace::Bitmap::PixelInformationType::NextPixelMaximum ( RandomGenerator CurrentGenerator,
register const RepulsionType RepulsionPointer 
) const
noexcept
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
CurrentGeneratorReference to the random number generator.
RepulsionPointerArray of the repulsion value for each pixel.
Exceptions
None.
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()

Bitmap::IndexType GraphicSpace::Bitmap::PixelInformationType::NextPixelRandom ( RandomGenerator CurrentGenerator,
register const RepulsionType RepulsionPointer 
) const
noexcept
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
CurrentGeneratorReference to the random number generator.
RepulsionPointerArray of the repulsion value for each pixel.
Exceptions
None.
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
ImageReference to the Bitmap containing the pixel.
ColorPointerPointer to the array that contains the the bitmap of the color.
PixelIndexIndex of the pixel.
OrthogonalAttractionArray of attraction factor for orthogonal neighbours.
DiagonalAttractionArray of attraction factor for diagonal neighbours.
Exceptions
None.
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.

Here is the call graph for this function:

◆ 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
ImageReference to the Bitmap containing the pixel.
RowRow index.
ColumnColumn index.
Exceptions
None.
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.

Member Data Documentation

◆ Neighbour

NeighbourType GraphicSpace::Bitmap::PixelInformationType::Neighbour[NUMBER_OF_NEIGHBOURS]

property Neigbour Array of information about neighbour pixels.

See also
NUMBER_OF_NEIGHBOURS

Definition at line 365 of file Bitmap.h.

Referenced by SetAttraction().

◆ NumberOfNeighbours

unsigned int GraphicSpace::Bitmap::PixelInformationType::NumberOfNeighbours

property NumberOfNeighbours Number of neigbour pixels.

Definition at line 359 of file Bitmap.h.

Referenced by SetAttraction().


The documentation for this struct was generated from the following files: