Review Request 115487: removed trailing spaces and optimised shear effect

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Review Request 115487: removed trailing spaces and optimised shear effect

Heena Mahour
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/115487/

Review request for Digikam.
By Heena Mahour.
Repository: digikam

Description

-Removed the trailing spaces
-Removed redundant code
-Required absolute value so used fabs()

Testing

yes,works fine.

Diffs

  • libs/dimg/filters/transform/shearfilter.cpp (96a4534)

View Diff


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Review Request 115487: removed trailing spaces and optimised shear effect

Martin Klapetek
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/115487/

libs/dimg/filters/transform/shearfilter.cpp (Diff revision 1)
void ShearFilter::filterImage()
123
    horz_add = nHeight * ((d->hAngle < 0.0) ? sin(horz_beta_angle) : cos(horz_beta_angle));
123
    horz_add = fabs(nHeight * ((d->hAngle < 0.0) ? sin(horz_beta_angle) : cos(horz_beta_angle)));
124
    vert_add = nWidth  * ((d->vAngle < 0.0) ? sin(vert_beta_angle) : cos(vert_beta_angle));
124
    vert_add = fabs(nWidth  * ((d->vAngle < 0.0) ? sin(vert_beta_angle) : cos(vert_beta_angle)));
125
126
    // get absolute values for the distances
127
    horz_add = fabs(horz_add);
128
    vert_add = fabs(vert_add);
Fwiw, the original code is easier to read to me...you should also merge the comments

libs/dimg/filters/transform/shearfilter.cpp (Diff revision 1)
void ShearFilter::filterImage()
180
            nx = x + dx + y * horz_factor;
176
            nx = fabs(x + dx + y * horz_factor);
181
            ny = y + dy + x * vert_factor;
177
            ny = fabs(y + dy + x * vert_factor);
I don't see a way this could be negative...? Iow, why the fabs here?

- Martin Klapetek


On February 4th, 2014, 9:10 p.m. CET, Heena Mahour wrote:

Review request for Digikam.
By Heena Mahour.

Updated Feb. 4, 2014, 9:10 p.m.

Repository: digikam

Description

-Removed the trailing spaces
-Removed redundant code
-Required absolute value so used fabs()

Testing

yes,works fine.

Diffs

  • libs/dimg/filters/transform/shearfilter.cpp (96a4534)

View Diff


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel