[gegl] cosmetic
- From: Nicolas Robidoux <nrobidoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] cosmetic
- Date: Tue, 25 Dec 2012 02:42:46 +0000 (UTC)
commit 11a0304eb54059b39ab0da4bba83ede2d74a711f
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date: Mon Dec 24 21:42:38 2012 -0500
cosmetic
operations/transform/transform-core.c | 220 ++++++++++++++++----------------
1 files changed, 110 insertions(+), 110 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index a520fce..3f67ef8 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -530,15 +530,15 @@ gegl_transform_get_bounding_box (GeglOperation *op)
* Does "- (gint) 1" interact badly with {*,*,0,0}?
*/
in_rect.width += context_rect.width - (gint) 1 > (gint) 0
- ?
+ ?
context_rect.width - (gint) 1
:
- (gint) 0;
+ (gint) 0;
in_rect.height += context_rect.height - (gint) 1 > (gint) 0
?
context_rect.height - (gint) 1
:
- (gint) 0;
+ (gint) 0;
}
#endif
@@ -789,7 +789,7 @@ transform_affine (GeglBuffer *dest,
GeglSampler *sampler,
gint level)
{
- const Babl *format = babl_format ("RaGaBaA float");
+ const Babl *format = babl_format ("RaGaBaA float");
GeglMatrix3 inverse;
GeglMatrix2 inverse_jacobian;
gint dest_pixels;
@@ -810,15 +810,15 @@ transform_affine (GeglBuffer *dest,
gegl_matrix3_invert (&inverse);
g_object_get (dest, "pixels", &dest_pixels, NULL);
-
+
{
const GeglRectangle *dest_extent = gegl_buffer_get_extent (dest);
GeglBufferIterator *i = gegl_buffer_iterator_new (dest,
- dest_extent,
- level,
- format,
- GEGL_BUFFER_WRITE,
- GEGL_ABYSS_NONE);
+ dest_extent,
+ level,
+ format,
+ GEGL_BUFFER_WRITE,
+ GEGL_ABYSS_NONE);
/*
* This code uses a (novel?) trick by Nicolas Robidoux that
@@ -933,40 +933,40 @@ transform_affine (GeglBuffer *dest,
while (gegl_buffer_iterator_next (i))
{
- GeglRectangle *roi = &i->roi[0];
- gfloat * restrict dest_buf = (gfloat *)i->data[0];
- gfloat * restrict dest_ptr =
- dest_buf +
- (gint) 4 * ( flip_x * (roi->width - (gint) 1) +
- flip_y * (roi->height - (gint) 1) * roi->width );
-
- gdouble u_start =
- base_u +
- inverse.coeff [0][0] * ( roi->x + flip_x * roi->width ) +
- inverse.coeff [0][1] * ( roi->y + flip_y * roi->height );
- gdouble v_start =
- base_v +
- inverse.coeff [1][0] * ( roi->x + flip_x * roi->width ) +
- inverse.coeff [1][1] * ( roi->y + flip_y * roi->height );
-
- gint y = roi->height;
- do {
- gdouble u_float = u_start;
- gdouble v_float = v_start;
-
- gint x = roi->width;
- do {
- gegl_sampler_get (sampler,
- u_float,
- v_float,
- &inverse_jacobian,
- dest_ptr,
- GEGL_ABYSS_NONE);
- dest_ptr += (gint) 4 - (gint) 8 * flip_x;
-
- u_float += inverse_jacobian.coeff [0][0];
- v_float += inverse_jacobian.coeff [1][0];
- } while (--x);
+ GeglRectangle *roi = &i->roi[0];
+ gfloat * restrict dest_buf = (gfloat *)i->data[0];
+ gfloat * restrict dest_ptr =
+ dest_buf +
+ (gint) 4 * ( flip_x * (roi->width - (gint) 1) +
+ flip_y * (roi->height - (gint) 1) * roi->width );
+
+ gdouble u_start =
+ base_u +
+ inverse.coeff [0][0] * ( roi->x + flip_x * roi->width ) +
+ inverse.coeff [0][1] * ( roi->y + flip_y * roi->height );
+ gdouble v_start =
+ base_v +
+ inverse.coeff [1][0] * ( roi->x + flip_x * roi->width ) +
+ inverse.coeff [1][1] * ( roi->y + flip_y * roi->height );
+
+ gint y = roi->height;
+ do {
+ gdouble u_float = u_start;
+ gdouble v_float = v_start;
+
+ gint x = roi->width;
+ do {
+ gegl_sampler_get (sampler,
+ u_float,
+ v_float,
+ &inverse_jacobian,
+ dest_ptr,
+ GEGL_ABYSS_NONE);
+ dest_ptr += (gint) 4 - (gint) 8 * flip_x;
+
+ u_float += inverse_jacobian.coeff [0][0];
+ v_float += inverse_jacobian.coeff [1][0];
+ } while (--x);
dest_ptr += (gint) 8 * (flip_x - flip_y) * roi->width;
@@ -1030,35 +1030,35 @@ transform_generic (GeglBuffer *dest,
* not to get right.
*/
const gdouble u_start_y =
- inverse.coeff [0][0] * (roi->x + (gdouble) 0.5) +
- inverse.coeff [0][1] * (roi->y + (gdouble) 0.5) +
- inverse.coeff [0][2];
+ inverse.coeff [0][0] * (roi->x + (gdouble) 0.5) +
+ inverse.coeff [0][1] * (roi->y + (gdouble) 0.5) +
+ inverse.coeff [0][2];
const gdouble v_start_y =
- inverse.coeff [1][0] * (roi->x + (gdouble) 0.5) +
- inverse.coeff [1][1] * (roi->y + (gdouble) 0.5) +
- inverse.coeff [1][2];
+ inverse.coeff [1][0] * (roi->x + (gdouble) 0.5) +
+ inverse.coeff [1][1] * (roi->y + (gdouble) 0.5) +
+ inverse.coeff [1][2];
const gdouble w_start_y =
- inverse.coeff [2][0] * (roi->x + (gdouble) 0.5) +
- inverse.coeff [2][1] * (roi->y + (gdouble) 0.5) +
- inverse.coeff [2][2];
+ inverse.coeff [2][0] * (roi->x + (gdouble) 0.5) +
+ inverse.coeff [2][1] * (roi->y + (gdouble) 0.5) +
+ inverse.coeff [2][2];
const gdouble u_float_y =
- u_start_y + inverse.coeff [0][1] * (roi->height - (gint) 1);
+ u_start_y + inverse.coeff [0][1] * (roi->height - (gint) 1);
const gdouble v_float_y =
- v_start_y + inverse.coeff [1][1] * (roi->height - (gint) 1);
+ v_start_y + inverse.coeff [1][1] * (roi->height - (gint) 1);
const gdouble w_float_y =
- w_start_y + inverse.coeff [2][1] * (roi->height - (gint) 1);
+ w_start_y + inverse.coeff [2][1] * (roi->height - (gint) 1);
- /*
+ /*
* Check whether the next scanline is likely to fall within the
* biased tile.
*/
const gint bflip_y =
- (u_float_y+v_float_y)/w_float_y < (u_start_y+v_start_y)/w_start_y
- ?
- (gint) 1
- :
- (gint) 0;
+ (u_float_y+v_float_y)/w_float_y < (u_start_y+v_start_y)/w_start_y
+ ?
+ (gint) 1
+ :
+ (gint) 0;
const gint flip_y = (gint) 1 - (gint) 2 * bflip_y;
/*
@@ -1072,18 +1072,18 @@ transform_generic (GeglBuffer *dest,
const gdouble w_start_x = bflip_y ? w_float_y : w_start_y;
const gdouble u_float_x =
- u_start_x + inverse.coeff [0][0] * (roi->width - (gint) 1);
+ u_start_x + inverse.coeff [0][0] * (roi->width - (gint) 1);
const gdouble v_float_x =
- v_start_x + inverse.coeff [1][0] * (roi->width - (gint) 1);
+ v_start_x + inverse.coeff [1][0] * (roi->width - (gint) 1);
const gdouble w_float_x =
- w_start_x + inverse.coeff [2][0] * (roi->width - (gint) 1);
+ w_start_x + inverse.coeff [2][0] * (roi->width - (gint) 1);
const gint bflip_x =
- (u_float_x + v_float_x)/w_float_x < (u_start_x + v_start_x)/w_start_x
- ?
- (gint) 1
- :
- (gint) 0;
+ (u_float_x + v_float_x)/w_float_x < (u_start_x + v_start_x)/w_start_x
+ ?
+ (gint) 1
+ :
+ (gint) 0;
const gint flip_x = (gint) 1 - (gint) 2 * bflip_x;
gdouble u_start = bflip_x ? u_float_x : u_start_x;
@@ -1091,52 +1091,52 @@ transform_generic (GeglBuffer *dest,
gdouble w_start = bflip_x ? w_float_x : w_start_x;
gfloat * restrict dest_ptr =
- dest_buf +
- (gint) 4 * ( bflip_x * (roi->width - (gint) 1) +
- bflip_y * (roi->height - (gint) 1) * roi->width );
+ dest_buf +
+ (gint) 4 * ( bflip_x * (roi->width - (gint) 1) +
+ bflip_y * (roi->height - (gint) 1) * roi->width );
/*
* Assumes that height and width are > 0.
*/
gint y = roi->height;
do {
- gdouble u_float = u_start;
- gdouble v_float = v_start;
- gdouble w_float = w_start;
-
- gint x = roi->width;
- do {
- gdouble w_recip = (gdouble) 1.0 / w_float;
- gdouble u = u_float * w_recip;
- gdouble v = v_float * w_recip;
-
- GeglMatrix2 inverse_jacobian;
- inverse_jacobian.coeff [0][0] =
- (inverse.coeff [0][0] - inverse.coeff [2][0] * u) * w_recip;
- inverse_jacobian.coeff [0][1] =
- (inverse.coeff [0][1] - inverse.coeff [2][1] * u) * w_recip;
- inverse_jacobian.coeff [1][0] =
- (inverse.coeff [1][0] - inverse.coeff [2][0] * v) * w_recip;
- inverse_jacobian.coeff [1][1] =
- (inverse.coeff [1][1] - inverse.coeff [2][1] * v) * w_recip;
-
- gegl_sampler_get (sampler,
- u,
- v,
- &inverse_jacobian,
- dest_ptr,
- GEGL_ABYSS_NONE);
-
- dest_ptr += flip_x * (gint) 4;
- u_float += flip_x * inverse.coeff [0][0];
- v_float += flip_x * inverse.coeff [1][0];
- w_float += flip_x * inverse.coeff [2][0];
- } while (--x);
-
- dest_ptr += (gint) 4 * (flip_y - flip_x) * roi->width;
- u_start += flip_y * inverse.coeff [0][1];
- v_start += flip_y * inverse.coeff [1][1];
- w_start += flip_y * inverse.coeff [2][1];
+ gdouble u_float = u_start;
+ gdouble v_float = v_start;
+ gdouble w_float = w_start;
+
+ gint x = roi->width;
+ do {
+ gdouble w_recip = (gdouble) 1.0 / w_float;
+ gdouble u = u_float * w_recip;
+ gdouble v = v_float * w_recip;
+
+ GeglMatrix2 inverse_jacobian;
+ inverse_jacobian.coeff [0][0] =
+ (inverse.coeff [0][0] - inverse.coeff [2][0] * u) * w_recip;
+ inverse_jacobian.coeff [0][1] =
+ (inverse.coeff [0][1] - inverse.coeff [2][1] * u) * w_recip;
+ inverse_jacobian.coeff [1][0] =
+ (inverse.coeff [1][0] - inverse.coeff [2][0] * v) * w_recip;
+ inverse_jacobian.coeff [1][1] =
+ (inverse.coeff [1][1] - inverse.coeff [2][1] * v) * w_recip;
+
+ gegl_sampler_get (sampler,
+ u,
+ v,
+ &inverse_jacobian,
+ dest_ptr,
+ GEGL_ABYSS_NONE);
+
+ dest_ptr += flip_x * (gint) 4;
+ u_float += flip_x * inverse.coeff [0][0];
+ v_float += flip_x * inverse.coeff [1][0];
+ w_float += flip_x * inverse.coeff [2][0];
+ } while (--x);
+
+ dest_ptr += (gint) 4 * (flip_y - flip_x) * roi->width;
+ u_start += flip_y * inverse.coeff [0][1];
+ v_start += flip_y * inverse.coeff [1][1];
+ w_start += flip_y * inverse.coeff [2][1];
} while (--y);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]