forked from wpilibsuite/allwpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wpiutil,cscore] Move VideoMode.PixelFormat to wpiutil
This tracks the RawFrame move.
- Loading branch information
1 parent
92c81d0
commit c3c1c49
Showing
6 changed files
with
64 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package edu.wpi.first.util; | ||
|
||
/** Image pixel format. */ | ||
public enum PixelFormat { | ||
/** Unknown format. */ | ||
kUnknown(0), | ||
/** Motion-JPEG (compressed image data). */ | ||
kMJPEG(1), | ||
/** YUY 4:2:2, 16 bpp. */ | ||
kYUYV(2), | ||
/** RGB 5-6-5, 16 bpp. */ | ||
kRGB565(3), | ||
/** BGR 8-8-8, 24 bpp. */ | ||
kBGR(4), | ||
/** Grayscale, 8 bpp. */ | ||
kGray(5), | ||
/** Grayscale, 16 bpp. */ | ||
kY16(6), | ||
/** YUV 4:2:2, 16 bpp. */ | ||
kUYVY(7); | ||
|
||
private final int value; | ||
|
||
PixelFormat(int value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* Gets the integer value of the pixel format. | ||
* | ||
* @return Integer value | ||
*/ | ||
public int getValue() { | ||
return value; | ||
} | ||
|
||
private static final PixelFormat[] s_values = values(); | ||
|
||
/** | ||
* Gets a PixelFormat enum value from its integer value. | ||
* | ||
* @param pixelFormat integer value | ||
* @return Enum value | ||
*/ | ||
public static PixelFormat getFromInt(int pixelFormat) { | ||
return s_values[pixelFormat]; | ||
} | ||
} |