Package quicktime.qd

Examples of quicktime.qd.Pict


            movie.getBounds().getWidth() - 180, 20));
        } // if (movieType == 0)
        else
        {
          // display a no-image picture
          Pict pict = ImageUtils.pictFromFile(PhoenixController.getImage(
          "noimage.bmp"));
          Image image = util.ImageUtils.makeJimage(pict, 200, 150);
          ImageIcon icon  = new ImageIcon(image);
          JLabel label = new JLabel(icon);
          this.getContentPane().add(label, BorderLayout.CENTER);
          this.slider.setPreferredSize(new Dimension(80, 20));
        } // else
        this.panel.add(this.slider, BorderLayout.NORTH);
      } // try
      catch (StdQTException stdqte)
      {
        stdqte.printStackTrace();
      } // catch (StdQTException)
      catch (QTException qte)
      {
        qte.printStackTrace();
      } // catch (QTException)
      catch (Exception e)
      {
        e.printStackTrace();
      } // catch (Exception)

      // initialize timer
      this.timer = new Timer(this.CLOCK, this);
      this.timer.start();
    } // if (movieType != 1)
    else
    {
      // display a no-image picture
      Pict pict = ImageUtils.pictFromFile(PhoenixController.getImage(
      "noimage.bmp"));
      Image image = util.ImageUtils.makeJimage(pict, 200, 150);
      ImageIcon icon  = new ImageIcon(image);
      JLabel label = new JLabel(icon);
      this.getContentPane().add(label, BorderLayout.SOUTH);
View Full Code Here


    } // if (((int)Math.floor(pict.getPictFrame().getHeight() * percent) ...
    else
    {
      BufferedImage squished1 = squishFrame(pic, direction, percent);
      BufferedImage squished2 = squishFrame(pic, direction, 1 - percent);
      Pict ret = glueFrame(squished1, squished2, direction,
        pic.getPictFrame().getWidth(), pic.getPictFrame().getHeight());
      return ret;
    } // else
  } // kluberizeOne(Pict, int, float)
View Full Code Here

    try
    {
      int timeScale = mov.getTimeScale();
      int begin = (int)Math.floor(start * timeScale);
      int finish = (int)Math.floor(end * timeScale);
      Pict oldPic = mov.getPict(begin);
      this.cache = chopFrame(oldPic);
      Track visualTrack = mov.getIndTrackType(1,
        StdQTConstants.visualMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      mov.setTime(new TimeRecord(timeScale, (int) begin));
      Boolean go = true;
      int lastTime = 0;
      while (go)
      {
        // user terminated execution
        if (Thread.interrupted())
        {
          throw new SchemeException(new Pair(), null, null);
        } // if (Thread.interrupted())

        // find the next frame
        TimeInfo ti = visualTrack.getNextInterestingTime(
          StdQTConstants.nextTimeMediaSample, mov.getTime(), 1);

        // if looped to earlier frame or finished selected section
        if ((lastTime > ti.time) || (ti.time >= finish))
        {
          go = false;
        } // if ((lastTime > ti.time) || (ti.time >= finish))
        else
        {
          // advance to the next frame
          mov.setTime(new TimeRecord(timeScale, ti.time));
          Pict newPic = mov.getPict(mov.getTime());
          float score = this.frameDifference(newPic);
          if ((score > threshold)
              && (mov.getTime() - lastCut > blockRange * mov.getTimeScale()))
          {
            this.cuts.add((float)mov.getTime() / mov.getTimeScale());
View Full Code Here

    try
    {
      int timeScale = mov.getTimeScale();
      int begin = (int)Math.floor(start * timeScale);
      int finish = (int)Math.floor(end * timeScale);
      Pict oldPic = mov.getPict(begin);
      this.cache = chopFrame(oldPic);

      // get the first visual track from mov
      Track visualTrack = mov.getIndTrackType(1,
        StdQTConstants.visualMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      mov.setTime(new TimeRecord(timeScale, (int) begin));
      Boolean go = true;
      int lastTime = 0;
      while (go)
      {
        // user terminated execution
        if (Thread.interrupted())
        {
          throw new SchemeException(new Pair(), null, null);
        } // if (Thread.interrupted())

        // find next frame
        TimeInfo ti = visualTrack.getNextInterestingTime(
          StdQTConstants.nextTimeMediaSample, mov.getTime(), 1);

        // if looped to earlier frame or finished selected section
        if ((lastTime > ti.time) || (ti.time >= finish))
        {
          go = false;
        } // if ((lastTime > ti.time) || (ti.time >= finish))
        else
        {
          mov.setTime(new TimeRecord(timeScale, ti.time));
          Pict newPic = mov.getPict(mov.getTime());
          float score = frameDifference(newPic);
          if ((score > this.threshold)
              && (mov.getTime() - this.lastCut
                  > this.blockRange * mov.getTimeScale()))
          {
View Full Code Here

    try
    {
      this.lastCut = 0 - ((int)this.blockRange * mov.getTimeScale());
      float end = (float) mov.getDuration() / (float) mov.getTimeScale();
      float now = 0;
      Pict oldPic = MovieUtils.getMovieFrame(mov, 0);
      Pict newPic;
      while (now < end)
      {
        // user terminated execution
        if (Thread.interrupted())
        {
View Full Code Here

    try
    {
      this.lastCut = 0 - ((int)this.blockRange * mov.getTimeScale());
      float end = (float) mov.getDuration() / (float) mov.getTimeScale();
      float now = 0;
      Pict oldPic = MovieUtils.getMovieFrame(mov, 0);
      Pict newPic;
      while (now < end)
      {
        // user terminated execution
        if (Thread.interrupted())
        {
View Full Code Here

   *
   * @param mov  Movie to make icon for
   */
  public static ImageIcon getIcon(Movie mov)
  {
    Pict pic = null;
    Image image = null;
    try
    {
      // if no visual track, substitute another image
      if ((mov.getBounds().getHeight() == 0)
View Full Code Here

   * @param time     Time in movie to retrieve WritableRaster
   * @return raster  WritableRaster of the frame in mov at time
   */
  public static WritableRaster makeRaster(Movie mov, float time)
  {
    Pict pic = MovieUtils.getMovieFrame(mov, time);
    BufferedImage image = ImageUtils.makeJimage(pic);
    return image.getRaster();
  } // makeRaster(Movie, float)
View Full Code Here

    // Add 512 byte header so the grapics importer will think that it's dealing
    // with a pict file

    byte[] newPictBytes = new byte[pic.getSize() + 512];
    pic.copyToArray(0, newPictBytes, 512, newPictBytes.length - 512);
    pic = new Pict(newPictBytes);

    // export the pict
    DataRef ref = new DataRef(pic, StdQTConstants.kDataRefQTFileTypeTag,
    "PICT");
    gi.setDataReference(ref);
View Full Code Here

   * @param buff   BufferedImage to be converted
   * @return pic   Pict from BufferedImage
   */
  public static Pict makeFrame(BufferedImage buff)
  {
    Pict pic = null;
    try
    {
      File tempfile = File.createTempFile("Frame2b", ".jpg");
      makeJpegFile(buff, tempfile.getPath());
      pic = pictFromFile(tempfile);
View Full Code Here

TOP

Related Classes of quicktime.qd.Pict

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.