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

Function getTexel_RGBA8

tutorials/common/texture/texture2d.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14// TODO blocking
15
16inline Vec4f getTexel_RGBA8(const Texture2D *self, const Vec2i i)
17{
18 assert(self);
19 const uint32_t c = ((const uint32_t *)self->data)[i.y*self->size.x + i.x];
20 const uint32_t r = c & 0xff;
21 const uint32_t g = (c >> 8) & 0xff;
22 const uint32_t b = (c >> 16) & 0xff;
23 const uint32_t a = c >> 24;
24 return Vec4f((float)r, (float)g, (float)b, (float)a)*(1.f/255.f);
25}
26
27inline Vec4f getTexel_RGB8(const Texture2D *self, const Vec2i i)
28{

Callers 1

getTexel_SRGBAFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected