Brian Silverman | e925980 | 2020-01-26 15:18:30 -0800 | [diff] [blame] | 1 | namespace frc971.vision; |
| 2 | |
| 3 | // Contains the image data from one frame of a camera. |
| 4 | // |
| 5 | // The following image options are hard-coded. If you add images in a different |
| 6 | // format, make fields for them which default to these values and remove this |
| 7 | // comment: |
| 8 | // * Format: YUYV (V4L2_PIX_FMT_YUYV, which puts 2 pixels in every 4 bytes, |
| 9 | // with the order Y0,U,Y1,V) |
| 10 | // * Order: row major (index 0 is upper left, index 1 is to its right) |
| 11 | table CameraImage { |
| 12 | // The number of rows in the image. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 13 | rows:int32 (id: 0); |
Brian Silverman | e925980 | 2020-01-26 15:18:30 -0800 | [diff] [blame] | 14 | // The number of columns in the image. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 15 | cols:int32 (id: 1); |
Brian Silverman | e925980 | 2020-01-26 15:18:30 -0800 | [diff] [blame] | 16 | // The image data. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 17 | data:[ubyte] (id: 2); |
Brian Silverman | 967e5df | 2020-02-09 16:43:34 -0800 | [diff] [blame] | 18 | // Timestamp when the frame was captured. This is the end-of-frame timestamp. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 19 | monotonic_timestamp_ns:int64 (id: 3); |
Brian Silverman | e925980 | 2020-01-26 15:18:30 -0800 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | root_type CameraImage; |