Class VisionPipeline<T>
java.lang.Object
com.codename1.ai.vision.VisionPipeline<T>
- All Implemented Interfaces:
AutoCloseable
Connects a camera frame stream to a reusable analyzer with keep-only-latest
backpressure. At most one analysis and one pending frame are retained, so a
slow model cannot build an unbounded queue. Results and errors arrive on
the EDT. The pipeline owns and closes the analyzer but not the camera
session.
-
Constructor Summary
ConstructorsConstructorDescriptionVisionPipeline(CameraSession session, VisionAnalyzer<T> analyzer, VisionPipelineListener<T> listener) Attaches immediately as the session's frame listener. -
Method Summary
-
Constructor Details
-
VisionPipeline
public VisionPipeline(CameraSession session, VisionAnalyzer<T> analyzer, VisionPipelineListener<T> listener) Attaches immediately as the session's frame listener.- Parameters:
session- active camera session whose frames should be analyzedanalyzer- reusable analyzer owned by this pipelinelistener- EDT result/error listener
-
-
Method Details
-
isBusy
public boolean isBusy()Returns whether a frame is currently being analyzed.- Returns:
truewhile the open pipeline has an analysis in flight
-
close
public void close()Stops accepting frames, detaches from the camera session, discards the pending frame, clears the busy state, and closes the analyzer. A pending frame already selected for dispatch is rechecked and discarded before it can reach the closed analyzer. Calling this method more than once has no effect.- Specified by:
closein interfaceAutoCloseable
-