Examples of mediaLibImage


Examples of com.sun.medialib.mlib.mediaLibImage

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

  mediaLibImage srcML[], dstML[];

        switch (dstAccessor.getDataType()) {
        case DataBuffer.TYPE_BYTE:
        case DataBuffer.TYPE_USHORT:
        case DataBuffer.TYPE_SHORT:
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

                    srcAccessor[i].getIntParameters(0, threshold[i]);
            }
        }

        // Temporary images.
        mediaLibImage tmpIm1 = null;
        mediaLibImage tmpImN = null;
        mediaLibImage[] tmpIm1Array = new mediaLibImage[] {tmpIm1};
        mediaLibImage[] tmpImNArray = new mediaLibImage[] {tmpImN};

        if(mosaicType == MosaicDescriptor.MOSAIC_TYPE_OVERLAY) {
            // Fill the destination with the background value.
            Image.Clear(dst[0], mlibBackground);

            for(int i = numSources - 1; i >= 0; i--) {
                if(src[i] == null) {
                    continue;
                }

                mediaLibImage weight =
                    getWeightImage(destRect, formatTag,
                                   dst[0], src[i][0],
                                   sourceAlpha != null &&
                                   sourceAlpha[i] != null ?
                                   alphaRaster[i] : null,
                                   sourceROI != null &&
                                   sourceROI[i] != null ?
                                   roiRaster[i] : null,
                                   mlibThreshold[i],
                                   tmpIm1Array,
                                   tmpImNArray);

                Image.Blend2(dst[0], src[i][0], weight);
            }
        } else if(mosaicType == MosaicDescriptor.MOSAIC_TYPE_BLEND) {
            tmpIm1 = new mediaLibImage(dst[0].getType(),
                                       1,
                                       dst[0].getWidth(),
                                       dst[0].getHeight());
            tmpImN = new mediaLibImage(dst[0].getType(),
                                       dst[0].getChannels(),
                                       dst[0].getWidth(),
                                       dst[0].getHeight());

            mediaLibImage[] alphas = new mediaLibImage[numNonNullSources];
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

                                         Raster alphaRaster,
                                         Raster roiRaster,
                                         int[] thresh,
                                         mediaLibImage[] tmpIm1,
                                         mediaLibImage[] tmpImN) {
        mediaLibImage weight = null;

        if(alphaRaster != null) {
            MediaLibAccessor alphaAccessor =
                new MediaLibAccessor(alphaRaster, destRect,
                                     formatTag);
            mediaLibImage[] alphaML = alphaAccessor.getMediaLibImages();

            if(isAlphaBitmask) {
                if(tmpIm1 == null) {
                    tmpIm1 = new mediaLibImage[] {null};
                }
                if(tmpIm1[0] == null) {
                    tmpIm1[0] = new mediaLibImage(src.getType(),
                                                  1,
                                                  src.getWidth(),
                                                  src.getHeight());
                }

                Image.Thresh1(tmpIm1[0], alphaML[0], new int[] {0},
                              new int[] {ghigh[0]}, new int[] {glow[0]});
                weight = tmpIm1[0];
            } else {
                weight = alphaML[0];
            }
        } else if(roiRaster != null) {
            int roiFmtTag =
                MediaLibAccessor.findCompatibleTag(null, roiRaster);

            MediaLibAccessor roiAccessor =
                new MediaLibAccessor(roiRaster, destRect,
                                     roiFmtTag, true);
            mediaLibImage[] roi = roiAccessor.getMediaLibImages();

            if(tmpIm1 == null) {
                tmpIm1 = new mediaLibImage[] {null};
            }
            if(tmpIm1[0] == null) {
                tmpIm1[0] = new mediaLibImage(src.getType(),
                                              1,
                                              src.getWidth(),
                                              src.getHeight());
            }

            if(tmpIm1[0].getType() != roi[0].getType()) {
                if(tmpIm1[0] == null) {
                    tmpIm1[0] = new mediaLibImage(src.getType(),
                                                  1,
                                                  src.getWidth(),
                                                  src.getHeight());
                }
                Image.DataTypeConvert(tmpIm1[0], roi[0]);
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

                    srcAccessor[i].getIntParameters(0, threshold[i]);
            }
        }

        // Temporary images.
        mediaLibImage tmpIm1 = null;
        mediaLibImage tmpImN = null;
        mediaLibImage[] tmpIm1Array = new mediaLibImage[] {tmpIm1};
        mediaLibImage[] tmpImNArray = new mediaLibImage[] {tmpImN};

        if(mosaicType == MosaicDescriptor.MOSAIC_TYPE_OVERLAY) {
            // Fill the destination with the background value.
            Image.Clear(dst[0], mlibBackground);

            for(int i = numSources - 1; i >= 0; i--) {
                if(src[i] == null) {
                    continue;
                }

                mediaLibImage weight =
                    getWeightImage(destRect, formatTag,
                                   dst[0], src[i][0],
                                   sourceAlpha != null &&
                                   sourceAlpha[i] != null ?
                                   alphaRaster[i] : null,
                                   sourceROI != null &&
                                   sourceROI[i] != null ?
                                   roiRaster[i] : null,
                                   mlibThreshold[i],
                                   tmpIm1Array,
                                   tmpImNArray);

                Image.Blend2(dst[0], src[i][0], weight);
            }
        } else if(mosaicType == MosaicDescriptor.MOSAIC_TYPE_BLEND) {
            tmpIm1 = new mediaLibImage(dst[0].getType(),
                                       1,
                                       dst[0].getWidth(),
                                       dst[0].getHeight());
            tmpImN = new mediaLibImage(dst[0].getType(),
                                       dst[0].getChannels(),
                                       dst[0].getWidth(),
                                       dst[0].getHeight());

            mediaLibImage[] alphas = new mediaLibImage[numNonNullSources];
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

                                         Raster alphaRaster,
                                         Raster roiRaster,
                                         int[] thresh,
                                         mediaLibImage[] tmpIm1,
                                         mediaLibImage[] tmpImN) {
        mediaLibImage weight = null;

        if(alphaRaster != null) {
            MediaLibAccessor alphaAccessor =
                new MediaLibAccessor(alphaRaster, destRect,
                                     formatTag);
            mediaLibImage[] alphaML = alphaAccessor.getMediaLibImages();

            if(isAlphaBitmask) {
                if(tmpIm1 == null) {
                    tmpIm1 = new mediaLibImage[] {null};
                }
                if(tmpIm1[0] == null) {
                    tmpIm1[0] = new mediaLibImage(src.getType(),
                                                  1,
                                                  src.getWidth(),
                                                  src.getHeight());
                }

                Image.Thresh1(tmpIm1[0], alphaML[0], new int[] {0},
                              new int[] {ghigh[0]}, new int[] {glow[0]});
                weight = tmpIm1[0];
            } else {
                weight = alphaML[0];
            }
        } else if(roiRaster != null) {
            int roiFmtTag =
                MediaLibAccessor.findCompatibleTag(null, roiRaster);

            MediaLibAccessor roiAccessor =
                new MediaLibAccessor(roiRaster, destRect,
                                     roiFmtTag, true);
            mediaLibImage[] roi = roiAccessor.getMediaLibImages();

            if(tmpIm1 == null) {
                tmpIm1 = new mediaLibImage[] {null};
            }
            if(tmpIm1[0] == null) {
                tmpIm1[0] = new mediaLibImage(src.getType(),
                                              1,
                                              src.getWidth(),
                                              src.getHeight());
            }

            if(tmpIm1[0].getType() != roi[0].getType()) {
                if(tmpIm1[0] == null) {
                    tmpIm1[0] = new mediaLibImage(src.getType(),
                                                  1,
                                                  src.getWidth(),
                                                  src.getHeight());
                }
                Image.DataTypeConvert(tmpIm1[0], roi[0]);
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

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

  mediaLibImage srcML[], dstML[];

        switch (dstAccessor.getDataType()) {
        case DataBuffer.TYPE_BYTE:
        case DataBuffer.TYPE_USHORT:
        case DataBuffer.TYPE_SHORT:
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

/*     */     case 1:
/*     */     case 2:
/*     */     case 3:
/*  77 */       for (int i = 0; i < dstMLI.length; i++)
/*     */       {
/*  79 */         mediaLibImage srcImg = srcMLI[i];
/*  80 */         mediaLibImage dstImg = dstMLI[i];
/*     */
/*  93 */         Image.Invert(dstMLI[i], srcMLI[i]);
/*     */       }
/*     */
/* 103 */       break;
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

/*  701 */         scanlineStride = rect.width;
/*  702 */         bdata = ImageUtil.getUnpackedBinaryData(raster, rect);
/*  703 */         this.formatTag |= 128;
/*      */       }
/*      */
/*  706 */       this.mlimages[0] = new mediaLibImage(mlibType, 1, rect.width, rect.height, scanlineStride, 0, bdata);
/*      */
/*  714 */       return;
/*      */     }
/*      */
/*  717 */     if ((formatTag & 0x80) == 0) {
/*  718 */       ComponentSampleModel csm = (ComponentSampleModel)raster.getSampleModel();
/*      */
/*  721 */       this.numBands = csm.getNumBands();
/*  722 */       this.bandOffsets = csm.getBandOffsets();
/*  723 */       int dataOffset = raster.getDataBuffer().getOffset();
/*  724 */       dataOffset += (rect.y - raster.getSampleModelTranslateY()) * csm.getScanlineStride() + (rect.x - raster.getSampleModelTranslateX()) * csm.getPixelStride();
/*      */
/*  731 */       int scanlineStride = csm.getScanlineStride();
/*      */
/*  733 */       switch (formatTag & 0x7F) {
/*      */       case 0:
/*  735 */         DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
/*  736 */         this.mlimages = new mediaLibImage[1];
/*  737 */         this.mlimages[0] = new mediaLibImage(1, this.numBands, rect.width, rect.height, scanlineStride, dataOffset, dbb.getData());
/*      */
/*  745 */         break;
/*      */       case 1:
/*  748 */         DataBufferUShort dbus = (DataBufferUShort)raster.getDataBuffer();
/*      */
/*  750 */         this.mlimages = new mediaLibImage[1];
/*  751 */         this.mlimages[0] = new mediaLibImage(6, this.numBands, rect.width, rect.height, scanlineStride, dataOffset, dbus.getData());
/*      */
/*  759 */         break;
/*      */       case 2:
/*  761 */         DataBufferShort dbs = (DataBufferShort)raster.getDataBuffer();
/*  762 */         this.mlimages = new mediaLibImage[1];
/*  763 */         this.mlimages[0] = new mediaLibImage(2, this.numBands, rect.width, rect.height, scanlineStride, dataOffset, dbs.getData());
/*      */
/*  771 */         break;
/*      */       case 3:
/*  773 */         DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer();
/*  774 */         this.mlimages = new mediaLibImage[1];
/*  775 */         this.mlimages[0] = new mediaLibImage(3, this.numBands, rect.width, rect.height, scanlineStride, dataOffset, dbi.getData());
/*      */
/*  783 */         break;
/*      */       case 4:
/*  785 */         DataBuffer dbf = raster.getDataBuffer();
/*  786 */         this.mlimages = new mediaLibImage[1];
/*  787 */         this.mlimages[0] = new mediaLibImage(4, this.numBands, rect.width, rect.height, scanlineStride, dataOffset, DataBufferUtils.getDataFloat(dbf));
/*      */
/*  795 */         break;
/*      */       case 5:
/*  797 */         DataBuffer dbd = raster.getDataBuffer();
/*  798 */         this.mlimages = new mediaLibImage[1];
/*  799 */         this.mlimages[0] = new mediaLibImage(5, this.numBands, rect.width, rect.height, scanlineStride, dataOffset, DataBufferUtils.getDataDouble(dbd));
/*      */
/*  807 */         break;
/*      */       default:
/*  809 */         throw new IllegalArgumentException((formatTag & 0x7F) + JaiI18N.getString("MediaLibAccessor1"));
/*      */       }
/*      */     }
/*      */     else {
/*  813 */       this.numBands = raster.getNumBands();
/*  814 */       this.bandOffsets = new int[this.numBands];
/*  815 */       for (int i = 0; i < this.numBands; i++) {
/*  816 */         this.bandOffsets[i] = i;
/*      */       }
/*  818 */       int scanlineStride = rect.width * this.numBands;
/*      */
/*  820 */       switch (formatTag & 0x7F) {
/*      */       case 0:
/*  822 */         byte[] bdata = new byte[rect.width * rect.height * this.numBands];
/*  823 */         this.mlimages = new mediaLibImage[1];
/*  824 */         this.mlimages[0] = new mediaLibImage(1, this.numBands, rect.width, rect.height, scanlineStride, 0, bdata);
/*      */
/*  832 */         break;
/*      */       case 1:
/*  834 */         short[] usdata = new short[rect.width * rect.height * this.numBands];
/*  835 */         this.mlimages = new mediaLibImage[1];
/*  836 */         this.mlimages[0] = new mediaLibImage(6, this.numBands, rect.width, rect.height, scanlineStride, 0, usdata);
/*      */
/*  844 */         break;
/*      */       case 2:
/*  846 */         short[] sdata = new short[rect.width * rect.height * this.numBands];
/*  847 */         this.mlimages = new mediaLibImage[1];
/*  848 */         this.mlimages[0] = new mediaLibImage(2, this.numBands, rect.width, rect.height, scanlineStride, 0, sdata);
/*      */
/*  856 */         break;
/*      */       case 3:
/*  858 */         int[] idata = new int[rect.width * rect.height * this.numBands];
/*  859 */         this.mlimages = new mediaLibImage[1];
/*  860 */         this.mlimages[0] = new mediaLibImage(3, this.numBands, rect.width, rect.height, scanlineStride, 0, idata);
/*      */
/*  868 */         break;
/*      */       case 4:
/*  870 */         float[] fdata = new float[rect.width * rect.height * this.numBands];
/*  871 */         this.mlimages = new mediaLibImage[1];
/*  872 */         this.mlimages[0] = new mediaLibImage(4, this.numBands, rect.width, rect.height, scanlineStride, 0, fdata);
/*      */
/*  880 */         break;
/*      */       case 5:
/*  882 */         double[] ddata = new double[rect.width * rect.height * this.numBands];
/*  883 */         this.mlimages = new mediaLibImage[1];
/*  884 */         this.mlimages[0] = new mediaLibImage(5, this.numBands, rect.width, rect.height, scanlineStride, 0, ddata);
/*      */
/*  892 */         break;
/*      */       default:
/*  894 */         throw new IllegalArgumentException((formatTag & 0x7F) + JaiI18N.getString("MediaLibAccessor1"));
/*      */       }
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

/* 169 */         mlibThreshold[i] = srcAccessor[i].getIntParameters(0, this.threshold[i]);
/*     */       }
/*     */
/*     */     }
/*     */
/* 175 */     mediaLibImage tmpIm1 = null;
/* 176 */     mediaLibImage tmpImN = null;
/* 177 */     mediaLibImage[] tmpIm1Array = { tmpIm1 };
/* 178 */     mediaLibImage[] tmpImNArray = { tmpImN };
/*     */
/* 180 */     if (this.mosaicType == MosaicDescriptor.MOSAIC_TYPE_OVERLAY)
/*     */     {
/* 182 */       Image.Clear(dst[0], mlibBackground);
/*     */
/* 184 */       for (int i = numSources - 1; i >= 0; i--)
/* 185 */         if (src[i] != null)
/*     */         {
/* 189 */           mediaLibImage weight = getWeightImage(destRect, formatTag, dst[0], src[i][0], (this.sourceAlpha != null) && (this.sourceAlpha[i] != null) ? alphaRaster[i] : null, (this.sourceROI != null) && (this.sourceROI[i] != null) ? roiRaster[i] : null, mlibThreshold[i], tmpIm1Array, tmpImNArray);
/*     */
/* 202 */           Image.Blend2(dst[0], src[i][0], weight);
/*     */         }
/* 204 */     } else if (this.mosaicType == MosaicDescriptor.MOSAIC_TYPE_BLEND) {
/* 205 */       tmpIm1 = new mediaLibImage(dst[0].getType(), 1, dst[0].getWidth(), dst[0].getHeight());
/*     */
/* 209 */       tmpImN = new mediaLibImage(dst[0].getType(), dst[0].getChannels(), dst[0].getWidth(), dst[0].getHeight());
/*     */
/* 214 */       mediaLibImage[] alphas = new mediaLibImage[numNonNullSources];
/* 215 */       mediaLibImage[] srcs = new mediaLibImage[numNonNullSources];
/*     */
/* 217 */       int sourceCount = 0;
View Full Code Here

Examples of com.sun.medialib.mlib.mediaLibImage

/*     */     }
/*     */   }
/*     */
/*     */   private mediaLibImage getWeightImage(Rectangle destRect, int formatTag, mediaLibImage dst, mediaLibImage src, Raster alphaRaster, Raster roiRaster, int[] thresh, mediaLibImage[] tmpIm1, mediaLibImage[] tmpImN)
/*     */   {
/* 270 */     mediaLibImage weight = null;
/*     */
/* 272 */     if (alphaRaster != null) {
/* 273 */       MediaLibAccessor alphaAccessor = new MediaLibAccessor(alphaRaster, destRect, formatTag);
/*     */
/* 276 */       mediaLibImage[] alphaML = alphaAccessor.getMediaLibImages();
/*     */
/* 278 */       if (this.isAlphaBitmask) {
/* 279 */         if (tmpIm1 == null) {
/* 280 */           tmpIm1 = new mediaLibImage[] { null };
/*     */         }
/* 282 */         if (tmpIm1[0] == null) {
/* 283 */           tmpIm1[0] = new mediaLibImage(src.getType(), 1, src.getWidth(), src.getHeight());
/*     */         }
/*     */
/* 289 */         Image.Thresh1(tmpIm1[0], alphaML[0], new int[] { 0 }, new int[] { this.ghigh[0] }, new int[] { this.glow[0] });
/*     */
/* 291 */         weight = tmpIm1[0];
/*     */       } else {
/* 293 */         weight = alphaML[0];
/*     */       }
/* 295 */     } else if (roiRaster != null) {
/* 296 */       int roiFmtTag = MediaLibAccessor.findCompatibleTag(null, roiRaster);
/*     */
/* 299 */       MediaLibAccessor roiAccessor = new MediaLibAccessor(roiRaster, destRect, roiFmtTag, true);
/*     */
/* 302 */       mediaLibImage[] roi = roiAccessor.getMediaLibImages();
/*     */
/* 304 */       if (tmpIm1 == null) {
/* 305 */         tmpIm1 = new mediaLibImage[] { null };
/*     */       }
/* 307 */       if (tmpIm1[0] == null) {
/* 308 */         tmpIm1[0] = new mediaLibImage(src.getType(), 1, src.getWidth(), src.getHeight());
/*     */       }
/*     */
/* 314 */       if (tmpIm1[0].getType() != roi[0].getType()) {
/* 315 */         if (tmpIm1[0] == null) {
/* 316 */           tmpIm1[0] = new mediaLibImage(src.getType(), 1, src.getWidth(), src.getHeight());
/*     */         }
/*     */
/* 321 */         Image.DataTypeConvert(tmpIm1[0], roi[0]);
/*     */       }
/*     */       else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.