Methods Summary |
---|
private java.awt.image.BufferedImage | bufferToImage(javax.media.Buffer buffer)
RGBFormat format = (RGBFormat) buffer.getFormat();
int rMask, gMask, bMask;
Object data = buffer.getData();
DirectColorModel dcm;
rMask = format.getRedMask();
gMask = format.getGreenMask();
bMask = format.getBlueMask();
int [] masks = new int[3];
masks[0] = rMask;
masks[1] = gMask;
masks[2] = bMask;
DataBuffer db = new DataBufferInt((int[])data,
format.getLineStride() *
format.getSize().height);
SampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,
format.getLineStride(),
format.getSize().height,
masks);
WritableRaster wr = Raster.createWritableRaster(sm, db, new Point(0, 0));
dcm = new DirectColorModel(24, rMask, gMask, bMask);
return new BufferedImage(dcm, wr, true, null);
|
public void | close()
lastImage = null;
|
public java.awt.Component | getComponent()
return this;
|
public java.lang.Object | getControl(java.lang.String arg)
Object rc = null;
if(arg.equals("javax.media.control.FrameGrabbingControl")) rc = this;
return rc;
|
public java.awt.Component | getControlComponent()
return null;
|
public java.lang.Object[] | getControls()
Object[] obj = { this };
return obj;
|
public java.lang.String | getName()
return "Fobs Java2DRenderer";
|
public javax.media.Format[] | getSupportedInputFormats()return new Format[] {new RGBFormat() };
|
public javax.media.Buffer | grabFrame()
Buffer buf = null;
if(lastImage != null) ImageToBuffer.createBuffer(lastImage,(float)0);
return buf;
|
public void | open()
|
protected void | paintComponent(java.awt.Graphics g)
if(lastImage != null) g.drawImage(lastImage, 0, 0, this.getWidth(),this.getHeight(), null);
|
public int | process(javax.media.Buffer buffer)
Graphics2D g2d = (Graphics2D) this.getGraphics();
if(g2d != null) {
if(lastImage == null) lastImage = bufferToImage(buffer);
g2d.drawImage(lastImage, 0, 0, this.getWidth(),this.getHeight(), null);
//g2d.dispose();
}
return BUFFER_PROCESSED_OK;
|
public void | reset()
lastImage = null;
|
public boolean | setComponent(java.awt.Component arg0)
return false;
|
public javax.media.Format | setInputFormat(javax.media.Format format)
System.out.println("Fobs Java2DRenderer: setInputFormat");
FobsConfiguration.videoFrameFormat=FobsConfiguration.RGBA;
vf = (RGBFormat) format;
int formatWidth = (int) vf.getSize().getWidth();
int formatHeight = (int) vf.getSize().getHeight();
this.setPreferredSize(new Dimension(formatWidth,formatHeight));
return format;
|
void | setValue(java.lang.Object aValue, boolean isSelected)
System.out.println(aValue.getClass().getName());
|
public void | start()
System.out.println("Fobs Java2DRenderer: start");
|
public void | stop()
System.out.println("Fobs Java2DRenderer: stop");
|