Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.imgstreaming
Class ImageStreamingUtils

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.imgstreaming.ImageStreamingUtils

public class ImageStreamingUtils
extends Object

This class provides utility functions and fields for image streaming.

Author:
Sebastien Vincent

Constructor Summary
ImageStreamingUtils()
           
 
Method Summary
static byte[] getImageBytes(BufferedImage src, byte[] output)
          Get raw bytes from ARGB BufferedImage.
static BufferedImage getScaledImage(BufferedImage src, int width, int height, int type)
          Get a scaled BufferedImage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageStreamingUtils

public ImageStreamingUtils()
Method Detail

getScaledImage

public static BufferedImage getScaledImage(BufferedImage src,
                                           int width,
                                           int height,
                                           int type)
Get a scaled BufferedImage. Mainly inspired by: http://java.developpez.com/faq/gui/?page=graphique_general_images #GRAPHIQUE_IMAGE_redimensionner

Parameters:
src - source image
width - width of scaled image
height - height of scaled image
type - BufferedImage type
Returns:
scaled BufferedImage

getImageBytes

public static byte[] getImageBytes(BufferedImage src,
                                   byte[] output)
Get raw bytes from ARGB BufferedImage.

Parameters:
src - ARGB
output - output buffer, if not null and if its length is at least image's (width * height) * 4, method will put bytes in it.
Returns:
raw bytes or null if src is not an ARGB BufferedImage

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.