summaryrefslogtreecommitdiffstats
path: root/src/main/java/dev/figboot/cuberender/state/Texture.java
blob: 3c69c58c3182acfafd3abc450991ab66f6dfdac9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package dev.figboot.cuberender.state;

import java.awt.image.BufferedImage;

public class Texture {
    public final BufferedImage image;
    public final transient int width;
    public final transient int height;

    public Texture(BufferedImage image) {
        this.image = image;
        this.width = image.getWidth();
        this.height = image.getHeight();
    }

    public float calcAspect() {
        return (float)width / height;
    }
}