@Override public void close() throws IOException { if (out != null) writeFooter(); super.close(); numBytes = 0; created = 0; offsets = null; pad = 0; numWritten = 0; }
throws FormatException, IOException checkParams(no, buf, x, y, w, h); if (needLegacy) { legacy.saveBytes(no, buf, x, y, w, h); MetadataRetrieve r = getMetadataRetrieve(); int nChannels = getSamplesPerPixel(); int planeSize = width * height * nChannels; setCodec(); if (codec != CODEC_RAW) { needLegacy = true; if (!isFullPlane(x, y, w, h)) { out.skipBytes(planeSize + pad * height); writeFooter();
@Override public void setId(String id) throws FormatException, IOException { super.setId(id); MetadataRetrieve r = getMetadataRetrieve(); MetadataTools.verifyMinimumPopulated(r, series); int nChannels = getSamplesPerPixel(); int planeSize = width * height * nChannels; writeAtom(8, "wide"); writeAtom(numBytes + 8, "mdat"); numWritten = 0; for (int i=0; i<getPlaneCount(); i++) { offsets.add(16 + i * (planeSize + pad * height));
private void writeFooter() throws IOException { out.seek(out.length()); MetadataRetrieve r = getMetadataRetrieve(); int width = r.getPixelsSizeX(series).getValue().intValue(); int height = r.getPixelsSizeY(series).getValue().intValue(); int nChannels = getSamplesPerPixel(); writeAtom(atomLength, "moov"); writeAtom(108, "mvhd"); out.writeShort(0); // version out.writeShort(0); // flags writeRotationMatrix(); writeAtom(atomLength, "trak"); writeAtom(92, "tkhd"); out.writeShort(0); // version out.writeShort(15); // flags writeRotationMatrix(); writeAtom(36, "edts"); writeAtom(28, "elst"); writeAtom(atomLength, "mdia"); writeAtom(32, "mdhd");
throws FormatException, IOException checkParams(no, buf, x, y, w, h); if (needLegacy) { legacy.saveBytes(no, buf, x, y, w, h); MetadataRetrieve r = getMetadataRetrieve(); int nChannels = getSamplesPerPixel(); int planeSize = width * height * nChannels; setCodec(); if (codec != CODEC_RAW) { needLegacy = true; if (!isFullPlane(x, y, w, h)) { out.skipBytes(planeSize + pad * height); writeFooter();
@Override public void setId(String id) throws FormatException, IOException { super.setId(id); MetadataRetrieve r = getMetadataRetrieve(); MetadataTools.verifyMinimumPopulated(r, series); int nChannels = getSamplesPerPixel(); int planeSize = width * height * nChannels; writeAtom(8, "wide"); writeAtom(numBytes + 8, "mdat"); numWritten = 0; for (int i=0; i<getPlaneCount(); i++) { offsets.add(16 + i * (planeSize + pad * height));
private void writeFooter() throws IOException { out.seek(out.length()); MetadataRetrieve r = getMetadataRetrieve(); int width = r.getPixelsSizeX(series).getValue().intValue(); int height = r.getPixelsSizeY(series).getValue().intValue(); int nChannels = getSamplesPerPixel(); writeAtom(atomLength, "moov"); writeAtom(108, "mvhd"); out.writeShort(0); // version out.writeShort(0); // flags writeRotationMatrix(); writeAtom(atomLength, "trak"); writeAtom(92, "tkhd"); out.writeShort(0); // version out.writeShort(15); // flags writeRotationMatrix(); writeAtom(36, "edts"); writeAtom(28, "elst"); writeAtom(atomLength, "mdia"); writeAtom(32, "mdhd");
@Override public void close() throws IOException { if (out != null) writeFooter(); super.close(); numBytes = 0; created = 0; offsets = null; pad = 0; numWritten = 0; }