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;
- 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;
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);