First try to understand what CIELAB means. Than you will find that your "so called" Lab* Values are the components of a Lab* Vector in the Lab* Colorspace
In very short:
Lab* is a (three dimensinal) colour space. The "*" Comes from history to make a clear difference between the CIE-LAB space and others like Hunter Lab.
See wiki:
CIEAB>[^]
Here you can find all the formulas (including explanation) to convert from e.g. sRGB to XYZ etc.
http://www.brucelindbloom.com/[
^]
[EDIT]
Sorry for bad layout, I don't know how to do it better ;)
That is simple vector addition/substratction.You do this component whise.
E.g. (and sorry for the bad representation)
3
lab_1= 4
2
7
lab_2= -1
1
3+7 10
than lab_1 + lab_2= 4+(-1) = 3
2+1 3
And in your case you have simply 4 lab vectors from the source picture you need to calculate:
according to G(x,y)= lab_1 - lab_2 + lab_3 - lab_4 to get the Lab* value in your target gradient.
[/EDIT]