equal
deleted
inserted
replaced
159 |
159 |
160 LCMS.colorConvert(this, in, out); |
160 LCMS.colorConvert(this, in, out); |
161 } |
161 } |
162 |
162 |
163 public void colorConvert(BufferedImage src, BufferedImage dst) { |
163 public void colorConvert(BufferedImage src, BufferedImage dst) { |
164 if (LCMSImageLayout.isSupported(src) && |
|
165 LCMSImageLayout.isSupported(dst)) |
|
166 { |
|
167 doTransform(new LCMSImageLayout(src), new LCMSImageLayout(dst)); |
|
168 return; |
|
169 } |
|
170 LCMSImageLayout srcIL, dstIL; |
164 LCMSImageLayout srcIL, dstIL; |
|
165 |
|
166 dstIL = LCMSImageLayout.createImageLayout(dst); |
|
167 |
|
168 if (dstIL != null) { |
|
169 srcIL = LCMSImageLayout.createImageLayout(src); |
|
170 if (srcIL != null) { |
|
171 doTransform(srcIL, dstIL); |
|
172 return; |
|
173 } |
|
174 } |
|
175 |
171 Raster srcRas = src.getRaster(); |
176 Raster srcRas = src.getRaster(); |
172 WritableRaster dstRas = dst.getRaster(); |
177 WritableRaster dstRas = dst.getRaster(); |
173 ColorModel srcCM = src.getColorModel(); |
178 ColorModel srcCM = src.getColorModel(); |
174 ColorModel dstCM = dst.getColorModel(); |
179 ColorModel dstCM = dst.getColorModel(); |
175 int w = src.getWidth(); |
180 int w = src.getWidth(); |
437 } |
442 } |
438 |
443 |
439 public void colorConvert(Raster src, WritableRaster dst) { |
444 public void colorConvert(Raster src, WritableRaster dst) { |
440 |
445 |
441 LCMSImageLayout srcIL, dstIL; |
446 LCMSImageLayout srcIL, dstIL; |
|
447 dstIL = LCMSImageLayout.createImageLayout(dst); |
|
448 if (dstIL != null) { |
|
449 srcIL = LCMSImageLayout.createImageLayout(src); |
|
450 if (srcIL != null) { |
|
451 doTransform(srcIL, dstIL); |
|
452 return; |
|
453 } |
|
454 } |
442 // Can't pass src and dst directly to CMM, so process per scanline |
455 // Can't pass src and dst directly to CMM, so process per scanline |
443 SampleModel srcSM = src.getSampleModel(); |
456 SampleModel srcSM = src.getSampleModel(); |
444 SampleModel dstSM = dst.getSampleModel(); |
457 SampleModel dstSM = dst.getSampleModel(); |
445 int srcTransferType = src.getTransferType(); |
458 int srcTransferType = src.getTransferType(); |
446 int dstTransferType = dst.getTransferType(); |
459 int dstTransferType = dst.getTransferType(); |