NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::imageProcessing::Pixel< dtype > Class Template Reference

Holds the information for a single pixel. More...

#include <Pixel.hpp>

Public Member Functions

constexpr Pixel ()=default
 
constexpr Pixel (uint32 inRow, uint32 inCol, dtype inIntensity) noexcept
 
constexpr bool operator!= (const Pixel< dtype > &rhs) const noexcept
 
bool operator< (const Pixel< dtype > &rhs) const noexcept
 
constexpr bool operator== (const Pixel< dtype > &rhs) const noexcept
 
void print () const
 
std::string str () const
 

Data Fields

int32 clusterId { -1 }
 
uint32 col { 0 }
 
dtype intensity { 0 }
 
uint32 row { 0 }
 

Friends

std::ostream & operator<< (std::ostream &inStream, const Pixel< dtype > &inPixel)
 

Detailed Description

template<typename dtype>
class nc::imageProcessing::Pixel< dtype >

Holds the information for a single pixel.

Constructor & Destructor Documentation

◆ Pixel() [1/2]

template<typename dtype >
constexpr nc::imageProcessing::Pixel< dtype >::Pixel ( )
constexprdefault

defualt constructor needed by containers

◆ Pixel() [2/2]

template<typename dtype >
constexpr nc::imageProcessing::Pixel< dtype >::Pixel ( uint32  inRow,
uint32  inCol,
dtype  inIntensity 
)
inlineconstexprnoexcept

constructor

Parameters
inRowpixel row
inColpixel column
inIntensitypixel intensity

Member Function Documentation

◆ operator!=()

template<typename dtype >
constexpr bool nc::imageProcessing::Pixel< dtype >::operator!= ( const Pixel< dtype > &  rhs) const
inlineconstexprnoexcept

not equality operator

Parameters
rhs
Returns
bool

◆ operator<()

template<typename dtype >
bool nc::imageProcessing::Pixel< dtype >::operator< ( const Pixel< dtype > &  rhs) const
inlinenoexcept

less than operator for std::sort algorithm and std::set<>; NOTE: std::sort sorts in ascending order. Since I want to sort the centroids in descensing order, I am purposefully defining this operator backwards!

Parameters
rhs
Returns
bool

◆ operator==()

template<typename dtype >
constexpr bool nc::imageProcessing::Pixel< dtype >::operator== ( const Pixel< dtype > &  rhs) const
inlineconstexprnoexcept

equality operator

Parameters
rhs
Returns
bool

◆ print()

template<typename dtype >
void nc::imageProcessing::Pixel< dtype >::print ( ) const
inline

Method Description: prints the Pixel object to the console

◆ str()

template<typename dtype >
std::string nc::imageProcessing::Pixel< dtype >::str ( ) const
inline

returns the pixel information as a string

Returns
std::string

Friends And Related Function Documentation

◆ operator<<

template<typename dtype >
std::ostream & operator<< ( std::ostream &  inStream,
const Pixel< dtype > &  inPixel 
)
friend

osstream operator

Parameters
inStream
inPixel
Returns
std::ostream

Field Documentation

◆ clusterId

template<typename dtype >
int32 nc::imageProcessing::Pixel< dtype >::clusterId { -1 }
mutable

◆ col

template<typename dtype >
uint32 nc::imageProcessing::Pixel< dtype >::col { 0 }

◆ intensity

template<typename dtype >
dtype nc::imageProcessing::Pixel< dtype >::intensity { 0 }

◆ row

template<typename dtype >
uint32 nc::imageProcessing::Pixel< dtype >::row { 0 }

The documentation for this class was generated from the following file: