View Javadoc

1   /**
2    * 
3    */
4   package de.desy.acop.video;
5   
6   import java.awt.Color;
7   
8   import de.desy.tine.types.IMAGE;
9   
10  /**
11   * This class provides the definitions of numerical constants and colors used in 
12   * </code>AcopVideo</code> and </code>SideProfileDisplayer</code> to draw analysis 
13   * elements.
14   * 
15   * @author Tilen Kusterle, Cosylab
16   *
17   */
18  public class Definitions {
19  	 
20  //	public static final int MAX_WIDTH = 768;
21  //	public static final int MAX_HEIGHT = 768;
22  	
23  	public static final int MAX_WIDTH = 2000;
24  	public static final int MAX_HEIGHT = 2000;
25  	public static final int IMAGE_SIZE = IMAGE.HEADER_SIZE + 8; //188 + 8 = 196
26  	//MAXSIZE = 6291456;
27  //	public static final int MAX_SIZE = 768 * 574 + VideoHeaderV2.HDRSIZE;
28  	//A_IMAGE_MAX_SIZE = 6304068 = MAX_SIZE + sideviewX(768 doubles), sideviewY(768 doubles) + 10* intFields (8*ROI+width+height) + 23*doubleFields (mean, std, etc) + calculateThreshold + performFit, image header
29  //	public static final int A_IMAGE_MAX_SIZE =  MAX_SIZE + 8*MAX_WIDTH + 8*MAX_HEIGHT + 10*4 + 22*8 + 2 + IMAGE.HEADER_SIZE;
30  	// 10*intFields (8*ROI+width+height) + 22*doubleFields (mean, std, etc) + calculateThreshold + performFit, image header
31  	public static final int A_IMAGE_MAX_SIZE = IMAGE_SIZE + 10*4 + 22*8 + 2 + 8*MAX_HEIGHT + 8*MAX_WIDTH;
32  
33  	
34  	private static final Color BACKGROUND_COLOR = Color.DARK_GRAY;
35  	private static final Color CANVAS_COLOR = Color.BLACK;
36  	private static final Color NEGATIVE_CANVAS_COLOR = Color.WHITE;
37  	private static final Color ROI_COLOR = Color.BLUE;
38  	private static final Color ROI_SELECTING_COLOR = Color.YELLOW;
39  	private static final Color NEGATIVE_ROI_SELECTING_COLOR = Color.GREEN;
40  	private static final Color DATA_COLOR = Color.WHITE;
41  	private static final Color NEGATIVE_DATA_COLOR = Color.BLACK;
42  	private static final Color FIT_COLOR = Color.GREEN;
43  	private static final Color STATISTICS_COLOR = Color.RED;
44  	private static final Color THRESHOLD_ROI_COLOR = Color.ORANGE;
45  	
46  	private static final boolean negatives = true;
47  	
48  	public static Color getBackgroundColor() {
49  		return BACKGROUND_COLOR;
50  	}
51  	
52  	public static Color getCanvasColor() {
53  		if (negatives) return NEGATIVE_CANVAS_COLOR;
54  		return CANVAS_COLOR;
55  	}
56  	
57  	/**
58  	 * Color for marking the region of interest.
59  	 * 
60  	 * @return
61  	 */
62  	public static Color getRoiColor() {
63  		return ROI_COLOR;
64  	}
65  	
66  	/**
67  	 * Color for threshold region of interest.
68  	 * 
69  	 * @return
70  	 */
71  	public static Color getThresholdRoiColor() {
72  		return THRESHOLD_ROI_COLOR;
73  	}
74  	
75  	public static Color getRoiSelectingColor() {
76  		if (negatives) return NEGATIVE_ROI_SELECTING_COLOR;
77  		return ROI_SELECTING_COLOR;
78  	}
79  	
80  	public static Color getDataColor() {
81  		if (negatives) return NEGATIVE_DATA_COLOR;
82  		return DATA_COLOR;
83  	}
84  	
85  	/**
86  	 * Color for drawing fitting results.
87  	 * 
88  	 * @return
89  	 */
90  	public static Color getFitColor() {
91  		return FIT_COLOR;
92  	}
93  	
94  	/**
95  	 * Color for drawing statistical results.
96  	 * @return
97  	 */
98  	public static Color getStatisticsColor() {
99  		return STATISTICS_COLOR;
100 	}
101 }