package cn.com.magnity.magnitycx; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /* loaded from: classes.dex */ public class ROIInfo { public static final int TYPE_POINT = 0; public static final int TYPE_RECT = 1; private static volatile Lock lock = new ReentrantLock(); private int aveTemp_; private int maxTempPos_; private int maxTemp_; private int minTempPos_; private int minTemp_; public String name; private int type_; private int x0_; private int x1_; private int y0_; private int y1_; private boolean isFinished_ = false; private boolean isBigEnouth_ = false; private boolean isTempValid_ = false; public ROIInfo(int type) { this.type_ = type; } public void setBeginPoint(int x0, int y0) { this.x0_ = x0; this.y0_ = y0; this.isBigEnouth_ = false; this.isFinished_ = false; } public void translate(int dx, int dy) { this.x0_ += dx; this.y0_ += dy; this.x1_ += dx; this.y1_ += dy; } public void setEndPoint(int x1, int y1) { this.x1_ = x1; this.y1_ = y1; int limit = MagApplication.magParameter.basePara1.fpaWidth / 12; if (Math.abs(this.x1_ - this.x0_) > limit && Math.abs(this.y1_ - this.y0_) > limit) { this.isBigEnouth_ = true; } else { this.isBigEnouth_ = false; } } public void setTempInfo(int minTemp, int maxTemp, int aveTemp, int minPos, int maxPos) { this.maxTemp_ = maxTemp; this.minTemp_ = minTemp; this.aveTemp_ = aveTemp; this.maxTempPos_ = maxPos; this.minTempPos_ = minPos; this.isTempValid_ = true; } public boolean isPointIn(int x, int y) { return x < this.x1_ && x > this.x0_ && y < this.y1_ && y > this.y0_; } public void setFinished() { this.isFinished_ = true; } public int getBeginPointX() { return this.x0_ > this.x1_ ? this.x1_ : this.x0_; } public int getBeginPointY() { return this.y0_ > this.y1_ ? this.y1_ : this.y0_; } public int getEndPointX() { return this.x0_ > this.x1_ ? this.x0_ : this.x1_; } public int getEndPointY() { return this.y0_ > this.y1_ ? this.y0_ : this.y1_; } public int getType() { return this.type_; } public int getMaxTemp() { return this.maxTemp_; } public int getMinTemp() { return this.minTemp_; } public int getMaxPos() { return this.maxTempPos_; } public int getMinPos() { return this.minTempPos_; } public boolean isFinished() { return this.isFinished_; } public boolean isBigEnouth() { return this.isBigEnouth_; } public boolean isTempValid() { return this.isTempValid_; } public static void lock() { lock.lock(); } public static void unlock() { lock.unlock(); } }