diewald_PS3
Class PS3

java.lang.Object
  extended by diewald_PS3.PS3

public class PS3
extends java.lang.Object

PS3 is the main entry class of the library.

it creates a PS3eye instance, and provides access to different parameters for the video-stream.

Author:
thomas diewald (c) 2011

Method Summary
static PS3 create(int index)
          method, to create a PS3-instance from a given index.
 void destroy()
          completely destroys an ps3-context.
static int getCameraCount()
          returns number of available cameras.
 void getFrame(int[] pixels)
          copy the pixels of the current ps3-frame to the given pixel-array.
 int getHeight()
          get the height of the current instance.
 int getIndex()
          get the index of the current instance.
 int getParameter(PS3_PARAM param)
          get the current value of a parameter.
 int getWidth()
          get the width of the current instance.
 PS3 init(VIDEO_MODE mode, COLOR_MODE color_mode, int frameRate)
          define a mode, specified by the video-mode (QVGA, or VGA), color-mode and a framerate.
static boolean libraryLoaded()
          check if the library got loaded.
static void loadLibrary(java.lang.String dll_path, java.lang.String dll_name)
          load the library with a custom path and name.
 void setLed(boolean on_off)
          change the status of the red LED.
 void setParameter(PS3_PARAM param, int value)
          set custom camera-parameters.
static void shutDown()
          shutdown all running ps3-threads.
 void start()
          start the ps3-device.
 void stop()
          stop the ps3-device.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCameraCount

public static final int getCameraCount()
returns number of available cameras.

Returns:
number of available cameras.

create

public static final PS3 create(int index)
method, to create a PS3-instance from a given index.

Parameters:
index - the index of the ps3-device.
Returns:
a ps3-instance on success. null on failure.

init

public final PS3 init(VIDEO_MODE mode,
                      COLOR_MODE color_mode,
                      int frameRate)
define a mode, specified by the video-mode (QVGA, or VGA), color-mode and a framerate. the default mode is:
init(VIDEOMODE.VGA, COLORMODE.COLOR_PROCESSED, 30);

Parameters:
mode - video-mode.
color_mode - color-mode.
frameRate - framerate.
Returns:
the current instance.

libraryLoaded

public static final boolean libraryLoaded()
check if the library got loaded.

Returns:
true if the library got loaded successfully.

loadLibrary

public static final void loadLibrary(java.lang.String dll_path,
                                     java.lang.String dll_name)
load the library with a custom path and name.

Parameters:
dll_path - path of the dll.
dll_name - name of the dll.

getIndex

public final int getIndex()
get the index of the current instance.

Returns:
the index.

getWidth

public final int getWidth()
get the width of the current instance.

Returns:
the width.

getHeight

public final int getHeight()
get the height of the current instance.

Returns:
the height.

getFrame

public final void getFrame(int[] pixels)
copy the pixels of the current ps3-frame to the given pixel-array. pixels[] has to have the same length as the frame of the current instance. e.g. int pixels[] = new int[ps3.getWidth() * ps3.getHeight() ]; or just pass the pixels of a PImage instance.

Parameters:
pixels -

start

public final void start()
start the ps3-device.


stop

public final void stop()
stop the ps3-device.


destroy

public final void destroy()
completely destroys an ps3-context. to restart the current instance: use init(...);


shutDown

public static void shutDown()
shutdown all running ps3-threads. use this method before you exit the application.


setLed

public final void setLed(boolean on_off)
change the status of the red LED.

Parameters:
on_off - status of the led.

setParameter

public final void setParameter(PS3_PARAM param,
                               int value)
set custom camera-parameters.

Parameters:
param - the parameter (enum).
value - the new value of the parameter.

getParameter

public final int getParameter(PS3_PARAM param)
get the current value of a parameter.

Parameters:
param - the parameter to get the value from.
Returns:
the current alue of the given parameter.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


processing library diewald_PS3 by Thomas Diewald. (c) 2011