Package com.lightcrafts.image.metadata.values

Examples of com.lightcrafts.image.metadata.values.ImageMetaValue


    /**
     * {@inheritDoc}
     */
    public float getFocalLength() {
        final ImageMetaValue value = getValue( CIFF_FL_FOCAL_LENGTH );
        return value != null ? value.getFloatValue() : 0;
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public int getImageHeight() {
        ImageMetaValue value = getValue( CIFF_II_IMAGE_HEIGHT );
        if ( value == null )
            value = getValue( CIFF_PI_IMAGE_HEIGHT );
        return value != null ? value.getIntValue() : 0;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public int getImageWidth() {
        ImageMetaValue value = getValue( CIFF_II_IMAGE_WIDTH );
        if ( value == null )
            value = getValue( CIFF_PI_IMAGE_WIDTH );
        return value != null ? value.getIntValue() : 0;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public int getISO() {
        final ImageMetaValue value = getValue( CIFF_SI_ISO );
        if ( value != null )
            return MetadataUtil.convertISOFromAPEX( value.getIntValue() );
        final String isoLabel = hasTagValueLabelFor( CIFF_CS_ISO );
        if ( isoLabel != null )
            try {
                //
                // The reason for using parseInt() is because most of the
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getLens() {
        final ImageMetaValue lensValue = getValue( CIFF_CS_LENS_TYPE );
        final String label = hasTagValueLabelFor( lensValue );
        if ( label != null )
            return label;
        return makeLensLabelFrom(
            getValue( CIFF_CS_SHORT_FOCAL_LENGTH ),
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public ImageOrientation getOrientation() {
        int orientation;
        ImageMetaValue value = getValue( CIFF_II_ROTATION );
        if ( value != null ) {
            orientation = value.getIntValue();
            if ( orientation < 0 )
                orientation += 360;
            switch ( orientation ) {
                case 0:
                    return ORIENTATION_LANDSCAPE;
                case 90:
                    return ORIENTATION_90CCW;
                case 180:
                    return ORIENTATION_180;
                case 270:
                    return ORIENTATION_90CW;
            }
        }
        value = getValue( CIFF_SI_AUTO_ROTATE );
        if ( value != null )
            switch ( value.getIntValue() ) {
                case CIFF_AUTO_ROTATE_NONE:
                    return ORIENTATION_LANDSCAPE;
                case CIFF_AUTO_ROTATE_90CCW:
                    return ORIENTATION_90CCW;
                case CIFF_AUTO_ROTATE_180:
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public float getShutterSpeed() {
        final ImageMetaValue value = getValue( CIFF_SI_SHUTTER_SPEED );
        if ( value == null )
            return 0;
        final int apex = value.getIntValue();
        final Rational speed = MetadataUtil.convertShutterSpeedFromAPEX( apex );
        return speed.floatValue();
    }
View Full Code Here

        pairs = new ArrayList<KeyValuePair>();
        Iterator<Map.Entry<Integer,ImageMetaValue>> i=directory.iterator();
        while (i.hasNext()) {
            Map.Entry<Integer,ImageMetaValue> entry = i.next();
            Integer id = entry.getKey();
            ImageMetaValue value = directory.getValue(id);
            if ( value.isDisplayable() ) {
                String key = directory.getTagLabelFor(id);
                KeyValuePair pair = new KeyValuePair(id, key, value);
                pairs.add(pair);
            }
        }
View Full Code Here

     * @param dir The {@link ImageMetadataDirectory} to check.
     * @return Returns <code>true</code> only if the metadata in the given
     * {@link ImageMetadataDirectory} is for the full-sized image.
     */
    public static boolean isFullSizedImage( ImageMetadataDirectory dir ) {
        ImageMetaValue value = dir.getValue( TIFF_NEW_SUBFILE_TYPE );
        if ( value != null && value.getIntValue() == 0 /* full-size */ )
            return true;
        value = dir.getValue( TIFF_SUBFILE_TYPE );
        return value != null && value.getIntValue() == 1 /* full size */;
    }
View Full Code Here

     * @return Returns said maximum or 0 if the metadata doesn't have a value
     * for either tag.
     */
    public static int maxTagValue( ImageMetadataDirectory dir, int tagID1,
                                   int tagID2 ) {
        final ImageMetaValue v1 = dir.getValue( tagID1 );
        final ImageMetaValue v2 = dir.getValue( tagID2 );
        if ( v1 == null )
            return v2 != null ? v2.getIntValue() : 0;
        if ( v2 == null )
            return v1.getIntValue();
        return Math.max( v1.getIntValue(), v2.getIntValue() );
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.image.metadata.values.ImageMetaValue

Copyright © 2018 www.massapicom. 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.