humble-video-noarch/src/main/java/io/humble/video/awt/MediaPictureConverterFactory.java
public static MediaPictureConverter createConverter(
    String converterDescriptor,
    PixelFormat.Type pictureType, 
    int pictureWidth, int pictureHeight,
    int imageWidth, int imageHeight)
  {
    MediaPictureConverter converter = null;
    
    // establish the converter type

    Type converterType = findRegisteredConverter(converterDescriptor);
    if (null == converterType)
      throw new UnsupportedOperationException(
        "No converter \"" + converterDescriptor + "\" found.");

    // create the converter

    try
    {
      // establish the constructor 

      Constructor<? extends MediaPictureConverter> converterConstructor = 
        converterType.getConverterClass().getConstructor(PixelFormat.Type.class,
          int.class, int.class, int.class, int.class);

      // create the converter

      converter = converterConstructor.newInstance(
        pictureType, pictureWidth, pictureHeight, imageWidth, imageHeight);
    }
    catch (NoSuchMethodException e)
    {
      throw new UnsupportedOperationException(
        "Converter " + converterType.getConverterClass() + 
        " requries a constructor of the form "  +
        "(PixelFormat.Type, int, int, int, int)");
    }
    catch (InvocationTargetException e)
    {
      Throwable cause = e.getCause();
      if (cause != null && cause instanceof OutOfMemoryError)
      {
        throw (OutOfMemoryError)cause;
      }
      else
      {
        throw new UnsupportedOperationException(
            "Converter " + converterType.getConverterClass() + 
            " constructor failed with: " + e.getCause());
      }
    }
    catch (IllegalAccessException e)
    {
      Throwable cause = e.getCause();
      if (cause != null && cause instanceof OutOfMemoryError)
      {
        throw (OutOfMemoryError)cause;
      }
      else
      {
        throw new UnsupportedOperationException(
            "Converter " + converterType.getConverterClass() + 
            " constructor failed with: " + e.getCause());
      }
    }
    catch (InstantiationException e)
    {
      Throwable cause = e.getCause();
      if (cause != null && cause instanceof OutOfMemoryError)
      {
        throw (OutOfMemoryError)cause;
      }
      else
      {
        throw new UnsupportedOperationException(
            "Converter " + converterType.getConverterClass() + 
            " constructor failed with: " + e.getCause());
      }
    }

    // return the newly created converter

    return converter;
  }
public static MediaPictureConverter createConverter(
    String converterDescriptor,
    PixelFormat.Type pictureType, 
    int pictureWidth, int pictureHeight,
    int imageWidth, int imageHeight)
  {
    MediaPictureConverter converter = null;
    
    // establish the converter type

    Type converterType = findRegisteredConverter(converterDescriptor);
    if (null == converterType)
      throw new UnsupportedOperationException(
        "No converter \"" + converterDescriptor + "\" found.");

    // create the converter

    try
    {
      // establish the constructor 

      Constructor<? extends MediaPictureConverter> converterConstructor = 
        converterType.getConverterClass().getConstructor(PixelFormat.Type.class,
          int.class, int.class, int.class, int.class);

      // create the converter

      converter = converterConstructor.newInstance(
        pictureType, pictureWidth, pictureHeight, imageWidth, imageHeight);
    }
    catch (NoSuchMethodException e)
    {
      throw new UnsupportedOperationException(
        "Converter " + converterType.getConverterClass() + 
        " requries a constructor of the form "  +
        "(PixelFormat.Type, int, int, int, int)");
    }
    catch (InvocationTargetException e)
    {
      Throwable cause = e.getCause();
      if (cause != null && cause instanceof OutOfMemoryError)
      {
        throw (OutOfMemoryError)cause;
      }
      else
      {
        throw new UnsupportedOperationException(
            "Converter " + converterType.getConverterClass() + 
            " constructor failed with: " + e.getCause());
      }
    }
    catch (IllegalAccessException e)
    {
      Throwable cause = e.getCause();
      if (cause != null && cause instanceof OutOfMemoryError)
      {
        throw (OutOfMemoryError)cause;
      }
      else
      {
        throw new UnsupportedOperationException(
            "Converter " + converterType.getConverterClass() + 
            " constructor failed with: " + e.getCause());
      }
    }
    catch (InstantiationException e)
    {
      Throwable cause = e.getCause();
      if (cause != null && cause instanceof OutOfMemoryError)
      {
        throw (OutOfMemoryError)cause;
      }
      else
      {
        throw new UnsupportedOperationException(
            "Converter " + converterType.getConverterClass() + 
            " constructor failed with: " + e.getCause());
      }
    }

    // return the newly created converter

    return converter;
  }
public static MediaPictureConverter createConverter ( String converterDescriptor , PixelFormat . Type pictureType , int pictureWidth , int pictureHeight , int imageWidth , int imageHeight ) { MediaPictureConverter converter = null ; // establish the converter type Type converterType = findRegisteredConverter ( converterDescriptor ) ; if ( null == converterType ) throw new UnsupportedOperationException ( "No converter \"" + converterDescriptor + "\" found." ) ; // create the converter try { // establish the constructor  Constructor < ? extends MediaPictureConverter > converterConstructor = converterType . getConverterClass ( ) . getConstructor ( PixelFormat . Type . class , int . class , int . class , int . class , int . class ) ; // create the converter converter = converterConstructor . newInstance ( pictureType , pictureWidth , pictureHeight , imageWidth , imageHeight ) ; } catch ( NoSuchMethodException e ) { throw new UnsupportedOperationException ( "Converter " + converterType . getConverterClass ( ) + " requries a constructor of the form " + "(PixelFormat.Type, int, int, int, int)" ) ; } catch ( InvocationTargetException e ) { Throwable cause = e . getCause ( ) ; if ( cause != null && cause instanceof OutOfMemoryError ) { throw ( OutOfMemoryError ) cause ; } else { throw new UnsupportedOperationException ( "Converter " + converterType . getConverterClass ( ) + " constructor failed with: " + e . getCause ( ) ) ; } } catch ( IllegalAccessException e ) { Throwable cause = e . getCause ( ) ; if ( cause != null && cause instanceof OutOfMemoryError ) { throw ( OutOfMemoryError ) cause ; } else { throw new UnsupportedOperationException ( "Converter " + converterType . getConverterClass ( ) + " constructor failed with: " + e . getCause ( ) ) ; } } catch ( InstantiationException e ) { Throwable cause = e . getCause ( ) ; if ( cause != null && cause instanceof OutOfMemoryError ) { throw ( OutOfMemoryError ) cause ; } else { throw new UnsupportedOperationException ( "Converter " + converterType . getConverterClass ( ) + " constructor failed with: " + e . getCause ( ) ) ; } } // return the newly created converter return converter ; }
Create a converter which translates betewen {@link BufferedImage}
and {@link MediaPicture} types.  This factory will attempt to
create a converter which can perform the translation.  If different
image and pictures sizes are passed the converter will resize
during translation.  If no converter can be created, a descriptive
{@link UnsupportedOperationException} is thrown.

@param converterDescriptor the unique string descriptor of the
converter which is to be created
@param pictureType the picture type of the converter
@param pictureWidth the width of pictures
@param pictureHeight the height of pictures
@param imageWidth the width of images
@param imageHeight the height of images

@throws UnsupportedOperationException if the converter can not be
found
@throws UnsupportedOperationException if the converter can not be
properly created or initialized
Create a converter which translates betewen { @link BufferedImage } and { @link MediaPicture } types . This factory will attempt to create a converter which can perform the translation . If different image and pictures sizes are passed the converter will resize during translation . If no converter can be created a descriptive { @link UnsupportedOperationException } is thrown .