-void draw_picture_quad(GLint prog, int frame)
-{
- glUseProgramObjectARB(prog);
- check_error();
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, SOURCE_IMAGE);
- glUniform1i(glGetUniformLocation(prog, "tex"), 0);
-
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_1D, SRGB_LUT);
- glUniform1i(glGetUniformLocation(prog, "srgb_tex"), 1);
-
- glActiveTexture(GL_TEXTURE2);
- glBindTexture(GL_TEXTURE_1D, SRGB_REVERSE_LUT);
- glUniform1i(glGetUniformLocation(prog, "srgb_reverse_tex"), 2);
-
- glUniform3f(glGetUniformLocation(prog, "lift"), lift_r, lift_g, lift_b);
- //glUniform3f(glGetUniformLocation(prog, "gamma"), gamma_r, gamma_g, gamma_b);
- glUniform3f(glGetUniformLocation(prog, "inv_gamma_22"),
- 2.2f / gamma_r,
- 2.2f / gamma_g,
- 2.2f / gamma_b);
- glUniform3f(glGetUniformLocation(prog, "gain_pow_inv_gamma"),
- pow(gain_r, 1.0f / gamma_r),
- pow(gain_g, 1.0f / gamma_g),
- pow(gain_b, 1.0f / gamma_b));
- glUniform1f(glGetUniformLocation(prog, "saturation"), saturation);
-
- glDisable(GL_BLEND);
- check_error();
- glDisable(GL_DEPTH_TEST);
- check_error();
- glDepthMask(GL_FALSE);
- check_error();
+ hsv2rgb(lift_theta, lift_rad, lift_v, &lift.r, &lift.g, &lift.b);
+ hsv2rgb(gamma_theta, gamma_rad, gamma_v * 2.0f, &gamma.r, &gamma.g, &gamma.b);
+ hsv2rgb(gain_theta, gain_rad, gain_v * 4.0f, &gain.r, &gain.g, &gain.b);