1
0
Fork 0
leet/framebuffer/framebuffer.proto

74 lines
1.7 KiB
Protocol Buffer

syntax = "proto3";
/*
Layer defines some default layers for compositing animations onto for
various purposes, and also defines some generic layers. Each service
should be allocated a unique enum eventually.
In the future, this system should be replaced by a configuration file
that assigns priorities to each service.
*/
enum Layer {
NONE = 0;
// Well-known layers
LIGHT = 10;
COLOR = 20;
NOTIFICATIONS = 90;
// Public layers
GENERAL_0 = 40;
GENERAL_1 = 41;
GENERAL_2 = 42;
GENERAL_3 = 43;
GENERAL_4 = 44;
GENERAL_5 = 45;
GENERAL_6 = 46;
GENERAL_7 = 47;
GENERAL_8 = 48;
GENERAL_9 = 49;
}
/*
FrameData represents either an array of dots or a fixed fill color to apply
to all dots. Having two use cases makes it easier for applications to
draw solid fill colors.
*/
message FrameData {
// ARGB
repeated fixed32 dots = 1;
fixed32 fill = 2;
}
/*
FrameBuffer represents an entire frame together with a layer tag. It also
defines a timestamp that can be used within a FrameSequence to define the
duration a frame will be shown.
*/
message FrameBuffer {
FrameData frame = 1;
fixed32 timestamp = 3;
Layer layer = 4;
}
/*
FrameSequence buffers a series of frames to be drawn one by one at intervals
defined by the timestamp included in the FrameBuffers. Useful for running
smooth animations.
In the future, this should have more metadata like looping counts and async
animations.
*/
message FrameSequence {
repeated FrameBuffer frames = 1;
}
message DrawResponse {
}
service Drawer {
// DrawFrame draws one frame
rpc DrawFrame (FrameBuffer) returns (DrawResponse) {}
// DrawFrames draws a series of frames
rpc DrawFrames (FrameSequence) returns (DrawResponse) {}
}