Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ConsoleGraphics/RenderSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace cg
{
public:
inline RenderSurface(Vec2u size);
inline RenderSurface(size_t width, size_t height);
inline RenderSurface(int width, int height);

[[nodiscard]] inline auto getSize() const noexcept -> Vec2u;

Expand Down Expand Up @@ -44,9 +44,10 @@ namespace cg
RenderSurface(size.x, size.y)
{}

inline RenderSurface::RenderSurface(size_t width, size_t height) :
m_surfaceSize{ width, height },
m_surface{ width * height, makeCharInfo(' ', Color::Black, Color::Gray) }
inline RenderSurface::RenderSurface(int width, int height) :
m_surfaceSize{ static_cast<decltype(m_surfaceSize.x)>(width),
static_cast<decltype(m_surfaceSize.x)>(height) },
m_surface{ static_cast<size_t>(width * height), makeCharInfo(' ', Color::Black, Color::Gray) }
{}

inline auto RenderSurface::getSize() const noexcept -> Vec2u
Expand Down
10 changes: 5 additions & 5 deletions ConsoleGraphics/bitmap_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ class bitmap_image
case red_plane : return 0;
case green_plane : return 1;
case blue_plane : return 2;
default : return std::numeric_limits<unsigned int>::max();
default : return (std::numeric_limits<unsigned int>::max)();
}
}

Expand All @@ -1254,11 +1254,11 @@ class bitmap_image
case red_plane : return 2;
case green_plane : return 1;
case blue_plane : return 0;
default : return std::numeric_limits<unsigned int>::max();
default : return (std::numeric_limits<unsigned int>::max)();
}
}

default : return std::numeric_limits<unsigned int>::max();
default : return (std::numeric_limits<unsigned int>::max)();
}
}

Expand Down Expand Up @@ -2941,7 +2941,7 @@ inline rgb_t find_nearest_color(const rgb_t& c, const Iterator begin, const Iter
if (0 == std::distance(begin,end))
return c;

double min_d = std::numeric_limits<double>::max();
double min_d = (std::numeric_limits<double>::max)();
rgb_t result = *begin;

for (Iterator itr = begin; itr != end; ++itr)
Expand Down Expand Up @@ -2981,7 +2981,7 @@ inline double find_nearest_wave_length(const rgb_t& c, const double increment =
const double max_wave_length = 800.0; //800nm

double min_wave_length = 0.0;
double min_d = std::numeric_limits<double>::max();
double min_d = (std::numeric_limits<double>::max)();

for (double i = 0.0; i < max_wave_length; i += increment)
{
Expand Down