Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: webcamcapture_module

[7:14] static extends: object

Module JAR loader class.

Methods

  • webcamcapture_module ()

class: Webcam

[45:14] (extern: com.lehman.aussom.AussomWebcam) extends: object

Represents one physical webcam device.

Methods

  • Webcam ()

    Default constructor.

  • getName ()

    Gets the webcam device name. This function takes no options.

    • @r A string with the device name.
  • open ()

    Opens the webcam for capture. This function takes no options. Set the capture size with setViewSize() or setResolution() before calling open().

    • @r This object.
  • close ()

    Closes the webcam and releases the device. This function takes no options. Calling close() on a closed webcam is allowed.

    • @r This object.
  • isOpen ()

    Checks whether the webcam is open. This function takes no options.

    • @r A bool with true if the webcam is open and false if not.
  • getViewSize ()

    Gets the current capture size. This function takes no options.

    • @r A two item list containing width and height.
  • getViewSizes ()

    Gets the capture sizes supported by this webcam driver. This function takes no options. Use one of the returned [width, height] pairs when calling setViewSize().

    • @r A list of two item lists. Each child list contains width and height.
  • setViewSize (int Width, int Height)

    Sets the capture size. This should be called before open(). Width and Height must be one of the [width, height] pairs returned by getViewSizes() for this camera. Common examples include 160x120, 320x240, 640x480, 1280x720, and 1920x1080, but the real options are device-specific.

    • @p Width is an int with the capture width from getViewSizes().
    • @p Height is an int with the capture height from getViewSizes().
    • @r This object.
  • setResolution (string Name)

    Sets the capture size from a WebcamResolution enum name. This should be called before open(). Available names are QQVGA, HQVGA, QVGA, WQVGA, HVGA, VGA, WVGA, FWVGA, SVGA, DVGA, WSVGA1, WSVGA2, XGA, XGAP, WXGA1, WXGA2, WXGAP, SXGA, SXGAP, WSXGAP, UXGA, WUXGA, QWXGA, QXGA, WQXGA, QSXGA, WQSXGA, QUXGA, WQUXGA, HXGA, WHXGA, HSXGA, WHSXGA, HUXGA, WHUXGA, NHD, QHD, HD, HDP, FHD, FHDP, DCI2K, WQHD, WQHDP, UWQHD, UW4K, UHD4K, DCI4K, UW5K, UHDP5K, UW8K, UHD8K, PAL, and CIF. The name must exist in the library and the selected camera must support that size. Use getViewSizes() when you need the exact sizes reported by the active device.

    • @p Name is a string with a WebcamResolution enum name.
    • @r This object.
  • getImageBytes (string Format = "png")

    Captures one frame and returns encoded image bytes. Format must be an ImageIO writer format name. Common built-in Java options are png, jpg, jpeg, gif, bmp, and wbmp. Some Java runtimes also provide tif or tiff. Format names are case-insensitive.

    • @p Format is an optional ImageIO format name. The default is png.
    • @r A Buffer containing the encoded image.
  • saveImage (string Path, string Format = null)

    Captures one frame and saves it to disk. Format must be an ImageIO writer format name. Common built-in Java options are png, jpg, jpeg, gif, bmp, and wbmp. Some Java runtimes also provide tif or tiff. Format names are case-insensitive. If Format is null, the file extension from Path is used.

    • @p Path is a string with the image output path. The parent directory must exist.
    • @p Format is an optional ImageIO format name or null to use the file extension.
    • @r This object.

class: WebcamCapture

[16:21] static (extern: com.lehman.aussom.AussomWebcamCapture) extends: object

Static entry point for webcam discovery.

Methods

  • getDefault ()

    Gets the system default webcam. This function takes no options. The selected device is chosen by the webcam-capture library and the operating system.

    • @r A Webcam object, or null if no webcam is available.
  • getWebcams ()

    Gets all webcams detected on the system. This function takes no options. Device discovery is handled by the webcam-capture library.

    • @r A list of Webcam objects. The list is empty when no webcam is found.
  • getDefaultName ()

    Gets the name of the system default webcam. This function takes no options. The selected device is chosen by the webcam-capture library and the operating system.

    • @r A string with the webcam name, or null if no webcam is available.