Package java.awt.image

Examples of java.awt.image.SampleModel.createCompatibleSampleModel()


                // Get the SampleModel.
                if(layout.isValid(ImageLayout.SAMPLE_MODEL_MASK)) {
                    sm = layout.getSampleModel(null);
                    if(sm.getWidth() != tileWidth ||
                       sm.getHeight() != tileHeight) {
                        sm = sm.createCompatibleSampleModel(tileWidth,
                                                            tileHeight);
                    }
                    if(layoutObserved != null) {
                        layoutObserved.setSampleModel(sm);
                    }
View Full Code Here


        } // hints != null

        // Ensure that the SampleModel is compatible with the tile size.
        if(sm != null &&
           (sm.getWidth() != tileWidth || sm.getHeight() != tileHeight)) {
            sm = sm.createCompatibleSampleModel(tileWidth, tileHeight);
        }

        // Attempt to derive compatible SampleModel/ColorModel combination.
        if(cm != null && (sm == null ||
                          !JDKWorkarounds.areCompatibleDataModels(sm, cm))) {
View Full Code Here

        /* Validate destination sampleModel. */
        SampleModel srcSM = sourceUnder.getSampleModel();
        if (sampleModel.getTransferType() != srcSM.getTransferType() ||
            sampleModel.getNumBands() != srcSM.getNumBands()) {
            sampleModel = srcSM.createCompatibleSampleModel(
                                tileWidth, tileHeight);

            if(colorModel != null &&
               !JDKWorkarounds.areCompatibleDataModels(sampleModel,
                                                       colorModel)) {
View Full Code Here

                // image data are modified so if this image is mutable
                // a copy must be created.
                SampleModel sm = tile.getSampleModel();
                if(sm.getWidth() != region.width ||
                   sm.getHeight() != region.height) {
                    sm = sm.createCompatibleSampleModel(region.width,
                                                        region.height);
                }
                WritableRaster destinationRaster =
                    createWritableRaster(sm, region.getLocation());
                Raster sourceRaster =
View Full Code Here

                }
            } else {
                SampleModel sm = sampleModel;
                if(sm.getWidth() != region.width ||
                   sm.getHeight() != region.height) {
                    sm = sm.createCompatibleSampleModel(region.width,
                                                        region.height);
                }

                try {
                    dstRaster = createWritableRaster(sm,
View Full Code Here

            region = getBounds();

            SampleModel sm = getSampleModel();
            if(sm.getWidth() != region.width ||
               sm.getHeight() != region.height) {
                sm = sm.createCompatibleSampleModel(region.width,
                                                    region.height);
            }
            raster = createWritableRaster(sm, region.getLocation());
        } else {
            region = raster.getBounds().intersection(getBounds());
View Full Code Here

        // Create a WritableRaster of the desired size
        SampleModel destSM = getSampleModel();
        if(destSM.getWidth() != region.width ||
           destSM.getHeight() != region.height) {
            destSM = destSM.createCompatibleSampleModel(region.width,
                                                        region.height);
        }

        // Translate it
        WritableRaster dest = createWritableRaster(destSM,
View Full Code Here

/*      */
/*  215 */         if (layout.isValid(256)) {
/*  216 */           sm = layout.getSampleModel(null);
/*  217 */           if ((sm.getWidth() != tileWidth) || (sm.getHeight() != tileHeight))
/*      */           {
/*  219 */             sm = sm.createCompatibleSampleModel(tileWidth, tileHeight);
/*      */           }
/*      */
/*  222 */           if (layoutObserved != null) {
/*  223 */             layoutObserved.setSampleModel(sm);
/*      */           }
View Full Code Here

/*      */
/*      */     }
/*      */
/*  259 */     if ((sm != null) && ((sm.getWidth() != tileWidth) || (sm.getHeight() != tileHeight)))
/*      */     {
/*  261 */       sm = sm.createCompatibleSampleModel(tileWidth, tileHeight);
/*      */     }
/*      */
/*  265 */     if ((cm != null) && ((sm == null) || (!JDKWorkarounds.areCompatibleDataModels(sm, cm))))
/*      */     {
/*  269 */       sm = cm.createCompatibleSampleModel(tileWidth, tileHeight);
View Full Code Here

/* 2100 */       if ((this instanceof WritableRenderedImage))
/*      */       {
/* 2104 */         SampleModel sm = tile.getSampleModel();
/* 2105 */         if ((sm.getWidth() != region.width) || (sm.getHeight() != region.height))
/*      */         {
/* 2107 */           sm = sm.createCompatibleSampleModel(region.width, region.height);
/*      */         }
/*      */
/* 2110 */         WritableRaster destinationRaster = createWritableRaster(sm, region.getLocation());
/*      */
/* 2112 */         Raster sourceRaster = tile.getBounds().equals(region) ? tile : tile.createChild(region.x, region.y, region.width, region.height, region.x, region.y, null);
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.