Package dev.ioliver.services
Class CamService
java.lang.Object
dev.ioliver.services.CamService
The CamService class provides a service for capturing frames from a camera using the OpenCV library.
It initializes the camera, reads frames, and processes them using a callback function.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface representing a frame processing callback. -
Constructor Summary
ConstructorDescriptionCamService
(int camIndex, CamService.FrameProcessorCb cb) Constructs a new CamService instance with the specified camera index and frame processing callback. -
Method Summary
-
Constructor Details
-
CamService
Constructs a new CamService instance with the specified camera index and frame processing callback.- Parameters:
camIndex
- The index of the camera to be used for capturing frames.cb
- The callback function for processing frames.- Throws:
RuntimeException
- If the camera fails to open.
-