MCPcopy Create free account
hub / github.com/RenderKit/embree / getTexel_RGB8

Function getTexel_RGB8

tutorials/common/texture/texture2d.cpp:27–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27inline 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
38inline Vec4f getTexel_R8(const Texture2D *self, const Vec2i i)
39{

Callers 1

getTexel_SRGBFunction · 0.85

Calls 1

Vec3faClass · 0.50

Tested by

no test coverage detected