Histogram

Is there some way of obtaining a histogram of a projection without using a glDrawPixels or glCopyPixels previously?

Thanks