All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Illuminators control
@ 2010-09-11  8:24 Jean-Francois Moine
  2010-09-11  8:43 ` Hans Verkuil
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Francois Moine @ 2010-09-11  8:24 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

Hi,

This new proposal cancels the previous patch 'Illuminators and status
LED controls'.

Cheers.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

[-- Attachment #2: illuminator.pat --]
[-- Type: application/octet-stream, Size: 2750 bytes --]

Some media devices (microscopes) may have one or many illuminators.
This patch makes them controlable by the applications.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caa..4226a9e 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
 	    information and bits 24-31 must be zero.</entry>
 	  </row>
 	  <row>
+	    <entry><constant>V4L2_CID_ILLUMINATORS_0</constant>
+		<constant>V4L2_CID_ILLUMINATORS_1</constant></entry>
+	    <entry>oolean</entry>
+	    <entry>Switch on or off the illuminator 0 or 1 of the device
+		(usually a microscope).</entry>
+	  </row>
+	  <row>
 	    <entry><constant>V4L2_CID_LASTP1</constant></entry>
 	    <entry></entry>
 	    <entry>End of the predefined control IDs (currently
-<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry>
+<constant>V4L2_CID_ILLUMINATORS_1</constant> + 1).</entry>
 	  </row>
 	  <row>
 	    <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index ea8d32c..70752ad 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -305,6 +305,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_ROTATE:			return "Rotate";
 	case V4L2_CID_BG_COLOR:			return "Background Color";
 	case V4L2_CID_CHROMA_GAIN:		return "Chroma Gain";
+	case V4L2_CID_ILLUMINATORS_0:		return "Illuminator 0";
+	case V4L2_CID_ILLUMINATORS_1:		return "Illuminator 1";
 
 	/* MPEG controls */
 	/* Keep the order of the 'case's the same as in videodev2.h! */
@@ -419,6 +421,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_AUDIO_LIMITER_ENABLED:
 	case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
 	case V4L2_CID_PILOT_TONE_ENABLED:
+	case V4L2_CID_ILLUMINATORS_0:
+	case V4L2_CID_ILLUMINATORS_1:
 		*type = V4L2_CTRL_TYPE_BOOLEAN;
 		*min = 0;
 		*max = *step = 1;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61490c6..0433297 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1045,8 +1045,12 @@ enum v4l2_colorfx {
 
 #define V4L2_CID_CHROMA_GAIN                    (V4L2_CID_BASE+36)
 
+#define V4L2_CID_ILLUMINATORS_0			(V4L2_CID_BASE+37)
+#define V4L2_CID_ILLUMINATORS_1			(V4L2_CID_BASE+38)
+};
+
 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+37)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+39)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)

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

* Re: [PATCH] Illuminators control
  2010-09-11  8:24 [PATCH] Illuminators control Jean-Francois Moine
@ 2010-09-11  8:43 ` Hans Verkuil
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2010-09-11  8:43 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: linux-media

On Saturday, September 11, 2010 10:24:26 Jean-Francois Moine wrote:
> Hi,
> 
> This new proposal cancels the previous patch 'Illuminators and status
> LED controls'.
> 
> Cheers.
> 
> 
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caa..4226a9e 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
 	    information and bits 24-31 must be zero.</entry>
 	  </row>
 	  <row>
+	    <entry><constant>V4L2_CID_ILLUMINATORS_0</constant>
+		<constant>V4L2_CID_ILLUMINATORS_1</constant></entry>
+	    <entry>oolean</entry>

Typo: 'oolean' -> boolean :-)

+	    <entry>Switch on or off the illuminator 0 or 1 of the device
+		(usually a microscope).</entry>
+	  </row>
+	  <row>
 	    <entry><constant>V4L2_CID_LASTP1</constant></entry>
 	    <entry></entry>
 	    <entry>End of the predefined control IDs (currently
-<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry>
+<constant>V4L2_CID_ILLUMINATORS_1</constant> + 1).</entry>
 	  </row>
 	  <row>
 	    <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>

I would recommend naming these controls ILLUMINATOR_1 and _2 instead of _0 and
_1. The average end-user starts counting at 1, not 0.

Regards,

	Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco

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

* Re: [PATCH] Illuminators control
  2010-09-13  8:07   ` Hans Verkuil
@ 2010-09-13 12:49     ` Andy Walls
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Walls @ 2010-09-13 12:49 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Laurent Pinchart, Jean-Francois Moine, linux-media

On Mon, 2010-09-13 at 10:07 +0200, Hans Verkuil wrote:
> On Monday, September 13, 2010 09:08:36 Laurent Pinchart wrote:
> > Hi,
> > 
> > On Saturday 11 September 2010 11:03:50 Jean-Francois Moine wrote:
> > 
> > > @@ -419,6 +421,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
> > v4l2_ctrl_type *type,
> > >  	case V4L2_CID_AUDIO_LIMITER_ENABLED:
> > >  	case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
> > >  	case V4L2_CID_PILOT_TONE_ENABLED:
> > > +	case V4L2_CID_ILLUMINATORS_1:
> > > +	case V4L2_CID_ILLUMINATORS_2:
> > >  		*type = V4L2_CTRL_TYPE_BOOLEAN;
> > >  		*min = 0;
> > >  		*max = *step = 1;
> > 
> > I would prefer integer controls for this, as we will need to support dimmable 
> > illuminators.
> > 
> > 
> 
> Don't. That should be a separate control. I expect that the brightness is
> something you touch a lot less than the on/of controls. Anyway, I think it
> makes a lot more sense to separate these two functions.



I would need to research what computerized microscopes today actually
have.

A quick look reveals: 
	http://www.bodelin.com/proscopehr/how_it_works/
	http://www.ecoscopestore.com/main.sc
	http://www.microscopeworld.com/MSWorld/Microscope-World/Digital-Microscopes/

handheld units likely have only on/off control for illumination.
Eyepiece cameras rely on what the existing laboratory microscope already
has for illumination.


In my limited experience, there are some microscope controls that a
human is going to have his hands on to get the desired image:
magnification, focus, and specimen position.  Illumination intensity
seems like it would fit in that group.

When I had a job in college fixing medical equipment, most microscopes
limited light using a mechanical iris controlled by hand.  The
illuminator was simply an on/off switch.  (BTW a mechanical iris is a
pain to take apart and rebuild.)  Light filters could be installed
between the illuminator and the iris. 

On some of the "digital microscopes" in the links above, you can see the
iris assembly underneath the stage.  The DMBA210 microscope has both a
manual iris and an illumination intensity knob.


So for digital microscopes we may not see illumination intensity
controllable by software.  Maybe for other types of cameras we will.

Regards,
Andy




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

* Re: [PATCH] Illuminators control
  2010-09-13  7:08 ` Laurent Pinchart
@ 2010-09-13  8:07   ` Hans Verkuil
  2010-09-13 12:49     ` Andy Walls
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Verkuil @ 2010-09-13  8:07 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Jean-Francois Moine, linux-media

On Monday, September 13, 2010 09:08:36 Laurent Pinchart wrote:
> Hi,
> 
> On Saturday 11 September 2010 11:03:50 Jean-Francois Moine wrote:
> 
> > @@ -419,6 +421,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
> v4l2_ctrl_type *type,
> >  	case V4L2_CID_AUDIO_LIMITER_ENABLED:
> >  	case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
> >  	case V4L2_CID_PILOT_TONE_ENABLED:
> > +	case V4L2_CID_ILLUMINATORS_1:
> > +	case V4L2_CID_ILLUMINATORS_2:
> >  		*type = V4L2_CTRL_TYPE_BOOLEAN;
> >  		*min = 0;
> >  		*max = *step = 1;
> 
> I would prefer integer controls for this, as we will need to support dimmable 
> illuminators.
> 
> 

Don't. That should be a separate control. I expect that the brightness is
something you touch a lot less than the on/of controls. Anyway, I think it
makes a lot more sense to separate these two functions.

Regards,

	Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco

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

* Re: [PATCH] Illuminators control
  2010-09-11  9:03 Jean-Francois Moine
  2010-09-11  9:31 ` Hans Verkuil
  2010-09-11 14:20 ` Andy Walls
@ 2010-09-13  7:08 ` Laurent Pinchart
  2010-09-13  8:07   ` Hans Verkuil
  2 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2010-09-13  7:08 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: linux-media

Hi,

On Saturday 11 September 2010 11:03:50 Jean-Francois Moine wrote:

> @@ -419,6 +421,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
>  	case V4L2_CID_AUDIO_LIMITER_ENABLED:
>  	case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
>  	case V4L2_CID_PILOT_TONE_ENABLED:
> +	case V4L2_CID_ILLUMINATORS_1:
> +	case V4L2_CID_ILLUMINATORS_2:
>  		*type = V4L2_CTRL_TYPE_BOOLEAN;
>  		*min = 0;
>  		*max = *step = 1;

I would prefer integer controls for this, as we will need to support dimmable 
illuminators.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH] Illuminators control
  2010-09-11  9:03 Jean-Francois Moine
  2010-09-11  9:31 ` Hans Verkuil
@ 2010-09-11 14:20 ` Andy Walls
  2010-09-13  7:08 ` Laurent Pinchart
  2 siblings, 0 replies; 8+ messages in thread
From: Andy Walls @ 2010-09-11 14:20 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: linux-media

On Sat, 2010-09-11 at 11:03 +0200, Jean-Francois Moine wrote:
> Hi,
> 
> This new proposal cancels the previous patch 'Illuminators control'.
> 
> Cheers.
> 

Acked-by: Andy Walls <awalls@md.metrocast.net>

I'll develop a new patch for gspca/cpia.c shortly.

Regards,
Andy


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

* Re: [PATCH] Illuminators control
  2010-09-11  9:03 Jean-Francois Moine
@ 2010-09-11  9:31 ` Hans Verkuil
  2010-09-11 14:20 ` Andy Walls
  2010-09-13  7:08 ` Laurent Pinchart
  2 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2010-09-11  9:31 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: linux-media

On Saturday, September 11, 2010 11:03:50 Jean-Francois Moine wrote:
> Hi,
> 
> This new proposal cancels the previous patch 'Illuminators control'.
> 
> Cheers.
> 
> 

Acked-by: Hans Verkuil <hverkuil@xs4all.nl>

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco

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

* [PATCH] Illuminators control
@ 2010-09-11  9:03 Jean-Francois Moine
  2010-09-11  9:31 ` Hans Verkuil
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jean-Francois Moine @ 2010-09-11  9:03 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

Hi,

This new proposal cancels the previous patch 'Illuminators control'.

Cheers.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

[-- Attachment #2: illuminator.pat --]
[-- Type: application/octet-stream, Size: 2747 bytes --]

Some media devices (microscopes) may have one or many illuminators.
This patch makes them controlable by the applications.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caa..68c8344 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
 	    information and bits 24-31 must be zero.</entry>
 	  </row>
 	  <row>
+	    <entry><constant>V4L2_CID_ILLUMINATORS_1</constant>
+		<constant>V4L2_CID_ILLUMINATORS_2</constant></entry>
+	    <entry>boolean</entry>
+	    <entry>Switch on or off the illuminator 1 or 2 of the device
+		(usually a microscope).</entry>
+	  </row>
+	  <row>
 	    <entry><constant>V4L2_CID_LASTP1</constant></entry>
 	    <entry></entry>
 	    <entry>End of the predefined control IDs (currently
-<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry>
+<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry>
 	  </row>
 	  <row>
 	    <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index ea8d32c..9d2502c 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -305,6 +305,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_ROTATE:			return "Rotate";
 	case V4L2_CID_BG_COLOR:			return "Background Color";
 	case V4L2_CID_CHROMA_GAIN:		return "Chroma Gain";
+	case V4L2_CID_ILLUMINATORS_1:		return "Illuminator 1";
+	case V4L2_CID_ILLUMINATORS_2:		return "Illuminator 2";
 
 	/* MPEG controls */
 	/* Keep the order of the 'case's the same as in videodev2.h! */
@@ -419,6 +421,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_AUDIO_LIMITER_ENABLED:
 	case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
 	case V4L2_CID_PILOT_TONE_ENABLED:
+	case V4L2_CID_ILLUMINATORS_1:
+	case V4L2_CID_ILLUMINATORS_2:
 		*type = V4L2_CTRL_TYPE_BOOLEAN;
 		*min = 0;
 		*max = *step = 1;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61490c6..65758cd 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1045,8 +1045,11 @@ enum v4l2_colorfx {
 
 #define V4L2_CID_CHROMA_GAIN                    (V4L2_CID_BASE+36)
 
+#define V4L2_CID_ILLUMINATORS_1			(V4L2_CID_BASE+37)
+#define V4L2_CID_ILLUMINATORS_2			(V4L2_CID_BASE+38)
+
 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+37)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+39)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)

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

end of thread, other threads:[~2010-09-13 12:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11  8:24 [PATCH] Illuminators control Jean-Francois Moine
2010-09-11  8:43 ` Hans Verkuil
2010-09-11  9:03 Jean-Francois Moine
2010-09-11  9:31 ` Hans Verkuil
2010-09-11 14:20 ` Andy Walls
2010-09-13  7:08 ` Laurent Pinchart
2010-09-13  8:07   ` Hans Verkuil
2010-09-13 12:49     ` Andy Walls

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.