javamorph
Class CMorphOperator

java.lang.Object
  extended by javamorph.CMorphOperator
All Implemented Interfaces:
Runnable

public class CMorphOperator
extends Object
implements Runnable

Version:
1.1
Author:
claus.erhard.wimmer@googlemail.com
Program: JavaMorph V 1.1.
Class: CMorphOperator.
License: GPLv2.
Description: Morph the result from left input to right input depending on the ratio parameter.
Hint: Writes the result into the working directory.

Field Summary
private static boolean f_break
          If true the user forces the morph process to abort.
private static int left_pixel
          RGB value of the current left pixel.
private static Point left_point
          Current point coordinates of the left image.
private static double left_ratio
          Polygon clip ratio of the current left pixel.
private static CTransform left_trafo
          Transformation matrix from result to left point.
private static CMain parent
          Application's main class.
private static CProgress progress
          Instance of the progress bar.
private static double ratio
          If 0.01.0 then output is the right image.
private static int result_pixel
          RGB value of the current result pixel.
private static Point result_point
          Current point coordinates of the result image.
private static int right_pixel
          RGB value of the current right pixel.
private static Point right_point
          Current point coordinates of the right image.
private static double right_ratio
          Polygon clip ratio of the current right pixel.
private static CTransform right_trafo
          Transformation matrix from result to right point.
private static int t_idx
          Index of the current triangle within all three lists.
private static Point[] withins
          List of result points situated within the current result triangle.
 
Constructor Summary
CMorphOperator()
           
 
Method Summary
static void doBreak()
          Enable abort of the morph process forced by user.
private static void genResultTriangles()
          Make a weighted average mesh depending on the current ratio.
private static void merge()
          Merge (left.pixel, right.pixel)->(result.pixel).
private static Point merge(Point p1, Point p2)
          Merge two points weighted by ratio.
static void morph(CMain parent, CProgress progress)
          Initialize static class components.
 void run()
          Thread API.
private static void triangle()
          Merge all points of a triangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private static CMain parent
Application's main class.


ratio

private static double ratio
If 0.01.0 then output is the right image. Every value between them leads to a merged image.


left_point

private static Point left_point
Current point coordinates of the left image.


right_point

private static Point right_point
Current point coordinates of the right image.


result_point

private static Point result_point
Current point coordinates of the result image.


left_pixel

private static int left_pixel
RGB value of the current left pixel.


right_pixel

private static int right_pixel
RGB value of the current right pixel.


result_pixel

private static int result_pixel
RGB value of the current result pixel.


left_trafo

private static CTransform left_trafo
Transformation matrix from result to left point.


right_trafo

private static CTransform right_trafo
Transformation matrix from result to right point.


t_idx

private static int t_idx
Index of the current triangle within all three lists.


withins

private static Point[] withins
List of result points situated within the current result triangle.


left_ratio

private static double left_ratio
Polygon clip ratio of the current left pixel.


right_ratio

private static double right_ratio
Polygon clip ratio of the current right pixel.


f_break

private static boolean f_break
If true the user forces the morph process to abort.


progress

private static CProgress progress
Instance of the progress bar.

Constructor Detail

CMorphOperator

public CMorphOperator()
Method Detail

morph

public static void morph(CMain parent,
                         CProgress progress)
Initialize static class components.

Parameters:
parent - Main JFrame.
progress - Progress bar.

doBreak

public static void doBreak()
Enable abort of the morph process forced by user.


run

public void run()
Thread API. Starts morph batch for a number of intermediate pictures with increasing ratio value.

Specified by:
run in interface Runnable

genResultTriangles

private static void genResultTriangles()
Make a weighted average mesh depending on the current ratio.


merge

private static Point merge(Point p1,
                           Point p2)
Merge two points weighted by ratio.

Parameters:
p1 - First point.
p2 - Second point.
Returns:
Point on a line between them.

triangle

private static void triangle()
Merge all points of a triangle.


merge

private static void merge()
Merge (left.pixel, right.pixel)->(result.pixel). Result depends on ratio value & both polygon matrixes.