001/*----------------------------------------------------------------------------*/ 002/* Copyright (c) 2016-2018 FIRST. 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/** 011 * A source that represents a video camera. 012 */ 013public class VideoCamera extends VideoSource { 014 public class WhiteBalance { 015 public static final int kFixedIndoor = 3000; 016 public static final int kFixedOutdoor1 = 4000; 017 public static final int kFixedOutdoor2 = 5000; 018 public static final int kFixedFluorescent1 = 5100; 019 public static final int kFixedFlourescent2 = 5200; 020 } 021 022 protected VideoCamera(int handle) { 023 super(handle); 024 } 025 026 /** 027 * Set the brightness, as a percentage (0-100). 028 */ 029 public synchronized void setBrightness(int brightness) { 030 CameraServerJNI.setCameraBrightness(m_handle, brightness); 031 } 032 033 /** 034 * Get the brightness, as a percentage (0-100). 035 */ 036 public synchronized int getBrightness() { 037 return CameraServerJNI.getCameraBrightness(m_handle); 038 } 039 040 /** 041 * Set the white balance to auto. 042 */ 043 public synchronized void setWhiteBalanceAuto() { 044 CameraServerJNI.setCameraWhiteBalanceAuto(m_handle); 045 } 046 047 /** 048 * Set the white balance to hold current. 049 */ 050 public synchronized void setWhiteBalanceHoldCurrent() { 051 CameraServerJNI.setCameraWhiteBalanceHoldCurrent(m_handle); 052 } 053 054 /** 055 * Set the white balance to manual, with specified color temperature. 056 */ 057 public synchronized void setWhiteBalanceManual(int value) { 058 CameraServerJNI.setCameraWhiteBalanceManual(m_handle, value); 059 } 060 061 /** 062 * Set the exposure to auto aperture. 063 */ 064 public synchronized void setExposureAuto() { 065 CameraServerJNI.setCameraExposureAuto(m_handle); 066 } 067 068 /** 069 * Set the exposure to hold current. 070 */ 071 public synchronized void setExposureHoldCurrent() { 072 CameraServerJNI.setCameraExposureHoldCurrent(m_handle); 073 } 074 075 /** 076 * Set the exposure to manual, as a percentage (0-100). 077 */ 078 public synchronized void setExposureManual(int value) { 079 CameraServerJNI.setCameraExposureManual(m_handle, value); 080 } 081}