projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix indentation,style
[demo]
/
src
/
image.cc
diff --git
a/src/image.cc
b/src/image.cc
index
82d8cd1
..
818b686
100644
(file)
--- a/
src/image.cc
+++ b/
src/image.cc
@@
-124,11
+124,11
@@
bool Image::load(const char *fname)
Vec4 Image::get_pixel(int x, int y) const
{
if(is_float) {
Vec4 Image::get_pixel(int x, int y) const
{
if(is_float) {
- return ((Vec4*)pixels)[y * w + x];
+ return ((Vec4 *)pixels)[y * w + x];
}
Vec4 color;
}
Vec4 color;
- unsigned char *pptr = ((unsigned char*)pixels) + (y * w + x) * 4;
+ unsigned char *pptr = ((unsigned char *)pixels) + (y * w + x) * 4;
color.x = pptr[0] / 255.0;
color.y = pptr[1] / 255.0;
color.z = pptr[2] / 255.0;
color.x = pptr[0] / 255.0;
color.y = pptr[1] / 255.0;
color.z = pptr[2] / 255.0;
@@
-165,7
+165,7
@@
Vec4 Image::lookup_linear(float u, float v, float du, float dv) const
Vec4 p00 = get_pixel(x0, y0);
Vec4 p01 = get_pixel(x0, y1);
Vec4 p11 = get_pixel(x1, y1);
Vec4 p00 = get_pixel(x0, y0);
Vec4 p01 = get_pixel(x0, y1);
Vec4 p11 = get_pixel(x1, y1);
- Vec4 p10 = get_pixel(x1, y0);
+ Vec4 p10 = get_pixel(x1, y0);
Vec4 ptop = lerp(p01, p11, tu);
Vec4 pbot = lerp(p00, p10, tu);
Vec4 ptop = lerp(p01, p11, tu);
Vec4 pbot = lerp(p00, p10, tu);