Class AConverter

    • Constructor Detail

      • AConverter

        public AConverter​(IPixelFormat.Type pictureType,
                          IPixelFormat.Type requiredPictureType,
                          int imageType,
                          int pictureWidth,
                          int pictureHeight,
                          int imageWidth,
                          int imageHeight)
        Construct an abstract Converter. This will create a IVideoResampler to change color-space or resize the picture as needed for the conversions specified.
        Parameters:
        pictureType - the recognized IVideoPicture type
        requiredPictureType - the picture type requred to translate to and from the BufferedImage
        imageType - the recognized BufferedImage type
        pictureWidth - the width of picture
        pictureHeight - the height of picture
        imageWidth - the width of image
        imageHeight - the height of image
    • Method Detail

      • getRequiredPictureType

        protected IPixelFormat.Type getRequiredPictureType()
        Return the Type which matches the BufferedImage type.
        Returns:
        the picture type which allows for image translation.
      • getImageType

        public int getImageType()
        Get the image type, as defined by BufferedImage, which this converter recognizes.
        Specified by:
        getImageType in interface IConverter
        Returns:
        the image type of this converter.
        See Also:
        BufferedImage
      • resample

        protected static IVideoPicture resample​(IVideoPicture picture1,
                                                IVideoResampler resampler)
        Re-sample a picture.
        Parameters:
        picture1 - the picture to re-sample
        resampler - the picture re-samper to use
        Throws:
        java.lang.RuntimeException - if could not re-sample picture
      • validateImage

        protected void validateImage​(java.awt.image.BufferedImage image)
        Test that the passed image is valid and conforms to the converters specifications.
        Parameters:
        image - the image to test
        Throws:
        java.lang.IllegalArgumentException - if the passed BufferedImage is NULL;
        java.lang.IllegalArgumentException - if the passed BufferedImage is not the correct type. See getImageType().
      • validatePicture

        protected void validatePicture​(IVideoPicture picture)
        Test that the passed picture is valid and conforms to the converters specifications.
        Parameters:
        picture - the picture to test
        Throws:
        java.lang.IllegalArgumentException - if the passed IVideoPicture is NULL;
        java.lang.IllegalArgumentException - if the passed IVideoPicture is not complete.
        java.lang.IllegalArgumentException - if the passed IVideoPicture is not the correct type.
      • getDescription

        public java.lang.String getDescription()
        Return a written description of the converter.
        Specified by:
        getDescription in interface IConverter
        Returns:
        a detailed description of what this converter does.
      • toString

        public java.lang.String toString()
        Get a string representation of this converter.
        Overrides:
        toString in class java.lang.Object
      • close

        public void close()