Geometrize  1.0
C++ library for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
scanline.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <vector>
5 
6 namespace geometrize
7 {
8 
13 class Scanline
14 {
15 public:
19  Scanline() = default;
20 
27  Scanline(std::int32_t y, std::int32_t x1, std::int32_t x2);
28 
29  ~Scanline() = default;
30  Scanline& operator=(const Scanline&) = default;
31  Scanline(const Scanline&) = default;
32 
33  std::int32_t y;
34  std::int32_t x1;
35  std::int32_t x2;
36 };
37 
38 bool operator==(const geometrize::Scanline& lhs, const geometrize::Scanline& rhs);
39 bool operator!=(const geometrize::Scanline& lhs, const geometrize::Scanline& rhs);
40 
48 std::vector<geometrize::Scanline> trimScanlines(const std::vector<geometrize::Scanline>& scanlines, std::uint32_t w, std::uint32_t h);
49 
50 }
Scanline()=default
Scanline Creates a new scanline (members are uninitialized)
The Scanline class represents a scanline, a row of pixels running across a bitmap.
Definition: scanline.h:13
std::int32_t x2
The rightmost x-coordinate of the scanline.
Definition: scanline.h:35
bool operator==(const geometrize::rgba &lhs, const geometrize::rgba &rhs)
Definition: rgba.cpp:6
std::vector< geometrize::Scanline > trimScanlines(const std::vector< geometrize::Scanline > &scanlines, const std::uint32_t w, const std::uint32_t h)
trimScanlines Crops the scanning width of an array of scanlines so they do not scan outside of the gi...
Definition: scanline.cpp:23
bool operator!=(const geometrize::rgba &lhs, const geometrize::rgba &rhs)
Definition: rgba.cpp:11
std::int32_t y
The y-coordinate of the scanline.
Definition: scanline.h:33
Scanline & operator=(const Scanline &)=default
std::int32_t x1
The leftmost x-coordinate of the scanline.
Definition: scanline.h:34