01: /*
02: * $RCSfile: ColorConvertCRIF.java,v $
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Use is subject to license terms.
07: *
08: * $Revision: 1.1 $
09: * $Date: 2005/02/11 04:56:17 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.opimage;
13:
14: import java.awt.RenderingHints;
15: import java.awt.image.ColorModel;
16: import java.awt.image.RenderedImage;
17: import java.awt.image.renderable.ParameterBlock;
18: import javax.media.jai.CRIFImpl;
19: import javax.media.jai.ImageLayout;
20: import java.util.Map;
21:
22: /**
23: * A <code>CRIF</code> supporting the "ColorConvert" operation in the rendered
24: * and renderable image layers.
25: *
26: * @see javax.media.jai.operator.ColorConvertDescriptor
27: * @see ColorConvertOpImage
28: *
29: * @since EA4
30: *
31: */
32: public class ColorConvertCRIF extends CRIFImpl {
33:
34: /** Constructor. */
35: public ColorConvertCRIF() {
36: super ("colorconvert");
37: }
38:
39: /**
40: * Creates a new instance of <code>ColorConvertOpImage</code> in the
41: * rendered layer.
42: *
43: * @param args The source image and the destination ColorModel.
44: * @param hints Optionally contains destination image layout.
45: */
46: public RenderedImage create(ParameterBlock args,
47: RenderingHints renderHints) {
48: // Get ImageLayout from renderHints if any.
49: ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
50:
51: return new ColorConvertOpImage(args.getRenderedSource(0),
52: renderHints, layout, (ColorModel) args
53: .getObjectParameter(0));
54: }
55: }
|