
public interface MediaPictureConverter
MediaPicture type and a BufferedImage type. Converters are created by MediaPictureConverterFactory. Each converter can translate between any
supported io.humble.video.IPixelFormat.Type and a single
BufferedImage type. Converters can optionally resize images
during
the conversion process.| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Release any resources used by this converter.
|
String |
getDescription()
Return a written description of the converter.
|
int |
getImageType()
Get the image type, as defined by
BufferedImage, which
this converter recognizes. |
PixelFormat.Type |
getPictureType()
Get the picture type, as defined by
PixelFormat.Type, which this converter
recognizes. |
BufferedImage |
toImage(BufferedImage output,
MediaPicture input)
Converts an
MediaPicture to a BufferedImage. |
MediaPicture |
toPicture(MediaPicture output,
BufferedImage input,
long timestamp)
Converts a
BufferedImage to an MediaPicture. |
boolean |
willResample()
Test if this converter is going to re-sample during conversion.
|
PixelFormat.Type getPictureType()
PixelFormat.Type, which this converter
recognizes.io.humble.video.IPixelFormat.Typeint getImageType()
BufferedImage, which
this converter recognizes.BufferedImageboolean willResample()
BufferedImage and MediaPicture, the MediaPicture will need to be re-sampled into
another pixel type, commonly between YUV and RGB types. This
re-sample is time consuming, and may not be available for
all installations of Humble Video.MediaPicture toPicture(MediaPicture output, BufferedImage input, long timestamp)
BufferedImage to an MediaPicture.output - the image to write the output to. any data previous in output will be overwritten.
if null, a new output MediaPicture of the correct dimensions will be allocated and returned.input - the source buffered image.timestamp - the time stamp which should be attached to the the
video picture (in microseconds).IllegalArgumentException - if the passed MediaPicture is not NULL but is of an unexpected width, height or format;IllegalArgumentException - if the passed BufferedImage is NULL;IllegalArgumentException - if the passed BufferedImage is not the correct type. See getImageType().IllegalArgumentException - if the underlying data buffer of
the BufferedImage is composed elements other bytes
or integers.BufferedImage toImage(BufferedImage output, MediaPicture input)
MediaPicture to a BufferedImage.output - the BufferedImage to copy data into, or if null, a new BufferedImage of the
correct dimensions will be allocated.input - the source video picture.IllegalArgumentException - if the passed BufferedImage is NOT NULL but has the wrong width, height or type;IllegalArgumentException - if the passed MediaPicture is NULL;IllegalArgumentException - if the passed MediaPicture is not the correct type. See getPictureType().String getDescription()
void delete()
Copyright © 2018 Humble Software. All rights reserved.