use of cbit.vcell.export.gloworm.quicktime.VRMediaMovie in project vcell by virtualcell.
the class IMGExporter method writeQTVRWorker.
public static void writeQTVRWorker(DataOutputStream dataOutputStream, VideoMediaChunk[] videoMediaChunks, int numTimePoints, int numslices, int width, int height) throws java.io.IOException, java.util.zip.DataFormatException {
/* make the single node VR World and required chunks */
if (numTimePoints * numslices != videoMediaChunks.length) {
throw new DataFormatException("NumTimePoints x Numslices != VideoMediaChunk length.");
}
VRWorld singleObjVRWorld = VRWorld.createSingleObjectVRWorld(videoMediaChunks[0].getDuration(), numTimePoints, numslices, (float) (width / 2), (float) (height / 2));
// reverse pan controls (set bit 3)
singleObjVRWorld.getVRObjectSampleAtom(0).setControlSettings(singleObjVRWorld.getVRObjectSampleAtom(0).getControlSettings() | (Integer.parseInt("00001000", 2)));
VRMediaChunk vrChunk = new VRMediaChunk(singleObjVRWorld);
ObjectMediaChunk objChunk = new ObjectMediaChunk(singleObjVRWorld);
/* assemble tracks and write the rest of the file */
MediaTrack qtvrTrack = new MediaTrack(vrChunk);
MediaTrack objectTrack = new MediaTrack(objChunk);
MediaTrack imageTrack = new MediaTrack(videoMediaChunks);
qtvrTrack.setWidth(imageTrack.getWidth());
qtvrTrack.setHeight(imageTrack.getHeight());
objectTrack.setWidth(imageTrack.getWidth());
objectTrack.setHeight(imageTrack.getHeight());
VRMediaMovie vrMovie = VRMediaMovie.createVRMediaMovie(qtvrTrack, objectTrack, imageTrack, null, imageTrack.getDuration(), videoMediaChunks[0].getDuration());
MediaMethods.writeMovie(dataOutputStream, vrMovie);
}
Aggregations