filmic: rename to aces-rrt

The ACES RRT is a filmic look, but a specific one hard-coded for ACES
workflows, renaming to show the intent of it becoming a parametric
implementation of the ACES RRT, update description.
parent 7bdab46b
......@@ -19,7 +19,7 @@ op_LTLIBRARIES = \
gradient-map.la \
hstack.la \
enlarge.la \
filmic.la \
aces-rrt.la \
inpaint.la \
integral-image.la \
linear-sinusoid.la \
......
......@@ -27,8 +27,8 @@
#else
#define GEGL_OP_POINT_FILTER
#define GEGL_OP_NAME filmic
#define GEGL_OP_C_SOURCE filmic.c
#define GEGL_OP_NAME aces_rrt
#define GEGL_OP_C_SOURCE aces-rrt.c
#include "gegl-op.h"
......@@ -44,6 +44,57 @@ static inline float aces_rrt (float x)
return a / b;
}
#define lerp(a,b,d) ((a) * (1.0-d) + (b) * ((d)))
#include <math.h>
static inline void aces_rrt_rgb (float rin, float gin, float bin, float *rout, float *gout, float *bout)
{
float r, g, b;
r = aces_rrt (rin);
g = aces_rrt (gin);
b = aces_rrt (bin);
r = (rin);
g = (gin);
b = (bin);
#if 0
/* this is not the proper glow + desaturate used by ACES RRT,
but does something similar
*/
#define THRESHOLD 0.05
#define THRESHOLD2 0.4
{
float gray;
gray = (r+g+b) / 3.0;
if (gray > 1.0f) gray = 1.0f;
if (gray < THRESHOLD)
{
float saturation = 1.0-(gray)/THRESHOLD;
r = lerp (r, gray, saturation);
g = lerp (g, gray, saturation);
b = lerp (b, gray, saturation);
}
else if (gray > THRESHOLD2)
{
float saturation = (gray - THRESHOLD2)/(1.0-THRESHOLD2);
r = lerp (r, gray, saturation);
g = lerp (g, gray, saturation);
b = lerp (b, gray, saturation);
}
}
#endif
*rout = r;
*gout = g;
*bout = b;
}
static gboolean
process (GeglOperation *op,
void *in_buf,
......@@ -57,9 +108,8 @@ process (GeglOperation *op,
while (samples--)
{
out[0] = aces_rrt (in[0]);
out[1] = aces_rrt (in[1]);
out[2] = aces_rrt (in[2]);
aces_rrt_rgb (in[0], in[1], in[2],
&out[0], &out[1], &out[2]);
out[3] = in[3];
in += 4;
......@@ -80,11 +130,11 @@ gegl_op_class_init (GeglOpClass *klass)
point_filter_class->process = process;
gegl_operation_class_set_keys (operation_class,
"name", "gegl:filmic",
"title", _("ACES Filmic"),
"name", "gegl:aces-rrt",
"title", _("ACES RRT"),
"categories" , "color:tonemapping",
"description",
_("HDR to SDR proofing filter/mapping curve that is an approximation of the ACES RRT (Reference Rendering Transform)."),
_("HDR to SDR proofing filter/mapping curve that is an approximation of the ACES RRT (Reference Rendering Transform). When feeding scene-refereed imagery into this op, the result is suitable for display referred transform to sRGB or output display using regular ICC matric profiles as the ODT. Note that for the time being, this is a luminance only approximation of the ACES RRT; without desaturation of highlights and shadows nor red hue modifications."),
NULL);
}
......
......@@ -253,7 +253,7 @@ operations/workshop/external/gluas.c
operations/workshop/external/lens-correct.c
operations/workshop/external/line-profile.c
operations/workshop/external/v4l2.c
operations/workshop/filmic.c
operations/workshop/aces-rrt.c
operations/workshop/generated/average.c
operations/workshop/generated/blend-reflect.c
operations/workshop/generated/negation.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment