Class JAIPNGWriter

    • Field Detail

      • adam7Interlacing

        public Parameter adam7Interlacing
        If the Adam7 Interlacing option is false, pixels are stored left to right and from top to bottom. If it is true (the default), seven distinct passes are made over the image, each transmitting a subset of the pixels.
      • background

        public Parameter background
        If the setBackground parameter is false, then this parameter is ignored. If it is true, this parameter sets the background color of the image. Note that this will only show up in images with transparency. If the image is a grayscale image, only the first value of the array is used. The value is an integer that should range from 0 to (2^bitdepth - 1). The bitdepth is defined by the bitDepth parameter in this actor. If the image is an RGB image, then the first 3 values of the array are read. Each of these also range from 0 to (2^bitdepth - 1).
      • bitDepth

        public Parameter bitDepth
        The bit depth. The initial default is an integer of value 8.
      • gamma

        public Parameter gamma
        The gamma. The initial default is a double of value 0.455.
      • setBackground

        public Parameter setBackground
        True if the background is to be set. The initial value is false.
      • setGamma

        public Parameter setGamma
        True if the gamma parameter is to be used. The initial value is false.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Override the base class and attempt set either the fileName, whether to overwrite an existing file or not, or how the data will be written.
        Overrides:
        attributeChanged in class NamedObj
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If a contained method throws it.
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Read an input JAIImageToken and write it to the file. If the file does not exist then create it. If the file already exists, then query the user for overwrite.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class JAIWriter
        Returns:
        True if the execution can continue.
        Throws:
        IllegalActionException - If the file cannot be opened or created, if the user refuses to overwrite an existing file, of if the image in unable to be encoded.