Coder Social home page Coder Social logo

cansik / spout-for-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ajasra/spout-for-python

4.0 1.0 1.0 2.42 MB

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

C++ 93.14% C 3.98% Python 2.88%

spout-for-python's Introduction

Spout for Python

Based on https://github.com/spiraltechnica/Spout-for-Python

A modified Spout library using Boost::Python to enable Spout texture sharing using Python. This library is for use with Python 3.5 / 3.6 / 3.7 64bit. Now it will automatically define python version and load appropriate file.

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.