Class RawSource

All Implemented Interfaces:
AutoCloseable

public class RawSource
extends ImageSource
A source for user code to provide video frames as raw bytes.

This is a complex API, most cases should use CvSource.

  • Constructor Details

    • RawSource

      public RawSource​(String name, VideoMode mode)
      Create a raw frame source.
      Parameters:
      name - Source name (arbitrary unique identifier)
      mode - Video mode being generated
    • RawSource

      public RawSource​(String name, VideoMode.PixelFormat pixelFormat, int width, int height, int fps)
      Create a raw frame source.
      Parameters:
      name - Source name (arbitrary unique identifier)
      pixelFormat - Pixel format
      width - width
      height - height
      fps - fps
  • Method Details

    • putFrame

      protected void putFrame​(RawFrame image)
      Put a raw image and notify sinks.
      Parameters:
      image - raw frame image
    • putFrame

      protected void putFrame​(long data, int width, int height, int pixelFormat, int totalData)
      Put a raw image and notify sinks.
      Parameters:
      data - raw frame data pointer
      width - frame width
      height - frame height
      pixelFormat - pixel format
      totalData - length of data in total
    • putFrame

      protected void putFrame​(long data, int width, int height, VideoMode.PixelFormat pixelFormat, int totalData)
      Put a raw image and notify sinks.
      Parameters:
      data - raw frame data pointer
      width - frame width
      height - frame height
      pixelFormat - pixel format
      totalData - length of data in total