linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: <enric.balletbo@collabora.com>, <jic23@kernel.org>,
	<bleung@chromium.org>, <groeck@chromium.org>,
	<linux-kernel@vger.kernel.org>, <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] iio: Add in_illumincance vectors in different color spaces
Date: Fri, 8 May 2020 16:16:35 +0100	[thread overview]
Message-ID: <20200508161635.00006cd2@Huawei.com> (raw)
In-Reply-To: <20200506230324.139241-2-gwendal@chromium.org>

On Wed, 6 May 2020 16:03:22 -0700
Gwendal Grignou <gwendal@chromium.org> wrote:

Illuminance in the title.  Plus I'm still arguing these
aren't illuminance values.  

The Y value is illuminance but X and Z definitely aren't.
RGB needs to stick to intensity - like the other existing
RGB sensors.

Gah.  XYZ and IIO is a mess. 

I suppose we could introduce a new type and have
in_illumiance_raw
in_chromacity_x_raw
in_chromacity_z_raw but chances of anyone understanding what we
are on about without reading wikipedia is low...

Sigh.  Unless someone else chips in, I'm inclined to be lazy and rely
on documentation to let in_illuminance_x,y,z be defined as being
cie xyz color space measurements.

It seems slighlty preferable to defining another type for these,
though I suspect I'll regret this comment when some adds
cie lab which was always my favourite colour space :)



> Define 2 spaces for defining color coming from color sensors:
> RGB and XYZ: Both are in lux.
> RGB is the raw output from sensors (Red, Green and Blue channels), in
> addition to the existing clear channel (C).

> The RGBC vector goes through a matrix transformation to produce the XYZ
> vector. Y is illumincance, and XY caries the chromaticity information.
> The matrix is model specific, as the color sensor can be behing a glass
> that can filter some wavelengths.
> 
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> New in v2.
> 
>  Documentation/ABI/testing/sysfs-bus-iio | 27 +++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index d3e53a6d8331b..256db6e63a25e 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1309,6 +1309,33 @@ Description:
>  		Illuminance measurement, units after application of scale
>  		and offset are lux.
>  
> +What:		/sys/.../iio:deviceX/in_illuminance_red_raw
> +What:		/sys/.../iio:deviceX/in_illuminance_green_raw
> +What:		/sys/.../iio:deviceX/in_illuminance_blue_raw
> +KernelVersion:	5.7
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Illuminance measuremed in red, green or blue channels, units
> +		after application of scale and offset are lux.

No they aren't.  Units are some magic intensity at some magic wavelength.

> +
> +What:		/sys/.../iio:deviceX/in_illuminance_x_raw
> +What:		/sys/.../iio:deviceX/in_illuminance_y_raw
> +What:		/sys/.../iio:deviceX/in_illuminance_z_raw
> +KernelVersion:	5.7
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		lluminance measured in the CIE 1931 color space (XYZ).
> +		in_illuminance_y_raw is a measure of the brightness, and is
> +		identical in_illuminance_raw.

That is fair enough.

> +		in_illuminance_x_raw and in_illuminance_z_raw carry chromacity
> +		information.
> +		in_illuminance_x,y,z_raw are be obtained from the sensor color
> +		channels using color matching functions that may be device
> +		specific.
> +		Units after application of scale and offset are lux.

True for Y, not for X and Z which don't have 'units' as such.

> +		The measurments can be used to represent colors in the CIE
> +		xyY color space

XYZ

> +
>  What:		/sys/.../iio:deviceX/in_intensityY_raw
>  What:		/sys/.../iio:deviceX/in_intensityY_ir_raw
>  What:		/sys/.../iio:deviceX/in_intensityY_both_raw



  reply	other threads:[~2020-05-08 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 23:03 [PATCH v3 0/3] iio: cros_ec: Add support for RGB light sensor Gwendal Grignou
2020-05-06 23:03 ` [PATCH v2 1/3] iio: Add in_illumincance vectors in different color spaces Gwendal Grignou
2020-05-08 15:16   ` Jonathan Cameron [this message]
2020-05-12  4:10     ` Gwendal Grignou
2020-05-16 15:49       ` Jonathan Cameron
2020-05-06 23:03 ` [PATCH v2 2/3] iio: cros_ec: Allow enabling/disabling calibration mode Gwendal Grignou
2020-05-06 23:03 ` [PATCH v2 3/3] iio: cros_ec_light: Add support for RGB sensor Gwendal Grignou
2020-05-08 15:23   ` Jonathan Cameron
2020-05-11  6:31   ` kbuild test robot
2020-05-08 14:56 ` [PATCH v3 0/3] iio: cros_ec: Add support for RGB light sensor Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508161635.00006cd2@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).