Geometrize 1.0
C++ library for geometrizing images into geometric primitives
scanline.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
6namespace geometrize
7{
8
14{
15public:
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
38bool operator==(const geometrize::Scanline& lhs, const geometrize::Scanline& rhs);
39bool operator!=(const geometrize::Scanline& lhs, const geometrize::Scanline& rhs);
40
50std::vector<geometrize::Scanline> trimScanlines(const std::vector<geometrize::Scanline>& scanlines, std::int32_t minX, std::int32_t minY, std::int32_t maxX, std::int32_t maxY);
51
52}
The Scanline class represents a scanline, a row of pixels running across a bitmap.
Definition: scanline.h:14
std::int32_t x2
The rightmost x-coordinate of the scanline.
Definition: scanline.h:35
std::int32_t y
The y-coordinate of the scanline.
Definition: scanline.h:33
Scanline()=default
Scanline Creates a new scanline (members are uninitialized)
Scanline & operator=(const Scanline &)=default
Scanline(const Scanline &)=default
std::int32_t x1
The leftmost x-coordinate of the scanline.
Definition: scanline.h:34
Definition: bitmap.cpp:8
std::vector< geometrize::Scanline > trimScanlines(const std::vector< geometrize::Scanline > &scanlines, std::int32_t minX, std::int32_t minY, std::int32_t maxX, std::int32_t maxY)
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:6
bool operator!=(const geometrize::rgba &lhs, const geometrize::rgba &rhs)
Definition: rgba.cpp:11