Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaran Dwivedi <karan.dwivedi42@gmail.com>2016-09-14 15:08:38 +0300
committerKaran Dwivedi <karan.dwivedi42@gmail.com>2016-09-14 15:08:38 +0300
commit46b219139d04821851e4b8de8cecd04025d42b76 (patch)
tree6a5f5428355221408159bb0e81268abf54442dbb
parentaa635cfddb4cf53fd37841b7fc827f48343cfee7 (diff)
Cast int to float
-rwxr-xr-xgeneric/image.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/image.c b/generic/image.c
index f30fcad..1f5163b 100755
--- a/generic/image.c
+++ b/generic/image.c
@@ -2116,9 +2116,9 @@ static inline void image_(drawPixel)(THTensor *output, int y, int x,
THTensor_(set3d)(output, 1, y, x, cg);
THTensor_(set3d)(output, 2, y, x, cb);
#else
- THTensor_(set3d)(output, 0, y, x, cr / 255);
- THTensor_(set3d)(output, 1, y, x, cg / 255);
- THTensor_(set3d)(output, 2, y, x, cb / 255);
+ THTensor_(set3d)(output, 0, y, x, cr / 255.0f);
+ THTensor_(set3d)(output, 1, y, x, cg / 255.0f);
+ THTensor_(set3d)(output, 2, y, x, cb / 255.0f);
#endif
}
static inline void image_(drawChar)(THTensor *output, int x, int y, unsigned char c, int size,