@Override @Nonnull public String toString() { return String.format("ConvertColorProfileOp(%s, %s)", ImageUtils.getICCProfileName(iccProfile), renderingIntent); } }
@Override @Nonnull public String toString() { return String.format("AssignColorProfileOp(%s)", ImageUtils.getICCProfileName(iccProfile)); } }
/******************************************************************************* * * ******************************************************************************/ public static String getICCProfileName (RenderedImage image) { ICC_Profile iccProfile = ImageUtils.getICCProfile(image); if (iccProfile != null) { return ImageUtils.getICCProfileName(iccProfile); } else { return null; } }
/******************************************************************************* * * ******************************************************************************/ private static String toString (ICC_ColorSpace colorSpace) { StringBuffer buffer = new StringBuffer(""); buffer.append(colorSpace.getClass().getName()); buffer.append("[type: "); buffer.append(colorSpace.getType()); buffer.append(", profile name: "); buffer.append(ImageUtils.getICCProfileName(colorSpace.getProfile())); buffer.append("]"); return buffer.toString(); }
@Nonnull @Override protected BufferedImage execute (final @Nonnull AssignColorProfileOp operation, final @Nonnull EditableImage image, final @Nonnull BufferedImage bufferedImage) { final ICC_Profile targetProfile = operation.getIccProfile(); log.trace("assignColorProfile({})", ImageUtils.getICCProfileName(targetProfile)); Java2DUtils.logImage(log, ">>>> source bufferedImage", bufferedImage); final ColorSpace colorSpace = new ICC_ColorSpace(targetProfile); final ColorModel colorModel = new ComponentColorModel(colorSpace, false, false, ColorModel.OPAQUE, bufferedImage.getRaster().getDataBuffer().getDataType()); final BufferedImage result = new BufferedImage(colorModel, bufferedImage.getRaster(), false, Java2DUtils.getProperties(bufferedImage)); Java2DUtils.logImage(log, ">>>> assignColorProfile() returning ", bufferedImage); return result; } }
log.debug("convertColorProfile({})", ImageUtils.getICCProfileName(targetProfile)); Java2DUtils.logImage(log, ">>>> source bufferedImage", bufferedImage); final String sourceProfileName = ImageUtils.getICCProfileName(sourceProfile); log.debug(">>>> Converting profile from {} to {}", sourceProfileName, ImageUtils.getICCProfileName(targetProfile));
/******************************************************************************* * * @inheritDoc * ******************************************************************************/ protected PlanarImage execute (ConvertColorProfileOp operation, final EditableImage image, PlanarImage planarImage) { ICC_Profile iccProfile = operation.getICCProfile(); logger.fine("convertColorProfile(" + ImageUtils.getICCProfileName(iccProfile) + ") - " + planarImage.getSampleModel()); planarImage = ColorConvertDescriptor.create(planarImage, JAIUtils.getColorModel(planarImage, iccProfile), null); // FIXME: RenderingHints JAIUtils.logImage(logger, ">>>> convertColorProfile() returning", planarImage); return planarImage; } }
String sourceProfileName = ImageUtils.getICCProfileName(colorSpace.getProfile());