|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.humatic.dsj.DSFilter
de.humatic.dsj.JavaOverlayFilter
public class JavaOverlayFilter
Custom DSFilter object representing the dsj_JavaOverlayFilter which enables mixing of java drawing with the
video of running DirectShow filtergraphs. The underlying DirectShow filter operates "in graph" and upstream from renderers, so in oposition
to the "draw over video" options, that the various RendererControls object in the rc package offer, it
can render to file.
The filter accepts 24bit RGB connections only. Depending on the format of the source video, a color space converter filter
may be required to put it into a graph (DirectShow will pull the converter in automatically if it is required and installed).
The filter operates with a callback mechanism. It sends PropertyChangeEvents of type DSFiltergraph.OVERLAY_BUFFER_REQUEST with
the time data is requested for and waits for data to be delivered (or waittime exceeds frame length). Both this and the
actual compositing code inside the filter are not the most efficient, so it is recommended to use this filter for file rendering
only and use RendererControls for display only graphics.
The filter should be inserted by calling DSFiltergraph.insertJavaOverlayFilter() before calling any "to File" method (like DSMovie.export(),
or DSCapture.setCaptureFile(..)), it will then be moved to the capture branch of filtergraphs during recording.
When working with capture graphs and (File)sinks the filter needs to be inserted after the sink is connected in order to capture the
overlay drawing. In this case call connectSink first, then call DSFiltergraph.insertOverlayFilter with the FORCE_CAPTURE_BRANCH bit set in the
flags parameter. Some devices may require a short pause between the two method calls.
The filter supports colorkeying and can perform some (fake) alpha blending on the none keyed pixels. However while keying is effective,
the alpha implementation is not and should rather not be used for large area alpha compositing.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.humatic.dsj.DSFilter |
|---|
DSFilter.DSPin |
| Field Summary | |
|---|---|
static int |
BLOCKING
Setup flags for use in DSFiltergraph.insertOverlayFilter(...) |
static int |
CALLBACK
Setup flags for use in DSFiltergraph.insertOverlayFilter(...) |
static int |
FORCE_CAPTURE_BRANCH
Setup flags for use in DSFiltergraph.insertOverlayFilter(...) |
static int |
RUNNING
Setup flags for use in DSFiltergraph.insertOverlayFilter(...) |
static int |
STATIC
|
static int |
STATIC_ADD
|
| Fields inherited from class de.humatic.dsj.DSFilter |
|---|
PINDIR_INPUT, PINDIR_OUTPUT |
| Method Summary | |
|---|---|
byte |
getAlpha()
|
int |
getBitDepth()
Returns the bitdepth of the drawing graphics |
java.awt.Graphics2D |
getDrawingSurface()
Returns the Graphics2D an application draws into. |
int |
getHeight()
Returns the height of the drawing graphics |
java.awt.Color |
getKeyColor()
|
int |
getWidth()
Returns the width of the drawing graphics |
void |
setAlpha(float a)
Sets the degree in which none keyed pixels will be blended with the underlying video (0 - fully transparent, 1.0 - fully opaque (default)). |
void |
setKeyColor(java.awt.Color kc)
Sets the keycolor. |
int |
submitFrame()
Submits a frame to the filter for compositing. |
int |
submitFrame(int flags)
Submits a frame to the filter for compositing and eventually - with the STATIC bit set in the flags argument - marks this frame as "static", that is: not to be changed until the next frame with that bit unset is submitted. |
void |
submitPartialFrame(java.awt.Rectangle r,
int flags)
Submits only the region denoted by the Rectangle argument for compositing. |
| Methods inherited from class de.humatic.dsj.DSFilter |
|---|
applyPropPageSettings, closePropPage, connectDownstream, disconnect, dumpConnections, embedPropertiesPage, getCLSID, getFiltergraph, getFilterInfo, getFilterState, getID, getInputs, getName, getOutputs, getPin, getPin, getPin, getPins, getPropPageCount, getPropPageSize, getPropPageTitles, loadFilterState, renderEx, renderPin, saveFilterState, setParameter, showPropertiesDialog, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int RUNNING
public static final int BLOCKING
public static final int CALLBACK
public static final int FORCE_CAPTURE_BRANCH
public static final int STATIC
public static final int STATIC_ADD
| Method Detail |
|---|
public void setKeyColor(java.awt.Color kc)
public java.awt.Color getKeyColor()
public void setAlpha(float a)
public byte getAlpha()
public int getBitDepth()
public int getWidth()
public int getHeight()
public java.awt.Graphics2D getDrawingSurface()
public int submitFrame()
throws java.lang.ArrayIndexOutOfBoundsException,
DSJException
java.lang.ArrayIndexOutOfBoundsException
DSJException
public int submitFrame(int flags)
throws java.lang.ArrayIndexOutOfBoundsException,
DSJException
java.lang.ArrayIndexOutOfBoundsException
DSJException
public void submitPartialFrame(java.awt.Rectangle r,
int flags)
throws java.lang.ArrayIndexOutOfBoundsException,
DSJException
java.lang.ArrayIndexOutOfBoundsException
DSJException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||