43 |
import java.awt.Point; |
import java.awt.Point; |
44 |
import java.awt.Transparency; |
import java.awt.Transparency; |
45 |
import java.awt.color.ColorSpace; |
import java.awt.color.ColorSpace; |
46 |
|
import java.lang.reflect.Constructor; |
47 |
import java.util.Arrays; |
import java.util.Arrays; |
48 |
|
|
49 |
/** |
/** |
159 |
this.transferType = transferType; |
this.transferType = transferType; |
160 |
} |
} |
161 |
|
|
162 |
|
// This is a hook for ColorConvertOp to create a colormodel with |
163 |
|
// a new colorspace |
164 |
|
ColorModel cloneColorModel(ColorSpace cspace) |
165 |
|
{ |
166 |
|
Class cls = this.getClass(); |
167 |
|
ColorModel cm; |
168 |
|
try { |
169 |
|
// This constructor will exist. |
170 |
|
Constructor ctor = |
171 |
|
cls.getConstructor(new Class[]{int.class, int[].class, |
172 |
|
ColorSpace.class, boolean.class, |
173 |
|
boolean.class, int.class, int.class}); |
174 |
|
cm = (ColorModel)ctor. |
175 |
|
newInstance(new Object[]{new Integer(pixel_bits), |
176 |
|
bits, cspace, Boolean.valueOf(hasAlpha), |
177 |
|
Boolean.valueOf(isAlphaPremultiplied), |
178 |
|
new Integer(transparency), |
179 |
|
new Integer(transferType)}); |
180 |
|
} |
181 |
|
catch (Exception e) |
182 |
|
{ |
183 |
|
throw new IllegalArgumentException(); |
184 |
|
} |
185 |
|
return cm; |
186 |
|
} |
187 |
|
|
188 |
public void finalize() |
public void finalize() |
189 |
{ |
{ |
190 |
// Do nothing here. |
// Do nothing here. |