Skip to content

Commit 1d61cea

Browse files
iche033mergify[bot]
authored andcommitted
lint and build fix
Signed-off-by: Ian Chen <[email protected]> (cherry picked from commit b71e351)
1 parent ed4c70c commit 1d61cea

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

graphics/src/Image.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#endif
2020
#include <FreeImage.h>
2121

22+
#include <cstdint>
2223
#include <cstring>
2324
#include <string>
2425

@@ -539,7 +540,7 @@ math::Color Image::Pixel(unsigned int _x, unsigned int _y) const
539540
if (_x >= this->Width() || _y >= this->Height())
540541
{
541542
gzerr << "Image: Coordinates out of range["
542-
<< _x << " " << _y << "] \n";
543+
<< _x << ", " << _y << "] \n";
543544
return clr;
544545
}
545546

@@ -551,7 +552,7 @@ math::Color Image::Pixel(unsigned int _x, unsigned int _y) const
551552
if (FreeImage_GetPixelColor(this->dataPtr->bitmap, _x, _y, &firgb) == FALSE)
552553
{
553554
gzerr << "Failed to get pixel value at ["
554-
<< _x << " " << _y << "] \n";
555+
<< _x << ", " << _y << "] \n";
555556
return clr;
556557
}
557558
clr.Set(firgb.rgbRed / 255.0f, firgb.rgbGreen / 255.0f,
@@ -563,7 +564,7 @@ math::Color Image::Pixel(unsigned int _x, unsigned int _y) const
563564
this->dataPtr->bitmap, _x, _y, clr) == FALSE)
564565
{
565566
gzerr << "Failed to get pixel value at ["
566-
<< _x << " " << _y << "] \n";
567+
<< _x << ", " << _y << "] \n";
567568
return clr;
568569
}
569570
}
@@ -628,7 +629,7 @@ BOOL Image::Implementation::PixelIndex(
628629
if (!_dib)
629630
return FALSE;
630631

631-
if (_x >= this->Width() || _y >= this->Height())
632+
if (_x >= FreeImage_GetWidth(_dib) || _y >= FreeImage_GetHeight(_dib))
632633
return FALSE;
633634

634635
// 8 bit images

graphics/src/Image_TEST.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*
1616
*/
1717
#include <fstream>
18+
#include <string>
1819

1920
#include <gtest/gtest.h>
2021

0 commit comments

Comments
 (0)