Classes | Public Member Functions | Private Attributes | Friends | List of all members
beluga::Bresenham2i::Line< Vector2, Integer > Class Template Reference

Bresenham's 2D line drawing as a range. More...

#include <bresenham.hpp>

Inheritance diagram for beluga::Bresenham2i::Line< Vector2, Integer >:
Inheritance graph
[legend]

Classes

class  iterator
 Bresenham's 2D line drawing iterator, one cell at a time. More...
 

Public Member Functions

auto begin () const
 Returns an iterator pointing to the first point in the line. More...
 
auto end () const
 Returns a sentinel as past-of-end iterator. More...
 
 Line ()=default
 Constructs point line. More...
 
 Line (Vector2 p0, Vector2 p1, Variant variant)
 Constructs a Bresenham's 2D line drawing. More...
 

Private Attributes

Vector2 p0_ {}
 
Vector2 p1_ {}
 
Variant variant_ {}
 

Friends

class iterator
 

Detailed Description

template<class Vector2, typename Integer = typename Vector2::Scalar>
class beluga::Bresenham2i::Line< Vector2, Integer >

Bresenham's 2D line drawing as a range.

Template Parameters
Vector22D vector type. Must be default constructible, copy constructible, and implement Vector2d::x() and Vector2::y() methods returning both lvalues (for mutation) and rvalues.
IntegerInteger scalar type.

Definition at line 51 of file bresenham.hpp.

Constructor & Destructor Documentation

◆ Line() [1/2]

template<class Vector2 , typename Integer = typename Vector2::Scalar>
beluga::Bresenham2i::Line< Vector2, Integer >::Line ( )
default

Constructs point line.

◆ Line() [2/2]

template<class Vector2 , typename Integer = typename Vector2::Scalar>
beluga::Bresenham2i::Line< Vector2, Integer >::Line ( Vector2  p0,
Vector2  p1,
Variant  variant 
)
inlineexplicit

Constructs a Bresenham's 2D line drawing.

Parameters
p0Line start point in 2D space.
p1Line end point in 2D space.
variantBresenham's algorithm variant to be used.

Definition at line 215 of file bresenham.hpp.

Member Function Documentation

◆ begin()

template<class Vector2 , typename Integer = typename Vector2::Scalar>
auto beluga::Bresenham2i::Line< Vector2, Integer >::begin ( ) const
inline

Returns an iterator pointing to the first point in the line.

Definition at line 219 of file bresenham.hpp.

◆ end()

template<class Vector2 , typename Integer = typename Vector2::Scalar>
auto beluga::Bresenham2i::Line< Vector2, Integer >::end ( ) const
inline

Returns a sentinel as past-of-end iterator.

Definition at line 222 of file bresenham.hpp.

Friends And Related Function Documentation

◆ iterator

template<class Vector2 , typename Integer = typename Vector2::Scalar>
friend class iterator
friend

Definition at line 225 of file bresenham.hpp.

Member Data Documentation

◆ p0_

template<class Vector2 , typename Integer = typename Vector2::Scalar>
Vector2 beluga::Bresenham2i::Line< Vector2, Integer >::p0_ {}
private

Definition at line 227 of file bresenham.hpp.

◆ p1_

template<class Vector2 , typename Integer = typename Vector2::Scalar>
Vector2 beluga::Bresenham2i::Line< Vector2, Integer >::p1_ {}
private

Definition at line 228 of file bresenham.hpp.

◆ variant_

template<class Vector2 , typename Integer = typename Vector2::Scalar>
Variant beluga::Bresenham2i::Line< Vector2, Integer >::variant_ {}
private

Definition at line 229 of file bresenham.hpp.


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


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54