Package com.avpkit.core.video
Interface IConverter
-
- All Known Implementing Classes:
AConverter,ArgbConverter,BgrConverter
public interface IConverter
This interface describes a converter which can perform bidirectional translation between a givenIVideoPicturetype and aBufferedImagetype. Converters are created byConverterFactory. Each converter can translate between any supportedIPixelFormat.Typeand a singleBufferedImagetype. Converters can optionally resize images during the conversion process.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete()Release any resources used by this converter.java.lang.StringgetDescription()Return a written description of the converter.intgetImageType()Get the image type, as defined byBufferedImage, which this converter recognizes.IPixelFormat.TypegetPictureType()Get the picture type, as defined byIPixelFormat.Type, which this converter recognizes.java.awt.image.BufferedImagetoImage(IVideoPicture picture)Converts anIVideoPictureto aBufferedImage.IVideoPicturetoPicture(java.awt.image.BufferedImage image, long timestamp)Converts aBufferedImageto anIVideoPicture.booleanwillResample()Test if this converter is going to re-sample during conversion.
-
-
-
Method Detail
-
getPictureType
IPixelFormat.Type getPictureType()
Get the picture type, as defined byIPixelFormat.Type, which this converter recognizes.- Returns:
- the picture type of this converter.
- See Also:
IPixelFormat.Type
-
getImageType
int getImageType()
Get the image type, as defined byBufferedImage, which this converter recognizes.- Returns:
- the image type of this converter.
- See Also:
BufferedImage
-
willResample
boolean willResample()
Test if this converter is going to re-sample during conversion. For some conversions betweenBufferedImageandIVideoPicture, the IVideoPicture 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 AVPKit.- Returns:
- true if this converter will re-sample during conversion.
- See Also:
IVideoResampler,IVideoResampler.isSupported(com.avpkit.core.IVideoResampler.Feature)
-
toPicture
IVideoPicture toPicture(java.awt.image.BufferedImage image, long timestamp)
Converts aBufferedImageto anIVideoPicture.- Parameters:
image- the source buffered image.timestamp- the time stamp which should be attached to the the video picture (in microseconds).- Throws:
java.lang.IllegalArgumentException- if the passedBufferedImageis NULL;java.lang.IllegalArgumentException- if the passedBufferedImageis not the correct type. SeegetImageType().java.lang.IllegalArgumentException- if the underlying data buffer of theBufferedImageis composed elements other bytes or integers.
-
toImage
java.awt.image.BufferedImage toImage(IVideoPicture picture)
Converts anIVideoPictureto aBufferedImage.- Parameters:
picture- the source video picture.- Throws:
java.lang.IllegalArgumentException- if the passedIVideoPictureis NULL;java.lang.IllegalArgumentException- if the passedIVideoPictureis not the correct type. SeegetPictureType().
-
getDescription
java.lang.String getDescription()
Return a written description of the converter.- Returns:
- a detailed description of what this converter does.
-
delete
void delete()
Release any resources used by this converter. Calls to the converter after this call are illegal and may fail in unspecified ways.
-
-