Giter Site home page Giter Site logo

05-project's Introduction

CF LAB

Transforming John

Author: Lena Eivy and Tanner Seramur

Links and Resources

Modules

Bitmap.js

Exported Values and Methods

Receives a file name, used in the transformer to note the new buffer. Exports multiple function that takes an array of buffer information from a bitmap and apply a transformation to that bitmap.

parser

Parser -- accepts a buffer and will parse through it, according to the specification, creating object properties for each segment of the file

greyscale.js

Exported Values and Methods

greyscale is a function that uses the parsed bitmap information from the parser to apply a transformation on the bitmap image changeing it from color to greyscale.

  • greyscale(pixelArray/colorArray)
    • pixelArray {array} - the buffer array of pixel information
    • colorArray {array} - the buffer array of pixel color information

invert.js

Exported Values and Methods

invert is a function that uses the parsed bitmap information from the parser to apply a transformation on the bitmap image inverting the colors.

  • invert(pixelArray/colorArray)
    • pixelArray {array} - the buffer array of pixel information
    • colorArray {array} - the buffer array of pixel color information

punk.js

Exported Values and Methods

punk is a function that uses the parsed bitmap information from the parser to apply a transformation on the bitmap image turning the blacks yellow and blue.

  • punk(pixelArray/colorArray)
    • pixelArray {array} - the buffer array of pixel information
    • colorArray {array} - the buffer array of pixel color information

darken.js

Exported Values and Methods

darken is a function that uses the parsed bitmap information from the parser to apply a transformation on the bitmap image making the entire image darker.

  • darken(pixelArray/colorArray)
    • pixelArray {array} - the buffer array of pixel information
    • colorArray {array} - the buffer array of pixel color information

mirror.js

Exported Values and Methods

mirror is a function that uses the parsed bitmap information from the parser to apply a transformation on the bitmap image making the top half of the image mirror on the bottom half.

  • mirror(pixelArray/colorArray)
    • pixelArray {array} - the buffer array of pixel information
    • colorArray {array} - the buffer array of pixel color information

flip.js

Exported Values and Methods

flip is a function that uses the parsed bitmap information from the parser to apply a transformation on the bitmap image making it flip up-side-down.

  • flip(pixelArray/colorArray)
    • pixelArray {array} - the buffer array of pixel information
    • colorArray {array} - the buffer array of pixel color information

Setup

Running the app

  • npm i
  • CLI requires: node index.js filepath-to-bitmap-image transformation-name
  • transformation name option:
    • greyscale
    • invert
    • punk
    • darken
    • flip
    • mirror

Tests

  • To run test in the CLI - npm run test
  • The following assertations were made:
    • user enters one of the specified named transformations
    • user enters a valid file path to a bmp image
    • greyscale will remove the color from an image
    • invert will invert the colors in the image
    • punk will turn the blacks blue
    • darken will darken the image
    • mirror will reflect the top of the image on the bottom
    • flip will turn the image up-side-down

Notes

  • in the index.js, we declare a const [file, operation] = process.argv.slice(2);
    • this is the variable that allows us to access the arguments entered in the CLI.
    • process.argv[0] is process exec path
    • process.argv[1] is the file path entered in the terminal
    • proccess.argv[2] is the transformion operation specificed in the terminal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.