gegl r2621 - in trunk: . gegl/property-types
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2621 - in trunk: . gegl/property-types
- Date: Tue, 14 Oct 2008 08:36:10 +0000 (UTC)
Author: ok
Date: Tue Oct 14 08:36:10 2008
New Revision: 2621
URL: http://svn.gnome.org/viewvc/gegl?rev=2621&view=rev
Log:
* gegl/property-types/gegl-vector.c: (gegl_vector_fill),
(gegl_operation_vector_prop_changed): fixed horizontal anti aliasaing,
re-added GeglVectorKnot and Point definitions that were accidentally
removed from the .c file.
Modified:
trunk/ChangeLog
trunk/gegl/property-types/gegl-vector.c
Modified: trunk/gegl/property-types/gegl-vector.c
==============================================================================
--- trunk/gegl/property-types/gegl-vector.c (original)
+++ trunk/gegl/property-types/gegl-vector.c Tue Oct 14 08:36:10 2008
@@ -32,16 +32,24 @@
#include <glib/gprintf.h>
-/* FIXME: relative commands are currently broken as they depend on
- * a head sentinel
- */
+typedef struct Point
+{
+ gfloat x;
+ gfloat y;
+} Point;
+
+typedef struct GeglVectorKnot
+{
+ gchar type; /* should perhaps be padded out? */
+ Point point[4];
+} GeglVectorKnot;
/* ###################################################################### */
/* path-list code originating in horizon */
typedef struct _Path Path;
-#define BEZIER_SEGMENTS 16
-#define AA 4
+#define BEZIER_SEGMENTS 32
+#define AA 3
#include <glib.h>
#include <math.h>
@@ -780,7 +788,7 @@
}
}
- /* for each scanline */
+ /* Fill the spans */
{
const gfloat *colc = gegl_color_float4 (color);
gfloat col[4] = {colc[0],colc[1],colc[2],colc[3]};
@@ -793,6 +801,7 @@
if (gegl_buffer_is_shared (buffer))
while (!gegl_buffer_try_lock (buffer));
+
for (i=0; i < extent.height * versub; i++)
{
GSList *iter = scanlines[i];
@@ -807,14 +816,9 @@
startx = GPOINTER_TO_INT (iter->data);
endx = GPOINTER_TO_INT (next->data);
-
- /* XXX: the horizontal subsampling bit can be done more efficiently
- * by only special treating the start and end of each span being
- * accumulated to.
- */
for (j=0;j<horsub;j++)
{
- GeglRectangle roi={(startx+j)/horsub, extent.y + i/versub, (endx - startx + j) / horsub, 1};
+ GeglRectangle roi={(startx+j)/horsub, extent.y + i/versub, (endx - startx-j) / horsub, 1};
gegl_buffer_accumulate (buffer, &roi, col);
}
@@ -823,6 +827,7 @@
if (scanlines[i])
g_slist_free (scanlines[i]);
}
+
if (gegl_buffer_is_shared (buffer))
gegl_buffer_unlock (buffer);
}
@@ -1443,9 +1448,9 @@
GeglOperation *operation)
{
/* In the end forces a re-render, should be adapted to
- * * allow a smaller region to be forced for re-rendering
- * * when the vector is incrementally grown
- * */
+ * allow a smaller region to be forced for re-rendering
+ * when the vector is incrementally grown
+ * */
/* g_object_notify (G_OBJECT (operation), "vector"); */
GeglRectangle rect = *roi;
gint radius = 8;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]