Package org.libjpegturbo.turbojpeg
Class TJScalingFactor
- java.lang.Object
-
- org.libjpegturbo.turbojpeg.TJScalingFactor
-
public class TJScalingFactor extends java.lang.Object
Fractional scaling factor
-
-
Constructor Summary
Constructors Constructor Description TJScalingFactor(int num, int denom)
Create a TurboJPEG scaling factor instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(TJScalingFactor other)
Returns true or false, depending on whether this instance andother
have the same numerator and denominator.int
getDenom()
Returns denominatorint
getNum()
Returns numeratorint
getScaled(int dimension)
Returns the scaled value ofdimension
.boolean
isOne()
Returns true or false, depending on whether this instance is equal to 1/1.
-
-
-
Method Detail
-
getNum
public int getNum()
Returns numerator- Returns:
- numerator
-
getDenom
public int getDenom()
Returns denominator- Returns:
- denominator
-
getScaled
public int getScaled(int dimension)
Returns the scaled value ofdimension
. This method performs the integer equivalent ofMath.ceil(dimension * scalingFactor)
.- Parameters:
dimension
- width or height to multiply by this scaling factor- Returns:
- the scaled value of
dimension
.
-
equals
public boolean equals(TJScalingFactor other)
Returns true or false, depending on whether this instance andother
have the same numerator and denominator.- Parameters:
other
- the scaling factor against which to compare this one- Returns:
- true or false, depending on whether this instance and
other
have the same numerator and denominator.
-
isOne
public boolean isOne()
Returns true or false, depending on whether this instance is equal to 1/1.- Returns:
- true or false, depending on whether this instance is equal to 1/1.
-
-