io.github.humbleui.skija.CubicResampler Maven / Gradle / Ivy
// Generated by delombok at Wed Sep 14 01:50:49 UTC 2022
package io.github.humbleui.skija;
import lombok.*;
import org.jetbrains.annotations.*;
/**
* Specify B and C (each between 0...1) to create a shader that applies the corresponding
* cubic reconstruction filter to the image.
*
* Example values:
*
* - B = 1/3, C = 1/3
- "Mitchell" filter
* - B = 0, C = 1/2
- "Catmull-Rom" filter
*
*
* See
*
* - "Reconstruction Filters in Computer Graphics" Don P. Mitchell, Arun N. Netravali, 1988
* https://www.cs.utexas.edu/~fussell/courses/cs384g-fall2013/lectures/mitchell/Mitchell.pdf
* - Desmos worksheet https://www.desmos.com/calculator/aghdpicrvr
* - Nice overview https://entropymine.com/imageworsener/bicubic/
*
*/
public class CubicResampler implements SamplingMode {
@ApiStatus.Internal
public final float _B;
@ApiStatus.Internal
public final float _C;
@ApiStatus.Internal
@Override
public long _pack() {
return -9223372036854775808L | (4611686018427387903L & (((long) Float.floatToIntBits(_B) << 32) | (long) Float.floatToIntBits(_C)));
}
@java.lang.SuppressWarnings("all")
public CubicResampler(final float b, final float c) {
this._B = b;
this._C = c;
}
@java.lang.SuppressWarnings("all")
public float getB() {
return this._B;
}
@java.lang.SuppressWarnings("all")
public float getC() {
return this._C;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof CubicResampler)) return false;
final CubicResampler other = (CubicResampler) o;
if (!other.canEqual((java.lang.Object) this)) return false;
if (java.lang.Float.compare(this.getB(), other.getB()) != 0) return false;
if (java.lang.Float.compare(this.getC(), other.getC()) != 0) return false;
return true;
}
@java.lang.SuppressWarnings("all")
protected boolean canEqual(final java.lang.Object other) {
return other instanceof CubicResampler;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = 1;
result = result * PRIME + java.lang.Float.floatToIntBits(this.getB());
result = result * PRIME + java.lang.Float.floatToIntBits(this.getC());
return result;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "CubicResampler(_B=" + this.getB() + ", _C=" + this.getC() + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy