Package java.awt.image

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


/* 259 */         out.writeInt(cm.getAlphaMask());
/*     */       }
/* 261 */       if (csSerialized) {
/* 262 */         out.writeBoolean(cm.isAlphaPremultiplied());
/*     */
/* 266 */         SampleModel sm = cm.createCompatibleSampleModel(1, 1);
/* 267 */         out.writeInt(sm.getTransferType());
/*     */       }
/*     */     } else {
/* 270 */       throw new RuntimeException(JaiI18N.getString("ColorModelState0"));
/*     */     }
View Full Code Here


/* 243 */         out.writeInt(cm.getAlphaMask());
/*     */       }
/* 245 */       if (csSerialized) {
/* 246 */         out.writeBoolean(cm.isAlphaPremultiplied());
/*     */
/* 250 */         SampleModel sm = cm.createCompatibleSampleModel(1, 1);
/* 251 */         out.writeInt(sm.getTransferType());
/*     */       }
/*     */     } else {
/* 254 */       throw new RuntimeException(JaiI18N.getString("ColorModelProxy0"));
/*     */     }
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

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.