Permalink
Browse files

Removed plugins so I can add the submodule

  • Loading branch information...
1 parent ac85c50 commit 22069a496261de534e951deefad761df239e7d4d @meltingice committed Mar 6, 2011
Showing with 0 additions and 421 deletions.
  1. +0 −103 src/plugins/blur.js
  2. +0 −63 src/plugins/camera.js
  3. +0 −37 src/plugins/edges.js
  4. +0 −218 src/plugins/presets.js
View
103 src/plugins/blur.js
@@ -1,103 +0,0 @@
-/*global Caman: true, exports: true */
-
-/*
- * NodeJS compatibility
- */
-if (!Caman && typeof exports == "object") {
- var Caman = {manip:{}};
- exports.plugins = Caman.manip;
-}
-
-(function (Caman) {
-
-Caman.manip.boxBlur = function () {
- return this.processKernel('Box Blur', [
- [1, 1, 1],
- [1, 1, 1],
- [1, 1, 1]
- ]);
-};
-
-Caman.manip.radialBlur = function () {
- return this.processKernel('Radial Blur', [
- [0, 1, 0],
- [1, 1, 1],
- [0, 1, 0]
- ], 5);
-};
-
-Caman.manip.heavyRadialBlur = function () {
- return this.processKernel('Heavy Radial Blur', [
- [0, 0, 1, 0, 0],
- [0, 1, 1, 1, 0],
- [1, 1, 1, 1, 1],
- [0, 1, 1, 1, 0],
- [0, 0, 1, 0, 0]
- ], 13);
-};
-
-Caman.manip.gaussianBlur = function () {
- return this.processKernel('Gaussian Blur', [
- [1, 4, 6, 4, 1],
- [4, 16, 24, 16, 4],
- [6, 24, 36, 24, 6],
- [4, 16, 24, 16, 4],
- [1, 4, 6, 4, 1]
- ], 256);
-};
-
-Caman.manip.motionBlur = function (degrees) {
- var kernel;
-
- if (degrees === 0 || degrees == 180) {
- kernel = [
- [0, 0, 1, 0, 0],
- [0, 0, 1, 0, 0],
- [0, 0, 1, 0, 0],
- [0, 0, 1, 0, 0],
- [0, 0, 1, 0, 0]
- ];
- } else if ((degrees > 0 && degrees < 90) || (degrees > 180 && degrees < 270)) {
- kernel = [
- [0, 0, 0, 0, 1],
- [0, 0, 0, 1, 0],
- [0, 0, 1, 0, 0],
- [0, 1, 0, 0, 0],
- [1, 0, 0, 0, 0]
- ];
- } else if (degrees == 90 || degrees == 270) {
- kernel = [
- [0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0],
- [1, 1, 1, 1, 1],
- [0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0]
- ];
- } else {
- kernel = [
- [1, 0, 0, 0, 0],
- [0, 1, 0, 0, 0],
- [0, 0, 1, 0, 0],
- [0, 0, 0, 1, 0],
- [0, 0, 0, 0, 1]
- ];
- }
-
- return this.processKernel('Motion Blur', kernel, 5);
-};
-
-Caman.manip.sharpen = function (amt) {
- if (!amt) {
- amt = 1;
- } else {
- amt /= 100;
- }
-
- return this.processKernel('Sharpen', [
- [0, -amt, 0],
- [-amt, 4 * amt + 1, -amt],
- [0, -amt, 0]
- ]);
-};
-
-}(Caman));
View
63 src/plugins/camera.js
@@ -1,63 +0,0 @@
-/*global Caman: true, exports: true */
-
-/*
- * NodeJS compatibility
- */
-if (!Caman && typeof exports == "object") {
- var Caman = {manip:{}};
- exports.plugins = Caman.manip;
-}
-
-(function (Caman) {
-
- /*
- * If size is a string and ends with %, its a percentage. Otherwise,
- * its an absolute number of pixels.
- */
- Caman.manip.vignette = function (size, strength) {
- var center, start, end, loc, dist, div, bezier;
-
- if (typeof size === "string" && size.substr(-1) == "%") {
- if (this.dimensions.height > this.dimensions.width) {
- size = this.dimensions.width * (Number(size.substr(0, size.length - 1)) / 100);
- } else {
- size = this.dimensions.height * (Number(size.substr(0, size.length - 1)) / 100);
- }
- }
-
- if (!strength) {
- strength = 0.6;
- } else {
- strength /= 100;
- }
-
- center = [(this.dimensions.width / 2), (this.dimensions.height / 2)];
-
- // start = darkest part
- start = Math.sqrt(Math.pow(center[0], 2) + Math.pow(center[1], 2)); // corner to center dist
-
- // end = lightest part (0 vignette)
- end = start - size;
-
- bezier = Caman.bezier([0, 1], [30, 30], [70, 60], [100, 80]);
- return this.process({center: center, start: start, end: end, size: size, strength: strength, bezier: bezier}, function vignette(data, rgba) {
- // current pixel coordinates
- loc = this.locationXY();
-
- // distance between center of image and current pixel
- dist = Math.sqrt(Math.pow(loc.x - data.center[0], 2) + Math.pow(loc.y - data.center[1], 2));
-
- if (dist > data.end) {
- // % of vignette
- div = Math.max(1, ((data.bezier[Math.round(((dist - data.end) / data.size) * 100)]/10) * strength));
-
- // Use gamma to adjust the vignette - much better results
- rgba.r = Math.pow(rgba.r / 255, div) * 255;
- rgba.g = Math.pow(rgba.g / 255, div) * 255;
- rgba.b = Math.pow(rgba.b / 255, div) * 255;
- }
-
- return rgba;
- });
- };
-}(Caman));
View
37 src/plugins/edges.js
@@ -1,37 +0,0 @@
-/*global Caman: true, exports: true */
-
-/*
- * NodeJS compatibility
- */
-if (!Caman && typeof exports == "object") {
- var Caman = {manip:{}};
- exports.plugins = Caman.manip;
-}
-
-(function (Caman) {
-
-Caman.manip.edgeEnhance = function () {
- return this.processKernel('Edge Enhance', [
- [0, 0, 0],
- [-1, 1, 0],
- [0, 0, 0]
- ]);
-};
-
-Caman.manip.edgeDetect = function () {
- return this.processKernel('Edge Detect', [
- [-1, -1, -1],
- [-1, 8, -1],
- [-1, -1, -1]
- ]);
-};
-
-Caman.manip.emboss = function () {
- return this.processKernel('Emboss', [
- [-2, -1, 0],
- [-1, 1, 1],
- [0, 1, 2]
- ]);
-};
-
-}(Caman));
View
218 src/plugins/presets.js
@@ -1,218 +0,0 @@
-/*global Caman: true, exports: true */
-
-/*
- * NodeJS compatibility
- */
-if (!Caman && typeof exports == "object") {
- var Caman = {manip:{}};
- exports.plugins = Caman.manip;
-}
-
-(function (Caman) {
-
-Caman.manip.vintage = function (vignette) {
- this
- .greyscale()
- .contrast(5)
- .noise(3)
- .sepia(100)
- .channels({red: 8, blue: 2, green: 4})
- .gamma(0.87);
-
- if (vignette || typeof vignette === 'undefined') {
- this.vignette("40%", 30);
- }
-
- return this;
-};
-
-Caman.manip.lomo = function() {
- return this
- .brightness(15)
- .exposure(15)
- .curves('rgb', [0, 0], [200, 0], [155, 255], [255, 255])
- .saturation(-20)
- .gamma(1.8)
- .vignette("50%", 60)
- .brightness(5);
-};
-
-Caman.manip.clarity = function (grey) {
- var manip = this
- .vibrance(20)
- .curves('rgb', [5, 0], [130, 150], [190, 220], [250, 255])
- .sharpen(15)
- .vignette("45%", 20);
-
- if (grey) {
- this
- .greyscale()
- .contrast(4);
- }
-
- return manip;
-};
-
-Caman.manip.sinCity = function () {
- return this
- .contrast(100)
- .brightness(15)
- .exposure(10)
- .curves('rgb', [0,0], [100, 0], [155, 255], [255, 255])
- .clip(30)
- .greyscale();
-};
-
-Caman.manip.sunrise = function () {
- return this
- .exposure(3.5)
- .saturation(-5)
- .vibrance(50)
- .sepia(60)
- .colorize('#e87b22', 10)
- .channels({red: 8, blue: 8})
- .contrast(5)
- .gamma(1.2)
- .vignette("55%", 25);
-};
-
-Caman.manip.crossProcess = function () {
- return this
- .exposure(5)
- .colorize('#e87b22', 4)
- .sepia(20)
- .channels({blue: 8, red: 3})
- .curves('b', [0, 0], [100, 150], [180, 180], [255, 255])
- .contrast(15)
- .vibrance(75)
- .gamma(1.6);
-};
-
-Caman.manip.orangePeel = function () {
- return this
- .curves('rgb', [0, 0], [100, 50], [140, 200], [255, 255])
- .vibrance(-30)
- .saturation(-30)
- .colorize('#ff9000', 30)
- .contrast(-5)
- .gamma(1.4);
-};
-
-Caman.manip.love = function () {
- return this
- .brightness(5)
- .exposure(8)
- .colorize('#c42007', 30)
- .vibrance(50)
- .gamma(1.3);
-};
-
-Caman.manip.grungy = function () {
- return this
- .gamma(1.5)
- .clip(25)
- .saturation(-60)
- .contrast(5)
- .noise(5)
- .vignette("50%", 30);
-};
-
-Caman.manip.jarques = function () {
- return this
- .saturation(-35)
- .curves('b', [20, 0], [90, 120], [186, 144], [255, 230])
- .curves('r', [0, 0], [144, 90], [138, 120], [255, 255])
- .curves('g', [10, 0], [115, 105], [148, 100], [255, 248])
- .curves('rgb', [0, 0], [120, 100], [128, 140], [255, 255])
- .sharpen(20);
-};
-
-Caman.manip.pinhole = function () {
- return this
- .greyscale()
- .sepia(10)
- .exposure(10)
- .contrast(15)
- .vignette("60%", 35);
-};
-
-Caman.manip.oldBoot = function () {
- return this
- .saturation(-20)
- .vibrance(-50)
- .gamma(1.1)
- .sepia(30)
- .channels({red: -10, blue: 5})
- .curves('rgb', [0, 0], [80, 50], [128, 230], [255, 255])
- .vignette("60%", 30);
-};
-
-Caman.manip.glowingSun = function () {
- this.brightness(10);
-
- this.newLayer(function () {
- this.setBlendingMode('multiply');
- this.opacity(80);
- this.copyParent();
-
- this.filter.gamma(0.8);
- this.filter.contrast(50);
-
- this.filter.exposure(10);
- });
-
- this.newLayer(function () {
- this.setBlendingMode('softLight');
- this.opacity(80);
- this.fillColor('#f49600');
- });
-
- this.exposure(20);
- this.gamma(0.8);
-
- return this.vignette("45%", 20);
-};
-
-Caman.manip.hazyDays = function () {
- this.gamma(1.2);
-
- this.newLayer(function () {
- this.setBlendingMode('overlay');
- this.opacity(60);
- this.copyParent();
-
- this.filter.channels({red: 5});
- this.filter.heavyRadialBlur();
- });
-
- this.newLayer(function () {
- this.setBlendingMode('addition');
- this.opacity(40);
- this.fillColor('#6899ba');
- });
-
- this.newLayer(function () {
- this.setBlendingMode('multiply');
- this.opacity(35);
- this.copyParent();
-
- this.filter.brightness(40);
- this.filter.vibrance(40);
- this.filter.exposure(30);
- this.filter.contrast(15);
-
- this.filter.curves('r', [0, 40], [128, 128], [128, 128], [255, 215]);
- this.filter.curves('g', [0, 40], [128, 128], [128, 128], [255, 215]);
- this.filter.curves('b', [0, 40], [128, 128], [128, 128], [255, 215]);
-
- this.filter.gaussianBlur();
- });
-
- this.curves('r', [20, 0], [128, 158], [128, 128], [235, 255]);
- this.curves('g', [20, 0], [128, 128], [128, 128], [235, 255]);
- this.curves('b', [20, 0], [128, 108], [128, 128], [235, 255]);
-
- return this.vignette("45%", 20);
-};
-
-}(Caman));

0 comments on commit 22069a4

Please sign in to comment.