Package com.drew.lang

Examples of com.drew.lang.RandomAccessReader


    {
        byte[] bytes = getByteArray(TAG_FACE_DETECTION_INFO);
        if (bytes==null)
            return null;

        RandomAccessReader reader = new ByteArrayReader(bytes);
        reader.setMotorolaByteOrder(false);
       
        try {
            int faceCount = reader.getUInt16(0);
            if (faceCount==0)
                return null;
            Face[] faces = new Face[faceCount];

            for (int i = 0; i < faceCount; i++) {
                int offset = 2 + i * 8;
                faces[i] = new Face(
                        reader.getUInt16(offset),
                        reader.getUInt16(offset + 2),
                        reader.getUInt16(offset + 4),
                        reader.getUInt16(offset + 6)
                        , null, null);
            }
            return faces;
        } catch (IOException e) {
            return null;
View Full Code Here


    {
        byte[] bytes = getByteArray(TAG_FACE_RECOGNITION_INFO);
        if (bytes == null)
            return null;

        RandomAccessReader reader = new ByteArrayReader(bytes);
        reader.setMotorolaByteOrder(false);

        try {
            int faceCount = reader.getUInt16(0);
            if (faceCount==0)
                return null;
            Face[] faces = new Face[faceCount];

            for (int i = 0; i < faceCount; i++) {
                int offset = 4 + i * 44;
                String name = reader.getString(offset, 20, "ASCII").trim();
                String age = reader.getString(offset + 28, 20, "ASCII").trim();
                faces[i] = new Face(
                        reader.getUInt16(offset + 20),
                        reader.getUInt16(offset + 22),
                        reader.getUInt16(offset + 24),
                        reader.getUInt16(offset + 26),
                        name,
                        Age.fromPanasonicString(age));
            }
            return faces;
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of com.drew.lang.RandomAccessReader

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.