Class SgiDecoder

  • All Implemented Interfaces:
    com.idrsolutions.image.Decoder

    public class SgiDecoder
    extends com.idrsolutions.image.JDeliImage
    implements com.idrsolutions.image.Decoder
    Class decodes images ending with .sgi or .rgb extensions as BufferedImage

    Example 1 (Using raw byte data):

    
     SgiDecoder decoder = new SgiDecoder();
     BufferedImage decodedImage = decoder.read(sgiBytes);
     

    Example 2 (Using File):

    
     File sgiFile = new File("C:\\path\\to\\output\\file.sgi");
     SgiDecoder decoder = new SgiDecoder();
     BufferedImage decodedImage = decoder.read(sgiFile);
     
    • Constructor Detail

      • SgiDecoder

        public SgiDecoder()
    • Method Detail

      • read

        public BufferedImage read​(byte[] data)
                           throws IOException
        Decodes and returns the SGI image as a BufferedImage from bytes
        Specified by:
        read in interface com.idrsolutions.image.Decoder
        Parameters:
        data - byte[] containing the SGI or RGB data to be decoded
        Returns:
        BufferedImage The decoded image
        Throws:
        IOException
      • read

        public BufferedImage read​(File file)
                           throws IOException
        Decodes and returns the SGI image as a BufferedImage from file
        Parameters:
        file - input image file to be decoded
        Returns:
        BufferedImage decoded image
        Throws:
        IOException