Code example for ImageTypeSpecifier

Methods: getBufferedImageTypegetColorModel

0
 
 
    private boolean canEncodeImage(String compression,
                                   ImageTypeSpecifier imgType, int rawType)
    { 
        int biType = imgType.getBufferedImageType();
        if ((!compression.equals("BI_BITFIELDS")) &&
            ((rawType == BufferedImage.TYPE_USHORT_565_RGB) ||
             (rawType == TYPE_USHORT_565_BGR)))
        { 
            return false; 
        } 
 
        int bpp = imgType.getColorModel().getPixelSize();
        if (compression.equals("BI_RLE4") && bpp != 4) {
            // only 4bpp images can be encoded as BI_RLE4 
            return false; 
        } 
        if (compression.equals("BI_RLE8") && bpp != 8) {
            // only 8bpp images can be encoded as BI_RLE8 
Experience pair programming with AI  Get Codota for Java