Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SimpleGuiDX11::applyGamma(float gamma) {
- if (lastGamma == gamma) return;
- lastGamma = gamma;
- {
- std::lock_guard<std::mutex> lock(tex_data_lock_);
- for (int y = 0; y < height_; ++y)
- {
- for (int x = 0; x < width_; ++x)
- {
- const int offset = (y * width_ + x) * 4;
- tex_data_[offset] = pow(raw_tex_data_[offset], gamma);
- tex_data_[offset + 1] = pow(raw_tex_data_[offset + 1], gamma);
- tex_data_[offset + 2] = pow(raw_tex_data_[offset + 2], gamma);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement