01: /*
02: * $RCSfile: JPEGDecodeParam.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:55:31 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.codec;
13:
14: /**
15: * An instance of <code>ImageDecodeParam</code> for decoding images in
16: * the JPEG format.
17: *
18: * <p> This class allows for the specification of whether to decode the
19: * JPEG data into an image having a <code>SampleModel</code> which is a
20: * <code>ComponentSampleModel</code> or a subclass thereof. By default
21: * data are decoded into an image having a <code>ComponentSampleModel</code>.
22: *
23: * <p><b> This class is not a committed part of the JAI API. It may
24: * be removed or changed in future releases of JAI.</b>
25: */
26: public class JPEGDecodeParam implements ImageDecodeParam {
27:
28: /**
29: * Flag indicating whether to decode the data into an image with
30: * a <code>ComponentSampleModel</code>.
31: */
32: private boolean decodeToCSM = true;
33:
34: /**
35: * Constructs a <code>JPEGDecodeParam</code> object with default
36: * parameter values.
37: */
38: public JPEGDecodeParam() {
39: }
40:
41: /**
42: * Sets the data formatting flag to the value of the supplied parameter.
43: * If <code>true</code> the data will be decoded into an image which has
44: * a <code>SampleModel</code> which is a <code>ComponentSampleModel</code>.
45: * The default setting of this flag is <code>true</code>. If the flag is
46: * set to <code>false</code> then memory may be saved during decoding but
47: * the resulting image is not in that case guaranteed to have a
48: * <code>ComponentSampleModel</code>.
49: *
50: * @param decodeToCSM <code>true</code> if a
51: * <code>ComponentSampleModel</code> layout is preferred for the
52: * decoded image.
53: */
54: public void setDecodeToCSM(boolean decodeToCSM) {
55: this .decodeToCSM = decodeToCSM;
56: }
57:
58: /**
59: * Returns the value of the <code>ComponentSampleModel</code> flag
60: * which is by default <code>true</code>.
61: */
62: public boolean getDecodeToCSM() {
63: return decodeToCSM;
64: }
65: }
|