diff --git a/pom.xml b/pom.xml index d959cab6..c1482057 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ webcam-capture webcam-capture-driver-ipcam webcam-capture-driver-jmf + webcam-capture-pages + + + + + + +
+

Webcam Capture

+

Generic Webcam Java Utility

+
+ + + +
+ +
+ + + +

Webcam Capture

+ +

+The goal of this project is to provide really simple webcam API allowing you to use your +build-in, external (USB-connected) webcams or IP / network cameras directly from Java code. +It provides basic webcam +interface and a set of additional drivers which can be used to replace default build-in +drivers to extend and/or replace default functionality. +

+ +

Continous Integration build status (Travis CI):

+ +

+Build Status +

+ +

Requirements

+ +

+

+

+ +

Core Features

+ +

+

+

+ + + +

How To Start

+ +

+Webcam Capture is avilable in Maven Central, so if you can add its dependency to your +project if you are using one of the dependency manager: +

+ +

Maven

+ +
+<dependency>
+    <groupId>com.github.sarxos</groupId>
+    <artifactId>webcam-capture</artifactId>
+    <version>0.3.5</version>
+</dependency>
+
+ +

No Dependency Manager?

+ +

+Download ZIP file containing complete API reference, required JARs, sources and examples +(link is visible at the right top corner of this page), uncompress, and add webcam-capture-[version].jar +and all JARs under libs directory to your project's classpath: +

+ +

Additional Drivers

+ +

+Currently Webcam Capture supports the following drivers: +

+ +

IP / Network Camera Driver

+ +

+This is IP camera driver for Webcam Capture project. It allows Webcam Capture to +handle pictures from IP cameras supporting JPEG and MJPEG (Motion JPEG) compression. +For more information about supported models, how to extend, examples, use-cases, please +follow to the Github project available here. +

+ +

+This driver is available in Maven Central. +

+ +

JMF / FMJ Driver

+ +

+This is driver containing video grabber for Webcam Capture project. It utilizes JMF +capabilities to access PC webcam (those USB-connected too) and can be used as a replacement +for default build-in driver. Its advantage is the fact it's pretty fast, but unformtunately, +from the other hand, it requires JMF +to be installed on your PC. +

+ +

+If you do not want to use JMF (due to e.g. licensing issues), you can choose +FMJ, which is a freeware replacement for JMF. +

+ +

+NOTE! Be aware of the fact that both JMF and FMJ are not being maintained any more! +

+ +

+This driver is available in Maven Central. +

+ +

OpenIMAJ Driver

+ +

+This is driver containing video grabber for Webcam Capture project. It utilizes +OpenIMAJ framework +capabilities to access PC webcam and can be used as a replacement +for default build-in driver. Its advantage is the fact it's pretty fast, supports +multiple platforms, but disadventage is the size of required 3rd party +JARs (around ~20MB). Default build-in driver uses OpenIMAJ natives to support video grabbing, +but id does not require all those additional JARs. +

+ +

+This driver is NOT available in Maven Central, but it can be used in Maven build. +In such a case user has to add those repositories to project's POM: +

+ +
+<repositories>
+    <repository>
+        <id>OpenIMAJ maven repository</id>
+        <url>http://maven.openimaj.org/</url>
+    </repository>
+    <repository>
+        <id>Octopussy thirdparty maven repository</id>
+        <url>http://octopussy.ecs.soton.ac.uk/m2/thirdparty/</url>
+    </repository>
+    <repository>
+        <id>OpenIMAJ Snapshots maven repository</id>
+        <url>http://octopussy.ecs.soton.ac.uk/m2/snapshots/</url>
+    </repository>
+</repositories>
+
+ + +

LTI-CIVIL Driver

+ +

+This is driver containing video grabber for Webcam Capture project. It utilizes +LTI-CIVIL project +capabilities to access PC webcam and can be used as a replacement +for default build-in driver. LTI-CIVIL supports Windows, Linux and MAC OS platforms. +For Mac OS it utilizes QTJ framework capabilities. For other ones it uses precompiled +natives. +

+ +

+This driver is NOT available in Maven Central, but it can be used in Maven build. +In such a case user has to add those repositories to project's POM: +

+ +
+<repositories>
+    <repository>
+        <id>sarxos-repo</id>
+        <url>http://repo.sarxos.pl/maven2</url>
+    </repository>
+</repositories>
+
+ +

+NOTE! Be aware of the fact that LTI-CIVIL not being maintained any more by its owner! +

+ + +

OpenCV Driver

+ +

EXPERIMENTAL STUFF!

+ +

+This is driver containing video grabber for Webcam Capture project. It utilizes +JavaCV Java wrapper for +OpenCV project +capabilities to access PC webcam and can be used as a replacement +for default build-in driver. Its advantage is quite stable interface, but unfortunately +it requires quite huge (around ~100MB) pre-installed OpenCV bundle. +

+ +

+This driver is NOT available in Maven Central, but it can be used in Maven build. +In such a case user has to add those repositories to project's POM: +

+ +
+<repositories>
+    <repository>
+        <id>javacv</id>
+        <url>http://maven2.javacv.googlecode.com/git</url>
+    </repository>
+    <repository>
+        <id>kevoree</id>
+        <url>http://maven.kevoree.org/release</url>
+    </repository>
+</repositories>
+
+ +

VLCj Driver

+ +

EXPERIMENTAL STUFF!

+ +

+This is driver containing video grabber for Webcam Capture project. It utilizes +VLCj Java wrapper for Videolan +VLC project +capabilities to access PC webcam and can be used as a replacement +for default build-in driver. Unfortunately it require VLC media player to be +pre-installed on the system where driver will be used. +

+ +

+This driver is NOT available in Maven Central, but it can be used in Maven build. +In such a case user has to add those repositories to project's POM: +

+ +
+<repositories>
+    <repository>
+        <id>caprica</id>
+        <url>http://www.capricasoftware.co.uk/repo</url>
+    </repository>
+</repositories>
+
+ + + + + + + +

Examples

+ +

Capture Image

+ +

To capture single image and save it to disk:

+ +
+Webcam webcam = Webcam.getDefault();
+BufferedImage image = webcam.getImage();
+ImageIO.write(image, "PNG", new File("test.png"));
+
+ +

If you have more then one webcam connected to your computer:

+ +
+Webcam laptop = Webcam.getWebcams().get(0);
+Webcam kitchen = Webcam.getWebcams().get(1);
+Webcam roof = Webcam.getWebcams().get(2);
+
+ +

Detect Motion

+ +

To detect motion with your webcam - loop solution:

+ +
+WebcamMotionDetector detector = new WebcamMotionDetector(Webcam.getDefault());
+detector.setInterval(100); // one check per 100 ms (10 FPS)
+detector.start();
+
+while (true) {
+    if (detector.isMotion()) {
+        System.out.println("Detected motion I, alarm turn on you have");
+    }
+    Thread.sleep(500);
+}
+
+ +

To detect motion with webcam - listener solution:

+ +
+public class DetectMotionExample implements WebcamMotionListener {
+
+    WebcamMotionDetector detector = new WebcamMotionDetector(Webcam.getDefault());
+
+    public DetectMotionExample() {
+        detector.setInterval(100); // one check per 100 ms (10 FPS)
+        detector.addMotionListener(this);
+        detector.start();
+    }
+
+    @Override
+    public void motionDetected(WebcamMotionEvent wme) {
+        System.out.println("Detected motion I, alarm turn on you have");
+    }
+
+    public static void main(String[] args) throws IOException {
+        new DetectMotionExample();
+        System.in.read(); // keeps your program open
+    }
+}
+
+ +

Swing Support

+ +

+You can display image from webcam in Swing JPanel. There is a special component +designed for this. +

+ +
+JFrame window = new JFrame("Test Webcam Panel");
+window.add(new WebcamPanel(Webcam.getDefault()));
+window.pack();
+window.setVisible(true);
+window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+ +

Display Image From IP / Network Camera

+ +

+To use Webcam Capture together with IP or network camera you have to add +IP / network camera driver +to your Webcam Capture project. +

+ +
+IpCamDevice ipcam = new B7210("B7210", "114.32.216.24");
+ipcam.setAuth(new IpCamAuth("demo", "demo"));
+ipcam.setSize(B7210.SIZE_QVGA);
+
+IpCamDriver driver = new IpCamDriver();
+driver.register(ipcam);
+
+Webcam.setDriver(driver);
+
+WebcamPanel panel = new WebcamPanel(Webcam.getDefault());
+panel.setFPS(0.5); // 1 frame per 2 seconds
+
+JFrame f = new JFrame("Night Tree Somewhere");
+f.add(panel);
+f.pack();
+f.setVisible(true);
+f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+ +More IP / network camera examples are available in Github project's page. + + +

Logging

+ +

Logging (Logback via SLF4J) is already there, so you can enable it simply by adding +logback.xml configuration file somewhere in your filesystem and calling: +

+ +
+WebcamLogConfigurator.configure("path/to/logback.xml");
+
+ + +

Want More?

+ +

+There are more examples available in src/example, don't forget to +check them - please follow to the Github Project's Page where Webcam Capture +source code is stored! +

+ + + +

License

+ +

Copyright (C) 2012 Bartosz Firyn

+

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ + + +
+ +
+ + + + + \ No newline at end of file diff --git a/webcam-capture-pages/src/site/javascripts/main.js b/webcam-capture-pages/src/site/javascripts/main.js new file mode 100644 index 00000000..c57e54c3 --- /dev/null +++ b/webcam-capture-pages/src/site/javascripts/main.js @@ -0,0 +1,53 @@ +var sectionHeight = function() { + var total = $(window).height(), + $section = $('section').css('height','auto'); + + if ($section.outerHeight(true) < total) { + var margin = $section.outerHeight(true) - $section.height(); + $section.height(total - margin - 20); + } else { + $section.css('height','auto'); + } +} + +$(window).resize(sectionHeight); + +$(document).ready(function(){ + $("section h1, section h2").each(function(){ + $("nav ul").append("
  • " + $(this).text() + "
  • "); + $(this).attr("id",$(this).text().toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g,'')); + $("nav ul li:first-child a").parent().addClass("active"); + }); + + $("nav ul li").on("click", "a", function(event) { + var position = $($(this).attr("href")).offset().top - 190; + $("html, body").animate({scrollTop: position}, 400); + $("nav ul li a").parent().removeClass("active"); + $(this).parent().addClass("active"); + event.preventDefault(); + }); + + sectionHeight(); + + $('img').load(sectionHeight); +}); + +fixScale = function(doc) { + + var addEvent = 'addEventListener', + type = 'gesturestart', + qsa = 'querySelectorAll', + scales = [1, 1], + meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; + + function fix() { + meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; + doc.removeEventListener(type, fix, true); + } + + if ((meta = meta[meta.length - 1]) && addEvent in doc) { + fix(); + scales = [.25, 1.6]; + doc[addEvent](type, fix, true); + } +}; \ No newline at end of file diff --git a/webcam-capture-pages/src/site/stylesheets/normalize.css b/webcam-capture-pages/src/site/stylesheets/normalize.css new file mode 100644 index 00000000..bc2ba932 --- /dev/null +++ b/webcam-capture-pages/src/site/stylesheets/normalize.css @@ -0,0 +1,459 @@ +/* normalize.css 2012-02-07T12:37 UTC - http://github.com/necolas/normalize.css */ +/* ============================================================================= + HTML5 display definitions + ========================================================================== */ +/* + * Corrects block display not defined in IE6/7/8/9 & FF3 + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +/* + * Corrects inline-block display not defined in IE6/7/8/9 & FF3 + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* + * Prevents modern browsers from displaying 'audio' without controls + */ +audio:not([controls]) { + display: none; +} + +/* + * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 + * Known issue: no IE6 support + */ +[hidden] { + display: none; +} + +/* ============================================================================= + Base + ========================================================================== */ +/* + * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units + * http://clagnut.com/blog/348/#c790 + * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom + * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ + */ +html { + font-size: 100%; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 2 */ +} + +/* + * Addresses font-family inconsistency between 'textarea' and other form elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/* + * Addresses margins handled incorrectly in IE6/7 + */ +body { + margin: 0; +} + +/* ============================================================================= + Links + ========================================================================== */ +/* + * Addresses outline displayed oddly in Chrome + */ +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers + * people.opera.com/patrickl/experiments/keyboard/test + */ +a:hover, +a:active { + outline: 0; +} + +/* ============================================================================= + Typography + ========================================================================== */ +/* + * Addresses font sizes and margins set differently in IE6/7 + * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.75em; + margin: 2.33em 0; +} + +/* + * Addresses styling not present in IE7/8/9, S5, Chrome + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to 'bolder' in FF3+, S4/5, Chrome +*/ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/* + * Addresses styling not present in S5, Chrome + */ +dfn { + font-style: italic; +} + +/* + * Addresses styling not present in IE6/7/8/9 + */ +mark { + background: #ff0; + color: #000; +} + +/* + * Addresses margins set differently in IE6/7 + */ +p, +pre { + margin: 1em 0; +} + +/* + * Corrects font family set oddly in IE6, S4/5, Chrome + * en.wikipedia.org/wiki/User:Davidgothberg/Test59 + */ +pre, +code, +kbd, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/* + * 1. Addresses CSS quotes not supported in IE6/7 + * 2. Addresses quote property not supported in S4 + */ +/* 1 */ +q { + quotes: none; +} + +/* 2 */ +q:before, +q:after { + content: ''; + content: none; +} + +small { + font-size: 75%; +} + +/* + * Prevents sub and sup affecting line-height in all browsers + * gist.github.com/413930 + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ============================================================================= + Lists + ========================================================================== */ +/* + * Addresses margins set differently in IE6/7 + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/* + * Addresses paddings set differently in IE6/7 + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/* + * Corrects list images handled incorrectly in IE7 + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ============================================================================= + Embedded content + ========================================================================== */ +/* + * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 + * 2. Improves image quality when scaled in IE7 + * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/* + * Corrects overflow displayed oddly in IE9 + */ +svg:not(:root) { + overflow: hidden; +} + +/* ============================================================================= + Figures + ========================================================================== */ +/* + * Addresses margin not present in IE6/7/8/9, S5, O11 + */ +figure { + margin: 0; +} + +/* ============================================================================= + Forms + ========================================================================== */ +/* + * Corrects margin displayed oddly in IE6/7 + */ +form { + margin: 0; +} + +/* + * Define consistent border, margin, and padding + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE6/7/8/9 + * 2. Corrects text not wrapping in FF3 + * 3. Corrects alignment displayed oddly in IE6/7 + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/* + * 1. Corrects font size not being inherited in all browsers + * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome + * 3. Improves appearance and consistency in all browsers + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/* + * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet + */ +button, +input { + line-height: normal; + /* 1 */ +} + +/* + * 1. Improves usability and consistency of cursor style between image-type 'input' and others + * 2. Corrects inability to style clickable 'input' types in iOS + * 3. Removes inner spacing in IE7 without affecting normal text inputs + * Known issue: inner spacing remains in IE6 + */ +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + /* 1 */ + -webkit-appearance: button; + /* 2 */ + *overflow: visible; + /* 3 */ +} + +/* + * Re-set default cursor for disabled elements + */ +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to content-box in IE8/9 + * 2. Removes excess padding in IE8/9 + * 3. Removes excess padding in IE7 + Known issue: excess padding remains in IE6 + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/* + * 1. Addresses appearance set to searchfield in S5, Chrome + * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in S5, Chrome on OS X + */ +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in FF3+ + * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE6/7/8/9 + * 2. Improves readability and alignment in all browsers + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ============================================================================= + Tables + ========================================================================== */ +/* + * Remove most spacing between table cells + */ +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/webcam-capture-pages/src/site/stylesheets/pygment_trac.css b/webcam-capture-pages/src/site/stylesheets/pygment_trac.css new file mode 100644 index 00000000..62fd970d --- /dev/null +++ b/webcam-capture-pages/src/site/stylesheets/pygment_trac.css @@ -0,0 +1,70 @@ +.highlight .hll { background-color: #404040 } +.highlight { color: #d0d0d0 } +.highlight .c { color: #999999; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .g { color: #d0d0d0 } /* Generic */ +.highlight .k { color: #6ab825; font-weight: normal } /* Keyword */ +.highlight .l { color: #d0d0d0 } /* Literal */ +.highlight .n { color: #d0d0d0 } /* Name */ +.highlight .o { color: #d0d0d0 } /* Operator */ +.highlight .x { color: #d0d0d0 } /* Other */ +.highlight .p { color: #d0d0d0 } /* Punctuation */ +.highlight .cm { color: #999999; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #cd2828; font-weight: normal } /* Comment.Preproc */ +.highlight .c1 { color: #999999; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #e50808; font-weight: normal; background-color: #520000 } /* Comment.Special */ +.highlight .gd { color: #d22323 } /* Generic.Deleted */ +.highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #d22323 } /* Generic.Error */ +.highlight .gh { color: #ffffff; font-weight: normal } /* Generic.Heading */ +.highlight .gi { color: #589819 } /* Generic.Inserted */ +.highlight .go { color: #cccccc } /* Generic.Output */ +.highlight .gp { color: #aaaaaa } /* Generic.Prompt */ +.highlight .gs { color: #d0d0d0; font-weight: normal } /* Generic.Strong */ +.highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */ +.highlight .gt { color: #d22323 } /* Generic.Traceback */ +.highlight .kc { color: #6ab825; font-weight: normal } /* Keyword.Constant */ +.highlight .kd { color: #6ab825; font-weight: normal } /* Keyword.Declaration */ +.highlight .kn { color: #6ab825; font-weight: normal } /* Keyword.Namespace */ +.highlight .kp { color: #6ab825 } /* Keyword.Pseudo */ +.highlight .kr { color: #6ab825; font-weight: normal } /* Keyword.Reserved */ +.highlight .kt { color: #6ab825; font-weight: normal } /* Keyword.Type */ +.highlight .ld { color: #d0d0d0 } /* Literal.Date */ +.highlight .m { color: #3677a9 } /* Literal.Number */ +.highlight .s { color: #ff8 } /* Literal.String */ +.highlight .na { color: #bbbbbb } /* Name.Attribute */ +.highlight .nb { color: #24909d } /* Name.Builtin */ +.highlight .nc { color: #447fcf; text-decoration: underline } /* Name.Class */ +.highlight .no { color: #40ffff } /* Name.Constant */ +.highlight .nd { color: #ffa500 } /* Name.Decorator */ +.highlight .ni { color: #d0d0d0 } /* Name.Entity */ +.highlight .ne { color: #bbbbbb } /* Name.Exception */ +.highlight .nf { color: #447fcf } /* Name.Function */ +.highlight .nl { color: #d0d0d0 } /* Name.Label */ +.highlight .nn { color: #447fcf; text-decoration: underline } /* Name.Namespace */ +.highlight .nx { color: #d0d0d0 } /* Name.Other */ +.highlight .py { color: #d0d0d0 } /* Name.Property */ +.highlight .nt { color: #6ab825;} /* Name.Tag */ +.highlight .nv { color: #40ffff } /* Name.Variable */ +.highlight .ow { color: #6ab825; font-weight: normal } /* Operator.Word */ +.highlight .w { color: #666666 } /* Text.Whitespace */ +.highlight .mf { color: #3677a9 } /* Literal.Number.Float */ +.highlight .mh { color: #3677a9 } /* Literal.Number.Hex */ +.highlight .mi { color: #3677a9 } /* Literal.Number.Integer */ +.highlight .mo { color: #3677a9 } /* Literal.Number.Oct */ +.highlight .sb { color: #ff8 } /* Literal.String.Backtick */ +.highlight .sc { color: #ff8 } /* Literal.String.Char */ +.highlight .sd { color: #ff8 } /* Literal.String.Doc */ +.highlight .s2 { color: #ff8 } /* Literal.String.Double */ +.highlight .se { color: #ff8 } /* Literal.String.Escape */ +.highlight .sh { color: #ff8 } /* Literal.String.Heredoc */ +.highlight .si { color: #ff8 } /* Literal.String.Interpol */ +.highlight .sx { color: #ffa500 } /* Literal.String.Other */ +.highlight .sr { color: #ff8 } /* Literal.String.Regex */ +.highlight .s1 { color: #ff8 } /* Literal.String.Single */ +.highlight .ss { color: #ff8 } /* Literal.String.Symbol */ +.highlight .bp { color: #24909d } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #40ffff } /* Name.Variable.Class */ +.highlight .vg { color: #40ffff } /* Name.Variable.Global */ +.highlight .vi { color: #40ffff } /* Name.Variable.Instance */ +.highlight .il { color: #3677a9 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/webcam-capture-pages/src/site/stylesheets/styles.css b/webcam-capture-pages/src/site/stylesheets/styles.css new file mode 100644 index 00000000..a5ad53a4 --- /dev/null +++ b/webcam-capture-pages/src/site/stylesheets/styles.css @@ -0,0 +1,1021 @@ + +@import url(http://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400italic,700,700italic); +@import url(http://fonts.googleapis.com/css?family=Copse); + +/* +Leap Day for Github Pages +by Matt Graham +*/ + +/* normalize.css 2012-02-07T12:37 UTC - http://github.com/necolas/normalize.css */ +/* ============================================================================= + HTML5 display definitions + ========================================================================== */ +/* + * Corrects block display not defined in IE6/7/8/9 & FF3 + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +/* + * Corrects inline-block display not defined in IE6/7/8/9 & FF3 + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* + * Prevents modern browsers from displaying 'audio' without controls + */ +audio:not([controls]) { + display: none; +} + +/* + * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 + * Known issue: no IE6 support + */ +[hidden] { + display: none; +} + +/* ============================================================================= + Base + ========================================================================== */ +/* + * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units + * http://clagnut.com/blog/348/#c790 + * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom + * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ + */ +html { + font-size: 100%; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 2 */ +} + +/* + * Addresses font-family inconsistency between 'textarea' and other form elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/* + * Addresses margins handled incorrectly in IE6/7 + */ +body { + margin: 0; +} + +/* ============================================================================= + Links + ========================================================================== */ +/* + * Addresses outline displayed oddly in Chrome + */ +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers + * people.opera.com/patrickl/experiments/keyboard/test + */ +a:hover, +a:active { + outline: 0; +} + +/* ============================================================================= + Typography + ========================================================================== */ +/* + * Addresses font sizes and margins set differently in IE6/7 + * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.75em; + margin: 2.33em 0; +} + +/* + * Addresses styling not present in IE7/8/9, S5, Chrome + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to 'bolder' in FF3+, S4/5, Chrome +*/ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/* + * Addresses styling not present in S5, Chrome + */ +dfn { + font-style: italic; +} + +/* + * Addresses styling not present in IE6/7/8/9 + */ +mark { + background: #ff0; + color: #000; +} + +/* + * Addresses margins set differently in IE6/7 + */ +p, +pre { + margin: 1em 0; +} + +/* + * Corrects font family set oddly in IE6, S4/5, Chrome + * en.wikipedia.org/wiki/User:Davidgothberg/Test59 + */ +pre, +code, +kbd, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +pre.prettyprint { + font-size: 12px; + line-height: 1em; +} + +/* + * 1. Addresses CSS quotes not supported in IE6/7 + * 2. Addresses quote property not supported in S4 + */ +/* 1 */ +q { + quotes: none; +} + +/* 2 */ +q:before, +q:after { + content: ''; + content: none; +} + +small { + font-size: 75%; +} + +/* + * Prevents sub and sup affecting line-height in all browsers + * gist.github.com/413930 + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ============================================================================= + Lists + ========================================================================== */ +/* + * Addresses margins set differently in IE6/7 + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/* + * Addresses paddings set differently in IE6/7 + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/* + * Corrects list images handled incorrectly in IE7 + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ============================================================================= + Embedded content + ========================================================================== */ +/* + * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 + * 2. Improves image quality when scaled in IE7 + * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/* + * Corrects overflow displayed oddly in IE9 + */ +svg:not(:root) { + overflow: hidden; +} + +/* ============================================================================= + Figures + ========================================================================== */ +/* + * Addresses margin not present in IE6/7/8/9, S5, O11 + */ +figure { + margin: 0; +} + +/* ============================================================================= + Forms + ========================================================================== */ +/* + * Corrects margin displayed oddly in IE6/7 + */ +form { + margin: 0; +} + +/* + * Define consistent border, margin, and padding + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE6/7/8/9 + * 2. Corrects text not wrapping in FF3 + * 3. Corrects alignment displayed oddly in IE6/7 + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/* + * 1. Corrects font size not being inherited in all browsers + * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome + * 3. Improves appearance and consistency in all browsers + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/* + * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet + */ +button, +input { + line-height: normal; + /* 1 */ +} + +/* + * 1. Improves usability and consistency of cursor style between image-type 'input' and others + * 2. Corrects inability to style clickable 'input' types in iOS + * 3. Removes inner spacing in IE7 without affecting normal text inputs + * Known issue: inner spacing remains in IE6 + */ +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + /* 1 */ + -webkit-appearance: button; + /* 2 */ + *overflow: visible; + /* 3 */ +} + +/* + * Re-set default cursor for disabled elements + */ +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to content-box in IE8/9 + * 2. Removes excess padding in IE8/9 + * 3. Removes excess padding in IE7 + Known issue: excess padding remains in IE6 + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/* + * 1. Addresses appearance set to searchfield in S5, Chrome + * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in S5, Chrome on OS X + */ +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in FF3+ + * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE6/7/8/9 + * 2. Improves readability and alignment in all browsers + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ============================================================================= + Tables + ========================================================================== */ +/* + * Remove most spacing between table cells + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +body { + font: 14px/22px "Quattrocento Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #666; + font-weight: 300; + margin: 0px; + padding: 0px 0 20px 0px; + background: url(../images/body-background.png) #eae6d1; +} + +h1, h2, h3, h4, h5, h6 { + color: #333; + margin: 0 0 10px; +} + +p, ul, ol, table, pre, dl { + margin: 0 0 20px; +} + +h1, h2, h3 { + line-height: 1.1; +} + +h1 { + font-size: 28px; +} + +h2 { + font-size: 24px; + color: #393939; +} + +h3, h4, h5, h6 { + color: #666666; +} + +h3 { + font-size: 18px; + line-height: 24px; +} + +a { + color: #3399cc; + font-weight: 400; + text-decoration: none; +} + +a small { + font-size: 11px; + color: #666; + margin-top: -0.6em; + display: block; +} + +ul { + list-style-image: url("../images/bullet.png"); +} + +strong { + font-weight: bold; + color: #333; +} + +.wrapper { + width: 650px; + margin: 0 auto; + position: relative; +} + +section img { + max-width: 100%; +} + +blockquote { + border-left: 1px solid #ffcc00; + margin: 0; + padding: 0 0 0 20px; + font-style: italic; +} + +pre > code { + font-family: "Lucida Sans", Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; + font-size: 13px; + color: #efefef; + text-shadow: 0px 1px 0px #000; + margin: 0 4px; + padding: 2px 6px; + background: #333; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} + +p > code { + background: none repeat scroll 0 0 #FFFFCC; + border-color: #999999; + border-radius: 2px 2px 2px 2px; + border-style: dotted; + border-width: 1px; + color: #333333; + font-family: "Lucida Sans",Monaco,Bitstream Vera Sans Mono,Lucida Console,Terminal; + font-size: 75%; + padding-left: 3px; + padding-right: 3px; +} + +pre { + padding: 8px 15px; + background: #333333; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -o-border-radius: 3px; + -ms-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px; + border: 1px solid #c7c7c7; + overflow: auto; + overflow-y: hidden; +} +pre code { + margin: 0px; + padding: 0px; +} + +table { + width: 100%; + border-collapse: collapse; +} + +th { + text-align: left; + padding: 5px 10px; + border-bottom: 1px solid #e5e5e5; + color: #444; +} + +td { + text-align: left; + padding: 5px 10px; + border-bottom: 1px solid #e5e5e5; + border-right: 1px solid #ffcc00; +} +td:first-child { + border-left: 1px solid #ffcc00; +} + +hr { + border: 0; + outline: none; + height: 11px; + background: transparent url("../images/hr.gif") center center repeat-x; + margin: 0 0 20px; +} + +dt { + color: #444; + font-weight: 700; +} + +header { + padding-top: 5px; + padding-bottom: 32px; + margin: 0; + position: fixed; + top: 0; + left: 0; + right: 0; + width: 100%; + text-align: center; + background: url(../images/background.png) #4276b6; + -moz-box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + -webkit-box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + -o-box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + z-index: 99; + -webkit-font-smoothing: antialiased; + min-height: 76px; +} +header h1 { + font: 40px/48px "Copse", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #f3f3f3; + text-shadow: 0px 2px 0px #235796; + margin: 0px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; +} +header p { + color: #d8d8d8; + text-shadow: rgba(0, 0, 0, 0.2) 0 1px 0; + font-size: 18px; + margin: 0px; +} + +#banner { + z-index: 100; + left: 0; + right: 50%; + height: 50px; + margin-right: -438px; + position: fixed; + top: 86px; + background: #ffcc00; + border: 1px solid #f0b500; + -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -o-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -moz-border-radius: 0px 2px 2px 0px; + -webkit-border-radius: 0px 2px 2px 0px; + -o-border-radius: 0px 2px 2px 0px; + -ms-border-radius: 0px 2px 2px 0px; + -khtml-border-radius: 0px 2px 2px 0px; + border-radius: 0px 2px 2px 0px; + padding-right: 10px; +} +#banner .button { + border: 1px solid #dba500; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffe788), color-stop(100%, #ffce38)); + background: -webkit-linear-gradient(#ffe788, #ffce38); + background: -moz-linear-gradient(#ffe788, #ffce38); + background: -o-linear-gradient(#ffe788, #ffce38); + background: -ms-linear-gradient(#ffe788, #ffce38); + background: linear-gradient(#ffe788, #ffce38); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; + -moz-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + -o-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + background-color: #FFE788; + margin-left: 5px; + padding: 10px 12px; + margin-top: 6px; + line-height: 14px; + font-size: 14px; + color: #333; + font-weight: bold; + display: inline-block; + text-align: center; +} +#banner .button:hover { + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffe788), color-stop(100%, #ffe788)); + background: -webkit-linear-gradient(#ffe788, #ffe788); + background: -moz-linear-gradient(#ffe788, #ffe788); + background: -o-linear-gradient(#ffe788, #ffe788); + background: -ms-linear-gradient(#ffe788, #ffe788); + background: linear-gradient(#ffe788, #ffe788); + background-color: #ffeca0; +} +#banner .fork { + position: fixed; + left: 50%; + margin-left: -325px; + padding: 10px 12px; + margin-top: 6px; + line-height: 14px; + font-size: 14px; + background-color: #FFE788; +} +#banner .downloads { + float: right; + margin: 0 45px 0 0; +} +#banner .downloads span { + float: left; + line-height: 52px; + font-size: 90%; + color: #9d7f0d; + text-transform: uppercase; + text-shadow: rgba(255, 255, 255, 0.2) 0 1px 0; +} +#banner ul { + list-style: none; + height: 40px; + padding: 0; + float: left; + margin-left: 10px; +} +#banner ul li { + display: inline; +} +#banner ul li a.button { + background-color: #FFE788; +} +#banner #logo { + position: absolute; + height: 36px; + width: 36px; + right: 7px; + top: 7px; + display: block; + background: url(../images/octocat-logo.png); +} + +section { + width: 645px; + padding: 30px 30px 50px 30px; + margin: 20px 0; + margin-top: 146px; + position: relative; + background: #fbfbfb; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -o-border-radius: 3px; + -ms-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px; + border: 1px solid #cbcbcb; + -moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); + -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); + -o-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); +} + +small { + font-size: 12px; +} + +nav { + width: 230px; + position: fixed; + top: 182px; + left: 50%; + margin-left: -580px; + text-align: right; +} +nav ul { + list-style: none; + list-style-image: none; + font-size: 14px; + line-height: 24px; +} +nav ul li { + padding: 5px 0px; + line-height: 16px; +} +nav ul li.tag-h1 { + font-size: 1.2em; +} +nav ul li.tag-h1 a { + font-weight: bold; + color: #333; +} +nav ul li.tag-h2 + .tag-h1 { + margin-top: 10px; +} +nav ul a { + color: #666; +} +nav ul a:hover { + color: #999; +} + +footer { + width: 180px; + position: fixed; + left: 50%; + margin-left: -530px; + bottom: 20px; + text-align: right; + line-height: 16px; +} + +@media print, screen and (max-width: 1060px) { + div.wrapper { + width: auto; + margin: 0; + } + + nav { + display: none; + } + + header, section, footer { + float: none; + } + header h1, section h1, footer h1 { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + } + + #banner { + width: 100%; + } + #banner .downloads { + margin-right: 60px; + } + #banner #logo { + margin-right: 15px; + } + + section { + border: 1px solid #e5e5e5; + border-width: 1px 0; + padding: 20px auto; + margin: 190px auto 20px; + max-width: 600px; + } + + footer { + text-align: center; + margin: 20px auto; + position: relative; + left: auto; + bottom: auto; + width: auto; + } +} +@media print, screen and (max-width: 720px) { + body { + word-wrap: break-word; + } + + header { + padding: 20px 20px; + margin: 0; + } + header h1 { + font-size: 32px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + } + header p { + display: none; + } + + #banner { + top: 80px; + } + #banner .fork { + float: left; + display: inline-block; + margin-left: 0px; + position: fixed; + left: 20px; + } + + section { + margin-top: 130px; + margin-bottom: 0px; + width: auto; + } + + header ul, header p.view { + position: static; + } +} +@media print, screen and (max-width: 480px) { + header { + position: relative; + padding: 5px 0px; + min-height: 0px; + } + header h1 { + font-size: 24px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + } + + section { + margin-top: 5px; + } + + #banner { + display: none; + } + + header ul { + display: none; + } +} +@media print { + body { + padding: 0.4in; + font-size: 12pt; + color: #444; + } +} +@media print, screen and (max-height: 680px) { + footer { + text-align: center; + margin: 20px auto; + position: relative; + left: auto; + bottom: auto; + width: auto; + } +} +@media print, screen and (max-height: 480px) { + nav { + display: none; + } + + footer { + text-align: center; + margin: 20px auto; + position: relative; + left: auto; + bottom: auto; + width: auto; + } +} + +#commits > ul { + margin-left: -40px; + line-height: 1em; +} + +#commits .gh_commit a { + margin-top: 0; + line-height: 1em; +} + +#commits .gh_commit .push h4, +#commits .gh_commit .push h5 { + margin: 0; + padding: 0; + line-height: 1em; +} + +#commits .gh_commit pre { + display: block; + margin-top: 10px; + margin-bottom: 0; + padding: 2px; + background-color: #FFC; + width: auto; + padding-left: 5px; +} diff --git a/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/DefaultDevice.java b/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/DefaultDevice.java deleted file mode 100644 index 233cce90..00000000 --- a/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/DefaultDevice.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.github.sarxos.webcam.ds.buildin; - -import java.awt.Dimension; -import java.awt.Transparency; -import java.awt.color.ColorSpace; -import java.awt.image.BufferedImage; -import java.awt.image.ColorModel; -import java.awt.image.ComponentColorModel; -import java.awt.image.ComponentSampleModel; -import java.awt.image.DataBuffer; -import java.awt.image.DataBufferByte; -import java.awt.image.Raster; -import java.awt.image.WritableRaster; - -import org.bridj.Pointer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.github.sarxos.webcam.WebcamDevice; -import com.github.sarxos.webcam.WebcamException; -import com.github.sarxos.webcam.ds.buildin.natives.Device; -import com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber; - - -public class DefaultDevice implements WebcamDevice { - - private static final Logger LOG = LoggerFactory.getLogger(DefaultDevice.class); - - /** - * Artificial view sizes. I'm really not sure if will fit into other webcams - * but hope that OpenIMAJ can handle this. - */ - //@formatter:off - private final static Dimension[] DIMENSIONS = new Dimension[] { - new Dimension(176, 144), - new Dimension(320, 240), - new Dimension(352, 288), - new Dimension(640, 400), - new Dimension(640, 480), - }; - //@formatter:on - - private static final int[] BAND_OFFSETS = new int[] { 0, 1, 2 }; - private static final int[] BITS = { 8, 8, 8 }; - private static final int[] OFFSET = new int[] { 0 }; - private static final int DATA_TYPE = DataBuffer.TYPE_BYTE; - - private static final ColorSpace COLOR_SPACE = ColorSpace.getInstance(ColorSpace.CS_sRGB); - - private OpenIMAJGrabber grabber = null; - private Device device = null; - private Dimension size = null; - private ComponentSampleModel sampleModel = null; - private ColorModel colorModel = null; - private volatile boolean open = false; - - protected DefaultDevice(Device device) { - this.device = device; - } - - @Override - public String getName() { - return device.getNameStr() + " " + device.getIdentifierStr(); - } - - @Override - public Dimension[] getSizes() { - return DIMENSIONS; - } - - @Override - public Dimension getSize() { - return size; - } - - @Override - public void setSize(Dimension size) { - this.size = size; - } - - @Override - public BufferedImage getImage() { - - if (!open) { - throw new WebcamException("Cannot get image when webcam device is not open"); - } - - grabber.nextFrame(); - - Pointer image = grabber.getImage(); - if (image == null) { - return null; - } - - byte[] bytes = image.getBytes(size.width * size.height * 3); - byte[][] data = new byte[][] { bytes }; - - DataBufferByte buffer = new DataBufferByte(data, bytes.length, OFFSET); - WritableRaster raster = Raster.createWritableRaster(sampleModel, buffer, null); - - BufferedImage bi = new BufferedImage(colorModel, raster, false, null); - bi.flush(); - - return bi; - } - - @Override - public synchronized void open() { - - if (open) { - return; - } - - if (size == null) { - size = getSizes()[0]; - } - - grabber = new OpenIMAJGrabber(); - - boolean started = grabber.startSession(size.width, size.height, 0, Pointer.pointerTo(device)); - if (!started) { - throw new WebcamException("Cannot start video data grabber!"); - } - - int w1 = size.width; - int w2 = grabber.getWidth(); - int h1 = size.height; - int h2 = grabber.getHeight(); - - if (w1 != w2 || h1 != h2) { - LOG.warn("Different size obtained vs requested - [" + w1 + "x" + h1 + "] vs [" + w2 + "x" + h2 + "]. Setting correct one. New size is [" + w2 + "x" + h2 + "]"); - size = new Dimension(w2, h2); - } - - sampleModel = new ComponentSampleModel(DATA_TYPE, size.width, size.height, 3, size.width * 3, BAND_OFFSETS); - colorModel = new ComponentColorModel(COLOR_SPACE, BITS, false, false, Transparency.OPAQUE, DATA_TYPE); - - int i = 0; - do { - grabber.nextFrame(); - grabber.getImage(); - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - LOG.error("Nasty interrupted exception", e); - } - } while (i++ < 3); - - open = true; - } - - @Override - public void close() { - - if (!open) { - return; - } - - grabber.stopSession(); - open = false; - } - -} diff --git a/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/DefaultDriver.java b/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/DefaultDriver.java deleted file mode 100644 index 488da4b1..00000000 --- a/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/DefaultDriver.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.github.sarxos.webcam.ds.buildin; - -import java.util.ArrayList; -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.github.sarxos.webcam.WebcamDevice; -import com.github.sarxos.webcam.WebcamDriver; -import com.github.sarxos.webcam.ds.buildin.natives.Device; -import com.github.sarxos.webcam.ds.buildin.natives.DeviceList; -import com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber; - - -/** - * Default build-in webcam driver based on natives from OpenIMAJ framework. It - * can be widely used on various systems - Mac OS X, Linux (x86, x64, 32-bit - * ARM), Windows (win32, win64). - * - * @author Bartosz Firyn (SarXos) - */ -public class DefaultDriver implements WebcamDriver { - - private static final Logger LOG = LoggerFactory.getLogger(DefaultDriver.class); - - private static OpenIMAJGrabber grabber = null; - private static List devices = null; - - @Override - public List getDevices() { - - if (grabber == null) { - LOG.debug("Creating grabber"); - grabber = new OpenIMAJGrabber(); - } - - if (devices == null) { - - LOG.debug("Searching devices"); - - devices = new ArrayList(); - - DeviceList list = grabber.getVideoDevices().get(); - for (Device device : list.asArrayList()) { - - if (device == null) { - LOG.error("Native discovery problem! Null device detected by grabber!"); - continue; - } - - devices.add(new DefaultDevice(device)); - } - - if (LOG.isDebugEnabled()) { - for (WebcamDevice device : devices) { - LOG.debug("Found device {}", device); - } - } - } - - return devices; - } -}