View Javadoc

1   package de.desy.acop.video;
2   
3   import de.desy.acop.displayers.tools.AcopDisplayerParameters;
4   import de.desy.acop.transport.ConnectionParameters;
5   import de.desy.acop.video.displayer.ColorMap;
6   import de.desy.acop.video.displayer.ImageDisplayer;
7   import de.desy.acop.video.displayer.ImageZoom;
8   import de.desy.acop.video.displayer.OverlayState;
9   
10  /**
11   * 
12   * <code>AcopVideoParameters</code> are parameters used by the AcopVideo.
13   * <p>
14   * They hold information about the {@link ConnectionParameters} and the specific
15   * AcopVideo features.
16   * 
17   * @author <a href="mailto:jaka.bobnar@cosylab.com">Jaka Bobnar</a>
18   * @version $Id: Templates.xml,v 1.10 2004/01/13 16:17:13 jbobnar Exp $
19   * 
20   */
21  public class AcopVideoParameters extends AcopDisplayerParameters {
22  
23  	private static final long serialVersionUID = 1L;
24  
25  	/**
26  	 * Constructs a new AcopVideoParameters with all properties false and
27  	 * grayscale color map.
28  	 * 
29  	 * @param parameters
30  	 */
31  	public AcopVideoParameters(ConnectionParameters parameters) {
32  		this(parameters, false, ImageZoom.AUTO, OverlayState.AUTO, false, false, 0x0, 0xff, ColorMap.NONE, false);
33  	}
34  
35  	/**
36  	 * Constructs a new AcopVideoParameters.
37  	 * 
38  	 * @param parameters
39  	 * @param aoiZoom
40  	 * @param imageZoom
41  	 * @param overlayState
42  	 * @param keepAspectRatio
43  	 * @param histogramEqualisation
44  	 * @param colorMap
45  	 */
46  	public AcopVideoParameters(ConnectionParameters parameters, //
47  			boolean aoiZoom, //
48  			ImageZoom imageZoom, //
49  			OverlayState overlayState, //
50  			boolean keepAspectRatio, //
51  			boolean histogramEqualisation, //
52  			int histogramMin, //
53  			int histogramMax, //
54  			ColorMap colorMap, //
55  			boolean displayClutHeader) {
56  
57  		super("", 0, parameters, 0, 0, 0, "", "%f");
58  
59  		addParameter(ImageDisplayer.PROPERTY_AOI_ZOOM, aoiZoom);
60  		addParameter(ImageDisplayer.PROPERTY_IMAGE_ZOOM, imageZoom);
61  		addParameter(ImageDisplayer.PROPERTY_OVERLAY_STATE, overlayState);
62  		addParameter(ImageDisplayer.PROPERTY_KEEP_ASPECT_RATIO, keepAspectRatio);
63  		addParameter(ImageDisplayer.PROPERTY_HISTOGRAM_EQUALISATION, histogramEqualisation);
64  		addParameter(ImageDisplayer.PROPERTY_HISTOGRAM_MIN, histogramMin);
65  		addParameter(ImageDisplayer.PROPERTY_HISTOGRAM_MAX, histogramMax);
66  		addParameter(ImageDisplayer.PROPERTY_COLOR_MAP, colorMap);
67  		addParameter(AcopVideo.PROPERTY_DISPLAY_CLUT_HEADER, displayClutHeader);
68  
69  	}
70  
71  	/**
72  	 * Returns the value of aoiZoom property.
73  	 * 
74  	 * @return
75  	 */
76  	public boolean isAOIZoom() {
77  		return getBool(ImageDisplayer.PROPERTY_AOI_ZOOM);
78  	}
79  
80  	/**
81  	 * Returns the value of the overlay state. mdavid
82  	 * 
83  	 * @return
84  	 */
85  	public ImageZoom getImageZoom() {
86  		return (ImageZoom) getParameter(ImageDisplayer.PROPERTY_IMAGE_ZOOM);
87  	}
88  
89  	/**
90  	 * Returns the value of the overlay state. mdavid
91  	 * 
92  	 * @return
93  	 */
94  	public OverlayState getOverlayState() {
95  		return (OverlayState) getParameter(ImageDisplayer.PROPERTY_OVERLAY_STATE);
96  	}
97  
98  	/**
99  	 * Returns the value of the keep aspect ratio property.
100 	 * 
101 	 * @return
102 	 */
103 	public boolean isKeepAspectRatio() {
104 		return getBool(ImageDisplayer.PROPERTY_KEEP_ASPECT_RATIO);
105 	}
106 
107 	/**
108 	 * Returns the value of the histogram equalization.
109 	 * 
110 	 * @return
111 	 */
112 	public boolean isHistogramEqualisation() {
113 		return getBool(ImageDisplayer.PROPERTY_HISTOGRAM_EQUALISATION);
114 	}
115 
116 	/**
117 	 * Returns min value of the histogram.
118 	 * 
119 	 * @return
120 	 */
121 	public int getHistogramMin() {
122 		return (Integer) getParameter(ImageDisplayer.PROPERTY_HISTOGRAM_MIN);
123 	}
124 
125 	/**
126 	 * Returns max value of the histogram.
127 	 * 
128 	 * @return
129 	 */
130 	public int getHistogramMax() {
131 		return (Integer) getParameter(ImageDisplayer.PROPERTY_HISTOGRAM_MAX);
132 	}
133 
134 	/**
135 	 * Returns the color map.
136 	 * 
137 	 * @return
138 	 */
139 	public ColorMap getColorMap() {
140 		return (ColorMap) getParameter(ImageDisplayer.PROPERTY_COLOR_MAP);
141 	}
142 
143 	/**
144 	 * Returns the value of the visible CLUT header property.
145 	 * 
146 	 * @return true if the CLUT header is visible, otherwise false
147 	 */
148 	public boolean isDisplayClutHeader() {
149 		return getBool(AcopVideo.PROPERTY_DISPLAY_CLUT_HEADER);
150 	}
151 }