管灌系统巡查员智能手机App
zuoxiao
2025-01-23 b6f46408cb3dc8b01051953e5c68de6c9195db60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package cc.shinichi.library.view.subsampling;
 
import android.graphics.PointF;
 
import androidx.annotation.NonNull;
 
import java.io.Serializable;
 
/**
 * Wraps the scale, center and orientation of a displayed image for easy restoration on screen rotate.
 */
@SuppressWarnings("WeakerAccess")
public class ImageViewState implements Serializable {
 
    private final float scale;
 
    private final float centerX;
 
    private final float centerY;
 
    private final int orientation;
 
    public ImageViewState(float scale, @NonNull PointF center, int orientation) {
        this.scale = scale;
        this.centerX = center.x;
        this.centerY = center.y;
        this.orientation = orientation;
    }
 
    public float getScale() {
        return scale;
    }
 
    @NonNull
    public PointF getCenter() {
        return new PointF(centerX, centerY);
    }
 
    public int getOrientation() {
        return orientation;
    }
 
}