~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/paint/gimpperspectiveclone.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "core/gimp.h"
38
38
#include "core/gimpdrawable.h"
39
39
#include "core/gimpimage.h"
40
 
#include "core/gimppattern.h"
41
40
#include "core/gimppickable.h"
42
41
#include "core/gimp-transform-region.h"
43
42
 
77
76
                                                   gint             *paint_area_height,
78
77
                                                   PixelRegion      *srcPR);
79
78
 
 
79
static void     gimp_perspective_clone_get_matrix (GimpPerspectiveClone *clone,
 
80
                                                   GimpMatrix3          *matrix);
 
81
 
80
82
 
81
83
G_DEFINE_TYPE (GimpPerspectiveClone, gimp_perspective_clone,
82
84
               GIMP_TYPE_CLONE)
409
411
  return TRUE;
410
412
}
411
413
 
 
414
 
 
415
/*  public functions  */
 
416
 
 
417
void
 
418
gimp_perspective_clone_set_transform (GimpPerspectiveClone *clone,
 
419
                                      GimpMatrix3          *transform)
 
420
{
 
421
  g_return_if_fail (GIMP_IS_PERSPECTIVE_CLONE (clone));
 
422
  g_return_if_fail (transform != NULL);
 
423
 
 
424
  clone->transform = *transform;
 
425
 
 
426
  clone->transform_inv = clone->transform;
 
427
  gimp_matrix3_invert (&clone->transform_inv);
 
428
 
 
429
#if 0
 
430
  g_printerr ("%f\t%f\t%f\n%f\t%f\t%f\n%f\t%f\t%f\n\n",
 
431
              clone->transform.coeff[0][0],
 
432
              clone->transform.coeff[0][1],
 
433
              clone->transform.coeff[0][2],
 
434
              clone->transform.coeff[1][0],
 
435
              clone->transform.coeff[1][1],
 
436
              clone->transform.coeff[1][2],
 
437
              clone->transform.coeff[2][0],
 
438
              clone->transform.coeff[2][1],
 
439
              clone->transform.coeff[2][2]);
 
440
#endif
 
441
}
 
442
 
412
443
void
413
444
gimp_perspective_clone_get_source_point (GimpPerspectiveClone *clone,
414
445
                                         gdouble               x,
418
449
{
419
450
  gdouble temp_x, temp_y;
420
451
 
 
452
  g_return_if_fail (GIMP_IS_PERSPECTIVE_CLONE (clone));
 
453
  g_return_if_fail (newx != NULL);
 
454
  g_return_if_fail (newy != NULL);
 
455
 
421
456
  gimp_matrix3_transform_point (&clone->transform_inv,
422
457
                                x, y, &temp_x, &temp_y);
423
458
 
441
476
                                temp_x, temp_y, newx, newy);
442
477
}
443
478
 
444
 
void
 
479
 
 
480
/*  private functions  */
 
481
 
 
482
static void
445
483
gimp_perspective_clone_get_matrix (GimpPerspectiveClone *clone,
446
484
                                   GimpMatrix3          *matrix)
447
485
{