video.neuquant
Class NeuquantCapture
java.lang.Object
video.neuquant.NeuquantCapture
public class NeuquantCapture
- extends java.lang.Object
Copyright DocJava, inc. User: lyon
Date: Nov 26, 2004
Time: 9:05:43 AM
Method Summary |
static java.awt.image.BufferedImage |
grabScreen(java.awt.Robot robot,
java.awt.Rectangle rect)
|
static void |
main(java.lang.String[] args)
|
static void |
neuquantImageStreamToAFile(long delayBetweenFrames,
int numberOfFrames,
java.awt.Rectangle inputRect,
java.awt.Dimension outputDim,
AnimatedGifEncoder age,
boolean isBuffered)
Call this method to save images to a file, slowly, compressing as we
go. |
static void |
neuquantImageStreamToAFile(NeuquantCaptureBean ncb)
|
static void |
sleep(long d)
|
static void |
streamScreenNeuquantImagesToAFile()
This is very memory efficient, and, if it works fast enough, it
should be ok for your application. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NeuquantCapture
public NeuquantCapture()
main
public static void main(java.lang.String[] args)
streamScreenNeuquantImagesToAFile
public static void streamScreenNeuquantImagesToAFile()
- This is very memory efficient, and, if it works fast enough, it
should be ok for your application. However, it is slow, for large
images. Todo: build a nice interface, with a cool dialog Even though
it is small in size, a rectangular area takes way too long to
digitize in a stream. Generally around 3 or 4 seconds per image.
Streaming generally results in an image that is 40k per image affineTransform
800x600. This is a 12:1 compression ratio. There is more work for
the algorithm when the image changes more. A threaded stream for the
output might be a good way to handle this.
neuquantImageStreamToAFile
public static void neuquantImageStreamToAFile(long delayBetweenFrames,
int numberOfFrames,
java.awt.Rectangle inputRect,
java.awt.Dimension outputDim,
AnimatedGifEncoder age,
boolean isBuffered)
throws java.awt.AWTException
- Call this method to save images to a file, slowly, compressing as we
go. It is typical for the process to take 13 seconds per frame on a
800 Mhz mac. Wow.
- Parameters:
delayBetweenFrames
- used on playback. Also, if the capture
program actually takes less time than the
delay, it will add the different to the
sleep time between frames.numberOfFrames
- total number of frames to captureinputRect
- size of the capture area.age
- neuquant codec.
- Throws:
java.awt.AWTException
neuquantImageStreamToAFile
public static void neuquantImageStreamToAFile(NeuquantCaptureBean ncb)
throws java.awt.AWTException
- Throws:
java.awt.AWTException
grabScreen
public static java.awt.image.BufferedImage grabScreen(java.awt.Robot robot,
java.awt.Rectangle rect)
sleep
public static void sleep(long d)
- Parameters:
d
- the number of seconds to sleep.