Skip to content

Commit

Permalink
C++ int format dance
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Oct 16, 2024
1 parent 9d0529d commit 607570c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/snippets/all/archetypes/image_formats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ int main() {

// Simple gradient image
std::vector<uint8_t> image(256 * 256 * 3);
for (int y = 0; y < 256; ++y) {
for (int x = 0; x < 256; ++x) {
for (size_t y = 0; y < 256; ++y) {
for (size_t x = 0; x < 256; ++x) {
image[(y * 256 + x) * 3 + 0] = static_cast<uint8_t>(x);
image[(y * 256 + x) * 3 + 1] = static_cast<uint8_t>(std::min(255, x + y));
image[(y * 256 + x) * 3 + 1] = static_cast<uint8_t>(std::min<size_t>(255, x + y));
image[(y * 256 + x) * 3 + 2] = static_cast<uint8_t>(y);
}
}
Expand Down
6 changes: 3 additions & 3 deletions rerun_cpp/src/rerun/archetypes/image.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 607570c

Please sign in to comment.