getting pixel data from image using libpng

I am trying for create a program that performs 2-dimensional fast fourier transforms on each pixel of data in an image. I am going to transform each channel seperately, then map the coefficients to colours and recombine them into an image.

But I cannot seem to figure out how to read/interpret the pixel data using libpng. Can someone help me find out how I would read a png image and read each pixel's data into an array?

I don't really have code to show you that would be of any help. But I can be more specific with the nature of my problem.

My program reads in a PNG file and I can fetch it's width and height from the info structure. I also know how to read each row into an array of type png_bytep. I have no idea how I am supposed to access the individual color components of each pixel from the byte array though. I apologize for my vague description initially, I am just new to this particular library, and it's common usage is apparently quite different than what I am attemping to use it for.