Skip to content

Chapter 8 Videobooth.js #9

@spaceyyy

Description

@spaceyyy

Where is the exercise to complete this code?

I believe the code would have to be added into the videobooth.html for a button to be pressed for an additional filter, but I couldn't
find the exercise in the book or anywhere online. Thanks in advance! Awesome book(s) by the way!!

/*

  • bwcartoon is an extra filter for an exercise
    */
    function bwcartoon(pos, r, g, b, outputData) {
    var offset = pos * 4;
    if (outputData[offset] < 120) {
    outputData[offset] = 80;
    outputData[++offset] = 80;
    outputData[++offset] = 80;
    } else {
    outputData[offset] = 255;
    outputData[++offset] = 255;
    outputData[++offset] = 255;
    }
    outputData[++offset] = 255;
    ++offset;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions