Top Copy

Article Info

Pseudocode

PROCEDURE top_copy(image)
    midpoint <- h / 2
    FOR x = 0 .. width DO
        FOR y = 0 .. midpoint DO
            c <- pixel(x, y)
            i <- midpoint + y
            pixel(x, i) <- c
        END FOR
    END FOR
END PROCEDURE

Description

Loop through each pixel in the image and retrieve its value. Calculate the location which this pixel will be copied to, and set the pixel at that location to the source pixel’s value.

Acknowledgements

Adapted from Pseudocode produced for COMP120 by Dr. Micheal Scott.

Graduation Cap Book Open book GitHub Info chevron-right Sticky Note chevron-left Puzzle Piece Square Lightbulb Video Exclamation Triangle Globe