/** Constructs a <code>PlatteBox</code> from an * <code>IndexColorModel</code>. */ public PaletteBox(IndexColorModel icm) { this(computeLength(icm), getCompSize(icm), getLUT(icm)); }
public int getWidth(int imageIndex) throws IOException { checkIndex(imageIndex); readHeader(); return width; }
/** Sets <code>packetPerTilePart</code> */ public void setPacketPerTilePart(int packetPerTilePart) { if (packetPerTilePart < 0) throw new IllegalArgumentException(I18N.getString("J2KImageWriteParamJava0")); this.packetPerTilePart = packetPerTilePart; if (packetPerTilePart > 0) { setSOP("true"); setEPH("true"); } }
private IIOMetadataNode createNodeIntoTree(IIOMetadataNode root, String name) { IIOMetadataNode node = getNodeFromTree(root, name, null); if (node != null) return node; node = new IIOMetadataNode(name); String parent = format.getParent(name); IIOMetadataNode parentNode = createNodeIntoTree(root, parent); parentNode.appendChild(node); return node; }
public ImageReader createReaderInstance(Object extension) throws IIOException { return new J2KImageReader(this); } }
/** * Advances to the next tile, in standard scan-line order (by rows then * columns). * */ public void nextTile() { co.x++; if (co.x >= getNumXTiles()) { co.x = 0; co.y++; } setTile(co.x, co.y); }
/** Read the bits per component. */ public void readBitsPerComponentBox(int length)throws IOException { bitDepths = new byte[length]; in.readFully(bitDepths, 0, length); if (metadata != null) { metadata.addNode(new BitsPerComponentBox(bitDepths)); } }
public IIOMetadata getImageMetadata(int imageIndex) throws IOException { checkIndex(imageIndex); if (ignoreMetadata) return null; if (imageMetadata == null) { iis.mark(); imageMetadata = new J2KMetadata(iis, this); iis.reset(); } return imageMetadata; }
/** Creates an <code>IIOMetadataNode</code> from this color specification * box. The format of this node is defined in the XML dtd and xsd * for the JP2 image file. */ public IIOMetadataNode getNativeNode() { return getNativeNodeForSimpleBox(); }
/** * Constructs a <code>J2KImageWriteParamJava</code> object with default * values for all parameters. */ public J2KImageWriteParamJava(Raster raster) { super(); setDefaults(raster); }
/** Returns the box content in byte array. */ public byte[] getContent() { if (data == null) compose(); return data; }
public static synchronized J2KMetadataFormat getInstance() { if (instance == null) instance = new J2KMetadataFormat(); return instance; }
/** Wrapper for the protected method <code>processImageProgress</code> * So it can be access from the classes which are not in * <code>ImageReader</code> hierarchy. */ public void processImageProgressWrapper(float percentageDone) { processImageProgress(percentageDone); }
public J2KRenderedImage(ImageInputStream iis, J2KImageReadParamJava param, J2KImageReader reader) throws IOException { this(new J2KReadState(iis, param, reader)); }
/** Creates an <code>IIOMetadataNode</code> from this file type box. * The format of this node is defined in the XML dtd and xsd * for the JP2 image file. */ public IIOMetadataNode getNativeNode() { return getNativeNodeForSimpleBox(); }