[gegl] plasma: Pull in comments from GIMP
- From: Mukund Sivaraman <muks src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] plasma: Pull in comments from GIMP
- Date: Thu, 30 Jun 2011 09:43:51 +0000 (UTC)
commit 5445b792d7f53cb20247874f28abaaa6a89a3e89
Author: Mukund Sivaraman <muks banu com>
Date: Thu Jun 30 15:06:51 2011 +0530
plasma: Pull in comments from GIMP
operations/workshop/plasma.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/operations/workshop/plasma.c b/operations/workshop/plasma.c
index 83ddd9d..e28a6af 100644
--- a/operations/workshop/plasma.c
+++ b/operations/workshop/plasma.c
@@ -17,6 +17,13 @@
* Copyright (C) 2011 Robert Sasu (sasu robert gmail com)
*/
+/*
+ * This plug-in produces plasma fractal images. The algorithm is losely
+ * based on a description of the fractint algorithm, but completely
+ * re-implemented because the fractint code was too ugly to read :). It
+ * was written by Stephen Norris for GIMP, and was ported to GEGL in
+ * 2011 by Robert Sasu.
+ */
#include "config.h"
#include <glib/gi18n-lib.h>
@@ -152,7 +159,7 @@ do_plasma_big (PlasmaContext *context,
random_rgba (context->gr, mb);
put_pixel_to_buffer (context->output, mb, xm, y2);
- /*ugly but working*/
+
return FALSE;
}
@@ -174,12 +181,12 @@ do_plasma_big (PlasmaContext *context,
if (xm != x1 || xm != x2)
{
- /*left*/
+ /* Left. */
average_pixel (ml, tl, bl);
add_random (context->gr, ml, ran);
put_pixel_to_buffer (context->output, ml, x1, ym);
- /*right*/
+ /* Right. */
if (x1 != x2)
{
average_pixel (mr, tr, br);
@@ -191,7 +198,7 @@ do_plasma_big (PlasmaContext *context,
if (ym != y1 || ym != x2)
{
- /*bottom*/
+ /* Bottom. */
if (x1 != xm || ym != y2)
{
average_pixel (mb, bl, br);
@@ -201,7 +208,7 @@ do_plasma_big (PlasmaContext *context,
if (y1 != y2)
{
- /*top*/
+ /* Top. */
average_pixel (mt, tl, tr);
add_random (context->gr, mt, ran);
put_pixel_to_buffer (context->output, mt, xm, y1);
@@ -210,6 +217,7 @@ do_plasma_big (PlasmaContext *context,
if (y1 != y2 || x1 != x2)
{
+ /* Middle pixel. */
average_pixel (mm, tl, br);
average_pixel (tmp, bl, tr);
average_pixel (mm, mm, tmp);
@@ -223,13 +231,13 @@ do_plasma_big (PlasmaContext *context,
if (x1 < x2 || y1 < y2)
{
- /*top-left*/
+ /* Top left. */
do_plasma_big (context, x1, y1, xm, ym, depth - 1, scale_depth + 1);
- /*bottom-left*/
+ /* Bottom left. */
do_plasma_big (context, x1, ym, xm, y2, depth - 1, scale_depth + 1);
- /*top-right*/
+ /* Top right. */
do_plasma_big (context, xm, y1, x2, ym, depth - 1, scale_depth + 1);
- /*bottom-right*/
+ /* Bottom right. */
return do_plasma_big (context, xm, ym, x2, y2, depth - 1, scale_depth + 1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]