Click here to Skip to main content
15,070,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp - My best solution Pin
Keith Davis3-Sep-16 6:28
MemberKeith 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
MemberKeith 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
MemberKeith 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
Memberleon 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
MemberKeith Davis4-Sep-16 9:10 
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
leon de boer4-Sep-16 22:36
Memberleon 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
MemberKeith Davis5-Sep-16 4:38 
Hi Leon,

I took a good look at the code and the web site that you suggested, and I find it interesting. That said, I don't think it applies to my application. If I'm not mistaken, your suggested code would be something that you might use for adjusting the gamma of a photo.

The algorithm that I have put forward is actually easy to control with either four slider controls, or four updown/edit controls that will affect the graphics card for your display monitor. One control for each of the following Brightness, Contrast, Level, and Brightness.

Allow me to explain the goals that I need to achieve here in my application:

I am working on a Navigation Display where there are strict specifications for color and brightness calibration in three viewing modes: Daytime, Twilight, and Night. In this application I also make calls to GetSysColors and SetSysColors to change the over all appearance of the Windows display for Day, Twilight, and Night. The specifications also call for three specific cursors that each have to meet strict size and color requirements for each display mode. There are numerous color checks involved, as well as a grey scale display check that must appear ever time the user switches to the night time display settings (and on demand).

These specifications are laid out in the the International Hydrographic Organizations (IHO) Presentation Library for ECDIS which uses the S-57 Electronic Navigation Chart (ENC) display.

For the twilight and night time display modes it is critical that mariner's night vision be preserved, and that optimum view-ability be achieved under bright sunlight conditions.

The grey scale check that is required consist of a black box with a slightly lighter shaded box inside for which the user must be able to calibrate his display so that the lighter shaded box can be easily differentiated from the black box background. The algorithm above serves these calibration purposes.

I have used this algorithm for a number of years to adjust my own display for less eye strain when I'm spending hours at a time writing code - sometimes in a night time environment (on the ship's bridge). Because of the my inability to derive the Brightness Contrast, Level, and Gamma settings directly from the Gamma Ramp array, I have not employed this method in any of my software releases.

Thus far the best I have been able to do is iterate through all possible settings until the output matches the Graphics Card's Gamma Ramp array received through the GetDeviceGammaRamp call. This works but it takes about 49,000,000 iterations and runs for 15-20 minutes. I have applied some variations to this which has shortened the run time; but it still takes about 5 minutes to run it. I need to be able to derive these settings in about a one second. I haven't given up yet thoughSmile | :)

I hope this helps to better explain my goals.

Again, thank you for your interest and your suggestions; it is much appreciated!

Best regards.
GeneralRe: Reference CalculateRamp - How to derive entry arguments from the existing Gamma Ramp Pin
leon de boer5-Sep-16 6:06
Memberleon 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
MemberKeith 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
Memberleon 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
MemberKeith 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
MemberKeith 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
MemberKeith Davis7-Sep-16 10:30 
QuestionPrinter Control Pin
Bram van Kampen27-Aug-16 15:38
MemberBram 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
MemberBram 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
MemberBram van Kampen1-Sep-16 13:37 
GeneralRe: Printer Control Pin
Richard MacCutchan1-Sep-16 23:37
mveRichard MacCutchan1-Sep-16 23:37 
GeneralRe: Printer Control Pin
Bram van Kampen4-Sep-16 15:24
MemberBram van Kampen4-Sep-16 15:24 

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.