Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use UINT8_MAX
  • Loading branch information
asukiaaa committed Jul 29, 2023
commit 2bb63f0ad9e43ff835237aa8ad7c9d89ad73eec7
4 changes: 2 additions & 2 deletions examples/viewer/opengl/k4adepthpixelcolorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class K4ADepthPixelColorizer
const DepthPixel &min,
const DepthPixel &max)
{
constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;

// Default to opaque black.
//
Expand Down Expand Up @@ -90,7 +90,7 @@ class K4ADepthPixelColorizer
//
DepthPixel pixelValue = std::min(value, max);

constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;
const auto normalizedValue = static_cast<uint8_t>((pixelValue - min) * (double(PixelMax) / (max - min)));

// All color channels are set the same (image is greyscale)
Expand Down
4 changes: 2 additions & 2 deletions tools/k4aviewer/k4adepthpixelcolorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class K4ADepthPixelColorizer
const DepthPixel &min,
const DepthPixel &max)
{
constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;

// Default to opaque black.
//
Expand Down Expand Up @@ -90,7 +90,7 @@ class K4ADepthPixelColorizer
//
DepthPixel pixelValue = std::min(value, max);

constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;
const auto normalizedValue = static_cast<uint8_t>((pixelValue - min) * (double(PixelMax) / (max - min)));

// All color channels are set the same (image is greyscale)
Expand Down