[C++, Photoshop API] Need to obtain the pixel data of a layer

I’m trying to stream a bit array of data (bitmap) to our application from photoshop. Has anyone used it enough to know how to get the pixel data from a layer or document in PS?
I’m looking at ‘PSPixelMap’ now but I don’t think that’s what I need.