Metadata-Version: 2.1
Name: roboflex.util.jpeg
Version: 0.1.1
Summary: Roboflex util jpeg Library
Home-page: https://github.com/flexrobotics/roboflex_util_jpeg
Author: Colin Prepscius
Author-email: colinprepscius@gmail.com
License: MIT
Keywords: jpeg,robotics,middleware,flexbuffers,python,c++,c++20
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: Framework :: Robot Framework
Classifier: Framework :: Robot Framework :: Library
Classifier: Framework :: Robot Framework :: Tool
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# roboflex.util.jpeg

Roboflex support for jpeg compression to file and memory, and jpeg decompression from memory.

Useful for compressing images over slow transports (wifi, etc).

## System Dependencies

    None! We build jpeg-compression from source...

## pip install

    pip install roboflex.util.jpeg

## Import

    import roboflex.util.jpeg as ruj

## Nodes

There are two complementary nodes: `JPEGCompressor`, which can turn rgb tensors into jpegs in memory, and `JPEGDecompressor`, which does the opposite. Useful either for writing rgb tensors to files, or compressing them (NOTE jpeg is lossy).

    # all parameters are optional
    c = JPEGCompressor(

        # in the incoming message, where to find the rgb tensor
        image_key = "rgb",

        # in the outgoing message, where to place the jpeg data
        output_key = "jpeg", 

        # If this is provided, will ALSO write jpeg files with this 
        # prefix, with a variation of the date and time as the suffix.
        filename_prefix = "",

        # name of the node
        name = "JPEGCompressor",

        # prints internal info
        debug = False,
    )

... and ...

    c = JPEGDecompressor(

        # in the incoming message, where to find the jpeg data as a blob
        input_key = "jpeg",

        # in the outgoing message, where to place the rgb data as a tensor
        output_key = "jpeg", 

        # name of the node
        name = "JPEGDecompressor",

        # prints internal info
        debug = False,
    )


