projects
/
cuda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uint*_tをuint_fast*_tに変更
[cuda.git]
/
libutils
/
ImageIO.cpp
diff --git
a/libutils/ImageIO.cpp
b/libutils/ImageIO.cpp
index
309e8ea
..
de43f35
100644
(file)
--- a/
libutils/ImageIO.cpp
+++ b/
libutils/ImageIO.cpp
@@
-43,7
+43,7
@@
static bool skip_comment(FILE* fp);
static bool read_end_of_line(FILE* fp);
static bool read_end_of_line(FILE* fp);
-Image<std::uint8_t>
+Image<std::uint
_fast
8_t>
FM7b5::loadPGM(const std::string& filename)
{
FILE* fp(nullptr);
FM7b5::loadPGM(const std::string& filename)
{
FILE* fp(nullptr);
@@
-69,7
+69,7
@@
FM7b5::loadPGM(const std::string& filename)
throw std::runtime_error(__FUNCTION__ ": supported depth is 255 only.");
}
throw std::runtime_error(__FUNCTION__ ": supported depth is 255 only.");
}
- Image<std::uint8_t> img(header.width, header.height);
+ Image<std::uint
_fast
8_t> img(header.width, header.height);
switch (header.magic[1]) {
case '2': // Gray ASCII format
switch (header.magic[1]) {
case '2': // Gray ASCII format
@@
-82,7
+82,7
@@
FM7b5::loadPGM(const std::string& filename)
throw std::runtime_error(__FUNCTION__ ": invalid data.");
}
throw std::runtime_error(__FUNCTION__ ": invalid data.");
}
- img(w, h) = static_cast<std::uint8_t>(val);
+ img(w, h) = static_cast<std::uint
_fast
8_t>(val);
}
}
break;
}
}
break;
@@
-90,7
+90,7
@@
FM7b5::loadPGM(const std::string& filename)
case '5': // Gray binary format
{
const size_t size(header.width * header.height);
case '5': // Gray binary format
{
const size_t size(header.width * header.height);
- size_t ret = fread(img.data(), sizeof(std::uint8_t), size, fp);
+ size_t ret = fread(img.data(), sizeof(std::uint
_fast
8_t), size, fp);
if (ret != size) {
throw std::runtime_error(__FUNCTION__ ": insufficient data.");
}
if (ret != size) {
throw std::runtime_error(__FUNCTION__ ": insufficient data.");
}