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

Method getPixelUnsignedByte

shared/Bitmap.h:112–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 if (comp_ > 3) data_[ofs + 3] = uint8_t(c.w * 255.0f);
111 }
112 glm::vec4 getPixelUnsignedByte(int x, int y) const
113 {
114 const int ofs = comp_ * (y * w_ + x);
115 return glm::vec4(
116 comp_ > 0 ? float(data_[ofs + 0]) / 255.0f : 0.0f,
117 comp_ > 1 ? float(data_[ofs + 1]) / 255.0f : 0.0f,
118 comp_ > 2 ? float(data_[ofs + 2]) / 255.0f : 0.0f,
119 comp_ > 3 ? float(data_[ofs + 3]) / 255.0f : 0.0f);
120 }
121};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected