44 */
55package org .epics .vtype ;
66
7+ import java .util .Objects ;
8+
79import org .epics .util .array .ListNumber ;
810
911/**
@@ -33,18 +35,17 @@ public abstract class VImage extends VType implements AlarmProvider, TimeProvide
3335 * @return ListNumber image data
3436 */
3537 public abstract ListNumber getData ();
36-
38+
3739 /**
38- * Describes the type in which the data is stored
39- * {@link VImageDataType}
40+ * Describes the type in which the data is stored {@link VImageDataType}
4041 *
41- * @return image data type
42+ * @return image data type
4243 */
4344 public abstract VImageDataType getDataType ();
4445
4546 /**
46- * Returns the image type, The image type describes the mechanism in which
47- * the data is encoded and how it can be converted to something that can be
47+ * Returns the image type, The image type describes the mechanism in which the
48+ * data is encoded and how it can be converted to something that can be
4849 * rendered.
4950 *
5051 * @return the image type {@link VImageType}
@@ -53,14 +54,50 @@ public abstract class VImage extends VType implements AlarmProvider, TimeProvide
5354
5455 /**
5556 * Creates a new VImage.
56- *
57+ *
5758 * @param value the value
5859 * @param alarm the alarm
5960 * @param time the time
6061 * @param display the display
61- * @return the new value
62+ * @return the new Image
6263 */
63- public static VImage of (int height , int width , final ListNumber data , VImageDataType imageDataType , Alarm alarm , Time time ) {
64- return new IVImage (height , width , data , imageDataType , VImageType .TYPE_3BYTE_BGR , alarm , time );
64+ public static VImage of (int height , int width , final ListNumber data , VImageDataType imageDataType , VImageType vImageType , Alarm alarm , Time time ) {
65+ return new IVImage (height , width , data , imageDataType , vImageType , alarm , time );
66+ }
67+
68+ @ Override
69+ public final boolean equals (Object obj ) {
70+ if (this == obj ) {
71+ return true ;
72+ }
73+
74+ if (obj instanceof VImage ) {
75+ VImage other = (VImage ) obj ;
76+
77+ return getClass ().equals (other .getClass ())
78+ && getHeight () == other .getHeight ()
79+ && getWidth () == other .getWidth ()
80+ && getData ().equals (other .getData ())
81+ && getDataType ().equals (other .getDataType ())
82+ && getVImageType ().equals (other .getVImageType ())
83+ && getAlarm ().equals (other .getAlarm ())
84+ && getTime ().equals (other .getTime ());
85+ }
86+
87+ return false ;
6588 }
89+
90+ @ Override
91+ public final int hashCode () {
92+ int hash = 7 ;
93+ hash = 23 * hash + Objects .hashCode (getHeight ());
94+ hash = 23 * hash + Objects .hashCode (getWidth ());
95+ hash = 23 * hash + Objects .hashCode (getData ());
96+ hash = 23 * hash + Objects .hashCode (getDataType ());
97+ hash = 23 * hash + Objects .hashCode (getVImageType ());
98+ hash = 23 * hash + Objects .hashCode (getAlarm ());
99+ hash = 23 * hash + Objects .hashCode (getTime ());
100+ return hash ;
101+ }
102+
66103}
0 commit comments