Java 8 PackedColorModel - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 PackedColorModel class.

This code example shows how to use the following methods:createCompatibleSampleModel
 
    @Override 
    public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException {
        readHeader(); 
        LinkedList<ImageTypeSpecifier> l = new LinkedList<ImageTypeSpecifier>();
        l.add(new ImageTypeSpecifier(RGB, RGB.createCompatibleSampleModel(image.getWidth(), image.getHeight())));
        return l.iterator();
    } 
 
    @Override 
    public IIOMetadata getStreamMetadata() throws IOException {
        return null; 
    } 
 
    @Override 
    public IIOMetadata getImageMetadata(int imageIndex) throws IOException {
        return null; 
    } 
 
    @Override 
3
CodeRank
This code example shows how to use the following methods:getMasks
                    } 
                } 
                if (PackedColorModel.class.isAssignableFrom(imageColorModelClass) 
                        && !imageColorModel.hasAlpha()) {
                    PackedColorModel pcm = (PackedColorModel) imageColorModel;
                    int[] masks = pcm.getMasks();
                    if (masks[0] == 255) {
                        return BufferedImage.TYPE_INT_BGR;
                    } else { 
                        return BufferedImage.TYPE_INT_RGB;
                    } 
                } 
                logger.debug("Unsupported type for data type TYPE_INT"); 
                return BufferedImage.TYPE_CUSTOM;
            default: 
                logger.debug("Unsupported data type of sample model"); 
                return BufferedImage.TYPE_CUSTOM;
        } 
    } 
 
4
CodeRank
See Code Examples for Java 8 PackedColorModel Methods: