1 package org.opencv.core;
6 public double width, height;
8 public Size(double width, double height) {
17 public Size(Point p) {
22 public Size(double[] vals) {
26 public void set(double[] vals) {
28 width = vals.length > 0 ? vals[0] : 0;
29 height = vals.length > 1 ? vals[1] : 0;
36 public double area() {
37 return width * height;
40 public boolean empty() {
41 return width <= 0 || height <= 0;
45 return new Size(width, height);
49 public int hashCode() {
53 temp = Double.doubleToLongBits(height);
54 result = prime * result + (int) (temp ^ (temp >>> 32));
55 temp = Double.doubleToLongBits(width);
56 result = prime * result + (int) (temp ^ (temp >>> 32));
61 public boolean equals(Object obj) {
62 if (this == obj) return true;
63 if (!(obj instanceof Size)) return false;
65 return width == it.width && height == it.height;
69 public String toString() {
70 return (int)width + "x" + (int)height;