Package quicktime.std.image

Examples of quicktime.std.image.Matrix


          throw new SchemeException(new Pair(), null, null);
        } // if (Thread.interrupted())
        Track video = mov.getIndTrackType(1, StdQTConstants.videoMediaType,
          StdQTConstants.movieTrackMediaType);
        Track newTrack = MovieUtils.addVideoTrack(video, temp);
        Matrix mat = new Matrix();
        QDRect from = mov.getBounds();
        QDRect to = null;
        int height = from.getHeight();
        int width = from.getWidth();
        int x = 0;
        int y = 0;
        if ((direction == 0) || (direction == 2))
        {
          height = Math.round(from.getHeight() * (float)1.0f/(i+1));
          y = j * height;
        } // if ((direction == 0) || (direction == 2))
        else if ((direction == 1) || (direction == 3))
        {
          width = Math.round(from.getWidth() * (float)1.0f/(i+1));
          x = j * width;
        } // else if ((direction == 1) || (direction == 3))
        to = new QDRect(x, y, width, height);
        mat.rect(from, to);
        newTrack.setMatrix(mat);
        newTrack.setLayer(-1);
      } // for
      result.add(temp);
    } // for
View Full Code Here


      textMedia.endEdits();
      textTrack.insertMedia(Math.round(start * movie.getTimeScale()), 0,
        textMedia.getDuration(), 1);

      // position the text track to (x, y)
      Matrix mat = new Matrix();
      mat.rect(new QDRect(0, 0, TEXT_TRACK_WIDTH, TEXT_TRACK_HEIGHT),
        new QDRect(x, y, TEXT_TRACK_WIDTH, TEXT_TRACK_HEIGHT));
      textTrack.setMatrix(mat);
    } // try
    catch (Exception e)
    {
View Full Code Here

    tcTrack.insertMedia(0, 0, tcMedia.getDuration(), 1);

    // set a transparent-background GrahpicsMode
    QDRect moveFrom = new QDRect(0, 0, width, height);
    QDRect moveTo = new QDRect(x, y, width, height);
    Matrix matrix = new Matrix();
    matrix.rect(moveFrom, moveTo);
    tcTrack.setMatrix (matrix);

    // if transparency is indicated, make the special value the transparent
    // color
    if (bgColor[0] == -1)
View Full Code Here

        StdQTConstants.videoMediaType,
        StdQTConstants.movieTrackMediaType);
      Track track2 = movie2.getIndTrackType(1,
        StdQTConstants.videoMediaType,
        StdQTConstants.movieTrackMediaType);
      Matrix matrix1 = track1.getMatrix();
      Matrix matrix2 = track2.getMatrix();

      // translate tracks based on size
      if (box1.equals(box2))
      {
        // do nothing - no resizing needed
      } // if (box1.equals(box2))
      else if ((height1 >= height2) && (width1 >= width2))
      {
        c = (width1 - width2) / 2;
        d = (height1 - height2) / 2;
      } // else if ((height1 >= height2) && (width1 >= width2))
      else if ((height2 >= height1) && (width2 >= width1))
      {
        a = (width2 - width1) / 2;
        b = (height2 - height1) / 2;
      } // else if ((height2 >= height1) && (width2 >= width1))
      else if ((height1 >= height2) && (width2 >= width1))
      {
        a = (width2 - width1) / 2;
        d = (height1 - height2) / 2;
      } // else if ((height1 >= height2) && (width2 >= width1))
      else if ((height2 >= height1) && (width1 >= width2))
      {
        b = (height2 - height1) / 2;
        c = (width1 - width2) / 2;
      } // else if ((height2 >= height1) && (width1 >= width2))

      // modify matrices based on changes made in the if-clause above
      matrix1.translate(a, b);
      matrix2.translate(c, d);

      // set tracks to changed matrices
      track1.setMatrix(matrix1);
      track2.setMatrix(matrix2);
View Full Code Here

      // scaling factor to adjust aspect ratios
      float scale = changedaspect * (1 / originalaspect);

      // get track matrix to preserve other scaling changes
      Matrix stretch = video.getMatrix();
      QDRect oldsize = new QDRect(0, 0, dim_size.getWidthF(),
        dim_size.getHeightF());
      QDRect newsize;

      // determine whether the aspect ratio needs to be checked/maintained
      if (aspect)
      {
        if (originalaspect != changedaspect)
        {
          height = (int) (height * scale);
        } // if (originalaspect != changedaspect)
      } // if (aspect)
      newsize = new QDRect(0, 0, width, height);
      stretch.map(oldsize, newsize);
      video.setMatrix(stretch);
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
View Full Code Here

        StdQTConstants.visualMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      trackBack = MovieUtils.addVideoTrack(trackBack, result);

      // make sure both tracks have their actual size
      Matrix matrix1 = new Matrix();
      QDRect from1 = new QDRect(0, 0, trackFore.getSize().getWidth(),
        trackFore.getSize().getHeight());
      QDRect to1 = new QDRect(0, 0,
        movFore.getDisplayBoundsRgn().getBounds().getWidth(),
        movFore.getDisplayBoundsRgn().getBounds().getHeight());
      matrix1.map(from1, to1);
      Matrix matrix2 = new Matrix();
      QDRect from2 = new QDRect(0, 0, trackBack.getSize().getWidth(),
        trackBack.getSize().getHeight());
      QDRect to2 = new QDRect(0, 0,
        movBack.getDisplayBoundsRgn().getBounds().getWidth(),
        movBack.getDisplayBoundsRgn().getBounds().getHeight());
      matrix2.map(from2, to2);

      GraphicsMode graph = new GraphicsMode(QDConstants.transparent, key);

      // make pixels with key color transparent, so back movie shows through
      VisualMediaHandler handlerFore =
View Full Code Here

        DataRef ref = new DataRef(pics[x],
          StdQTConstants.kDataRefQTFileTypeTag, "PICT");
        gi.setDataReference(ref);

        // create matrix to represent scaling of each pict
        Matrix drawMatrix = new Matrix();
        drawMatrix.rect(srcRect, gRect);
        gi.setMatrix(drawMatrix);
        gi.draw();

        // compress frame
        CompressedFrameInfo cfInfo = seq.compressFrame(gw, gRect,
View Full Code Here

/*     */   }
/*     */
/*     */   public Matrix getMatrix()
/*     */     throws StdQTException
/*     */   {
/* 104 */     Matrix localMatrix = new Matrix();
/* 105 */     int i = SGGetChannelMatrix(_ID(), localMatrix.getBytes());
/* 106 */     StdQTException.checkError(i);
/* 107 */     return localMatrix;
/*     */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public Matrix getMatrix()
/*      */     throws StdQTException
/*      */   {
/* 1142 */     Matrix localMatrix = new Matrix();
/* 1143 */     GetMovieMatrix(_ID(), localMatrix.getBytes());
/* 1144 */     StdQTException.checkError(GetMoviesError());
/* 1145 */     return localMatrix;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public Matrix getMatrix()
/*      */     throws StdQTException
/*      */   {
/*  470 */     Matrix localMatrix = new Matrix();
/*  471 */     GetTrackMatrix(_ID(), localMatrix.getBytes());
/*  472 */     StdQTException.checkError(GetMoviesError());
/*  473 */     return localMatrix;
/*      */   }
View Full Code Here

TOP

Related Classes of quicktime.std.image.Matrix

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.