package leigh.astro.fits;

import java.util.Objects;

/**
 * This class represents an exposure configuration.
 *
 * @author Alex Leigh
 */
public class Exposure {
    public static final String KEY_RED = "Red";
    public static final String KEY_GREEN = "Green";
    public static final String KEY_BLUE = "Blue";
    public static final String KEY_LUMINANCE = "LPR";
    public static final String KEY_HA = "H_Alpha";
    public static final String KEY_OIII = "OIII";
    public static final String KEY_SII = "SII";

    private final double exp;
    private final int gain;
    private final int offset;
    private final String filter;

    public Exposure(double exp, int gain, int offset, String filter) {
        this.exp = exp;
        this.gain = gain;
        this.offset = offset;
        this.filter = filter;
    }

    public double getLength() {
        return exp;
    }

    public int getGain() {
        return gain;
    }

    public int getOffset() {
        return offset;
    }

    public String getFilter() {
        return filter;
    }

    @Override
    public String toString() {
        return "Exposure{" +
                "exp=" + exp +
                ", gain=" + gain +
                ", offset=" + offset +
                ", filter='" + filter + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Exposure exposure = (Exposure) o;
        return Double.compare(exposure.exp, exp) == 0 &&
                gain == exposure.gain &&
                offset == exposure.offset &&
                Objects.equals(filter, exposure.filter);
    }

    @Override
    public int hashCode() {
        return Objects.hash(exp, gain, offset, filter);
    }
}
