Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How do you read / use this code? Pin
leon de boer8-Sep-16 17:26
leon de boer8-Sep-16 17:26 
GeneralSOLVED Re: How do you read / use this code? Pin
Vaclav_9-Sep-16 18:23
Vaclav_9-Sep-16 18:23 
QuestionReference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp - My best solution Pin
Keith Davis3-Sep-16 6:28
Keith Davis3-Sep-16 6:28 
QuestionRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Richard MacCutchan3-Sep-16 6:36
mveRichard MacCutchan3-Sep-16 6:36 
AnswerRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis3-Sep-16 6:47
Keith Davis3-Sep-16 6:47 
AnswerRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis3-Sep-16 7:11
Keith Davis3-Sep-16 7:11 
AnswerRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
leon de boer4-Sep-16 3:54
leon de boer4-Sep-16 3:54 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis4-Sep-16 9:10
Keith Davis4-Sep-16 9:10 
Hi Leon,

I understand what is going on with the Gamma Ramp. My question is really a math problem, and thus far the solution is beyond my skill level.

The algorithm previously posted works very well, and gives good control of the gamma ramp. What I don't understand concerning this algorithm is why my question has not been asked before. It seems that the first thing you would want to do is interpret the current settings from the gamma ramp array; and present the current settings to the user so that he can then begin to make adjustments by using the algorithm that I previously posted.

I'm trying to work the problem backwards from the GetDeviceGammaRamp function call to whatever input values would be required to create the current gamma ramp array: What will be the Brightness setting, what will be the Contrast setting, what will be the Level setting, and what will be the Gamma setting "going in".

The way that the input algorithm works is made ever more complex because "value" undergoes four or five operations before arriving at a final input value for each of the 256 members of the array. How to reverse this series of operations has me stumped.

Given any two of the three parts for any of these operations; it is possible to come up with the third part:

For example: any unknown part of 6=2*3 can be determine so long as any two parts are known ie: 3=6/2.

x=pow(y,z): y can be determined using y=pow(x,(1.0/z)); and z can be determined using log(x)/log(y).

The initial "value" is determined by it's place in the array, so this is known to us. Also know to us is the final value of "value" because we can extract it from the current gamma ramp array. So how would you work the problem backwards through each operation from the value of the gamma array [element] to determine each of the values for Brightness, Contrast, Level, and Gamma?

My graph visually demonstrates what is going on with the gamma ramp array. When Gamma is set to input value of 10, the curve is neutralized, and the graph presents a strait line.

When Brightness is lower than 50 the line moves in parallel from the 45 degree angle towards the lower right, and greater that 50 moves the line towards the upper left in parallel.

When Contrast is lower than 50, the graph line pivots clockwise about it's midpoint, and an input greater than 50 will pivot the line counterclockwise about its midpoint.

When Level is adjusted below 50 then the end of the graph line swings downwards while the starting point (0,0) remains stationary; and when Level is adjusted upwards the end of the graph line swings upwards while the starting point remains stationary.

When Gamma is adjusted to either side of 10; the graph line becomes a positive or negative curve.

All very interesting, but it doesn't provide me with any solutions to my problem.

At any rate, thanks for your interest and your input!

Best regards,
In Corona simul veritasSmile | :)
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
leon de boer4-Sep-16 22:36
leon de boer4-Sep-16 22:36 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis5-Sep-16 4:38
Keith Davis5-Sep-16 4:38 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
leon de boer5-Sep-16 6:06
leon de boer5-Sep-16 6:06 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis5-Sep-16 8:23
Keith Davis5-Sep-16 8:23 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
leon de boer5-Sep-16 18:55
leon de boer5-Sep-16 18:55 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis5-Sep-16 19:55
Keith Davis5-Sep-16 19:55 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
Keith Davis8-Sep-16 9:31
Keith Davis8-Sep-16 9:31 
AnswerRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp - My Solution Pin
Keith Davis7-Sep-16 10:30
Keith Davis7-Sep-16 10:30 
QuestionPrinter Control Pin
Bram van Kampen27-Aug-16 15:38
Bram van Kampen27-Aug-16 15:38 
QuestionRe: Printer Control Pin
Richard MacCutchan27-Aug-16 20:31
mveRichard MacCutchan27-Aug-16 20:31 
AnswerRe: Printer Control Pin
Bram van Kampen28-Aug-16 14:20
Bram van Kampen28-Aug-16 14:20 
GeneralRe: Printer Control Pin
Richard MacCutchan28-Aug-16 20:56
mveRichard MacCutchan28-Aug-16 20:56 
GeneralRe: Printer Control Pin
Jochen Arndt28-Aug-16 21:38
professionalJochen Arndt28-Aug-16 21:38 
GeneralRe: Printer Control Pin
Richard MacCutchan28-Aug-16 22:03
mveRichard MacCutchan28-Aug-16 22:03 
GeneralRe: Printer Control Pin
Jochen Arndt28-Aug-16 22:09
professionalJochen Arndt28-Aug-16 22:09 
GeneralRe: Printer Control Pin
Richard MacCutchan28-Aug-16 22:19
mveRichard MacCutchan28-Aug-16 22:19 
GeneralRe: Printer Control Pin
Bram van Kampen1-Sep-16 13:37
Bram van Kampen1-Sep-16 13:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.