vxp
Class JMFLivePixelSource

java.lang.Object
  extended byvxp.PixelSource
      extended byvxp.JMFLivePixelSource

public class JMFLivePixelSource
extends PixelSource


Field Summary
 javax.media.CaptureDeviceInfo captureDeviceInfo
           
 javax.media.Buffer imageBuffer
           
 javax.media.MediaLocator mediaLocator
           
static javax.media.Player mediaPlayer
           
 
Fields inherited from class vxp.PixelSource
kHeight, kWidth, vidWidth
 
Constructor Summary
JMFLivePixelSource(int pw, int ph, int _frameRate)
           
 
Method Summary
 java.lang.String changeSource(int whichSource)
           
 java.awt.image.BufferedImage getImage()
          Gives you a bufferedImage from the live camera.
 void getImage(java.awt.image.BufferedImage _bi)
          Gives you a bufferedImage from the live camera.
 int[] getPixel(int x, int y)
          This returns a 3 element array which contains the values for Red Green and Blue at the specified x,y coordinate.
 int[] getPixelArray()
          This tickles tickles the video and puts the pixels in an int array that you supplied .
 void getPixelArray(int[] _newPixels)
          This tickles tickles the video and puts the pixels in an int array that you supplied .
 int[] getPixelBrightness(int x, int y)
           
 boolean grabFrame()
          This gives you a fresh frame for getPixel and setPixel to operate on.
 void idleIt()
          This tickles whatever is suppling the video to give up fresh pixels.
 void killSession()
          Be sure to call this when you close or destroy your main window so a connection to your camera is not left hanging .
 void setPixel(int[] inputArray, int _offset, int red, int green, int blue, int alpha)
          Sets the color of a given pixel within a supplied array but uses a precomputed offset instead of the x and y.
 void setPixel(int[] inputArray, int x, int y, int red, int green, int blue, int alpha)
          Sets the color of a given pixel within an array of pixels.
 void setPixel(int _offset, int red, int green, int blue, int alpha)
          Sets the color of a given pixel within the current frame but uses a precomputed offset instead of the x and y.
 void setPixel(int x, int y, int red, int green, int blue, int alpha)
          Sets the color of a pixel in the current frame of video at a given location.
 void videoSettings()
          Gives you a pop up dialog box for the video digitizer driver.
 
Methods inherited from class vxp.PixelSource
addVideoListener, getArray, getColorOrder, getDeviceList, getDeviceName, getPixel, getPixel, getVideoHeight, getVideoWidth, setDevice, setDevice, setImageType, setImageType, setInput, setNativeArrays, tellVideoListeners
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mediaPlayer

public static javax.media.Player mediaPlayer

captureDeviceInfo

public javax.media.CaptureDeviceInfo captureDeviceInfo

mediaLocator

public javax.media.MediaLocator mediaLocator

imageBuffer

public javax.media.Buffer imageBuffer
Constructor Detail

JMFLivePixelSource

public JMFLivePixelSource(int pw,
                          int ph,
                          int _frameRate)
Method Detail

idleIt

public void idleIt()
This tickles whatever is suppling the video to give up fresh pixels.

Overrides:
idleIt in class PixelSource

getImage

public java.awt.image.BufferedImage getImage()
Gives you a bufferedImage from the live camera.

Overrides:
getImage in class PixelSource

getImage

public void getImage(java.awt.image.BufferedImage _bi)
Gives you a bufferedImage from the live camera.

Overrides:
getImage in class PixelSource
Parameters:
_bi - the BufferedImage into which you would like the video image placed.

getPixelArray

public int[] getPixelArray()
This tickles tickles the video and puts the pixels in an int array that you supplied .

Overrides:
getPixelArray in class PixelSource
Returns:

getPixelArray

public void getPixelArray(int[] _newPixels)
This tickles tickles the video and puts the pixels in an int array that you supplied .

Overrides:
getPixelArray in class PixelSource
Parameters:
_newPixels - array that you want the pixel values placed into

grabFrame

public boolean grabFrame()
This gives you a fresh frame for getPixel and setPixel to operate on.

Overrides:
grabFrame in class PixelSource
Returns:

killSession

public void killSession()
Be sure to call this when you close or destroy your main window so a connection to your camera is not left hanging .

Overrides:
killSession in class PixelSource

getPixel

public int[] getPixel(int x,
                      int y)
This returns a 3 element array which contains the values for Red Green and Blue at the specified x,y coordinate. A fourth number is returned which is the offset in the big array for this pixel in case you want to manipulate it directly. This is very convenient but maybe a tiny bit slower. If you want speed you sould use getPixelArray and pull out the Red Green and Blue in your own object using shifting and Masking

Overrides:
getPixel in class PixelSource
Parameters:
x -
y -
Returns:
integer array with the offset in 0, the r in 1, the g in 2 and the b in 3

getPixelBrightness

public int[] getPixelBrightness(int x,
                                int y)
Overrides:
getPixelBrightness in class PixelSource

setPixel

public void setPixel(int x,
                     int y,
                     int red,
                     int green,
                     int blue,
                     int alpha)
Sets the color of a pixel in the current frame of video at a given location.

Overrides:
setPixel in class PixelSource
Parameters:
x -
y -
red -
green -
blue -
alpha -

setPixel

public void setPixel(int[] inputArray,
                     int x,
                     int y,
                     int red,
                     int green,
                     int blue,
                     int alpha)
Sets the color of a given pixel within an array of pixels.

Overrides:
setPixel in class PixelSource
Parameters:
inputArray -
x -
y -
red -
green -
blue -
alpha -

setPixel

public void setPixel(int _offset,
                     int red,
                     int green,
                     int blue,
                     int alpha)
Sets the color of a given pixel within the current frame but uses a precomputed offset instead of the x and y. Often set pixel is used after getPixel where you get the offset back so there it is faster if you this function does not have to computer it again.

Overrides:
setPixel in class PixelSource
Parameters:
_offset -
red -
green -
blue -
alpha -

setPixel

public void setPixel(int[] inputArray,
                     int _offset,
                     int red,
                     int green,
                     int blue,
                     int alpha)
Sets the color of a given pixel within a supplied array but uses a precomputed offset instead of the x and y. Often set pixel is used after getPixel where you get the offset back so there it is faster if you this function does not have to computer it again.

Overrides:
setPixel in class PixelSource
Parameters:
inputArray -
_offset -
red -
green -
blue -
alpha -

changeSource

public java.lang.String changeSource(int whichSource)

videoSettings

public void videoSettings()
Description copied from class: PixelSource
Gives you a pop up dialog box for the video digitizer driver.

Overrides:
videoSettings in class PixelSource