Class TJScalingFactor

java.lang.Object
org.libjpegturbo.turbojpeg.TJScalingFactor

public class TJScalingFactor extends Object
Fractional scaling factor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Denominator
    private int
    Numerator
  • Constructor Summary

    Constructors
    Constructor
    Description
    TJScalingFactor(int num, int denom)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true or false, depending on whether this instance and other have the same numerator and denominator.
    int
    Returns denominator
    int
    Returns numerator
    int
    getScaled(int dimension)
    Returns the scaled value of dimension.
    boolean
    Returns true or false, depending on whether this instance is equal to 1/1.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • num

      private int num
      Numerator
    • denom

      private int denom
      Denominator
  • Constructor Details

    • TJScalingFactor

      public TJScalingFactor(int num, int denom) throws Exception
      Throws:
      Exception
  • Method Details

    • 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 of dimension. This function performs the integer equivalent of ceil(dimension * scalingFactor).
      Returns:
      the scaled value of dimension
    • equals

      public boolean equals(TJScalingFactor other)
      Returns true or false, depending on whether this instance and other have the same numerator and denominator.
      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