Skip to content

A modified Spout library using Boost::Python to enable Spout texture sharing using Python.

Notifications You must be signed in to change notification settings

fusefactory/Spout-for-Python

 
 

Repository files navigation

Spout for Python

A modified Spout library using Boost::Python to enable Spout texture sharing using Python. Previous versions of this library have been tested with Python 3.5 / 3.6 / 3.7. This version of the library has been tested with Python 3.9 and a modern NVIDIA RTX A4000 GPU.

Using the Library

Watch video use/demo >

python test.py or just check sample code in the test.py

# import library
from Library.Spout import Spout

def main() :
    # create spout object
    spout = Spout(silent = True)
    # create receiver
    spout.createReceiver('input')
    # create sender
    spout.createSender('output')

    while True :
        # check on exit
        spout.check()
        # receive data
        data = spout.receive()
        # send data
        spout.send(data)
    
if __name__ == "__main__":
    main()

If want multiple receivers/senders, check test_mult.py

Parameters

Parameters and arguments for sender and receiver can be checked in the Library/Spout.py

Requirements

Install Spout from here

pip install -r requirements.txt
  • pygame
  • pyopengl

Additional

  • Allow multiple receivers senders
  • Now it can be used as any python library, just few lines of code
  • Automatically define the size of receiver and data to send
  • Can change receiver size on the go
  • Support different receiver/sender imageFormat/type

About

A modified Spout library using Boost::Python to enable Spout texture sharing using Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.4%
  • Python 2.2%
  • C 0.4%