TheDesk Riina (ver.3)

This commit is contained in:
cutls
2018-02-19 02:41:25 +09:00
parent 0ada3a03b0
commit 7a1c6ea17c
997 changed files with 161887 additions and 34 deletions

BIN
app/node_modules/jimp/browser/examples/dice.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

24
app/node_modules/jimp/browser/examples/example1.html generated vendored Normal file
View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Jimp browser example 1</title>
</head>
<body>
<!-- Demonstrates loading a local file using Jimp on the main thread -->
<script src="../lib/jimp.min.js"></script>
<script>
Jimp.read("https://upload.wikimedia.org/wikipedia/commons/0/01/Bot-Test.jpg").then(function (lenna) {
lenna.resize(256, Jimp.AUTO) // resize
.quality(60) // set JPEG quality
.greyscale() // set greyscale
.getBase64(Jimp.AUTO, function (err, src) {
var img = document.createElement("img");
img.setAttribute("src", src);
document.body.appendChild(img);
});
});
</script>
</body>
</html>

20
app/node_modules/jimp/browser/examples/example2.html generated vendored Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Jimp browser example 2</title>
</head>
<body>
<!-- Demonstrates loading a relative file using Jimp on a WebWorker thread -->
<script>
var worker = new Worker("jimp-worker.js");
worker.onmessage = function (e) {
var img = document.createElement("img");
img.setAttribute("src", e.data);
document.body.appendChild(img);
};
worker.postMessage("lenna.png");
</script>
</body>
</html>

35
app/node_modules/jimp/browser/examples/example3.html generated vendored Normal file
View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Jimp browser example 3</title>
</head>
<body>
<!-- Demonstrates loading a local file using Jimp on a WebWorker thread -->
<p><input type="file" onchange="newFiles(this);" /></p>
<script>
function newFiles(element){
for (var i=0; i<element.files.length; i++) {
readFileAndProcess(element.files[i]);
}
function readFileAndProcess(readfile){
var reader = new FileReader();
reader.addEventListener("load", function(){
var worker = new Worker("jimp-worker.js");
worker.onmessage = function (e) {
var img = document.createElement("img");
img.setAttribute("src", e.data);
document.body.appendChild(img);
};
worker.postMessage(this.result);
});
reader.readAsArrayBuffer(readfile);
}
}
</script>
</body>
</html>

13
app/node_modules/jimp/browser/examples/jimp-worker.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
importScripts("../lib/jimp.min.js");
self.addEventListener("message", function(e) {
Jimp.read(e.data).then(function (lenna) {
lenna.resize(256, Jimp.AUTO) // resize
.quality(60) // set JPEG quality
.greyscale() // set greyscale
.getBase64(Jimp.AUTO, function (err, src) {
self.postMessage(src);
self.close();
});
});
});

BIN
app/node_modules/jimp/browser/examples/lenna.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 KiB

43
app/node_modules/jimp/browser/examples/test.html generated vendored Normal file
View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title>Jimp browser example 1</title>
</head>
<body>
<!-- Demonstrates loading a local file using Jimp on the main thread -->
<script src="../lib/jimp.min.js"></script>
<script>
function dropShadow(x, y, b, a) {
var img = new Jimp(this.bitmap.width + Math.abs(x*2) + (b*2), this.bitmap.height + Math.abs(y*2) + (b*2));
var orig = this.clone();
this.scan(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data[ idx + 0 ] = 0;
this.bitmap.data[ idx + 1 ] = 0;
this.bitmap.data[ idx + 2 ] = 0;
this.bitmap.data[ idx + 3 ] = this.bitmap.data[ idx + 3 ] * a;
});
// this.resize(this.bitmap.width + Math.abs(x) + b, this.bitmap.height + Math.abs(y) + b);
var x1 = Math.max(x * -1, 0) + b;
var y1 = Math.max(y * -1, 0) + b;
img.composite(this, x1, y1);
img.blur(b);
img.composite(orig, x1 - x, y1 - y);
//img.autocrop();
return img;
}
Jimp.read("dice.png").then(function (img) {
console.log(img.getMIME(), img.getExtension());
var img = dropShadow.call(img, 20, 20, 20, 0.3)
img.getBase64(Jimp.AUTO, function (err, src) {
var img = document.createElement("img");
img.setAttribute("src", src);
document.body.appendChild(img);
});
});
</script>
</body>
</html>