| 25 | } |
| 26 | |
| 27 | inline Vec4f getTexel_RGB8(const Texture2D *self, const Vec2i i) |
| 28 | { |
| 29 | assert(self); |
| 30 | const uint8_t *texel = (const uint8_t *)self->data; |
| 31 | const uint32_t texelOfs = 3*(i.y*self->size.x + i.x); |
| 32 | const uint32_t r = texel[texelOfs]; |
| 33 | const uint32_t g = texel[texelOfs+1]; |
| 34 | const uint32_t b = texel[texelOfs+2]; |
| 35 | return Vec4f(Vec3fa((float)r, (float)g, (float)b)*(1.f/255.f), 1.f); |
| 36 | } |
| 37 | |
| 38 | inline Vec4f getTexel_R8(const Texture2D *self, const Vec2i i) |
| 39 | { |