org.qtunes.db
Class ImageScaler

java.lang.Object
  extended by org.qtunes.db.ImageScaler

public class ImageScaler
extends java.lang.Object

Utility class to return the image from a Track no larger than the specified size. Will cache previously scaled images


Constructor Summary
ImageScaler()
           
 
Method Summary
 java.nio.ByteBuffer getImageBuffer(Track track, int maxwidth, int maxheight, java.lang.String format)
          Get the ImageBuffer from the specified Track.
static ImageScaler getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageScaler

public ImageScaler()
Method Detail

getInstance

public static ImageScaler getInstance()

getImageBuffer

public java.nio.ByteBuffer getImageBuffer(Track track,
                                          int maxwidth,
                                          int maxheight,
                                          java.lang.String format)
                                   throws java.io.IOException
Get the ImageBuffer from the specified Track. If the image is larger than the specified size, a scaled version of the image will be created in the specified format. If the track has no image or it can't be parsed for any reason, this method returns null.

Throws:
java.io.IOException