gegl r2337 - in branches/branch_zhangjb: . operations/frequency operations/frequency/tools
- From: zhangjb svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2337 - in branches/branch_zhangjb: . operations/frequency operations/frequency/tools
- Date: Thu, 22 May 2008 15:55:55 +0000 (UTC)
Author: zhangjb
Date: Thu May 22 15:55:54 2008
New Revision: 2337
URL: http://svn.gnome.org/viewvc/gegl?rev=2337&view=rev
Log:
* operations/frequency/dft-grey.c: format the code.
* operations/frequency/dft-inverse-grey.c: format the code.
* operations/frequency/preview-frequency-grey.c: format the code.
* operations/frequency/tools/display.c: format the code.
Modified:
branches/branch_zhangjb/ChangeLog
branches/branch_zhangjb/operations/frequency/dft-grey.c
branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c
branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c
branches/branch_zhangjb/operations/frequency/tools/display.c
Modified: branches/branch_zhangjb/operations/frequency/dft-grey.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/dft-grey.c (original)
+++ branches/branch_zhangjb/operations/frequency/dft-grey.c Thu May 22 15:55:54 2008
@@ -15,39 +15,43 @@
#include "tools/dft.c"
#include <fftw3.h>
-static GeglRectangle get_required_for_output(GeglOperation *operation,
- const gchar *input_pad,
- const GeglRectangle *roi)
+static GeglRectangle
+get_required_for_output(GeglOperation *operation,
+ const gchar *input_pad,
+ const GeglRectangle *roi)
{
GeglRectangle result = *gegl_operation_source_get_bounding_box(operation,
"input");
return result;
}
-static GeglRectangle get_cached_region(GeglOperation *operation,
- const GeglRectangle *roi)
+static GeglRectangle
+get_cached_region(GeglOperation *operation,
+ const GeglRectangle *roi)
{
return *gegl_operation_source_get_bounding_box(operation, "input");
}
-static void prepare(GeglOperation *operation)
+static void
+prepare(GeglOperation *operation)
{
Babl *image_format = babl_format_new(babl_model("Y"),
babl_type("double"),
babl_component("Y"),
- NULL);
+ NULL);
Babl *frequency_format = babl_format_new(babl_model("Y"),
babl_type("double"),
babl_component("Y"),
- NULL);
+ NULL);
gegl_operation_set_format(operation, "input", image_format);
gegl_operation_set_format(operation, "output", frequency_format);
}
-static gboolean process(GeglOperation *operation,
- GeglBuffer *input,
- GeglBuffer *output,
- const GeglRectangle *result)
+static gboolean
+process(GeglOperation *operation,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result)
{
gint width = gegl_buffer_get_width(input);
gint height = gegl_buffer_get_height(input);
@@ -56,25 +60,26 @@
src_buf = g_new0(gdouble, width*height);
gegl_buffer_get(input, 1.0,
- NULL, babl_format_new(babl_model("Y"),
- babl_type("double"),
- babl_component("Y"),
- NULL), src_buf, GEGL_AUTO_ROWSTRIDE);
+ NULL, babl_format_new(babl_model("Y"),
+ babl_type("double"),
+ babl_component("Y"),
+ NULL), src_buf, GEGL_AUTO_ROWSTRIDE);
dst_buf = g_new0(gdouble, 2*width*FFT_HALF(height));
dft(src_buf, (fftw_complex *)dst_buf, width, height);
gegl_buffer_set(output,
- NULL, babl_format_new(babl_model("Y"),
- babl_type("double"),
- babl_component("Y"),
- NULL), (gdouble *)dst_buf, GEGL_AUTO_ROWSTRIDE);
+ NULL, babl_format_new(babl_model("Y"),
+ babl_type("double"),
+ babl_component("Y"),
+ NULL), (gdouble *)dst_buf, GEGL_AUTO_ROWSTRIDE);
g_free(src_buf);
g_free(dst_buf);
return TRUE;
}
-static void gegl_chant_class_init(GeglChantClass *klass)
+static void
+gegl_chant_class_init(GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
@@ -90,9 +95,9 @@
operation_class->name = "dft-grey";
operation_class->categories = "frequency";
operation_class->description
- = "Perform 2-D inverse Discrete Fourier Transform .\n"
- "Note this operation is just for test, which can NOT be "
- "used to do anything by now.";
+ = "Perform 2-D inverse Discrete Fourier Transform .\n"
+ "Note this operation is just for test, which can NOT be "
+ "used to do anything by now.";
}
#endif
Modified: branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c (original)
+++ branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c Thu May 22 15:55:54 2008
@@ -15,39 +15,43 @@
#include "tools/dft.c"
#include <fftw3.h>
-static GeglRectangle get_required_for_output(GeglOperation *operation,
- const gchar *input_pad,
- const GeglRectangle *roi)
+static GeglRectangle
+get_required_for_output(GeglOperation *operation,
+ const gchar *input_pad,
+ const GeglRectangle *roi)
{
GeglRectangle result = *gegl_operation_source_get_bounding_box(operation,
"input");
return result;
}
-static GeglRectangle get_cached_region(GeglOperation *operation,
- const GeglRectangle *roi)
+static GeglRectangle
+get_cached_region(GeglOperation *operation,
+ const GeglRectangle *roi)
{
return *gegl_operation_source_get_bounding_box(operation, "input");
}
-static void prepare(GeglOperation *operation)
+static void
+prepare(GeglOperation *operation)
{
Babl *image_format = babl_format_new(babl_model("Y"),
babl_type("double"),
babl_component("Y"),
- NULL);
+ NULL);
Babl *frequency_format = babl_format_new(babl_model("Y"),
babl_type("double"),
babl_component("Y"),
- NULL);
+ NULL);
gegl_operation_set_format(operation, "input", image_format);
gegl_operation_set_format(operation, "output", frequency_format);
}
-static gboolean process(GeglOperation *operation,
- GeglBuffer *input,
- GeglBuffer *output,
- const GeglRectangle *result)
+static gboolean
+process(GeglOperation *operation,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result)
{
gint width = gegl_buffer_get_width(input);
gint height = gegl_buffer_get_height(input);
@@ -56,24 +60,25 @@
src_buf = g_new0(gdouble, 2*width*FFT_HALF(height));
gegl_buffer_get(input, 1.0,
- NULL, babl_format_new(babl_model("Y"),
- babl_type("double"),
- babl_component("Y"),
- NULL), (gdouble *)src_buf, GEGL_AUTO_ROWSTRIDE);
+ NULL, babl_format_new(babl_model("Y"),
+ babl_type("double"),
+ babl_component("Y"),
+ NULL), (gdouble *)src_buf, GEGL_AUTO_ROWSTRIDE);
dst_buf = g_new0(gdouble, width*height);
idft((fftw_complex *)src_buf, dst_buf, width, height);
gegl_buffer_set(output,
- NULL, babl_format_new(babl_model("Y"),
- babl_type("double"),
- babl_component("Y"),
- NULL), dst_buf, GEGL_AUTO_ROWSTRIDE);
+ NULL, babl_format_new(babl_model("Y"),
+ babl_type("double"),
+ babl_component("Y"),
+ NULL), dst_buf, GEGL_AUTO_ROWSTRIDE);
g_free(src_buf);
g_free(dst_buf);
return TRUE;
}
-static void gegl_chant_class_init(GeglChantClass *klass)
+static void
+gegl_chant_class_init(GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
@@ -89,9 +94,9 @@
operation_class->name = "dft-inverse-grey";
operation_class->categories = "frequency";
operation_class->description
- = "Perform 2-D Discrete Fourier Transform for the image.\n"
- "Note this operation is just for test, which can NOT be "
- "used to do anything by now.";
+ = "Perform 2-D Discrete Fourier Transform for the image.\n"
+ "Note this operation is just for test, which can NOT be "
+ "used to do anything by now.";
}
#endif
Modified: branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c (original)
+++ branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c Thu May 22 15:55:54 2008
@@ -15,39 +15,43 @@
#include "tools/display.c"
#include <fftw3.h>
-static GeglRectangle get_required_for_output(GeglOperation *operation,
- const gchar *input_pad,
- const GeglRectangle *roi)
+static GeglRectangle
+get_required_for_output(GeglOperation *operation,
+ const gchar *input_pad,
+ const GeglRectangle *roi)
{
GeglRectangle result = *gegl_operation_source_get_bounding_box(operation,
"input");
return result;
}
-static GeglRectangle get_cached_region(GeglOperation *operation,
- const GeglRectangle *roi)
+static GeglRectangle
+get_cached_region(GeglOperation *operation,
+ const GeglRectangle *roi)
{
return *gegl_operation_source_get_bounding_box(operation, "input");
}
-static void prepare(GeglOperation *operation)
+static void
+prepare(GeglOperation *operation)
{
Babl *image_format = babl_format_new(babl_model("Y"),
babl_type("double"),
babl_component("Y"),
- NULL);
+ NULL);
Babl *frequency_format = babl_format_new(babl_model("Y"),
babl_type("double"),
babl_component("Y"),
- NULL);
+ NULL);
gegl_operation_set_format(operation, "input", image_format);
gegl_operation_set_format(operation, "output", frequency_format);
}
-static gboolean process(GeglOperation *operation,
- GeglBuffer *input,
- GeglBuffer *output,
- const GeglRectangle *result)
+static gboolean
+process(GeglOperation *operation,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result)
{
gint width = gegl_buffer_get_width(input);
gint height = gegl_buffer_get_height(input);
@@ -56,25 +60,26 @@
src_buf = g_new0(gdouble, 2*width*FFT_HALF(height));
gegl_buffer_get(input, 1.0,
- NULL, babl_format_new(babl_model("Y"),
- babl_type("double"),
- babl_component("Y"),
- NULL), src_buf, GEGL_AUTO_ROWSTRIDE);
+ NULL, babl_format_new(babl_model("Y"),
+ babl_type("double"),
+ babl_component("Y"),
+ NULL), src_buf, GEGL_AUTO_ROWSTRIDE);
dst_buf = g_new0(gdouble, 2*width*height);
fre2img((fftw_complex *)src_buf, dst_buf, width, height);
gegl_buffer_set(output,
- NULL, babl_format_new(babl_model("Y"),
- babl_type("double"),
- babl_component("Y"),
- NULL), (gdouble *)dst_buf, GEGL_AUTO_ROWSTRIDE);
+ NULL, babl_format_new(babl_model("Y"),
+ babl_type("double"),
+ babl_component("Y"),
+ NULL), (gdouble *)dst_buf, GEGL_AUTO_ROWSTRIDE);
g_free(src_buf);
g_free(dst_buf);
return TRUE;
}
-static void gegl_chant_class_init(GeglChantClass *klass)
+static void
+gegl_chant_class_init(GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
@@ -90,7 +95,7 @@
operation_class->name = "preview-frequency-grey";
operation_class->categories = "frequency";
operation_class->description
- = "convert the frequency buffer to a diplayable image.";
+ = "convert the frequency buffer to a diplayable image.";
}
#endif
Modified: branches/branch_zhangjb/operations/frequency/tools/display.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/tools/display.c (original)
+++ branches/branch_zhangjb/operations/frequency/tools/display.c Thu May 22 15:55:54 2008
@@ -32,7 +32,8 @@
gboolean zoomshow(gdouble *buf, glong samples);
gboolean fre2img(fftw_complex *src_buf, gdouble *des_buf, gint width, gint height);
-static gint fft_complex_get_half_id(gint x, gint y, gint width, gint height)
+static gint
+fft_complex_get_half_id(gint x, gint y, gint width, gint height)
{
if (x >= FFT_HALF(x))
{
@@ -45,7 +46,8 @@
return 0;
}
-gboolean shift_dft(gdouble *buf, gint width, gint height)
+gboolean
+shift_dft(gdouble *buf, gint width, gint height)
{
gint cx, cy;
gint add_x, add_y;
@@ -72,7 +74,8 @@
return TRUE;
}
-void get_min_max(gdouble *buf, gdouble *min, gdouble *max, glong samples)
+void
+get_min_max(gdouble *buf, gdouble *min, gdouble *max, glong samples)
{
gfloat tmin = 9000000.0;
gfloat tmax =-9000000.0;
@@ -92,7 +95,8 @@
*max = tmax;
}
-gboolean zoomshow(gdouble *buf, glong samples)
+gboolean
+zoomshow(gdouble *buf, glong samples)
{
glong i;
gdouble min, max;
@@ -112,7 +116,8 @@
return TRUE;
}
-gboolean fre2img(fftw_complex *src_buf, gdouble *dst_buf, gint width, gint height)
+gboolean
+fre2img(fftw_complex *src_buf, gdouble *dst_buf, gint width, gint height)
{
gint i, j;
glong samples = width*height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]