Skip to content

Commit

Permalink
Add LICENSE file and update names/URLs
Browse files Browse the repository at this point in the history
* fixes obsolete URLs/naming
* adds standard LICENSE file with the MIT-style text
  * fixes #40
* updats yuv-buffer to 1.0.1
  • Loading branch information
bvibber committed Oct 3, 2024
1 parent acd5e7a commit 29769d4
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 185 deletions.
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>

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.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# YUVCanvas draws YUV video frames to an HTML 5 canvas element.

It is used in the [ogv.js media player](https://github.com/brion/ogv.js)
It is used in the [ogv.js media player](https://github.com/bvibber/ogv.js)
and is suitable for high-frequency frame updates using WebGL for drawing
and colorspace conversion.

## Copyright

Copyright 2014-2023 by Brion Vibber <brion@pobox.com>
Copyright 2014-2024 by Brooke Vibber <bvibber@pobox.com>
MIT license, see the source files:

* Source: https://github.com/brion/yuv-canvas
* Issues: https://github.com/brion/yuv-canvas/issues
* Source: https://github.com/bvibber/yuv-canvas
* Issues: https://github.com/bvibber/yuv-canvas/issues

## Updates

1.3.0 - 2023-02-24
1.3.0 - 2024-10-03

* build cleanup
* doc/name/links cleanup

1.2.11 - 2022-03-04

Expand Down Expand Up @@ -85,7 +86,7 @@ MIT license, see the source files:

## Data format

Planar YUV frames are packed into objects per the [yuv-buffer](https://github.com/brion/yuv-buffer) format. Frame buffer objects can be safely copied or transferred between worker threads, and can be either garbage collected or reused for another frame after output.
Planar YUV frames are packed into objects per the [yuv-buffer](https://github.com/bvibber/yuv-buffer) format. Frame buffer objects can be safely copied or transferred between worker threads, and can be either garbage collected or reused for another frame after output.

Each frame buffer includes the frame's size, a crop rectangle, a display aspect ratio, and chroma subsampling format as well as the raw bytes.

Expand Down Expand Up @@ -134,10 +135,22 @@ yuv.clear();

## Demo

The [included demo](https://brion.github.io/yuv-canvas/demo.html) combines Y, U, and V planes from grayscale JPEGs into a color photograph on a canvas. Check it out!
The [included demo](https://bvibber.github.io/yuv-canvas/demo.html) combines Y, U, and V planes from grayscale JPEGs into a color photograph on a canvas. Check it out!

## Building

Run `npm install` (or `grunt` to rebuild if necessary) to build derived files in a local source checkout.

Derived files are the array of WebGL shaders (`build/shaders.js`) and the bundled JS for the demo (`docs/demo-bundled.js`).

# License

MIT-style license:

Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>

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.
35 changes: 10 additions & 25 deletions docs/demo-bundled.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module.exports = {

},{"./../src/yuv-canvas.js":9,"yuv-buffer":3}],3:[function(require,module,exports){
/*
Copyright (c) 2014-2016 Brion Vibber <brion@pobox.com>
Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>
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
Expand Down Expand Up @@ -257,21 +257,6 @@ var YUVBuffer = {
};
},

/**
* Allocate a new YUVPlane object of the given size.
* @param {number} stride - byte distance between rows
* @param {number} rows - number of rows to allocate
* @returns {YUVPlane} - freshly allocated planar buffer
*/
allocPlane: function(stride, rows) {
YUVBuffer.validateDimension(stride);
YUVBuffer.validateDimension(rows);
return {
bytes: new Uint8Array(stride * rows),
stride: stride
}
},

/**
* Pick a suitable stride for a custom-allocated thingy
* @param {number} width - width in bytes
Expand Down Expand Up @@ -461,7 +446,7 @@ module.exports = YUVBuffer;

},{}],5:[function(require,module,exports){
/*
Copyright (c) 2014-2016 Brion Vibber <brion@pobox.com>
Copyright (c) 2014-20124 Brooke Vibber <bvibber@pobox.com>
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
Expand Down Expand Up @@ -577,7 +562,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

},{"./FrameSink.js":4,"./YCbCr.js":7}],6:[function(require,module,exports){
/*
Copyright (c) 2014-2016 Brion Vibber <brion@pobox.com>
Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>
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
Expand Down Expand Up @@ -1104,7 +1089,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

},{"../build/shaders.js":1,"./FrameSink.js":4}],7:[function(require,module,exports){
/*
Copyright (c) 2014-2019 Brion Vibber <brion@pobox.com>
Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>
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
Expand All @@ -1131,8 +1116,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
* Basic YCbCr->RGB conversion
*
* @author Brion Vibber <brion@pobox.com>
* @copyright 2014-2019
* @author Brooke Vibber <bvibber@pobox.com>
* @copyright 2014-2024
* @license MIT-style
*
* @param {YUVFrame} buffer - input frame buffer
Expand Down Expand Up @@ -1245,7 +1230,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

},{"./depower.js":8}],8:[function(require,module,exports){
/*
Copyright (c) 2014-2016 Brion Vibber <brion@pobox.com>
Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>
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
Expand All @@ -1271,8 +1256,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Convert a ratio into a bit-shift count; for instance a ratio of 2
* becomes a bit-shift of 1, while a ratio of 1 is a bit-shift of 0.
*
* @author Brion Vibber <brion@pobox.com>
* @copyright 2016
* @author Brooke Vibber <bvibber@pobox.com>
* @copyright 2016-2024
* @license MIT-style
*
* @param {number} ratio - the integer ratio to convert.
Expand All @@ -1297,7 +1282,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

},{}],9:[function(require,module,exports){
/*
Copyright (c) 2014-2016 Brion Vibber <brion@pobox.com>
Copyright (c) 2014-2024 Brooke Vibber <bvibber@pobox.com>
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
Expand Down
4 changes: 2 additions & 2 deletions docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>yuv-canvas demo</title>
</head>
<body>
<h1><a href="https://github.com/brion/yuv-canvas">yuv-canvas</a> demo</h1>
<h1><a href="https://github.com/bvibber/yuv-canvas">yuv-canvas</a> demo</h1>

<p>This canvas is drawn from the three planar images below:</p>

Expand Down Expand Up @@ -33,7 +33,7 @@ <h1><a href="https://github.com/brion/yuv-canvas">yuv-canvas</a> demo</h1>
</tr>
</table>

<p>See <a href="https://github.com/brion/yuv-canvas/blob/master/demo/demo.js#L1">source code of this demo</a>.</p>
<p>See <a href="https://github.com/bvibber/yuv-canvas/blob/master/demo/demo.js#L1">source code of this demo</a>.</p>

<script src="demo-bundled.js"></script>
</body>
Expand Down
Loading

0 comments on commit 29769d4

Please sign in to comment.