rockin the video

This commit is contained in:
benfry
2004-07-10 03:04:23 +00:00
parent bbc7f8dc8b
commit 2ba64fcda1
3 changed files with 43 additions and 4 deletions

View File

@@ -203,11 +203,27 @@ cd ../..
CLASSPATH="..\\..\\build\\windows\\work\\lib\\core.jar;..\\..\\build\\windows\\work\\java\\lib\\rt.jar"
cd ../../lib/serial
../../build/windows/work/jikes +D -classpath "RXTXcomm.jar;$CLASSPATH" -d . *.java
#../../build/windows/work/jikes +D -classpath "comm.jar;$CLASSPATH" -d . *.java
zip -r0q serial.jar processing
rm -rf processing
cp serial.jar "C:\\Documents and Settings\\fry\\My Documents\\sketchbook\\rxtx_work\\code"
QTJAVA="$WINDIR\\system32\\QTJava.zip"
if test -f "${QTJAVA}"
then
echo "Found Quicktime at $QTJAVA"
else
echo "could not find qtjava.zip in"
echo "${WINDIR}\\system32\\qtjava.zip"
echo "quicktime for java must be installed before building."
exit 1;
fi
cd ../../lib/video
../../build/windows/work/jikes +D -classpath "$QTJAVA;$CLASSPATH" -d . PCamera.java
zip -r0q video.jar processing
rm -rf processing
cp video.jar "C:\\Documents and Settings\\fry\\My Documents\\sketchbook\\new_camera_action\\code"

View File

@@ -75,7 +75,7 @@ public class PImage implements PConstants, Cloneable {
boolean smooth = false;
// for gl subclass / hardware accel
int cacheIndex;
public int cacheIndex;
// private fields
private int fracU, ifU, fracV, ifV, u1, u2, v1, v2, sX, sY, iw, iw1, ih1;
@@ -104,7 +104,8 @@ public class PImage implements PConstants, Cloneable {
* alpha is zero, it will be transparent.
*/
public PImage(int width, int height) {
this(new int[width * height], width, height, RGBA);
setup(width, height, RGBA);
//this(new int[width * height], width, height, RGBA);
// toxi: is it maybe better to init the image with max alpha enabled?
//for(int i=0; i<pixels.length; i++) pixels[i]=0xffffffff;
// fry: i'm opting for the full transparent image, which is how
@@ -125,6 +126,18 @@ public class PImage implements PConstants, Cloneable {
}
/**
* Function to be used by subclasses to setup their own bidness.
*/
public void setup(int width, int height, int format) {
this.width = width;
this.height = height;
this.pixels = new int[width*height];
this.format = format;
this.cacheIndex = -1;
}
/**
* Construct a new PImage from a java.awt.Image
*

View File

@@ -257,6 +257,16 @@ X COM1 19200 for phone
X add "available" function to PSerial
040709 evening
X working on video library, get camera working again
_ getCameras() or getPorts() or list() ?
_ figure out how polling works
_ is it possible to check if new frames are available?
_ properly synchronize() the pixels
_ may need to always copy to a new array? (or does it already?)
_ provide a useful error message when winvdig not installed (for capture)
_ also be able to set one in particular
_ make sure it's possible to use multiple cameras
_ error in System.err stream coming from running external
_ dies after a while or goes weird