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, 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

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

      protected void putFrame​(long data, int size, int width, int height, int stride, PixelFormat pixelFormat)
      Put a raw image and notify sinks.
      Parameters:
      data - raw frame native data pointer
      size - total size in bytes
      width - frame width
      height - frame height
      stride - size of each row in bytes
      pixelFormat - pixel format
    • putFrame

      public void putFrame​(ByteBuffer data, int width, int height, int stride, PixelFormat pixelFormat)
      Put a raw image and notify sinks.
      Parameters:
      data - raw frame native ByteBuffer
      width - frame width
      height - frame height
      stride - size of each row in bytes
      pixelFormat - pixel format