Examples of Rational


Examples of com.drew.lang.Rational

    }

    public String getYResolutionDescription() throws MetadataException
    {
        if (!_directory.containsTag(ExifDirectory.TAG_Y_RESOLUTION)) return null;
        Rational resolution = _directory.getRational(ExifDirectory.TAG_Y_RESOLUTION);
        return resolution.toSimpleString(_allowDecimalRepresentationOfRationals) +
                " dots per " +
                getResolutionDescription().toLowerCase();
    }
View Full Code Here

Examples of com.drew.lang.Rational

    }

    public String getXResolutionDescription() throws MetadataException
    {
        if (!_directory.containsTag(ExifDirectory.TAG_X_RESOLUTION)) return null;
        Rational resolution = _directory.getRational(ExifDirectory.TAG_X_RESOLUTION);
        return resolution.toSimpleString(_allowDecimalRepresentationOfRationals) +
                " dots per " +
                getResolutionDescription().toLowerCase();
    }
View Full Code Here

Examples of com.drew.lang.Rational

    }

    public String getFNumberDescription() throws MetadataException
    {
        if (!_directory.containsTag(ExifDirectory.TAG_FNUMBER)) return null;
        Rational fNumber = _directory.getRational(ExifDirectory.TAG_FNUMBER);
        return "F" + SimpleDecimalFormatter.format(fNumber.doubleValue());
    }
View Full Code Here

Examples of com.lightcrafts.media.jai.util.Rational

        // Represent the scale factors as Rational numbers.
        // Since a value of 1.2 is represented as 1.200001 which
        // throws the forward/backward mapping in certain situations.
  // Convert the scale and translation factors to Rational numbers
        Rational scaleXRational =
      Rational.approximate(scaleX, rationalTolerance);

        Rational scaleYRational =
      Rational.approximate(scaleY, rationalTolerance);

  long scaleXRationalNum = (long)scaleXRational.num;
  long scaleXRationalDenom = (long)scaleXRational.denom;
  long scaleYRationalNum = (long)scaleYRational.num;
  long scaleYRationalDenom = (long)scaleYRational.denom;

        Rational transXRational =
      Rational.approximate(transX, rationalTolerance);

        Rational transYRational =
      Rational.approximate(transY, rationalTolerance);

  long transXRationalNum = (long)transXRational.num;
  long transXRationalDenom = (long)transXRational.denom;
  long transYRationalNum = (long)transYRational.num;
View Full Code Here

Examples of com.lightcrafts.media.jai.util.Rational

  this.transXRationalDenom = (long)this.transXRational.denom;
  this.transYRationalNum = (long)this.transYRational.num;
  this.transYRationalDenom = (long)this.transYRational.denom;

  // Inverse scale factors as Rationals
  invScaleXRational = new Rational(scaleXRational);
  invScaleXRational.invert();
  invScaleYRational = new Rational(scaleYRational);
  invScaleYRational.invert();
  invScaleXRationalNum = invScaleXRational.num;
  invScaleXRationalDenom = invScaleXRational.denom;
  invScaleYRationalNum = invScaleYRational.num;
  invScaleYRationalDenom = invScaleYRational.denom;
View Full Code Here

Examples of com.lightcrafts.utils.Rational

     *
     * @param numerator The numerator.
     * @param denominator The denominator.  It must not be zero.
     */
    public RationalMetaValue( int numerator, int denominator ) {
        this( new Rational( numerator, denominator ) );
    }
View Full Code Here

Examples of com.lightcrafts.utils.Rational

     * as a {@link Rational}, returns 1.
     * @see #compareTo(Object)
     */
    public final int compareTo( String s ) {
        try {
            final Rational rightRational = Rational.parseRational( s );
            final Rational leftRational = getRationalValue();
            return leftRational.compareTo( rightRational );
        }
        catch ( NumberFormatException e ) {
            return 1;
        }
    }
View Full Code Here

Examples of com.lightcrafts.utils.Rational

    /**
     * {@inheritDoc}
     */
    public void setLongValue( long newValue ) {
        setRationalValueAt( new Rational( (int)newValue, 1 ), 0 );
    }
View Full Code Here

Examples of com.lightcrafts.utils.Rational

     */
    public final void readExternal( ObjectInput in ) throws IOException {
        final int length = readHeader( in );
        m_value = new Rational[ length ];
        for ( int i = 0; i < length; ++i )
            m_value[i] = new Rational( in.readInt(), in.readInt() );
    }
View Full Code Here

Examples of com.lightcrafts.utils.Rational

     * Parse and append a new value.
     *
     * @param newValue The new value.
     */
    protected final void appendValueImpl( String newValue ) {
        final Rational newRational = Rational.parseRational( newValue );
        if ( m_value == null )
            m_value = new Rational[] { newRational };
        else {
            m_value = (Rational[])LCArrays.resize( m_value, m_value.length + 1 );
            m_value[ m_value.length - 1 ] = newRational;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.