Switch to Lut1d

This commit is contained in:
Ian Gulliver
2017-08-12 14:16:06 -07:00
parent 604d72594d
commit 30fba94b1b
4 changed files with 96 additions and 23 deletions

View File

@@ -37,14 +37,14 @@ template <int32_t X, int32_t Y, int32_t C>
void Image<X, Y, C>::DrawXLine(const Coord<2>& coord, const Color<C>& color, int32_t length) {
auto& row = this->at(coord.at(1));
for (int32_t x = coord.at(0); x < std::min(X, coord.at(0) + length); ++x) {
for (int32_t x = coord.at(0); x < std::min(X - 1, coord.at(0) + length); ++x) {
row.at(x) = color;
}
}
template <int32_t X, int32_t Y, int32_t C>
void Image<X, Y, C>::DrawYLine(const Coord<2>& coord, const Color<C>& color, int32_t length) {
for (int32_t y = coord.at(1); y <= std::min(Y, coord.at(1) + length); ++y) {
for (int32_t y = coord.at(1); y <= std::min(Y - 1, coord.at(1) + length); ++y) {
SetPixel({{{{coord.at(0), y}}}}, color);
}
}