Package java.awt.image

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


/*      */           }
/*  389 */           else if (layout.getSampleModel(null) == null)
/*      */           {
/*  395 */             il.setColorModel(cmLayout);
/*      */
/*  398 */             SampleModel derivedSM = cmLayout.createCompatibleSampleModel(il.getTileWidth(null), il.getTileHeight(null));
/*      */
/*  404 */             il.setSampleModel(derivedSM);
/*      */           }
/*      */
/*      */         }
View Full Code Here


/*      */             {
/*  426 */               ColorModel newCM = PlanarImage.getDefaultColorModel(sm.getDataType(), cmSource.getNumComponents());
/*      */               SampleModel newSM;
/*      */               SampleModel newSM;
/*  432 */               if (newCM != null) {
/*  433 */                 newSM = newCM.createCompatibleSampleModel(il.getTileWidth(null), il.getTileHeight(null));
/*      */               }
/*      */               else
/*      */               {
/*  438 */                 newSM = RasterFactory.createPixelInterleavedSampleModel(sm.getDataType(), il.getTileWidth(null), il.getTileHeight(null), cmSource.getNumComponents());
/*      */               }
View Full Code Here

/*      */
/*  521 */         cm = PlanarImage.getDefaultColorModel(srcSM.getDataType(), icm.getNumComponents());
/*      */         SampleModel newSM;
/*      */         SampleModel newSM;
/*  525 */         if (cm != null) {
/*  526 */           newSM = cm.createCompatibleSampleModel(srcSM.getWidth(), srcSM.getHeight());
/*      */         }
/*      */         else {
/*  529 */           newSM = RasterFactory.createPixelInterleavedSampleModel(srcSM.getDataType(), srcSM.getWidth(), srcSM.getHeight(), icm.getNumComponents());
/*      */         }
/*      */
View Full Code Here

/*  261 */       sm = sm.createCompatibleSampleModel(tileWidth, tileHeight);
/*      */     }
/*      */
/*  265 */     if ((cm != null) && ((sm == null) || (!JDKWorkarounds.areCompatibleDataModels(sm, cm))))
/*      */     {
/*  269 */       sm = cm.createCompatibleSampleModel(tileWidth, tileHeight);
/*  270 */     } else if ((cm == null) && (sm != null))
/*      */     {
/*  273 */       cm = PlanarImage.createColorModel(sm);
/*      */
/*  277 */       ColorModel cmRGB = ColorModel.getRGBdefault();
View Full Code Here

    @Override
    public Iterator<ImageTypeSpecifier> getImageTypes(final int i)
                    throws IOException {
        final ColorModel model = getImage(i).getColorModel();
        final ImageTypeSpecifier[] spec = { new ImageTypeSpecifier(model,
                        model.createCompatibleSampleModel(1, 1)) };
        return Arrays.asList(spec).iterator();
    }

    @Override
    public IIOMetadata getStreamMetadata() throws IOException {
View Full Code Here

    {
        ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next();
        ImageWriteParam writeParam = writer.getDefaultWriteParam();
        ColorModel colorModel = new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff);
        ImageTypeSpecifier imageTypeSpecifier =
            new ImageTypeSpecifier(colorModel, colorModel.createCompatibleSampleModel(1, 1)/*ignored*/);
        writeParam.setDestinationType(imageTypeSpecifier);
        writeParam.setSourceBands(new int[] {0, 1, 2});
        writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
        writeParam.setCompressionQuality(quality);

View Full Code Here

                (cs, 24, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x0,
                 false, DataBuffer.TYPE_INT);

        int tileSize = AbstractTiledRed.getDefaultTileSize();
        init((CachableRed)null, devRect, cm,
             cm.createCompatibleSampleModel(tileSize, tileSize),
             0, 0, null);
    }

}
View Full Code Here

            cm = GraphicsUtil.Linear_sRGB_Pre;
        else
            cm = GraphicsUtil.sRGB_Pre;

        SampleModel sm =
            cm.createCompatibleSampleModel(litRegion.width,
                                           litRegion.height);
                                            
        init((CachableRed)null, litRegion, cm, sm,
             litRegion.x, litRegion.y, null);
    }
View Full Code Here

        int tw = litRegion.width;
        int th = litRegion.height;
        int defSz = AbstractTiledRed.getDefaultTileSize();
        if (tw > defSz) tw = defSz;
        if (th > defSz) th = defSz;
        SampleModel sm = cm.createCompatibleSampleModel(tw, th);
                                            
        init((CachableRed)null, litRegion, cm, sm,
             litRegion.x, litRegion.y, null);
    }
View Full Code Here

        super();
        ColorModel  cm = cr.getColorModel();
        Rectangle bounds = cr.getBounds();
        if (tileWidth  > bounds.widthtileWidth  = bounds.width;
        if (tileHeight > bounds.height) tileHeight = bounds.height;
        SampleModel sm = cm.createCompatibleSampleModel(tileWidth, tileHeight);
        init(cr, bounds, cm, sm,
             cr.getTileGridXOffset(), cr.getTileGridYOffset(),
             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.