Package javax.media.jai

Examples of javax.media.jai.InterpolationTable


        case DataBuffer.TYPE_SHORT:
        case DataBuffer.TYPE_INT:

      // computing medialibtable and calc for integral type and call
      if (mlibInterpTableI==null){
          InterpolationTable jtable = (InterpolationTable)interp;
          mlibInterpTableI =
      new mediaLibImageInterpTable(Constants.MLIB_INT,
                 jtable.getWidth(),
                 jtable.getHeight(),
                 jtable.getLeftPadding(),
                 jtable.getTopPadding(),
                 jtable.getSubsampleBitsH(),
                 jtable.getSubsampleBitsV(),
                 jtable.getPrecisionBits(),
                 jtable.getHorizontalTableData(),
                 jtable.getVerticalTableData());

      }

            if (setBackground)
          for (int i = 0 ; i < dstMLI.length; i++) {
              Image.GridWarpTable2(dstMLI[i], srcMLI[i],
           xWarpPos, yWarpPos,
                                         source.getMinX(),
                                         source.getMinY(),
                                         xStart - destRect.x,
                                         xStep, xNumCells,
                                         yStart - destRect.y,
                                         yStep, yNumCells,
                                         mlibInterpTableI,
                                         Constants.MLIB_EDGE_DST_NO_WRITE,
                                         intBackgroundValues);
          }
            else
          for (int i = 0 ; i < dstMLI.length; i++) {
              Image.GridWarpTable(dstMLI[i], srcMLI[i],
          xWarpPos, yWarpPos,
                                        source.getMinX(),
                                        source.getMinY(),
                                        xStart - destRect.x,
                                        xStep, xNumCells,
                                        yStart - destRect.y,
                                        yStep, yNumCells,
                                        mlibInterpTableI,
                                        Constants.MLIB_EDGE_DST_NO_WRITE);
                    MlibUtils.clampImage(dstMLI[i], getColorModel());
          }

            break;

        case DataBuffer.TYPE_FLOAT:
      if (mlibInterpTableF==null){
          InterpolationTable jtable = (InterpolationTable)interp;
          mlibInterpTableF =
        new mediaLibImageInterpTable(Constants.MLIB_FLOAT,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableDataFloat(),
                                             jtable.getVerticalTableDataFloat());

      }

            if (setBackground)
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.GridWarpTable2_Fp(dstMLI[i], srcMLI[i],
                                            xWarpPos, yWarpPos,
                                            source.getMinX(),
                                            source.getMinY(),
                                            xStart - destRect.x,
                                            xStep, xNumCells,
                                            yStart - destRect.y,
                                            yStep, yNumCells,
                                            mlibInterpTableF,
                                            Constants.MLIB_EDGE_DST_NO_WRITE,
                                            backgroundValues);
                }
            else
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.GridWarpTable_Fp(dstMLI[i], srcMLI[i],
                                           xWarpPos, yWarpPos,
                                           source.getMinX(),
                                           source.getMinY(),
                                           xStart - destRect.x,
                                           xStep, xNumCells,
                                           yStart - destRect.y,
                                           yStep, yNumCells,
                                           mlibInterpTableF,
                                           Constants.MLIB_EDGE_DST_NO_WRITE);
                }
            break;

        case DataBuffer.TYPE_DOUBLE:
        if (mlibInterpTableD == null){
          InterpolationTable jtable = (InterpolationTable)interp;
          mlibInterpTableD =
      new mediaLibImageInterpTable(Constants.MLIB_DOUBLE,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableDataDouble(),
                                             jtable.getVerticalTableDataDouble());
      }

            if (setBackground)
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.GridWarpTable2_Fp(dstMLI[i], srcMLI[i],
View Full Code Here


    protected void computeRect(Raster[] sources,
                               WritableRaster dest,
                               Rectangle destRect) {

  // Cast the Interpolation object to InterpolationTable object
  InterpolationTable jtable = (InterpolationTable)interp;

  // The Medialib InterpolationTable class equivalent
  mediaLibImageInterpTable mlibInterpTable;

  Raster source = sources[0];
  Rectangle srcRect = source.getBounds();
 
        int formatTag = MediaLibAccessor.findCompatibleTag(sources, dest);

        MediaLibAccessor srcAccessor = new MediaLibAccessor(source, srcRect,
                  formatTag);
        MediaLibAccessor dstAccessor = new MediaLibAccessor(dest, destRect,
                  formatTag);

  // Get the floating point scale factors
  float mlibScaleX = (float)scaleXRationalNum / (float)scaleXRationalDenom;
  float mlibScaleY = (float)scaleYRationalNum / (float)scaleYRationalDenom;

        // Translation to be specified to Medialib. Note that we have to
  // specify an additional translation since all images are 0 based
  // in Medialib.

  // Calculate intermediate values.
  float tempDX = (float)(srcRect.x * scaleXRationalNum) /
      (float)scaleXRationalDenom;
  float tempDY = (float)(srcRect.y * scaleYRationalNum) /
      (float)scaleYRationalDenom;

        float tx = transX - destRect.x + tempDX;
        float ty = transY - destRect.y + tempDY;

  mediaLibImage srcML[], dstML[];
 
        switch (dstAccessor.getDataType()) {
        case DataBuffer.TYPE_BYTE:
        case DataBuffer.TYPE_USHORT:
        case DataBuffer.TYPE_SHORT:
        case DataBuffer.TYPE_INT:

      mlibInterpTable =
    new mediaLibImageInterpTable(Constants.MLIB_INT,
               jtable.getWidth(),
               jtable.getHeight(),
               jtable.getLeftPadding(),
               jtable.getTopPadding(),
               jtable.getSubsampleBitsH(),
               jtable.getSubsampleBitsV(),
               jtable.getPrecisionBits(),
               jtable.getHorizontalTableData(),
               jtable.getVerticalTableData());

            srcML = srcAccessor.getMediaLibImages();
            dstML = dstAccessor.getMediaLibImages();
            for (int i = 0 ; i < dstML.length; i++) {
    Image.ZoomTranslateTable(dstML[i], srcML[i],
               (double)mlibScaleX,
               (double)mlibScaleY,
               (double)tx, (double)ty,
               mlibInterpTable,
               Constants.MLIB_EDGE_DST_NO_WRITE);
                MlibUtils.clampImage(dstML[i], getColorModel());
            }
            break;

        case DataBuffer.TYPE_FLOAT:

      mlibInterpTable =
    new mediaLibImageInterpTable(
              Constants.MLIB_FLOAT,
              jtable.getWidth(),
              jtable.getHeight(),
              jtable.getLeftPadding(),
              jtable.getTopPadding(),
              jtable.getSubsampleBitsH(),
              jtable.getSubsampleBitsV(),
              jtable.getPrecisionBits(),
              jtable.getHorizontalTableDataFloat(),
              jtable.getVerticalTableDataFloat());
     
      srcML = srcAccessor.getMediaLibImages();
            dstML = dstAccessor.getMediaLibImages();
            for (int i = 0 ; i < dstML.length; i++) {
    Image.ZoomTranslateTable_Fp(dstML[i], srcML[i],
                  (double)mlibScaleX,
                  (double)mlibScaleY,
                  (double)tx,
                  (double)ty,
                  mlibInterpTable,
                  Constants.MLIB_EDGE_DST_NO_WRITE);
            }
            break;

        case DataBuffer.TYPE_DOUBLE:

      mlibInterpTable =
    new mediaLibImageInterpTable(
             Constants.MLIB_DOUBLE,
             jtable.getWidth(),
             jtable.getHeight(),
             jtable.getLeftPadding(),
             jtable.getTopPadding(),
             jtable.getSubsampleBitsH(),
             jtable.getSubsampleBitsV(),
             jtable.getPrecisionBits(),
             jtable.getHorizontalTableDataDouble(),
             jtable.getVerticalTableDataDouble());

      srcML = srcAccessor.getMediaLibImages();
            dstML = dstAccessor.getMediaLibImages();
            for (int i = 0 ; i < dstML.length; i++) {
    Image.ZoomTranslateTable_Fp(dstML[i], srcML[i],
View Full Code Here

    protected void computeRect(Raster[] sources,
                               WritableRaster dest,
                               Rectangle destRect) {

        // Cast the Interpolation object to InterpolationTable object
        InterpolationTable jtable = (InterpolationTable)interp;

        // The Medialib InterpolationTable class equivalent
        mediaLibImageInterpTable mlibInterpTable;

        Raster source = sources[0];
        Rectangle srcRect = source.getBounds();

        int formatTag = MediaLibAccessor.findCompatibleTag(sources,dest);

        MediaLibAccessor srcAccessor =
            new MediaLibAccessor(source,srcRect,formatTag);
        MediaLibAccessor dstAccessor =
            new MediaLibAccessor(dest,destRect,formatTag);

        //
        // The AffineTransform needs to be readjusted as per the
        // location of the current source & destination rectangles
        //

        // Clone the global transform so as not to write to an instance
        // variable as this method may be called from different threads.
        double[] medialib_tr = (double[])this.medialib_tr.clone();

        medialib_tr[2] = m_transform[0] * srcRect.x +
            m_transform[1] * srcRect.y +
            m_transform[2] -
            destRect.x;
        medialib_tr[5] = m_transform[3] * srcRect.x +
            m_transform[4] * srcRect.y +
            m_transform[5] -
            destRect.y;

  mediaLibImage srcML[], dstML[];

        switch (dstAccessor.getDataType()) {
        case DataBuffer.TYPE_BYTE:
        case DataBuffer.TYPE_USHORT:
        case DataBuffer.TYPE_SHORT:
        case DataBuffer.TYPE_INT:
            mlibInterpTable =
                new mediaLibImageInterpTable(Constants.MLIB_INT,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableData(),
                                             jtable.getVerticalTableData());

      srcML = srcAccessor.getMediaLibImages();
      dstML = dstAccessor.getMediaLibImages();

            if (setBackground)
                Image.AffineTable2(dstML[0],
                                   srcML[0],
                                   medialib_tr,
                                   mlibInterpTable,
                                   Constants.MLIB_EDGE_DST_NO_WRITE,
                                   intBackgroundValues);
            else
                Image.AffineTable(dstML[0],
                                  srcML[0],
                                  medialib_tr,
                                  mlibInterpTable,
                                  Constants.MLIB_EDGE_DST_NO_WRITE);
            MlibUtils.clampImage(dstML[0], getColorModel());
            break;

        case DataBuffer.TYPE_FLOAT:
             mlibInterpTable =
                new mediaLibImageInterpTable(Constants.MLIB_FLOAT,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableDataFloat(),
                                             jtable.getVerticalTableDataFloat());

            srcML = srcAccessor.getMediaLibImages();
      dstML = dstAccessor.getMediaLibImages();

            if (setBackground)
                Image.AffineTable2_Fp(dstML[0],
                                      srcML[0],
                                      medialib_tr,
                                      mlibInterpTable,
                                      Constants.MLIB_EDGE_DST_NO_WRITE,
                                      backgroundValues);
            else
                Image.AffineTable_Fp(dstML[0],
                                     srcML[0],
                                     medialib_tr,
                                     mlibInterpTable,
                                     Constants.MLIB_EDGE_DST_NO_WRITE);
      break;

        case DataBuffer.TYPE_DOUBLE:
             mlibInterpTable =
                new mediaLibImageInterpTable(Constants.MLIB_DOUBLE,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableDataDouble(),
                                             jtable.getVerticalTableDataDouble());

      srcML = srcAccessor.getMediaLibImages();
      dstML = dstAccessor.getMediaLibImages();

            if (setBackground)
View Full Code Here

        case DataBuffer.TYPE_BYTE:
        case DataBuffer.TYPE_USHORT:
        case DataBuffer.TYPE_SHORT:
        case DataBuffer.TYPE_INT:
       if (mlibInterpTableI==null){
          InterpolationTable jtable = (InterpolationTable)interp;
          mlibInterpTableI =
      new mediaLibImageInterpTable(Constants.MLIB_INT,
                 jtable.getWidth(),
                 jtable.getHeight(),
                 jtable.getLeftPadding(),
                 jtable.getTopPadding(),
                 jtable.getSubsampleBitsH(),
                 jtable.getSubsampleBitsV(),
                 jtable.getPrecisionBits(),
                 jtable.getHorizontalTableData(),
                 jtable.getVerticalTableData());

      }

            if (setBackground)
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.PolynomialWarpTable2(dstMLI[i], srcMLI[i],
                                               xCoeffs, yCoeffs,
                                               destRect.x,
                                               destRect.y,
                                               source.getMinX(),
                                               source.getMinY(),
                                               preScaleX, preScaleY,
                                               postScaleX, postScaleY,
                                               mlibInterpTableI,
                                               Constants.MLIB_EDGE_DST_NO_WRITE,
                                               intBackgroundValues);
                }
            else
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.PolynomialWarpTable(dstMLI[i], srcMLI[i],
                                              xCoeffs, yCoeffs,
                                              destRect.x,
                                              destRect.y,
                                              source.getMinX(),
                                              source.getMinY(),
                                              preScaleX, preScaleY,
                                              postScaleX, postScaleY,
                                              mlibInterpTableI,
                                              Constants.MLIB_EDGE_DST_NO_WRITE);
                    MlibUtils.clampImage(dstMLI[i], getColorModel());
                }
            break;

        case DataBuffer.TYPE_FLOAT:
      if (mlibInterpTableF==null){
          InterpolationTable jtable = (InterpolationTable)interp;
          mlibInterpTableF =
        new mediaLibImageInterpTable(Constants.MLIB_FLOAT,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableDataFloat(),
                                             jtable.getVerticalTableDataFloat());

      }

            if (setBackground)
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.PolynomialWarpTable2_Fp(dstMLI[i], srcMLI[i],
                                                 xCoeffs, yCoeffs,
                                                 destRect.x,
                                                 destRect.y,
                                                 source.getMinX(),
                                                 source.getMinY(),
                                                 preScaleX, preScaleY,
                                                 postScaleX, postScaleY,
                                                 mlibInterpTableD,
                                                 Constants.MLIB_EDGE_DST_NO_WRITE,
                                                 backgroundValues);
          }
            else
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.PolynomialWarpTable_Fp(dstMLI[i], srcMLI[i],
                                                 xCoeffs, yCoeffs,
                                                 destRect.x,
                                                 destRect.y,
                                                 source.getMinX(),
                                                 source.getMinY(),
                                                 preScaleX, preScaleY,
                                                 postScaleX, postScaleY,
                                                 mlibInterpTableD,
                                                 Constants.MLIB_EDGE_DST_NO_WRITE);
          }
            break;


        case DataBuffer.TYPE_DOUBLE:
        if (mlibInterpTableD == null){
          InterpolationTable jtable = (InterpolationTable)interp;
          mlibInterpTableD =
      new mediaLibImageInterpTable(Constants.MLIB_DOUBLE,
                                             jtable.getWidth(),
                                             jtable.getHeight(),
                                             jtable.getLeftPadding(),
                                             jtable.getTopPadding(),
                                             jtable.getSubsampleBitsH(),
                                             jtable.getSubsampleBitsV(),
                                             jtable.getPrecisionBits(),
                                             jtable.getHorizontalTableDataDouble(),
                                             jtable.getVerticalTableDataDouble());
      }

            if (setBackground)
                for (int i = 0 ; i < dstMLI.length; i++) {
                    Image.PolynomialWarpTable2_Fp(dstMLI[i], srcMLI[i],
View Full Code Here

/*  70 */     super(source, layout, config, extender, tr, interp, backgroundValues);
/*     */   }
/*     */
/*     */   protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
/*     */   {
/*  93 */     InterpolationTable jtable = (InterpolationTable)this.interp;
/*     */
/*  98 */     Raster source = sources[0];
/*  99 */     Rectangle srcRect = source.getBounds();
/*     */
/* 101 */     int formatTag = MediaLibAccessor.findCompatibleTag(sources, dest);
/*     */
/* 103 */     MediaLibAccessor srcAccessor = new MediaLibAccessor(source, srcRect, formatTag);
/*     */
/* 105 */     MediaLibAccessor dstAccessor = new MediaLibAccessor(dest, destRect, formatTag);
/*     */
/* 115 */     double[] medialib_tr = (double[])this.medialib_tr.clone();
/*     */
/* 117 */     medialib_tr[2] = (this.m_transform[0] * srcRect.x + this.m_transform[1] * srcRect.y + this.m_transform[2] - destRect.x);
/*     */
/* 121 */     medialib_tr[5] = (this.m_transform[3] * srcRect.x + this.m_transform[4] * srcRect.y + this.m_transform[5] - destRect.y);
/*     */     mediaLibImageInterpTable mlibInterpTable;
/*     */     mediaLibImage[] srcML;
/*     */     mediaLibImage[] dstML;
/* 128 */     switch (dstAccessor.getDataType()) {
/*     */     case 0:
/*     */     case 1:
/*     */     case 2:
/*     */     case 3:
/* 133 */       mlibInterpTable = new mediaLibImageInterpTable(3, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableData(), jtable.getVerticalTableData());
/*     */
/* 145 */       srcML = srcAccessor.getMediaLibImages();
/* 146 */       dstML = dstAccessor.getMediaLibImages();
/*     */
/* 148 */       if (this.setBackground) {
/* 149 */         Image.AffineTable2(dstML[0], srcML[0], medialib_tr, mlibInterpTable, 0, this.intBackgroundValues);
/*     */       }
/*     */       else
/*     */       {
/* 156 */         Image.AffineTable(dstML[0], srcML[0], medialib_tr, mlibInterpTable, 0);
/*     */       }
/*     */
/* 161 */       break;
/*     */     case 4:
/* 164 */       mlibInterpTable = new mediaLibImageInterpTable(4, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableDataFloat(), jtable.getVerticalTableDataFloat());
/*     */
/* 176 */       srcML = srcAccessor.getMediaLibImages();
/* 177 */       dstML = dstAccessor.getMediaLibImages();
/*     */
/* 179 */       if (this.setBackground) {
/* 180 */         Image.AffineTable2_Fp(dstML[0], srcML[0], medialib_tr, mlibInterpTable, 0, this.backgroundValues);
/*     */       }
/*     */       else
/*     */       {
/* 187 */         Image.AffineTable_Fp(dstML[0], srcML[0], medialib_tr, mlibInterpTable, 0);
/*     */       }
/*     */
/* 192 */       break;
/*     */     case 5:
/* 195 */       mlibInterpTable = new mediaLibImageInterpTable(5, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableDataDouble(), jtable.getVerticalTableDataDouble());
/*     */
/* 207 */       srcML = srcAccessor.getMediaLibImages();
/* 208 */       dstML = dstAccessor.getMediaLibImages();
/*     */
/* 210 */       if (this.setBackground) {
View Full Code Here

/*     */     case 0:
/*     */     case 1:
/*     */     case 2:
/*     */     case 3:
/* 354 */       if (this.mlibInterpTableI == null) {
/* 355 */         InterpolationTable jtable = (InterpolationTable)this.interp;
/* 356 */         this.mlibInterpTableI = new mediaLibImageInterpTable(3, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableData(), jtable.getVerticalTableData());
/*     */       }
/*     */
/* 370 */       if (this.setBackground) {
/* 371 */         for (int i = 0; i < dstMLI.length; i++) {
/* 372 */           Image.GridWarpTable2(dstMLI[i], srcMLI[i], this.xWarpPos, this.yWarpPos, source.getMinX(), source.getMinY(), this.xStart - destRect.x, this.xStep, this.xNumCells, this.yStart - destRect.y, this.yStep, this.yNumCells, this.mlibInterpTableI, 0, this.intBackgroundValues);
/*     */         }
/*     */
/*     */       }
/*     */       else
/*     */       {
/* 385 */         for (int i = 0; i < dstMLI.length; i++) {
/* 386 */           Image.GridWarpTable(dstMLI[i], srcMLI[i], this.xWarpPos, this.yWarpPos, source.getMinX(), source.getMinY(), this.xStart - destRect.x, this.xStep, this.xNumCells, this.yStart - destRect.y, this.yStep, this.yNumCells, this.mlibInterpTableI, 0);
/*     */         }
/*     */
/*     */       }
/*     */
/* 398 */       break;
/*     */     case 4:
/* 401 */       if (this.mlibInterpTableF == null) {
/* 402 */         InterpolationTable jtable = (InterpolationTable)this.interp;
/* 403 */         this.mlibInterpTableF = new mediaLibImageInterpTable(4, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableDataFloat(), jtable.getVerticalTableDataFloat());
/*     */       }
/*     */
/* 417 */       if (this.setBackground) {
/* 418 */         for (int i = 0; i < dstMLI.length; i++) {
/* 419 */           Image.GridWarpTable2_Fp(dstMLI[i], srcMLI[i], this.xWarpPos, this.yWarpPos, source.getMinX(), source.getMinY(), this.xStart - destRect.x, this.xStep, this.xNumCells, this.yStart - destRect.y, this.yStep, this.yNumCells, this.mlibInterpTableF, 0, this.backgroundValues);
/*     */         }
/*     */
/*     */       }
/*     */       else
/*     */       {
/* 432 */         for (int i = 0; i < dstMLI.length; i++) {
/* 433 */           Image.GridWarpTable_Fp(dstMLI[i], srcMLI[i], this.xWarpPos, this.yWarpPos, source.getMinX(), source.getMinY(), this.xStart - destRect.x, this.xStep, this.xNumCells, this.yStart - destRect.y, this.yStep, this.yNumCells, this.mlibInterpTableF, 0);
/*     */         }
/*     */
/*     */       }
/*     */
/* 444 */       break;
/*     */     case 5:
/* 447 */       if (this.mlibInterpTableD == null) {
/* 448 */         InterpolationTable jtable = (InterpolationTable)this.interp;
/* 449 */         this.mlibInterpTableD = new mediaLibImageInterpTable(5, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableDataDouble(), jtable.getVerticalTableDataDouble());
/*     */       }
/*     */
/* 462 */       if (this.setBackground) {
/* 463 */         for (int i = 0; i < dstMLI.length; i++) {
/* 464 */           Image.GridWarpTable2_Fp(dstMLI[i], srcMLI[i], this.xWarpPos, this.yWarpPos, source.getMinX(), source.getMinY(), this.xStart - destRect.x, this.xStep, this.xNumCells, this.yStart - destRect.y, this.yStep, this.yNumCells, this.mlibInterpTableD, 0, this.backgroundValues);
View Full Code Here

/*  67 */     super(source, extender, config, layout, xScale, yScale, xTrans, yTrans, interp, true);
/*     */   }
/*     */
/*     */   protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
/*     */   {
/*  85 */     InterpolationTable jtable = (InterpolationTable)this.interp;
/*     */
/*  90 */     Raster source = sources[0];
/*  91 */     Rectangle srcRect = source.getBounds();
/*     */
/*  93 */     int formatTag = MediaLibAccessor.findCompatibleTag(sources, dest);
/*     */
/*  95 */     MediaLibAccessor srcAccessor = new MediaLibAccessor(source, srcRect, formatTag);
/*     */
/*  97 */     MediaLibAccessor dstAccessor = new MediaLibAccessor(dest, destRect, formatTag);
/*     */
/* 101 */     float mlibScaleX = (float)this.scaleXRationalNum / (float)this.scaleXRationalDenom;
/* 102 */     float mlibScaleY = (float)this.scaleYRationalNum / (float)this.scaleYRationalDenom;
/*     */
/* 109 */     float tempDX = (float)(srcRect.x * this.scaleXRationalNum) / (float)this.scaleXRationalDenom;
/*     */
/* 111 */     float tempDY = (float)(srcRect.y * this.scaleYRationalNum) / (float)this.scaleYRationalDenom;
/*     */
/* 114 */     float tx = this.transX - destRect.x + tempDX;
/* 115 */     float ty = this.transY - destRect.y + tempDY;
/*     */     mediaLibImageInterpTable mlibInterpTable;
/*     */     mediaLibImage[] srcML;
/*     */     mediaLibImage[] dstML;
/* 119 */     switch (dstAccessor.getDataType())
/*     */     {
/*     */     case 0:
/*     */     case 1:
/*     */     case 2:
/*     */     case 3:
/* 125 */       mlibInterpTable = new mediaLibImageInterpTable(3, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableData(), jtable.getVerticalTableData());
/*     */
/* 137 */       srcML = srcAccessor.getMediaLibImages();
/* 138 */       dstML = dstAccessor.getMediaLibImages();
/* 139 */       for (int i = 0; i < dstML.length; i++) {
/* 140 */         Image.ZoomTranslateTable(dstML[i], srcML[i], mlibScaleX, mlibScaleY, tx, ty, mlibInterpTable, 0);
/*     */       }
/*     */
/* 147 */       break;
/*     */     case 4:
/* 151 */       mlibInterpTable = new mediaLibImageInterpTable(4, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableDataFloat(), jtable.getVerticalTableDataFloat());
/*     */
/* 164 */       srcML = srcAccessor.getMediaLibImages();
/* 165 */       dstML = dstAccessor.getMediaLibImages();
/* 166 */       for (int i = 0; i < dstML.length; i++) {
/* 167 */         Image.ZoomTranslateTable_Fp(dstML[i], srcML[i], mlibScaleX, mlibScaleY, tx, ty, mlibInterpTable, 0);
/*     */       }
/*     */
/* 175 */       break;
/*     */     case 5:
/* 179 */       mlibInterpTable = new mediaLibImageInterpTable(5, jtable.getWidth(), jtable.getHeight(), jtable.getLeftPadding(), jtable.getTopPadding(), jtable.getSubsampleBitsH(), jtable.getSubsampleBitsV(), jtable.getPrecisionBits(), jtable.getHorizontalTableDataDouble(), jtable.getVerticalTableDataDouble());
/*     */
/* 192 */       srcML = srcAccessor.getMediaLibImages();
/* 193 */       dstML = dstAccessor.getMediaLibImages();
/* 194 */       for (int i = 0; i < dstML.length; i++) {
/* 195 */         Image.ZoomTranslateTable_Fp(dstML[i], srcML[i], mlibScaleX, mlibScaleY, tx, ty, mlibInterpTable, 0);
View Full Code Here

TOP

Related Classes of javax.media.jai.InterpolationTable

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.