Skip to content

Commit f2b2b45

Browse files
committed
Add support for image source/sink nodes
1 parent 6c0905e commit f2b2b45

5 files changed

Lines changed: 62 additions & 0 deletions

File tree

api/datatype.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,24 @@ message AnnotatedTensor {
107107
// e.g. pipeline latencies
108108
map<string, google.protobuf.Value> metadata = 2;
109109
}
110+
111+
enum PixelFormat {
112+
kPixelFormatUnknown = 0;
113+
kYUV420_888 = 1;
114+
kRGB888 = 2;
115+
kRGBA8888 = 3;
116+
kGrayscale8 = 4;
117+
kRAW10 = 5;
118+
kRAW16 = 6;
119+
kNV12 = 7;
120+
kNV21 = 8;
121+
}
122+
123+
message ImageFrame {
124+
uint32 width = 1;
125+
uint32 height = 2;
126+
PixelFormat format = 3;
127+
uint64 sequence_number = 4;
128+
uint64 timestamp_ns = 5;
129+
bytes data = 6;
130+
}

api/device.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ message Peripheral {
1313
kElectricalStimulation = 2;
1414
kOpticalStimulation = 3;
1515
kSpikeSource = 4;
16+
kCamera = 5;
1617
}
1718
string name = 1;
1819
string vendor = 2;

api/node.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import "api/nodes/disk_writer.proto";
1111
import "api/nodes/spike_source.proto";
1212
import "api/nodes/spike_binner.proto";
1313
import "api/nodes/application.proto";
14+
import "api/nodes/image_source.proto";
15+
import "api/nodes/image_sink.proto";
1416

1517
enum NodeType {
1618
kNodeTypeUnknown = 0;
@@ -27,6 +29,8 @@ enum NodeType {
2729
kDiskWriter = 9;
2830
kSpikeBinner = 10;
2931
kApplication = 11;
32+
kImageSource = 12;
33+
kImageSink = 13;
3034
}
3135

3236
message NodeConfig {
@@ -47,6 +51,8 @@ message NodeConfig {
4751
SpikeSourceConfig spike_source = 12;
4852
SpikeBinnerConfig spike_binner = 13;
4953
ApplicationNodeConfig application = 14;
54+
ImageSourceConfig image_source = 15;
55+
ImageSinkConfig image_sink = 16;
5056
}
5157
}
5258

@@ -63,6 +69,8 @@ message NodeStatus {
6369
ApplicationNodeStatus application = 7;
6470
OpticalStimulationStatus optical_stimulation = 8;
6571
DiskWriterStatus disk_writer = 10;
72+
ImageSourceStatus image_source = 11;
73+
ImageSinkStatus image_sink = 12;
6674
}
6775
}
6876

api/nodes/image_sink.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
syntax = "proto3";
2+
3+
package synapse;
4+
5+
message ImageSinkConfig {
6+
uint32 peripheral_id = 1;
7+
uint32 frame_rate_hz = 2;
8+
}
9+
10+
message ImageSinkStatus {
11+
uint64 frames_exported = 1;
12+
float actual_rate_hz = 2;
13+
float latency_ms = 3;
14+
}

api/nodes/image_source.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
syntax = "proto3";
2+
3+
package synapse;
4+
5+
import "api/datatype.proto";
6+
7+
message ImageSourceConfig {
8+
uint32 peripheral_id = 1;
9+
uint32 width = 2;
10+
uint32 height = 3;
11+
PixelFormat format = 4;
12+
uint32 frame_rate_hz = 5;
13+
}
14+
15+
message ImageSourceStatus {
16+
uint64 frames_produced = 1;
17+
uint64 frames_dropped = 2;
18+
}

0 commit comments

Comments
 (0)