[media] V4L: Extend V4L2_CID_COLORFX with more image effects
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 2 Apr 2012 09:40:19 +0000 (06:40 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 14 May 2012 17:02:23 +0000 (14:02 -0300)
This patch adds definition of additional color effects:

 - V4L2_COLORFX_AQUA,
 - V4L2_COLORFX_ART_FREEZE,
 - V4L2_COLORFX_SILHOUETTE,
 - V4L2_COLORFX_SOLARIZATION,
 - V4L2_COLORFX_ANTIQUE,
 - V4L2_COLORFX_SET_CBCR.

The new V4L2_COLORFX_CBCR control is added to allow setting
the fixed Cb, Cr values that replace chroma Cb/Cr coefficients
in case of V4L2_COLORFX_SET_CBCR effect.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Documentation/DocBook/media/v4l/compat.xml
Documentation/DocBook/media/v4l/controls.xml
Documentation/DocBook/media/v4l/v4l2.xml
drivers/media/video/v4l2-ctrls.c
include/linux/videodev2.h

index 87339b2aad78232f6890e9ac572dfa002c1f16f6..149f65dfaa72bf574e206c002819c6a3cb144a83 100644 (file)
@@ -2422,6 +2422,19 @@ details.</para>
          &VIDIOC-SUBDEV-G-SELECTION; and
          &VIDIOC-SUBDEV-S-SELECTION;.</para>
         </listitem>
+        <listitem>
+         <para> Added <constant>V4L2_COLORFX_ANTIQUE</constant>,
+         <constant>V4L2_COLORFX_ART_FREEZE</constant>,
+         <constant>V4L2_COLORFX_AQUA</constant>,
+         <constant>V4L2_COLORFX_SILHOUETTE</constant>,
+         <constant>V4L2_COLORFX_SOLARIZATION</constant>,
+         <constant>V4L2_COLORFX_VIVID</constant> and
+         <constant>V4L2_COLORFX_ARBITRARY_CBCR</constant> menu items
+         to the <constant>V4L2_CID_COLORFX</constant> control.</para>
+        </listitem>
+        <listitem>
+         <para> Added <constant>V4L2_CID_COLORFX_CBCR</constant> control.</para>
+        </listitem>
       </orderedlist>
     </section>
 
index 662127447aa6321227ffeec0b1f76757e09a2257..e2ff0f98f08de8176cd91961f1ad9c5ce2126f91 100644 (file)
@@ -285,18 +285,92 @@ minimum value disables backlight compensation.</entry>
          <row id="v4l2-colorfx">
            <entry><constant>V4L2_CID_COLORFX</constant></entry>
            <entry>enum</entry>
-           <entry>Selects a color effect. Possible values for
-<constant>enum v4l2_colorfx</constant> are:
-<constant>V4L2_COLORFX_NONE</constant> (0),
-<constant>V4L2_COLORFX_BW</constant> (1),
-<constant>V4L2_COLORFX_SEPIA</constant> (2),
-<constant>V4L2_COLORFX_NEGATIVE</constant> (3),
-<constant>V4L2_COLORFX_EMBOSS</constant> (4),
-<constant>V4L2_COLORFX_SKETCH</constant> (5),
-<constant>V4L2_COLORFX_SKY_BLUE</constant> (6),
-<constant>V4L2_COLORFX_GRASS_GREEN</constant> (7),
-<constant>V4L2_COLORFX_SKIN_WHITEN</constant> (8) and
-<constant>V4L2_COLORFX_VIVID</constant> (9).</entry>
+           <entry>Selects a color effect. The following values are defined:
+           </entry>
+         </row><row>
+         <entry></entry>
+         <entry></entry>
+           <entrytbl spanname="descr" cols="2">
+             <tbody valign="top">
+               <row>
+                 <entry><constant>V4L2_COLORFX_NONE</constant>&nbsp;</entry>
+                 <entry>Color effect is disabled.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_ANTIQUE</constant>&nbsp;</entry>
+                 <entry>An aging (old photo) effect.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_ART_FREEZE</constant>&nbsp;</entry>
+                 <entry>Frost color effect.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_AQUA</constant>&nbsp;</entry>
+                 <entry>Water color, cool tone.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_BW</constant>&nbsp;</entry>
+                 <entry>Black and white.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_EMBOSS</constant>&nbsp;</entry>
+                 <entry>Emboss, the highlights and shadows replace light/dark boundaries
+                 and low contrast areas are set to a gray background.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_GRASS_GREEN</constant>&nbsp;</entry>
+                 <entry>Grass green.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_NEGATIVE</constant>&nbsp;</entry>
+                 <entry>Negative.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SEPIA</constant>&nbsp;</entry>
+                 <entry>Sepia tone.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SKETCH</constant>&nbsp;</entry>
+                 <entry>Sketch.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SKIN_WHITEN</constant>&nbsp;</entry>
+                 <entry>Skin whiten.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SKY_BLUE</constant>&nbsp;</entry>
+                 <entry>Sky blue.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SOLARIZATION</constant>&nbsp;</entry>
+                 <entry>Solarization, the image is partially reversed in tone,
+                 only color values above or below a certain threshold are inverted.
+                 </entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SILHOUETTE</constant>&nbsp;</entry>
+                 <entry>Silhouette (outline).</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_VIVID</constant>&nbsp;</entry>
+                 <entry>Vivid colors.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_COLORFX_SET_CBCR</constant>&nbsp;</entry>
+                 <entry>The Cb and Cr chroma components are replaced by fixed
+                 coefficients determined by <constant>V4L2_CID_COLORFX_CBCR</constant>
+                 control.</entry>
+               </row>
+             </tbody>
+           </entrytbl>
+         </row>
+         <row>
+           <entry><constant>V4L2_CID_COLORFX_CBCR</constant></entry>
+           <entry>integer</entry>
+           <entry>Determines the Cb and Cr coefficients for <constant>V4L2_COLORFX_SET_CBCR</constant>
+           color effect. Bits [7:0] of the supplied 32 bit value are interpreted as
+           Cr component, bits [15:8] as Cb component and bits [31:16] must be zero.
+         </entry>
          </row>
          <row>
            <entry><constant>V4L2_CID_ROTATE</constant></entry>
index fbf808d242f754f3090dd1cddbb1ed03d098c361..63242e2adc02f29d7728de9aaa65609f91c1edf8 100644 (file)
@@ -141,9 +141,10 @@ applications. -->
       <revision>
        <revnumber>3.5</revnumber>
        <date>2012-04-02</date>
-       <authorinitials>sa</authorinitials>
+       <authorinitials>sa, sn</authorinitials>
        <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev
-           selections API.
+           selections API. Improved the description of V4L2_CID_COLORFX
+           control, added V4L2_CID_COLORFX_CBCR control.
        </revremark>
       </revision>
 
index e5531ace5ee76b5ebb868160e8241cb45cc8270f..9bd8a92419e13d086368e1fe04462aaf4deb4de7 100644 (file)
@@ -241,6 +241,12 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
                "Grass Green",
                "Skin Whiten",
                "Vivid",
+               "Aqua",
+               "Art Freeze",
+               "Silhouette",
+               "Solarization",
+               "Antique",
+               "Set Cb/Cr",
                NULL
        };
        static const char * const tune_preemphasis[] = {
@@ -493,6 +499,7 @@ const char *v4l2_ctrl_get_name(u32 id)
        case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE:  return "Min Number of Capture Buffers";
        case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT:   return "Min Number of Output Buffers";
        case V4L2_CID_ALPHA_COMPONENT:          return "Alpha Component";
+       case V4L2_CID_COLORFX_CBCR:             return "Color Effects, CbCr";
 
        /* MPEG controls */
        /* Keep the order of the 'case's the same as in videodev2.h! */
index 7f75846a4a0c2876cc8cf25f5d37c3de9019ddb1..07bce86f35488b51af65fa7886b4b4ea3cb08a31 100644 (file)
@@ -1248,16 +1248,22 @@ enum v4l2_power_line_frequency {
 #define V4L2_CID_COLOR_KILLER                   (V4L2_CID_BASE+30)
 #define V4L2_CID_COLORFX                       (V4L2_CID_BASE+31)
 enum v4l2_colorfx {
-       V4L2_COLORFX_NONE       = 0,
-       V4L2_COLORFX_BW         = 1,
-       V4L2_COLORFX_SEPIA      = 2,
-       V4L2_COLORFX_NEGATIVE = 3,
-       V4L2_COLORFX_EMBOSS = 4,
-       V4L2_COLORFX_SKETCH = 5,
-       V4L2_COLORFX_SKY_BLUE = 6,
-       V4L2_COLORFX_GRASS_GREEN = 7,
-       V4L2_COLORFX_SKIN_WHITEN = 8,
-       V4L2_COLORFX_VIVID = 9,
+       V4L2_COLORFX_NONE                       = 0,
+       V4L2_COLORFX_BW                         = 1,
+       V4L2_COLORFX_SEPIA                      = 2,
+       V4L2_COLORFX_NEGATIVE                   = 3,
+       V4L2_COLORFX_EMBOSS                     = 4,
+       V4L2_COLORFX_SKETCH                     = 5,
+       V4L2_COLORFX_SKY_BLUE                   = 6,
+       V4L2_COLORFX_GRASS_GREEN                = 7,
+       V4L2_COLORFX_SKIN_WHITEN                = 8,
+       V4L2_COLORFX_VIVID                      = 9,
+       V4L2_COLORFX_AQUA                       = 10,
+       V4L2_COLORFX_ART_FREEZE                 = 11,
+       V4L2_COLORFX_SILHOUETTE                 = 12,
+       V4L2_COLORFX_SOLARIZATION               = 13,
+       V4L2_COLORFX_ANTIQUE                    = 14,
+       V4L2_COLORFX_SET_CBCR                   = 15,
 };
 #define V4L2_CID_AUTOBRIGHTNESS                        (V4L2_CID_BASE+32)
 #define V4L2_CID_BAND_STOP_FILTER              (V4L2_CID_BASE+33)
@@ -1274,9 +1280,10 @@ enum v4l2_colorfx {
 #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT                (V4L2_CID_BASE+40)
 
 #define V4L2_CID_ALPHA_COMPONENT               (V4L2_CID_BASE+41)
+#define V4L2_CID_COLORFX_CBCR                  (V4L2_CID_BASE+42)
 
 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+42)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+43)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE                     (V4L2_CTRL_CLASS_MPEG | 0x900)