001/*----------------------------------------------------------------------------*/ 002/* Copyright (c) FIRST 2016. All Rights Reserved. */ 003/* Open Source Software - may be modified and shared by FRC teams. The code */ 004/* must be accompanied by the FIRST BSD license file in the root directory of */ 005/* the project. */ 006/*----------------------------------------------------------------------------*/ 007 008package edu.wpi.cscore; 009 010/// A source that represents a video camera. 011public class VideoCamera extends VideoSource { 012 public class WhiteBalance { 013 public static final int kFixedIndoor = 3000; 014 public static final int kFixedOutdoor1 = 4000; 015 public static final int kFixedOutdoor2 = 5000; 016 public static final int kFixedFluorescent1 = 5100; 017 public static final int kFixedFlourescent2 = 5200; 018 } 019 020 protected VideoCamera(int handle) { 021 super(handle); 022 } 023 024 /// Set the brightness, as a percentage (0-100). 025 public synchronized void setBrightness(int brightness) { 026 CameraServerJNI.setCameraBrightness(m_handle, brightness); 027 } 028 029 /// Get the brightness, as a percentage (0-100). 030 public synchronized int getBrightness() { 031 return CameraServerJNI.getCameraBrightness(m_handle); 032 } 033 034 /// Set the white balance to auto. 035 public synchronized void setWhiteBalanceAuto() { 036 CameraServerJNI.setCameraWhiteBalanceAuto(m_handle); 037 } 038 039 /// Set the white balance to hold current. 040 public synchronized void setWhiteBalanceHoldCurrent() { 041 CameraServerJNI.setCameraWhiteBalanceHoldCurrent(m_handle); 042 } 043 044 /// Set the white balance to manual, with specified color temperature. 045 public synchronized void setWhiteBalanceManual(int value) { 046 CameraServerJNI.setCameraWhiteBalanceManual(m_handle, value); 047 } 048 049 /// Set the exposure to auto aperture. 050 public synchronized void setExposureAuto() { 051 CameraServerJNI.setCameraExposureAuto(m_handle); 052 } 053 054 /// Set the exposure to hold current. 055 public synchronized void setExposureHoldCurrent() { 056 CameraServerJNI.setCameraExposureHoldCurrent(m_handle); 057 } 058 059 /// Set the exposure to manual, as a percentage (0-100). 060 public synchronized void setExposureManual(int value) { 061 CameraServerJNI.setCameraExposureManual(m_handle, value); 062 } 063}