@@ -29,6 +29,42 @@ public abstract class VImage extends VType implements AlarmProvider, TimeProvide
2929 */
3030 public abstract int getWidth ();
3131
32+ /**
33+ * Horizontal pixel offset.
34+ * For sub-images within a larger image,
35+ * this is the X offset.
36+ * Defaults to zero.
37+ *
38+ * @return pixel offset
39+ */
40+ public abstract int getXOffset ();
41+
42+ /**
43+ * Vertical pixel offset.
44+ * For sub-images within a larger image,
45+ * this is the Y offset.
46+ * Defaults to zero.
47+ *
48+ * @return pixel offset
49+ */
50+ public abstract int getYOffset ();
51+
52+ /**
53+ * Is the horizontal axis reversed?
54+ * Defaults to false.
55+ *
56+ * @return <code>true</code> if axis is reversed
57+ */
58+ public abstract boolean isXReversed ();
59+
60+ /**
61+ * Is the vertical axis reversed?
62+ * Defaults to false.
63+ *
64+ * @return <code>true</code> if axis is reversed
65+ */
66+ public abstract boolean isYReversed ();
67+
3268 /**
3369 * Image data;
3470 *
@@ -65,7 +101,28 @@ public abstract class VImage extends VType implements AlarmProvider, TimeProvide
65101 * @return a new instance of VImage
66102 */
67103 public static VImage of (int height , int width , final ListNumber data , VImageDataType imageDataType , VImageType vImageType , Alarm alarm , Time time ) {
68- return new IVImage (height , width , data , imageDataType , vImageType , alarm , time );
104+ return of (height , width , 0 , 0 , false , false , data , imageDataType , vImageType , alarm , time );
105+ }
106+
107+ /**
108+ * Creates a new VImage.
109+ *
110+ * @param height image height
111+ * @param width image width
112+ * @param xoffset horizontal offset
113+ * @param yoffset vertical offset
114+ * @param xreversed is horizontal axis reversed?
115+ * @param yreversed is vertical axis reversed?
116+ * @param data image data
117+ * @param imageDataType image data type
118+ * @param vImageType image type
119+ * @param alarm alarm information
120+ * @param time timestamp
121+ * @return a new instance of VImage
122+ */
123+ public static VImage of (int height , int width , int xoffset , int yoffset , boolean xreversed , boolean yreversed ,
124+ final ListNumber data , VImageDataType imageDataType , VImageType vImageType , Alarm alarm , Time time ) {
125+ return new IVImage (height , width , xoffset , yoffset , xreversed , yreversed , data , imageDataType , vImageType , alarm , time );
69126 }
70127
71128 @ Override
@@ -80,6 +137,8 @@ public final boolean equals(Object obj) {
80137 return getClass ().equals (other .getClass ())
81138 && getHeight () == other .getHeight ()
82139 && getWidth () == other .getWidth ()
140+ && getXOffset () == other .getXOffset ()
141+ && getYOffset () == other .getYOffset ()
83142 && getData ().equals (other .getData ())
84143 && getDataType ().equals (other .getDataType ())
85144 && getVImageType ().equals (other .getVImageType ())
@@ -95,6 +154,8 @@ public final int hashCode() {
95154 int hash = 7 ;
96155 hash = 23 * hash + Objects .hashCode (getHeight ());
97156 hash = 23 * hash + Objects .hashCode (getWidth ());
157+ hash = 23 * hash + Objects .hashCode (getXOffset ());
158+ hash = 23 * hash + Objects .hashCode (getYOffset ());
98159 hash = 23 * hash + Objects .hashCode (getData ());
99160 hash = 23 * hash + Objects .hashCode (getDataType ());
100161 hash = 23 * hash + Objects .hashCode (getVImageType ());
0 commit comments