[gegl] op/multiply.c: update autogenerated file (why is it in git anyways?)
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] op/multiply.c: update autogenerated file (why is it in git anyways?)
- Date: Tue, 13 Mar 2012 10:31:41 +0000 (UTC)
commit f0337a673b0110d9b4703379628d4f8771cce197
Author: Ãyvind KolÃs <pippin gimp org>
Date: Tue Mar 13 03:57:02 2012 +0000
op/multiply.c: update autogenerated file (why is it in git anyways?)
it seems like svg-multiply and math-multiply is overwriting the same file.
operations/generated/multiply.c | 107 +++++++++++++++++++++------------------
1 files changed, 58 insertions(+), 49 deletions(-)
---
diff --git a/operations/generated/multiply.c b/operations/generated/multiply.c
index a9661aa..d2ed165 100644
--- a/operations/generated/multiply.c
+++ b/operations/generated/multiply.c
@@ -1,5 +1,5 @@
-/* !!!! AUTOGENERATED FILE generated by svg12-blend.rb !!!!!
+/* !!!! AUTOGENERATED FILE generated by math.rb !!!!!
*
* This file is an image processing operation for GEGL
*
@@ -16,15 +16,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
*
- * Copyright 2006, 2007 Ãyvind KolÃs <pippin gimp org>
- * 2007 John Marshall
- *
- * SVG rendering modes; see:
- * http://www.w3.org/TR/SVG12/rendering.html
- * http://www.w3.org/TR/2004/WD-SVG12-20041027/rendering.html#comp-op-prop
- *
- * aA = aux(src) alpha aB = in(dst) alpha aD = out alpha
- * cA = aux(src) colour cB = in(dst) colour cD = out colour
+ * Copyright 2006 Ãyvind KolÃs <pippin gimp org>
*
* !!!! AUTOGENERATED FILE !!!!!
*/
@@ -34,61 +26,80 @@
#ifdef GEGL_CHANT_PROPERTIES
-/* no properties */
+gegl_chant_double (value, _("Value"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.0, _("global value used if aux doesn't contain data"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
-#define GEGL_CHANT_C_FILE "multiply.c"
+#define GEGL_CHANT_C_FILE "multiply.c"
#include "gegl-chant.h"
+#include <math.h>
+#ifdef _MSC_VER
+#define powf(a,b) ((gfloat)pow(a,b))
+#endif
+
+
static void prepare (GeglOperation *operation)
{
- Babl *format = babl_format ("RaGaBaA float");
+ Babl *format = babl_format ("RGBA float");
gegl_operation_set_format (operation, "input", format);
- gegl_operation_set_format (operation, "aux", format);
+ gegl_operation_set_format (operation, "aux", babl_format ("RGB float"));
gegl_operation_set_format (operation, "output", format);
}
static gboolean
-process (GeglOperation *op,
- void *in_buf,
- void *aux_buf,
- void *out_buf,
- glong n_pixels,
- const GeglRectangle *roi)
+process (GeglOperation *op,
+ void *in_buf,
+ void *aux_buf,
+ void *out_buf,
+ glong n_pixels,
+ const GeglRectangle *roi)
{
gfloat * GEGL_ALIGNED in = in_buf;
- gfloat * GEGL_ALIGNED aux = aux_buf;
gfloat * GEGL_ALIGNED out = out_buf;
+ gfloat * GEGL_ALIGNED aux = aux_buf;
gint i;
- if (aux==NULL)
- return TRUE;
-
- for (i = 0; i < n_pixels; i++)
+ if (aux == NULL)
{
- gfloat aA, aB, aD;
- gint j;
-
- aB = in[3];
- aA = aux[3];
- aD = aA + aB - aA * aB;
-
- for (j = 0; j < 3; j++)
+ gfloat value = GEGL_CHANT_PROPERTIES (op)->value;
+ for (i=0; i<n_pixels; i++)
{
- gfloat cA, cB;
-
- cB = in[j];
- cA = aux[j];
- out[j] = CLAMP (cA * cB + cA * (1 - aB) + cB * (1 - aA), 0, aD);
+ gint j;
+ gfloat c;
+ for (j=0; j<3; j++)
+ {
+ c=in[j];
+ c = c * value;
+ out[j]=c;
+ }
+ out[3]=in[3];
+ in += 4;
+ out+= 4;
+ }
+ }
+ else
+ {
+ for (i=0; i<n_pixels; i++)
+ {
+ gint j;
+ gfloat c;
+ gfloat value;
+ for (j=0; j<3; j++)
+ {
+ c=in[j];
+ value=aux[j];
+ c = c * value;
+ out[j]=c;
+ }
+ out[3]=in[3];
+ in += 4;
+ aux += 3;
+ out+= 4;
}
- out[3] = aD;
- in += 4;
- aux += 4;
- out += 4;
}
return TRUE;
@@ -100,17 +111,15 @@ gegl_chant_class_init (GeglChantClass *klass)
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
- operation_class = GEGL_OPERATION_CLASS (klass);
- point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
+ operation_class = GEGL_OPERATION_CLASS (klass);
+ point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
point_composer_class->process = process;
operation_class->prepare = prepare;
- operation_class->compat_name = "gegl:multiply";
- operation_class->name = "svg:multiply";
+ operation_class->name = "gegl:multiply";
+ operation_class->categories = "compositors:math";
operation_class->description =
- _("SVG blend operation multiply (<tt>d = cA * cB + cA * (1 - aB) + cB * (1 - aA)</tt>)");
- operation_class->categories = "compositors:svgfilter";
+ _("Math operation multiply (c = c * value)");
}
-
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]