added desaturate effect control
This commit is contained in:
parent
8361c754f9
commit
41626d8ab7
1 changed files with 19 additions and 0 deletions
|
@ -178,6 +178,8 @@ function ComicBook(id, srcs, opts) {
|
|||
ComicBook.prototype.enhance.brightness({ contrast: ui.value });
|
||||
}
|
||||
}))
|
||||
.append("<input type='checkbox' id='desaturate' />")
|
||||
.append("<label for='desaturate'>Desaturate</label>")
|
||||
.css({
|
||||
position: "absolute",
|
||||
top: "40%",
|
||||
|
@ -208,10 +210,19 @@ function ComicBook(id, srcs, opts) {
|
|||
* TODO: center, make sure they never leave the visible portion of the screen
|
||||
*/
|
||||
ComicBook.prototype.renderControls = function() {
|
||||
|
||||
$(canvas)
|
||||
.after(this.getControl("navigation").left)
|
||||
.after(this.getControl("navigation").right)
|
||||
.after(this.getControl("image").hide());
|
||||
|
||||
$("#desaturate").click(function(e){
|
||||
if (this.checked) {
|
||||
ComicBook.prototype.enhance.desaturate();
|
||||
} else {
|
||||
ComicBook.prototype.enhance.resaturate();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
ComicBook.prototype.getControl = function(control) {
|
||||
|
@ -533,6 +544,14 @@ function ComicBook(id, srcs, opts) {
|
|||
init();
|
||||
},
|
||||
|
||||
/**
|
||||
* Undo desaturate
|
||||
*/
|
||||
resaturate: function() {
|
||||
delete options.enhance.desaturate;
|
||||
ComicBook.prototype.drawPage();
|
||||
},
|
||||
|
||||
/**
|
||||
* Sharpen
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue