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

Method setPixelFloat

shared/Bitmap.h:84–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 void setPixelFloat(int x, int y, const glm::vec4& c)
85 {
86 const int ofs = comp_ * (y * w_ + x);
87 float* data = reinterpret_cast<float*>(data_.data());
88 if (comp_ > 0) data[ofs + 0] = c.x;
89 if (comp_ > 1) data[ofs + 1] = c.y;
90 if (comp_ > 2) data[ofs + 2] = c.z;
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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected