Code Monkey home page Code Monkey logo

imageinputstream's Introduction

ImageInputStream

High-performance InputStream implementations for image stream handling.

ImageInputStream provides a set of hand-crafted image loaders

  • reduced functionality for maximum performance
  • designed for handling image streams or sequences elegantly
  • dependency free + simple, readable code
  • planned support for PNM (PPM, PGM) and PNG (RGBA only)
  • ...

Basic Image Loading

FileInputStream fis = new FileInputStream("test.ppm");
BufferedImage b = new PPMInputStream(fis).readFrame().getImage();

H264-compressed WebCam Streaming via SSH across machines

//Video decoder setup
String cmd[] = { "/bin/bash", "-c", "ssh [email protected] "+
    "/usr/local/bin/ffmpeg -f avfoundation -i 0 -vcodec h264 -f m4v - | "+ 
    "/usr/local/bin/ffmpeg -i - -f image2pipe -vcodec ppm -" };
Process p = Runtime.getRuntime().exec(cmd);

try (PNMInputStream pis = new PPMInputStream(p.getInputStream())) {
    //ImageInputStream setup
    ImageSource is = pis.readFrame();
    BufferedImage pbi = is.getImage();

    //UI setup
    JFrame f = new JFrame();
    JLabel l = new JLabel(new ImageIcon(pbi));
    f.setContentPane(l);
    f.setVisible(true);
    f.pack();

    //Frame loop
    for (is = pis.readFrame(); is!=null; l.repaint(), is = pis.readFrame() )
        is.getImage(pbi);
}

Release

The current state of the project is to be considered pre-1.0 or almost-1.0.

In order to include this library to your project you have to

  1. clone, build and install it

     git clone [...]/ImageInputStream.git && cd ImageInputStream && mvn compile install
    
  2. modify the dependency declaration of your project (e.g. your maven pom.xml)

     <dependencies>
         ...
         <dependency>
             <groupId>de.dualuse</groupId>
             <artifactId>ImageInputStream</artifactId>
             <version>LATEST</version>
         </dependency>
         ...
     </dependencies>
    
  3. enjoy

imageinputstream's People

Contributors

holzschneider avatar

Watchers

James Cloos avatar  avatar

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.