Set up wpiformat (#86)

This commit is contained in:
Tyler Veness
2017-08-25 17:48:06 -07:00
committed by Peter Johnson
parent dd85b1e519
commit 06636a0e1c
75 changed files with 866 additions and 655 deletions

View File

@@ -1,7 +1,14 @@
#include "cscore.h"
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#include "llvm/SmallString.h"
#include "llvm/raw_ostream.h"
#include <llvm/SmallString.h>
#include <llvm/raw_ostream.h>
#include "cscore.h"
int main() {
CS_Status status = 0;
@@ -17,7 +24,8 @@ int main() {
llvm::outs() << " " << prop.GetName();
switch (prop.GetKind()) {
case cs::VideoProperty::kBoolean:
llvm::outs() << " (bool): " << "value=" << prop.Get()
llvm::outs() << " (bool): "
<< "value=" << prop.Get()
<< " default=" << prop.GetDefault();
break;
case cs::VideoProperty::kInteger:
@@ -30,7 +38,8 @@ int main() {
llvm::outs() << " (string): " << prop.GetString(buf);
break;
case cs::VideoProperty::kEnum: {
llvm::outs() << " (enum): " << "value=" << prop.Get();
llvm::outs() << " (enum): "
<< "value=" << prop.Get();
auto choices = prop.GetChoices();
for (size_t i = 0; i < choices.size(); ++i) {
if (choices[i].empty()) continue;
@@ -48,10 +57,18 @@ int main() {
for (const auto& mode : camera.EnumerateVideoModes()) {
llvm::outs() << " PixelFormat:";
switch (mode.pixelFormat) {
case cs::VideoMode::kMJPEG: llvm::outs() << "MJPEG"; break;
case cs::VideoMode::kYUYV: llvm::outs() << "YUYV"; break;
case cs::VideoMode::kRGB565: llvm::outs() << "RGB565"; break;
default: llvm::outs() << "Unknown"; break;
case cs::VideoMode::kMJPEG:
llvm::outs() << "MJPEG";
break;
case cs::VideoMode::kYUYV:
llvm::outs() << "YUYV";
break;
case cs::VideoMode::kRGB565:
llvm::outs() << "RGB565";
break;
default:
llvm::outs() << "Unknown";
break;
}
llvm::outs() << " Width:" << mode.width;
llvm::outs() << " Height:" << mode.height;