public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Mistake on the colorspace page in the API doc
@ 2013-05-26  6:34 Wouter Thielen
  2013-06-18 20:58 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Wouter Thielen @ 2013-05-26  6:34 UTC (permalink / raw)
  To: linux-media

Hi all,

I have been trying to get the colors right in the images grabbed from my
webcam, and I tried the color conversion code on
http://linuxtv.org/downloads/v4l-dvb-apis/colorspaces.html.

It turned out to be very white, so I checked out the intermediate steps,
and thought the part:

ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */
EG = clamp (g * 255);
EB = clamp (b * 255);


should be without the * 255. I tried removing *255 and that worked.

Regards,

--
Wouter Thielen
http://morannon.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Mistake on the colorspace page in the API doc
  2013-05-26  6:34 Mistake on the colorspace page in the API doc Wouter Thielen
@ 2013-06-18 20:58 ` Laurent Pinchart
  2013-06-24  5:47   ` Wouter Thielen
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2013-06-18 20:58 UTC (permalink / raw)
  To: Wouter Thielen; +Cc: linux-media

Hi Wouter,

On Sunday 26 May 2013 15:34:26 Wouter Thielen wrote:
> Hi all,
> 
> I have been trying to get the colors right in the images grabbed from my
> webcam, and I tried the color conversion code on
> http://linuxtv.org/downloads/v4l-dvb-apis/colorspaces.html.
> 
> It turned out to be very white, so I checked out the intermediate steps,
> and thought the part:
> 
> ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */
> EG = clamp (g * 255);
> EB = clamp (b * 255);
> 
> 
> should be without the * 255. I tried removing *255 and that worked.

Good catch. I would instead do

y1 = (Y1 - 16) / 219.0;
pb = (Cb - 128) / 224.0;
pr = (Cr - 128) / 224.0;

and keep the E[RGB] lines unmodified to keep lower-case variables in the [0.0 
1.0] or [-0.5 0.5] range.

Would you like to post a patch for the documentation ? If not I can take care 
of it.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Mistake on the colorspace page in the API doc
  2013-06-18 20:58 ` Laurent Pinchart
@ 2013-06-24  5:47   ` Wouter Thielen
  2013-06-24 10:02     ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Wouter Thielen @ 2013-06-24  5:47 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Hi Laurent,

Sorry for the late reply. I'll post a patch of your revised version,
but I don't see the documentation anywhere in your git repositories. I
guess I'll download the file (preserving directory structure), update
it, and send you a diff -run. If this is not how it is done, please
let me know.

Regards,

Wouter


On Wed, Jun 19, 2013 at 5:58 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Wouter,
>
> On Sunday 26 May 2013 15:34:26 Wouter Thielen wrote:
>> Hi all,
>>
>> I have been trying to get the colors right in the images grabbed from my
>> webcam, and I tried the color conversion code on
>> http://linuxtv.org/downloads/v4l-dvb-apis/colorspaces.html.
>>
>> It turned out to be very white, so I checked out the intermediate steps,
>> and thought the part:
>>
>> ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */
>> EG = clamp (g * 255);
>> EB = clamp (b * 255);
>>
>>
>> should be without the * 255. I tried removing *255 and that worked.
>
> Good catch. I would instead do
>
> y1 = (Y1 - 16) / 219.0;
> pb = (Cb - 128) / 224.0;
> pr = (Cr - 128) / 224.0;
>
> and keep the E[RGB] lines unmodified to keep lower-case variables in the [0.0
> 1.0] or [-0.5 0.5] range.
>
> Would you like to post a patch for the documentation ? If not I can take care
> of it.
>
> --
> Regards,
>
> Laurent Pinchart
>



-- 
Wouter Thielen

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Mistake on the colorspace page in the API doc
  2013-06-24  5:47   ` Wouter Thielen
@ 2013-06-24 10:02     ` Laurent Pinchart
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2013-06-24 10:02 UTC (permalink / raw)
  To: Wouter Thielen; +Cc: linux-media

Hi Wouter,

On Monday 24 June 2013 14:47:30 Wouter Thielen wrote:
> Hi Laurent,
> 
> Sorry for the late reply. I'll post a patch of your revised version,
> but I don't see the documentation anywhere in your git repositories. I
> guess I'll download the file (preserving directory structure), update
> it, and send you a diff -run. If this is not how it is done, please
> let me know.

The documentation is located in the kernel sources. The file you're looking 
for is Documentation/DocBook/media/v4l/pixfmt.xml. It can be compiled to html 
by running

make htmldocs

in the root directory of the kernel tree.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-24 10:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-26  6:34 Mistake on the colorspace page in the API doc Wouter Thielen
2013-06-18 20:58 ` Laurent Pinchart
2013-06-24  5:47   ` Wouter Thielen
2013-06-24 10:02     ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox