frame_msg library

Classes

IMUData
IMURawData
RxAudio
RxIMU
IMU data stream, returns raw 3-axis magnetometer and 3-axis accelerometer data and optionally computes derived values Note, a proper calculation of Heading requires magnetometer calibration, tilt compensation (which we can do here from the accelerometer), and magnetic declination adjustment (which is lat-long and time-dependent). Magnetometer calibration and declination adjustments need to be done outside this class.
RxPhoto
Returns a photo as a JPEG image from Frame. Note: The camera sensor on Frame is rotated 90 degrees clockwise, so raw images are rotated, but by default RxPhoto will correct this by rotating -90 degrees. If you want to save the cost of copyRotate here you can specify upright=false in the constructor since some ML packages allow for specifying the orientation of the image when passing it in. Pairs with frame.camera.read_raw(), that is, jpeg header and footer are not sent from Frame - only the content, using non-final and final message types Jpeg header and footer are added in here on the client, so a quality level must be provided to select the correct header. Returns a Stream with exactly one jpeg as bytes, then is Done
RxTap
Multi-Tap data stream, returns the number of taps detected
SensorBuffer
Buffer class to allow us to provide a smoothed moving average of samples
TxAutoExpSettings
A message containing a collection of camera settings suitable for requesting the frameside app enable auto exposure and gain with the specified settings
TxCaptureSettings
A message containing a collection of camera settings suitable for requesting the frameside app to take a photo with the specified settings
TxCode
A message containing only a single optional byte suitable for signalling the frameside app to take some action (e.g. toggle streaming, take a photo with default parameters etc.)
TxImageSpriteBlock
Represents an image of a specified size sliced into a number of "sprite lines" of the full width of the image, and the specified height, and possibly a final sprite line of a different height. When sending TxImageSpriteBlock to Frame, the sendMessage() will send the header with block dimensions and sprite line height, and the user then sends each line[] as a TxSprite message with the same msgCode as the Block, and the frame app will use the line height to place each line. By sending each line separately we can display them as they arrive, as well as reducing overall memory requirement (each concat() call is smaller). Sending an ImageSpriteBlock with no lines is not intended usage.
TxManualExpSettings
A message containing a collection of camera settings suitable for requesting the frameside app enable manual exposure and gain with the specified settings
TxMsg
The base class for all Tx (transmit phone to Frame) messages that can be sent using sendMessage() which performs splitting across multiple MTU-sized packets an assembled automatically frameside by the data handler.
TxPlainText
A message containing a String of plain text, plus optional top-left corner position coordinates for the text to be printed in the Frame display (Lua/1-based, i.e. 1,1 to 640,400) plus an optional palette offset (1..15, 0/'VOID' is invalid), plus optional character spacing
TxSprite
TxTextSpriteBlock
Represents an (optionally) multi-line block of text of a specified width and number of visible rows at a specified lineHeight If the supplied text string is longer, only the last displayRows will be shown rendered and sent to Frame. If the supplied text string has fewer than or equal to displayRows, only the number of actual rows will be rendered and sent to Frame If any given line of text is shorter than width, the text Sprite will be set to the actual width required. When sending TxTextSpriteBlock to Frame, the sendMessage() will send the header with block dimensions and line-by-line offsets and the user then sends each line[] as a TxSprite message with the same msgCode as the Block, and the frame app will use the offsets to place each line. By sending each line separately we can display them as they arrive, as well as reducing overall memory requirement (each concat() call is smaller). After calling the constructor, check isNotEmpty before calling rasterize() and sending the header or the sprites. Sending a TextSpriteBlock with no lines is not intended usage. text is trimmed (leading and trailing whitespace) before laying out the paragraph, but any blank lines within the range of displayed rows will be sent as an empty (1px) TxSprite