1 package mhr.appcore.image.layers.lut;
3 import org.w3c.dom.Document;
4 import org.w3c.dom.Element;
6 import mhr.appcore.bitmap.NBitmap;
7 import mhr.appcore.bitmap.exceptions.BitmapAllocationException;
8 import mhr.appcore.bitmap.exceptions.UnsupportedBitmapException;
9 import mhr.appcore.exceptions.AlreadyDisposedException;
10 import mhr.appcore.image.Image;
11 import mhr.appcore.image.exceptions.InvalidLayerSpecificPresentationSuppliedException;
12 import mhr.appcore.image.exceptions.LayerCreationException;
13 import mhr.appcore.image.layers.Layer;
14 import mhr.appcore.image.layers.LayerPDInfo;
15 import mhr.appcore.image.layers.LayerType;
16 import mhr.appcore.interfaces.ImageFile;
17 import mhr.appcore.pointops.LUT;
18 import mhr.appcore.pointops.LUTAllocationException;
19 import mhr.appcore.utils.NotImplementedException;
20 import mhr.appcore.utils.Rect;
51 this.
M =
new float[2][l.
M[0].length];
52 this.
R =
new float[2][l.
R[0].length];
53 this.
G =
new float[2][l.
G[0].length];
54 this.
B =
new float[2][l.
B[0].length];
55 this.
A =
new float[2][l.
A[0].length];
57 for (
int i = 0; i < 2; i++) {
58 System.arraycopy(l.
M[i], 0,
this.M[i], 0, l.
M[i].length);
59 System.arraycopy(l.
R[i], 0,
this.R[i], 0, l.
R[i].length);
60 System.arraycopy(l.
G[i], 0,
this.G[i], 0, l.
G[i].length);
61 System.arraycopy(l.
B[i], 0,
this.B[i], 0, l.
B[i].length);
62 System.arraycopy(l.
A[i], 0,
this.A[i], 0, l.
A[i].length);
79 float[][] defVals =
new float[][]{
83 M = defVals;
R = defVals;
G = defVals;
B = defVals;
A = defVals;
91 M[0] =
extractFrom(i.getElementsByTagName(
"MX").item(0).getTextContent());
92 M[1] =
extractFrom(i.getElementsByTagName(
"MY").item(0).getTextContent());
95 R[0] =
extractFrom(i.getElementsByTagName(
"RX").item(0).getTextContent());
96 R[1] =
extractFrom(i.getElementsByTagName(
"RY").item(0).getTextContent());
99 G[0] =
extractFrom(i.getElementsByTagName(
"GX").item(0).getTextContent());
100 G[1] =
extractFrom(i.getElementsByTagName(
"GY").item(0).getTextContent());
103 B[0] =
extractFrom(i.getElementsByTagName(
"BX").item(0).getTextContent());
104 B[1] =
extractFrom(i.getElementsByTagName(
"BY").item(0).getTextContent());
107 A[0] =
extractFrom(i.getElementsByTagName(
"AX").item(0).getTextContent());
108 A[1] =
extractFrom(i.getElementsByTagName(
"AY").item(0).getTextContent());
109 }
catch (Exception e) {
129 protected void fillWith(StringBuilder b,
float[] arr) {
132 for (
int i = 1; i < arr.length; i++) {
139 String[] vals = s.split(
" ");
140 float[] r =
new float[vals.length];
141 for (
int i = 0; i < vals.length; i++) {
142 r[i] = Float.parseFloat(vals[i]);
148 StringBuilder b =
new StringBuilder();
205 CurvesLUTLayerSpecificPresentation p = (CurvesLUTLayerSpecificPresentation) presentation.
extra;