#include <cmath>
+#include "color.h"
#include "colorcurve.h"
#include "mesh.h"
#include "shader.h"
{
shprog.attach_shader(get_fullscreen_vertex_shader());
shprog.attach_shader_owned(new FragmentShader(fragment_src));
+ shprog.bind_attribute(get_component_type(VERTEX2), "vertex");
shprog.link();
shdata.uniform("texture", 0);
unsigned char curve_data[256];
curve_data[0] = 0;
for(unsigned i=1; i<256; ++i)
- curve_data[i] = (1.055*pow(i/255.0f, 1/2.4f)-0.055)*255+0.5;
+ curve_data[i] = to_srgb(i/255.0f)*255+0.5f;
curve.image(0, LUMINANCE, UNSIGNED_BYTE, curve_data);
}
{
Bind _bind_shader(shprog);
shdata.apply();
+ Bind _bind_mesh(quad);
Bind _bind_tex(color_buf);
Bind _bind_curve(curve, 1);
quad.draw();