MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / LutsDiffer

Method LutsDiffer

ij/src/main/java/ij/process/LUT.java:116–140  ·  view source on GitHub ↗

Returns 'true' if the LUTs of the two images differ.

(ImagePlus imp1, ImagePlus imp2)

Source from the content-addressed store, hash-verified

114
115 /** Returns 'true' if the LUTs of the two images differ. */
116 public static boolean LutsDiffer(ImagePlus imp1, ImagePlus imp2) {
117 if (!imp1.isComposite() || !imp2.isComposite())
118 return false;
119 LUT[] luts1 = ((CompositeImage)imp1).getLuts();
120 LUT[] luts2 = ((CompositeImage)imp2).getLuts();
121 if (luts1==null || luts2==null)
122 return false;
123 if (luts1.length!=luts2.length)
124 return true;
125 for (int i=0; i<luts1.length; i++) {
126 if (luts1[i].min!=luts2[i].min)
127 return true;
128 if (luts1[i].max!=luts2[i].max)
129 return true;
130 byte[] bytes1 = luts1[i].getBytes();
131 byte[] bytes2 = luts2[i].getBytes();
132 if (bytes1.length!=bytes2.length)
133 return true;
134 for (int j=0; j<bytes1.length; j++) {
135 if (bytes1[j]!=bytes2[j])
136 return true;
137 }
138 }
139 return false;
140 }
141
142}

Callers 1

runMethod · 0.95

Calls 3

isCompositeMethod · 0.80
getLutsMethod · 0.45
getBytesMethod · 0.45

Tested by

no test coverage detected