All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jcodec.containers.mxf.model.J2KPictureDescriptor Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package org.jcodec.containers.mxf.model;

import java.nio.ByteBuffer;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

/**
 * This class is part of JCodec ( www.jcodec.org ) This software is distributed
 * under FreeBSD License
 * 
 * @author The JCodec project
 * 
 */
public class J2KPictureDescriptor extends MXFInterchangeObject {

    private short rsiz;
    private int xsiz;
    private int ysiz;
    private int xOsiz;
    private int yOsiz;
    private int xTsiz;
    private int yTsiz;
    private int xTOsiz;
    private int yTOsiz;
    private short csiz;

    public J2KPictureDescriptor(UL ul) {
        super(ul);
    }

    @Override
    protected void read(Map tags) {
        for (Iterator> it = tags.entrySet().iterator(); it.hasNext();) {
            Entry entry = it.next();

            ByteBuffer _bb = entry.getValue();
            switch (entry.getKey()) {
            case 0x6104:
                rsiz = _bb.getShort();
                break;
            case 0x6105:
                xsiz = _bb.getInt();
                break;
            case 0x6106:
                ysiz = _bb.getInt();
                break;
            case 0x6107:
                xOsiz = _bb.getInt();
                break;
            case 0x6108:
                yOsiz = _bb.getInt();
                break;
            case 0x6109:
                xTsiz = _bb.getInt();
                break;
            case 0x610a:
                yTsiz = _bb.getInt();
                break;
            case 0x610b:
                xTOsiz = _bb.getInt();
                break;
            case 0x610c:
                yTOsiz = _bb.getInt();
                break;
            case 0x610d:
                csiz = _bb.getShort();
                break;

            default:
                System.out.println(String.format("Unknown tag [ Identification: " + ul + "]: %04x", entry.getKey()));
                continue;
            }
            it.remove();
        }
    }

    public short getRsiz() {
        return rsiz;
    }

    public int getXsiz() {
        return xsiz;
    }

    public int getYsiz() {
        return ysiz;
    }

    public int getxOsiz() {
        return xOsiz;
    }

    public int getyOsiz() {
        return yOsiz;
    }

    public int getxTsiz() {
        return xTsiz;
    }

    public int getyTsiz() {
        return yTsiz;
    }

    public int getxTOsiz() {
        return xTOsiz;
    }

    public int getyTOsiz() {
        return yTOsiz;
    }

    public short getCsiz() {
        return csiz;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy