1 package mhr.appcore.transform;
3 import mhr.appcore.bitmap.BitmapInfo;
4 import mhr.appcore.bitmap.ChannelCount;
5 import mhr.appcore.bitmap.NBitmap;
6 import mhr.appcore.bitmap.NativeType;
7 import mhr.appcore.interpolators.InterpolatorType;
28 protected static native
int applyMatrixTo(
int nativeType,
long dstAdress,
long srcAdress,
int interpolatorType,
29 double a11,
double a12,
double a13,
30 double a21,
double a22,
double a23,
31 double a31,
double a32,
double a33);
42 throw new IllegalArgumentException(
"Operation is not applicable to suplied NBitmaps.");
52 return new TM( 1, 0, 0,
58 return new TM( Math.cos(alpha), Math.sin(alpha), 0,
59 -Math.sin(alpha), Math.cos(alpha), 0,
64 return new TM( x, 0, 0,
70 return new TM( 1, y, 0,
75 public static TM getProjectiveMatrix(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4) {
77 m.a13 = ((x1 - x2 + x4 - x3) * (y3 - y4) - (y1 - y2 + y4 - y3) * (x3 - x4)) / ((x2 - x4) * (y3 - y4) - (x3 - x4) * (y2 - y4));
78 m.a23 = ((y1 - y2 + y4 - y3) * (x2 - x4) - (x1 - x2 + x4 - x3) * (y2 - y4)) / ((x2 - x4) * (y3 - y4) - (x3 - x4) * (y2 - y4));
80 m.a11 = x2 - x1 + m.a13 * x2;
81 m.a21 = x3 - x1 + m.a23 * x3;
84 m.a12 = y2 - y1 + m.a13 * y2;
85 m.a22 = y3 - y1 + m.a23 * y3;