Package com.drew.lang

Examples of com.drew.lang.Rational.toSimpleString()


        assertEquals("3/8", threeEigths.toSimpleString(true));

        Rational zero = new Rational(0, 8);
        assertTrue(zero.isInteger());
        assertEquals("0", zero.toSimpleString(true));
        assertEquals("0", zero.toSimpleString(false));

        zero = new Rational(0, 0);
        assertTrue(zero.isInteger());
        assertEquals("0", zero.toSimpleString(true));
        assertEquals("0", zero.toSimpleString(false));
View Full Code Here


        assertEquals("0", zero.toSimpleString(true));
        assertEquals("0", zero.toSimpleString(false));

        zero = new Rational(0, 0);
        assertTrue(zero.isInteger());
        assertEquals("0", zero.toSimpleString(true));
        assertEquals("0", zero.toSimpleString(false));

        // not sure this is a nice presentation of rationals.  won't implement it for now.
//        Rational twoAndAHalf = new Rational(10,4);
//        assertEquals("2 1/2", twoAndAHalf.toSimpleString());
View Full Code Here

        assertEquals("0", zero.toSimpleString(false));

        zero = new Rational(0, 0);
        assertTrue(zero.isInteger());
        assertEquals("0", zero.toSimpleString(true));
        assertEquals("0", zero.toSimpleString(false));

        // not sure this is a nice presentation of rationals.  won't implement it for now.
//        Rational twoAndAHalf = new Rational(10,4);
//        assertEquals("2 1/2", twoAndAHalf.toSimpleString());
    }
View Full Code Here

    public String getExposureBiasDescription() throws MetadataException
    {
        if (!_directory.containsTag(ExifDirectory.TAG_EXPOSURE_BIAS)) return null;
        Rational exposureBias = _directory.getRational(ExifDirectory.TAG_EXPOSURE_BIAS);
        return exposureBias.toSimpleString(true) + " EV";
    }

    public String getMaxApertureValueDescription() throws MetadataException
    {
        if (!_directory.containsTag(ExifDirectory.TAG_MAX_APERTURE)) return null;
View Full Code Here

    public String getCompressionLevelDescription() throws MetadataException
    {
        if (!_directory.containsTag(ExifDirectory.TAG_COMPRESSION_LEVEL)) return null;
        Rational compressionRatio = _directory.getRational(ExifDirectory.TAG_COMPRESSION_LEVEL);
        String ratio = compressionRatio.toSimpleString(_allowDecimalRepresentationOfRationals);
        if (compressionRatio.isInteger() && compressionRatio.intValue() == 1) {
            return ratio + " bit/pixel";
        } else {
            return ratio + " bits/pixel";
        }
View Full Code Here

    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();
    }

    public String getXResolutionDescription() throws MetadataException
View Full Code Here

    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();
    }

    public String getExposureTimeDescription()
View Full Code Here

        if (!_directory.containsTag(NikonType1MakernoteDirectory.TAG_NIKON_TYPE1_DIGITAL_ZOOM)) return null;
        Rational value = _directory.getRational(NikonType1MakernoteDirectory.TAG_NIKON_TYPE1_DIGITAL_ZOOM);
        if (value.getNumerator() == 0) {
            return "No digital zoom";
        }
        return value.toSimpleString(true) + "x digital zoom";
    }

    public String getFocusDescription() throws MetadataException
    {
        if (!_directory.containsTag(NikonType1MakernoteDirectory.TAG_NIKON_TYPE1_FOCUS)) return null;
View Full Code Here

        if (!_directory.containsTag(NikonType1MakernoteDirectory.TAG_NIKON_TYPE1_FOCUS)) return null;
        Rational value = _directory.getRational(NikonType1MakernoteDirectory.TAG_NIKON_TYPE1_FOCUS);
        if (value.getNumerator() == 1 && value.getDenominator() == 0) {
            return "Infinite";
        }
        return value.toSimpleString(true);
    }

    public String getWhiteBalanceDescription() throws MetadataException
    {
        if (!_directory.containsTag(NikonType1MakernoteDirectory.TAG_NIKON_TYPE1_WHITE_BALANCE)) return null;
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.