Package org.apache.sanselan.formats.tiff.fieldtypes

Examples of org.apache.sanselan.formats.tiff.fieldtypes.FieldType


                        // ignore offset fields.
                        continue;
                    }

                    TagInfo tagInfo = srcField.tagInfo;
                    FieldType fieldType = srcField.fieldType;
                    int count = srcField.length;
                    //            byte bytes[] = srcField.fieldType.getRawBytes(srcField);

                    //                    Debug.debug("tagInfo", tagInfo);
View Full Code Here


    public static TiffOutputField create(TagInfo tagInfo, int byteOrder,
            Number number) throws ImageWriteException
    {
        if (tagInfo.dataTypes == null || tagInfo.dataTypes.length < 1)
            throw new ImageWriteException("Tag has no default data type.");
        FieldType fieldType = tagInfo.dataTypes[0];

        if (tagInfo.length != 1)
            throw new ImageWriteException("Tag does not expect a single value.");

        byte bytes[] = fieldType.writeData(number, byteOrder);

        return new TiffOutputField(tagInfo.tag, tagInfo, fieldType, 1, bytes);
    }
View Full Code Here

    public static TiffOutputField create(TagInfo tagInfo, int byteOrder,
            Number value[]) throws ImageWriteException
    {
        if (tagInfo.dataTypes == null || tagInfo.dataTypes.length < 1)
            throw new ImageWriteException("Tag has no default data type.");
        FieldType fieldType = tagInfo.dataTypes[0];

        if (tagInfo.length != value.length)
            throw new ImageWriteException("Tag does not expect a single value.");

        byte bytes[] = fieldType.writeData(value, byteOrder);

        return new TiffOutputField(tagInfo.tag, tagInfo, fieldType,
                value.length, bytes);
    }
View Full Code Here

    }

    public static TiffOutputField create(TagInfo tagInfo, int byteOrder,
            String value) throws ImageWriteException
    {
        FieldType fieldType;
        if (tagInfo.dataTypes == null)
            fieldType = FIELD_TYPE_ASCII;
        else if (tagInfo.dataTypes == FIELD_TYPE_DESCRIPTION_ASCII)
            fieldType = FIELD_TYPE_ASCII;
        else
            throw new ImageWriteException("Tag has unexpected data type.");

        byte bytes[] = fieldType.writeData(value, byteOrder);

        return new TiffOutputField(tagInfo.tag, tagInfo, fieldType, 1, bytes);
    }
View Full Code Here

                        // ignore offset fields.
                        continue;
                    }

                    TagInfo tagInfo = srcField.tagInfo;
                    FieldType fieldType = srcField.fieldType;
                    int count = srcField.length;
                    //            byte bytes[] = srcField.fieldType.getRawBytes(srcField);

                    //                    Debug.debug("tagInfo", tagInfo);
View Full Code Here

    private static FieldType getFieldType(int value)
    {
        for (int i = 0; i < FIELD_TYPES.length; i++)
        {
            FieldType fieldType = FIELD_TYPES[i];
            if (fieldType.type == value)
                return fieldType;
        }

        return FIELD_TYPE_UNKNOWN;
View Full Code Here

TOP

Related Classes of org.apache.sanselan.formats.tiff.fieldtypes.FieldType

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.