libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::Pixel Struct Referencefinal

Representation of a pixel on a display or a plane. More...

#include <Pixel.h>

Public Member Functions

std::string GetDisplayText () const
uint64_t GetId () const
 Returns a unique number based on the coordinates of the pixel.
bool operator!= (const Pixel &other) const
bool operator< (const Pixel &other) const
std::ostream & operator<< (std::ostream &stream) const
bool operator== (const Pixel &other) const
 Pixel ()=default
 The default constructor creates an uninitialized instance (for performance reasons).
 Pixel (uint32_t x, uint32_t y)

Public Attributes

uint32_t x
uint32_t y

Detailed Description

Representation of a pixel on a display or a plane.

Coordinates are non-negative, values are decimal.

Constructor & Destructor Documentation

◆ Pixel() [1/2]

osmscout::Pixel::Pixel ( )
inlinedefault

The default constructor creates an uninitialized instance (for performance reasons).

Referenced by operator!=(), operator<(), and operator==().

◆ Pixel() [2/2]

osmscout::Pixel::Pixel ( uint32_t x,
uint32_t y )
inline

References x, and y.

Member Function Documentation

◆ GetDisplayText()

std::string osmscout::Pixel::GetDisplayText ( ) const

References x, and y.

Referenced by operator<<().

◆ GetId()

uint64_t osmscout::Pixel::GetId ( ) const
inline

Returns a unique number based on the coordinates of the pixel.

The bits of the coordinates are projected onto one number by interleaving the bits of the coordinates. Coordinates close in 2D space are thus likely clos ein one dimensional space, too.

References osmscout::InterleaveNumbers(), x, and y.

◆ operator!=()

bool osmscout::Pixel::operator!= ( const Pixel & other) const
inline

References Pixel(), x, and y.

◆ operator<()

bool osmscout::Pixel::operator< ( const Pixel & other) const
inline

References Pixel(), x, and y.

◆ operator<<()

std::ostream & osmscout::Pixel::operator<< ( std::ostream & stream) const
inline

References GetDisplayText().

◆ operator==()

bool osmscout::Pixel::operator== ( const Pixel & other) const
inline

References Pixel(), x, and y.

Member Data Documentation

◆ x

◆ y


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