Re: HDR display support ideas

Robin Rowe <[email protected]> Wed, 22 Oct 2008 01:46:39 -0700
Newsgroups gmane.comp.video.cinepaint.devel
Message-ID <[email protected]>
Kai-Uwe,

 > HDR displaying is something I'd like to see supported.

Here are my thoughts...

The bleeding edge Cairo HDR support is unnecessary if using OpenGL. The 
OpenGL call should punch an HDR hole through the 8-bit X window.

To output 10-bit per channel in Linux we'd need an HDR video card (such 
as the ATI 7700), an HDR video cable (such as HDMI), and a HDR monitor 
(such as HP DreamColor). Macintosh 10-bit display seems feasible, too.

The CinePaint image display code would need to be modified to output 
using OpenGL instead of GTK. If using glTexSubImage2D(), the supported 
HDR pixel channel types are GL_UNSIGNED_SHORT, GL_SHORT, 
GL_UNSIGNED_INT, GL_INT, and GL_FLOAT.

The display must first to be set up as 10-bit in GLUT (freeglut):

// set 10 bit colors, a depth buffer, and doublebuffering:
glutInitDisplayString("red=10 green=10 blue=10 depth double");
// check got 10 bits:
int red_bits, green_bits, blue_bits;
glGetIntegerv(GL_RED_BITS, &red_bits);
glGetIntegerv(GL_GREEN_BITS, &green_bits);
glGetIntegerv(GL_BLUE_BITS, &blue_bits);
...

The AMD docs say to use pixel buffer objects with GL_RGBA format and 
GL_UNSIGNED_INT_2_10_10_10_REV for best performance. That format packs 
each pixel into a 32-bit value, with 3 10-bit channels and 2 bits of 
alpha. By the way, I have suitable pixel pack/unpack C++ code that could 
be reused from the img_img DPX driver I wrote. DPX manipulates 30-bit 
pixels, too.

Robin
-- 
Robin Rowe
CinePaint Project Leader
Beverly Hills, California
www.CinePaint.org
www.cinepaint.blogspot.com
www.linkedin.com/in/robinrowe

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/