Package java.awt.image

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


            out.writeObject(cmap);
            out.writeBoolean(cm.hasAlpha());
            out.writeInt(cm.getTransparentPixel());
            // Create a SampleModel to get the transferType. This is
            // absurd but is the only apparent way to retrieve this value.
            SampleModel sm = cm.createCompatibleSampleModel(1, 1);
            out.writeInt(sm.getTransferType());
        } else if(colorModel instanceof DirectColorModel) {
            DirectColorModel cm = (DirectColorModel)colorModel;
            out.writeInt(COLORMODEL_DIRECT);
            boolean csSerialized =
View Full Code Here


            if(csSerialized) {
                out.writeBoolean(cm.isAlphaPremultiplied());
                // Create a SampleModel to get the transferType. This is
                // absurd but is the only apparent way to retrieve this
                // value.
                SampleModel sm = cm.createCompatibleSampleModel(1, 1);
                out.writeInt(sm.getTransferType());
            }
        } else {
            throw new RuntimeException(JaiI18N.getString("ColorModelState0"));
        }
View Full Code Here

            out.writeBoolean(cm.hasAlpha());
            out.writeBoolean(cm.isAlphaPremultiplied());
            out.writeInt(cm.getTransparency());
            // Create a SampleModel to get the transferType. This is
            // absurd but is the only apparent way to retrieve this value.
            SampleModel sm = cm.createCompatibleSampleModel(1, 1);
            out.writeInt(sm.getTransferType());
        } else if(colorModel instanceof IndexColorModel) {
            IndexColorModel cm = (IndexColorModel)colorModel;
            out.writeInt(COLORMODEL_INDEX);
            int size = cm.getMapSize();
View Full Code Here

            out.writeObject(cmap);
            out.writeBoolean(cm.hasAlpha());
            out.writeInt(cm.getTransparentPixel());
            // Create a SampleModel to get the transferType. This is
            // absurd but is the only apparent way to retrieve this value.
            SampleModel sm = cm.createCompatibleSampleModel(1, 1);
            out.writeInt(sm.getTransferType());
        } else if(colorModel instanceof DirectColorModel) {
            DirectColorModel cm = (DirectColorModel)colorModel;
            out.writeInt(COLORMODEL_DIRECT);
            boolean csSerialized =
View Full Code Here

            if(csSerialized) {
                out.writeBoolean(cm.isAlphaPremultiplied());
                // Create a SampleModel to get the transferType. This is
                // absurd but is the only apparent way to retrieve this
                // value.
                SampleModel sm = cm.createCompatibleSampleModel(1, 1);
                out.writeInt(sm.getTransferType());
            }
        } else {
            throw new RuntimeException(JaiI18N.getString("ColorModelProxy0"));
        }
View Full Code Here

            il.setColorModel(cmRGB);

            RenderingHints rh = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, il);

            il.setSampleModel(cmRGB.createCompatibleSampleModel(src.getTileWidth(), src.getTileHeight()));
            pb = new ParameterBlock();
            pb.addSource(src);
            src = JAI.create("format", pb, rh);
        }
View Full Code Here

                    false, false, Transparency.OPAQUE, dataType);
        } else {
            ccm = new ComponentColorModel(
                cSpace, false, false, Transparency.OPAQUE, dataType);
        }
        SampleModel sm = ccm.createCompatibleSampleModel(WIDTH, HEIGHT);
        WritableRaster raster = ccm.createCompatibleWritableRaster(WIDTH,
                                                                   HEIGHT);
        DataBuffer data = raster.getDataBuffer();
        fillCCM(data, sm, cSpace);
        return new BufferedImage(ccm, raster, false, null);
View Full Code Here

            numBits[1] = bits;
        }
        int transparency = hasAlpha ? Transparency.TRANSLUCENT : Transparency.OPAQUE;
        ColorModel model = new ComponentColorModel(colorSpace, numBits, hasAlpha, isAlphaPremultiplied, transparency, dataType);

        return new ImageTypeSpecifier(model, model.createCompatibleSampleModel(1, 1));
    }


    public static ImageTypeSpecifier createIndexed(byte[] redLUT,
                                                   byte[] greenLUT,
View Full Code Here

/*     */       }
/* 224 */       out.writeBoolean(cm.hasAlpha());
/* 225 */       out.writeBoolean(cm.isAlphaPremultiplied());
/* 226 */       out.writeInt(cm.getTransparency());
/*     */
/* 229 */       SampleModel sm = cm.createCompatibleSampleModel(1, 1);
/* 230 */       out.writeInt(sm.getTransferType());
/* 231 */     } else if ((colorModel instanceof IndexColorModel)) {
/* 232 */       IndexColorModel cm = (IndexColorModel)colorModel;
/* 233 */       out.writeInt(3);
/* 234 */       int size = cm.getMapSize();
View Full Code Here

/* 238 */       out.writeInt(size);
/* 239 */       out.writeObject(cmap);
/* 240 */       out.writeBoolean(cm.hasAlpha());
/* 241 */       out.writeInt(cm.getTransparentPixel());
/*     */
/* 244 */       SampleModel sm = cm.createCompatibleSampleModel(1, 1);
/* 245 */       out.writeInt(sm.getTransferType());
/* 246 */     } else if ((colorModel instanceof DirectColorModel)) {
/* 247 */       DirectColorModel cm = (DirectColorModel)colorModel;
/* 248 */       out.writeInt(4);
/* 249 */       boolean csSerialized = serializeColorSpace(cm.getColorSpace(), out);
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.