Permalink
Browse files

Pruning test files out of master branch for an easier-to-understand d…

…ownload
  • Loading branch information...
1 parent bc8137c commit e2f71856ac9d644dd21da21a02b299aee6978358 @mezzoblue committed Sep 20, 2010
View
@@ -1,120 +0,0 @@
-/* --------------------------------------------------
-//
-// style.css
-// Supporting style for the PaintbrushJS demo page
-// (not part of the core PaintbrushJS, safe to delete)
-//
-// This project lives on GitHub:
-// http://github.com/mezzoblue/PaintbrushJS
-//
-// --------------------------------------------------
-*/
-
-body {
- font: italic 13px palatino, georgia, serif;
- margin: 0 50px 50px 50px;
-}
-h1 {
- color: #bbb;
- font-weight: normal;
- font-size: 18px;
- margin: 0;
- padding: 50px 0 10px 5px;
- clear: both;
-}
- h1 a, h1 a:visited {
- color: #999;
- }
-h2 {
- color: #ccc;
- font-weight: normal;
- font-size: 16px;
- margin: 0;
- padding: 50px 0 10px 5px;
- clear: both;
-}
-h3 {
- font-style: normal;
- margin-top: 0;
-}
-ul {
- clear: left;
- margin: 0;
- padding: 0;
-}
- ul.odd {
- padding-top: 20px;
- }
-li {
- margin: 10px 5px 0 5px;
- padding: 0;
- float: left;
- list-style: none;
-}
-img {
- margin: 0;
- line-height: 0;
- vertical-align: bottom;
-}
-figure {
- width: 240px;
- display: block;
- text-align: center;
- background: url(../images/bg.png);
-}
-label {
- display: block;
- margin-bottom: 1em;
-}
-p {
- color: #666;
-}
-figcaption, li p {
- display: block;
- text-align: center;
- color: #666;
- background: #fff;
- padding-top: 10px;
-}
-.tag {
- padding-left: 5px;
-}
-#copyright {
- text-align: left;
- padding-top: 50px;
- clear: both;
-}
-.thumb img {
- cursor: pointer;
-}
-
-
-
-
-/* for debugging */
-canvas {
- display: block;
- padding: 1px;
- border: solid 5px #f00;
-}
-
-
-.bee, .lighthouse, .road, .stones {
- width: 240px;
- padding-top: 160px;
-}
-.bee {
- background: url(../images/240/bee.jpg) no-repeat 0 0;
-}
-.dots {
- background: url(../images/120/dots.png) no-repeat 0 0;
-}
-.lighthouse {
- background: url(../images/240/lighthouse.jpg) no-repeat 0 0;
-}
-.road {
- background: url(../images/240/road.jpg) no-repeat 0 0;
-}
-.stones {
- background: url(../images/240/stones.jpg) no-repeat 0 0;
-}
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
@@ -1,101 +0,0 @@
-//
-//
-//
-// you can pretty much ignore this file
-// it's an alternate take at implementing a convolution matrix and will go away once that's done
-//
-//
-//
-
-
-
-
-
-
- // http://forum.processing.org/topic/controlled-blur-or-edge-detect-effect-using-convolution-kernel
-
-
- case "filter-kernel":
-
- // 3x3 matrix can be any combination of digits, though to maintain brightness they should add up to 1
- // (-1 x 8 + 9 = 1)
- // (write a function to normalize all)
- var matrix = [
-/*
- -1, -1, -1,
- -1, 9, -1,
- -1, -1, -1
-*/
-
- 0, -1, 0,
- -1, 5, -1,
- 0, -1, 0
-
-/*
- 0.111, 0.111, 0.111,
- 0.111, 0.111, 0.111,
- 0.111, 0.111, 0.111
-*/
- ];
- matrix = normalizeMatrix(matrix);
-
-
- // index, prevRow, nextRow = scale 4
- // imgwidth = scale 1
- var prevRow = index - (imgWidth - 1) * 4;
- var nextRow = index + (imgWidth + 1) * 4;
-
- tempR = applyMatrix(data, matrix, index, prevRow, nextRow);
- tempG = applyMatrix(data, matrix, index + 1, prevRow, nextRow);
- tempB = applyMatrix(data, matrix, index + 2, prevRow, nextRow);
-
- data = setRGB(data, index,
- findColorDifference(params.kernelAmount, tempR, thisPixel.r),
- findColorDifference(params.kernelAmount, tempG, thisPixel.g),
- findColorDifference(params.kernelAmount, tempB, thisPixel.b));
- break;
-
-
-
-
-
-
-
-
-
-
- function applyMatrix(data, matrix, index, prevRow, nextRow) {
-/* console.log(matrix); */
- var temp = (
- data[prevRow - 4] * matrix[0] + data[prevRow] * matrix[1] + data[prevRow + 4] * matrix[2] +
- data[index - 4] * matrix[3] + data[index] * matrix[4] + data[index + 4] * matrix[5] +
- data[nextRow - 4] * matrix[6] + data[nextRow] * matrix[7] + data[nextRow + 4] * matrix[8]
- );
- return temp;
- }
-
-
-
- function normalizeMatrix(matrix) {
- console.log(matrix[4]);
- for (var i = 0, j = 0; i < matrix.length; i++) {
- j += matrix[i];
- }
- for (var i = 0; i < matrix.length; i++) {
- matrix[i] /= j;
- }
- console.log(matrix[4]);
- return matrix;
- }
-
-/*
- function normalizeKernel( ar ) {
- for (var i = 0, n = 0; i < ar.length; i++)
- n += ar[i];
- for (var i = 0; i < ar.length; i++)
- ar[i] /= n;
-
- return ar;
- }
-*/
-
Oops, something went wrong.

0 comments on commit e2f7185

Please sign in to comment.