Having written a function to read a PGM image, how do we use it? Well, the testbench at the bottom of the pgm vhdl file has an example:
variable i : pixel\_array\_ptr; -- Without the transpose function, we would have to …
Having set up a library for reading images, let’s now go on to read an image in!
pgm_read Recall, we have a function: impure function pgm_read (filename : string) return pixel_array_ptr; So, some declarations - …
Data storage One of the things VHDL can do (contrary to popular belief :)) is 2-D arrays. So reading images into a 2-D array is a very natural way to store the data. We’ll create a package called pgm to keep all …