I've had years of paid experience here delivering solutions using OpenCV/C++ portable to linux and Windows both, various UIs (C#, html5, et al.)
If I understand correctly, you want to pre- specify fixed values for a histogram, contrast, brightness, and color levels, then ... make each image, one at a time, conform to those variables, to 90% accuracy or better...
I'd definitely try to use OpenCV for everything, but might need to use something like GTK (GIMP Tool Kit = GTK+ lib), or possibly ImageMagick lib, to easily do the histogram changing, and color level adjustments and tweaking, if OpenCV proves too clunky for that.
I'd probably start with a multivariate hill-climbing approach that would attempt to locally optimize toward the desired set points ... I'd seek to find heuristics that would tell me what to start with (histogram vs contrast vs brightness etc), and hope the hill-climbing can always find a solution given the desired settings and a given input image.
Please realize, it may be, for some arbitrary desired values for histogram+contract+brightness+... and a given input image, that no solution will exist. (I can think of examples of this.) So this leads to further Qs like: can we tell ahead of time if a solution is possible, given the desired settings and an input image?
Q: Do you have any sample images and example target setting values (histogram, contrast, etc etc), you can get to me now that I should test with? I do have more Qs...