MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / getPixelFloat

Method getPixelFloat

shared/Bitmap.h:93–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 if (comp_ > 3) data[ofs + 3] = c.w;
92 }
93 glm::vec4 getPixelFloat(int x, int y) const
94 {
95 const int ofs = comp_ * (y * w_ + x);
96 const float* data = reinterpret_cast<const float*>(data_.data());
97 return glm::vec4(
98 comp_ > 0 ? data[ofs + 0] : 0.0f,
99 comp_ > 1 ? data[ofs + 1] : 0.0f,
100 comp_ > 2 ? data[ofs + 2] : 0.0f,
101 comp_ > 3 ? data[ofs + 3] : 0.0f);
102 }
103
104 void setPixelUnsignedByte(int x, int y, const glm::vec4& c)
105 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected