public class AffineTransform2D extends Object implements AffineGet, AffineSet, Concatenable<AffineGet>, PreConcatenable<AffineGet>
Modifier and Type | Class and Description |
---|---|
protected static class |
AffineTransform2D.AffineMatrix2D |
Modifier and Type | Field and Description |
---|---|
protected AffineTransform2D.AffineMatrix2D |
a |
protected RealPoint |
d0 |
protected RealPoint |
d1 |
protected RealPoint[] |
ds |
protected AffineTransform2D |
inverse |
Modifier | Constructor and Description |
---|---|
|
AffineTransform2D() |
protected |
AffineTransform2D(AffineTransform2D.AffineMatrix2D a) |
protected |
AffineTransform2D(AffineTransform2D inverse) |
Modifier and Type | Method and Description |
---|---|
void |
apply(double[] source,
double[] target)
Apply the
RealTransform to a source vector to obtain a target
vector. |
void |
apply(float[] source,
float[] target)
Apply the
RealTransform to a source vector to obtain a target
vector. |
void |
apply(RealLocalizable source,
RealPositionable target)
|
void |
applyInverse(double[] source,
double[] target)
Apply the inverse transform to a target vector to obtain a source vector.
|
void |
applyInverse(float[] source,
float[] target)
Apply the inverse transform to a target vector to obtain a source vector.
|
void |
applyInverse(RealPositionable source,
RealLocalizable target)
Apply the inverse transform to a target
RealLocalizable to obtain
a source RealPositionable . |
AffineTransform2D |
concatenate(AffineGet affine)
Concatenate this object with a.
|
AffineTransform2D |
concatenate(AffineTransform2D model) |
AffineTransform2D |
copy()
Create a deep copy of this
RealTransform . |
RealLocalizable |
d(int d)
Get the constant partial differential vector for dimension d.
|
FinalRealInterval |
estimateBounds(RealInterval interval)
Calculate the boundary interval of an interval after it has been
transformed.
|
double |
get(int row,
int column)
Get a field of the n×(n+1) affine transformation
matrix.
|
Class<AffineGet> |
getConcatenableClass() |
Class<AffineGet> |
getPreConcatenableClass() |
double[] |
getRowPackedCopy()
Get a copy of the n×(n+1) affine transformation
matrix as a row packed array similar to Jama.
|
AffineTransform2D |
inverse()
Get the inverse transform.
|
protected void |
invert() |
boolean |
isIdentity()
Check if the
RealTransform is identity. |
int |
numDimensions()
Gets the space's number of dimensions.
|
int |
numSourceDimensions()
Returns n, the minimal number of dimension of the source vector.
|
int |
numTargetDimensions()
Returns m, the minimal dimension of the target vector.
|
AffineTransform2D |
preConcatenate(AffineGet affine)
Pre-concatenate this object with a.
|
AffineTransform2D |
preConcatenate(AffineTransform2D affine) |
void |
rotate(double d)
Rotate
|
void |
scale(double d)
Scale
|
void |
scale(double s0,
double s1)
Scale
|
void |
set(AffineTransform2D m) |
void |
set(double... values)
Set the n×(n+1) affine transformation matrix with
row packed double values.
|
void |
set(double[][] values)
Set the n×(n+1) affine transformation matrix with
double values from a [row][column] addressed array.
|
void |
set(double value,
int row,
int column)
Set a field of the n×(n+1) affine transformation
matrix.
|
void |
toArray(double[] data) |
void |
toMatrix(double[][] data) |
String |
toString() |
void |
translate(double... t)
Translate
|
protected void |
updateDs() |
protected final AffineTransform2D.AffineMatrix2D a
protected final RealPoint d0
protected final RealPoint d1
protected final RealPoint[] ds
protected final AffineTransform2D inverse
public AffineTransform2D()
protected AffineTransform2D(AffineTransform2D.AffineMatrix2D a)
protected AffineTransform2D(AffineTransform2D inverse)
protected void invert()
protected void updateDs()
public final void apply(double[] source, double[] target)
RealTransform
RealTransform
to a source vector to obtain a target
vector.apply
in interface RealTransform
source
- source coordinates, length must be >=
RealTransform.numSourceDimensions()
target
- set this to the target coordinates, length must be >=
RealTransform.numTargetDimensions()
public void apply(float[] source, float[] target)
RealTransform
RealTransform
to a source vector to obtain a target
vector.apply
in interface RealTransform
source
- source coordinates, length must be >=
RealTransform.numSourceDimensions()
target
- set this to the target coordinates, length must be >=
RealTransform.numTargetDimensions()
public void apply(RealLocalizable source, RealPositionable target)
RealTransform
apply
in interface RealTransform
source
- source coordinates, numDimensions()
must be >=
RealTransform.numSourceDimensions()
target
- set this to the target coordinates,
numDimensions()
must
be >=
RealTransform.numTargetDimensions()
public final void applyInverse(double[] source, double[] target)
InvertibleRealTransform
applyInverse
in interface InvertibleRealTransform
source
- set this to the source coordinates.target
- target coordinates.public void applyInverse(float[] source, float[] target)
InvertibleRealTransform
applyInverse
in interface InvertibleRealTransform
source
- set this to the source coordinates.target
- target coordinates.public void applyInverse(RealPositionable source, RealLocalizable target)
InvertibleRealTransform
RealLocalizable
to obtain
a source RealPositionable
.applyInverse
in interface InvertibleRealTransform
source
- set this to the source coordinates.target
- target coordinates.public final AffineTransform2D concatenate(AffineGet affine)
Concatenable
concatenate
in interface Concatenable<AffineGet>
public final AffineTransform2D concatenate(AffineTransform2D model)
public AffineTransform2D copy()
RealTransform
RealTransform
.
Deep copying is required to make sure that stateful RealTransforms
can be duplicated for concurrent code.
copy
in interface AffineGet
copy
in interface InvertibleRealTransform
copy
in interface RealTransform
public RealLocalizable d(int d)
AffineGet
public double get(int row, int column)
AffineGet
public double[] getRowPackedCopy()
AffineGet
getRowPackedCopy
in interface AffineGet
public Class<AffineGet> getConcatenableClass()
getConcatenableClass
in interface Concatenable<AffineGet>
public Class<AffineGet> getPreConcatenableClass()
getPreConcatenableClass
in interface PreConcatenable<AffineGet>
public AffineTransform2D inverse()
InvertibleRealTransform
inverse
in interface AffineGet
inverse
in interface InvertibleRealTransform
public int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
public int numSourceDimensions()
RealTransform
numSourceDimensions
in interface RealTransform
public int numTargetDimensions()
RealTransform
numTargetDimensions
in interface RealTransform
public final AffineTransform2D preConcatenate(AffineGet affine)
PreConcatenable
preConcatenate
in interface PreConcatenable<AffineGet>
public final AffineTransform2D preConcatenate(AffineTransform2D affine)
public void rotate(double d)
d
- angle in radianspublic void translate(double... t)
t
- 2d translation vectorpublic void scale(double d)
d
- scale factorpublic void scale(double s0, double s1)
s0
- scale factor for dimension 0s1
- scale factor for dimension 1public final void set(AffineTransform2D m)
public void toArray(double[] data)
public void toMatrix(double[][] data)
public void set(double value, int row, int column)
AffineSet
public void set(double... values)
AffineSet
public void set(double[][] values)
AffineSet
public boolean isIdentity()
RealTransform
RealTransform
is identity.isIdentity
in interface RealTransform
public FinalRealInterval estimateBounds(RealInterval interval)
interval
- the original boundsCopyright © 2015–2022 ImgLib2. All rights reserved.