- function pixelOnVerticalEdge(pixel, image, borderWidth)—This function has three parameters where pixel is a single pixel, image is the complete image, and borderWidth is an integer specifying the thickness of the vertical borders. This function returns true if the pixel’s location is within borderWidth of any of the two vertical borders, and thus on the border. Otherwise it returns false.
- function pixelOnHorizontalEdge(pixel, image, borderWidth)—This function has three parameters where pixel is a single pixel, image is the complete image, and borderWidth is an integer specifying the thickness of the horizontal borders. This function returns true if the pixel’s location is within borderWidth of any of the two horizontal borders, and thus on the border. Otherwise it returns false.
Thursday, 8 October 2015
Write a complete javascript program that specifies two thicknesses, one for the vertical borders and one for the horizontal borders of an image. You should write the two boolean functions shown below. Be sure to print the image and run your program with different border values for the horizontal and vertical edges.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment