From dc1954f00c7cda9e1c5e6b60fb77d68e11ca9715 Mon Sep 17 00:00:00 2001
From: Josua Grawitter <grewater@googlemail.com>
Date: Sun, 7 Jun 2009 13:21:29 +0200
Subject: [PATCH 1/2] Clean namespace, move colour matrix to seperate header

	"Namespace pollution. Names like these are not good, because they may
	 clash with other stuff on the kernel, use a more meaningful name, and
	 keep it lower-case (upper case is generally for macro).
	 Also, it may be a good idea to move these into a header file."
	(Daniel Ribeiro)

Signed-off-by: Josua Grawitter <grewater@googlemail.com>
---
 sn9c20x-bridge.c |  327 +--------------------------------------------------
 sn9c20x-matrix.h |  341 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 348 insertions(+), 320 deletions(-)
 create mode 100644 sn9c20x-matrix.h

diff --git a/sn9c20x-bridge.c b/sn9c20x-bridge.c
index dddc0a4..07e9267 100644
--- a/sn9c20x-bridge.c
+++ b/sn9c20x-bridge.c
@@ -29,320 +29,7 @@
 #include <linux/string.h>
 #include "sn9c20x.h"
 #include "sn9c20x-bridge.h"
-
-
-
-/**
- * @var RX
- *   Coordinate X aray for eliptic HSV corrections, conditionaly Red pixel
- */
-static const int RX[] = {
-	41,  44,  46,  48,  50,  52,  54,  56,
-	58,  60,  62,  64,  66,  68,  70,  72,
-	74,  76,  78,  80,  81,  83,  85,  87,
-	88,  90,  92,  93,  95,  97,  98, 100,
-	101, 102, 104, 105, 107, 108, 109, 110,
-	112, 113, 114, 115, 116, 117, 118, 119,
-	120, 121, 122, 123, 123, 124, 125, 125,
-	126, 127, 127, 128, 128, 129, 129, 129,
-	130, 130, 130, 130, 131, 131, 131, 131,
-	131, 131, 131, 131, 130, 130, 130, 130,
-	129, 129, 129, 128, 128, 127, 127, 126,
-	125, 125, 124, 123, 122, 122, 121, 120,
-	119, 118, 117, 116, 115, 114, 112, 111,
-	110, 109, 107, 106, 105, 103, 102, 101,
-	99,  98,  96,  94,  93,  91,  90,  88,
-	86,  84,  83,  81,  79,  77,  75,  74,
-	72,  70,  68,  66,  64,  62,  60,  58,
-	56,  54,  52,  49,  47,  45,  43,  41,
-	39,  36,  34,  32,  30,  28,  25,  23,
-	21,  19,  16,  14,  12,   9,   7,   5,
-	3,   0,  -1,  -3,  -6,  -8, -10, -12,
-	-15, -17, -19, -22, -24, -26, -28, -30,
-	-33, -35, -37, -39, -41, -44, -46, -48,
-	-50, -52, -54, -56, -58, -60, -62, -64,
-	-66, -68, -70, -72, -74, -76, -78, -80,
-	-81, -83, -85, -87, -88, -90, -92, -93,
-	-95, -97, -98, -100, -101, -102, -104, -105,
-	-107, -108, -109, -110, -112, -113, -114, -115,
-	-116, -117, -118, -119, -120, -121, -122, -123,
-	-123, -124, -125, -125, -126, -127, -127, -128,
-	-128, -128, -128, -128, -128, -128, -128, -128,
-	-128, -128, -128, -128, -128, -128, -128, -128,
-	-128, -128, -128, -128, -128, -128, -128, -128,
-	-128, -127, -127, -126, -125, -125, -124, -123,
-	-122, -122, -121, -120, -119, -118, -117, -116,
-	-115, -114, -112, -111, -110, -109, -107, -106,
-	-105, -103, -102, -101, -99, -98, -96, -94,
-	-93, -91, -90, -88, -86, -84, -83, -81,
-	-79, -77, -75, -74, -72, -70, -68, -66,
-	-64, -62, -60, -58, -56, -54, -52, -49,
-	-47, -45, -43, -41, -39, -36, -34, -32,
-	-30, -28, -25, -23, -21, -19, -16, -14,
-	-12,  -9,  -7,  -5,  -3,   0,   1,   3,
-	6,   8,  10,  12,  15,  17,  19,  22,
-	24,  26,  28,  30,  33,  35,  37,  39, 41
-};
-/**
- * @var RY
- *   Coordinate Y aray for eliptic HSV corrections, conditionaly Red pixel
- */
-static const int RY[] = {
-	82,  80,  78,  76,  74,  73,  71,  69,
-	67,  65,  63,  61,  58,  56,  54,  52,
-	50,  48,  46,  44,  41,  39,  37,  35,
-	32,  30,  28,  26,  23,  21,  19,  16,
-	14,  12,  10,   7,   5,   3,   0,  -1,
-	-3,  -6,  -8, -10, -13, -15, -17, -19,
-	-22, -24, -26, -29, -31, -33, -35, -38,
-	-40, -42, -44, -46, -48, -51, -53, -55,
-	-57, -59, -61, -63, -65, -67, -69, -71,
-	-73, -75, -77, -79, -81, -82, -84, -86,
-	-88, -89, -91, -93, -94, -96, -98, -99,
-	-101, -102, -104, -105, -106, -108, -109, -110,
-	-112, -113, -114, -115, -116, -117, -119, -120,
-	-120, -121, -122, -123, -124, -125, -126, -126,
-	-127, -128, -128, -128, -128, -128, -128, -128,
-	-128, -128, -128, -128, -128, -128, -128, -128,
-	-128, -128, -128, -128, -128, -128, -128, -128,
-	-128, -128, -128, -128, -128, -128, -128, -128,
-	-127, -127, -126, -125, -125, -124, -123, -122,
-	-121, -120, -119, -118, -117, -116, -115, -114,
-	-113, -111, -110, -109, -107, -106, -105, -103,
-	-102, -100, -99, -97, -96, -94, -92, -91,
-	-89, -87, -85, -84, -82, -80, -78, -76,
-	-74, -73, -71, -69, -67, -65, -63, -61,
-	-58, -56, -54, -52, -50, -48, -46, -44,
-	-41, -39, -37, -35, -32, -30, -28, -26,
-	-23, -21, -19, -16, -14, -12, -10,  -7,
-	-5,  -3,   0,   1,   3,   6,   8,  10,
-	13,  15,  17,  19,  22,  24,  26,  29,
-	31,  33,  35,  38,  40,  42,  44,  46,
-	48,  51,  53,  55,  57,  59,  61,  63,
-	65,  67,  69,  71,  73,  75,  77,  79,
-	81,  82,  84,  86,  88,  89,  91,  93,
-	94,  96,  98,  99, 101, 102, 104, 105,
-	106, 108, 109, 110, 112, 113, 114, 115,
-	116, 117, 119, 120, 120, 121, 122, 123,
-	124, 125, 126, 126, 127, 128, 128, 129,
-	129, 130, 130, 131, 131, 131, 131, 132,
-	132, 132, 132, 132, 132, 132, 132, 132,
-	132, 132, 132, 131, 131, 131, 130, 130,
-	130, 129, 129, 128, 127, 127, 126, 125,
-	125, 124, 123, 122, 121, 120, 119, 118,
-	117, 116, 115, 114, 113, 111, 110, 109,
-	107, 106, 105, 103, 102, 100,  99,  97,
-	96, 94, 92, 91, 89, 87, 85, 84, 82
-};
-
-/**
- * @var GX
- *   Coordinate X aray for eliptic HSV corrections, conditionaly Green pixel
- */
-static const int GX[] = {
-	-124, -124, -125, -125, -125, -125, -125, -125,
-	-125, -126, -126, -125, -125, -125, -125, -125,
-	-125, -124, -124, -124, -123, -123, -122, -122,
-	-121, -121, -120, -120, -119, -118, -117, -117,
-	-116, -115, -114, -113, -112, -111, -110, -109,
-	-108, -107, -105, -104, -103, -102, -100, -99,
-	-98, -96, -95, -93, -92, -91, -89, -87,
-	-86, -84, -83, -81, -79, -77, -76, -74,
-	-72, -70, -69, -67, -65, -63, -61, -59,
-	-57, -55, -53, -51, -49, -47, -45, -43,
-	-41, -39, -37, -35, -33, -30, -28, -26,
-	-24, -22, -20, -18, -15, -13, -11,  -9,
-	-7,  -4,  -2,   0,   1,   3,   6,   8,
-	10,  12,  14,  17,  19,  21,  23,  25,
-	27,  29,  32,  34,  36,  38,  40,  42,
-	44,  46,  48,  50,  52,  54,  56,  58,
-	60,  62,  64,  66,  68,  70,  71,  73,
-	75,  77,  78,  80,  82,  83,  85,  87,
-	88,  90,  91,  93,  94,  96,  97,  98,
-	100, 101, 102, 104, 105, 106, 107, 108,
-	109, 111, 112, 113, 113, 114, 115, 116,
-	117, 118, 118, 119, 120, 120, 121, 122,
-	122, 123, 123, 124, 124, 124, 125, 125,
-	125, 125, 125, 125, 125, 126, 126, 125,
-	125, 125, 125, 125, 125, 124, 124, 124,
-	123, 123, 122, 122, 121, 121, 120, 120,
-	119, 118, 117, 117, 116, 115, 114, 113,
-	112, 111, 110, 109, 108, 107, 105, 104,
-	103, 102, 100,  99,  98,  96,  95,  93,
-	92,  91,  89,  87,  86,  84,  83,  81,
-	79,  77,  76,  74,  72,  70,  69,  67,
-	65,  63,  61,  59,  57,  55,  53,  51,
-	49,  47,  45,  43,  41,  39,  37,  35,
-	33,  30,  28,  26,  24,  22,  20,  18,
-	15,  13,  11,   9,   7,   4,   2,   0,
-	-1,  -3,  -6,  -8, -10, -12, -14, -17,
-	-19, -21, -23, -25, -27, -29, -32, -34,
-	-36, -38, -40, -42, -44, -46, -48, -50,
-	-52, -54, -56, -58, -60, -62, -64, -66,
-	-68, -70, -71, -73, -75, -77, -78, -80,
-	-82, -83, -85, -87, -88, -90, -91, -93,
-	-94, -96, -97, -98, -100, -101, -102, -104,
-	-105, -106, -107, -108, -109, -111, -112, -113,
-	-113, -114, -115, -116, -117, -118, -118, -119,
-	-120, -120, -121, -122, -122, -123, -123, -124, -124
-};
-
-/**
- * @var GY
- *   Coordinate Y aray for eliptic HSV corrections, conditionaly Green pixel
- */
-static const int GY[] = {
-	-100, -99, -98, -97, -95, -94, -93, -91,
-	-90, -89, -87, -86, -84, -83, -81, -80,
-	-78, -76, -75, -73, -71, -70, -68, -66,
-	-64, -63, -61, -59, -57, -55, -53, -51,
-	-49, -48, -46, -44, -42, -40, -38, -36,
-	-34, -32, -30, -27, -25, -23, -21, -19,
-	-17, -15, -13, -11,  -9,  -7,  -4,  -2,
-	0,   1,   3,   5,   7,   9,  11,  14,
-	16,  18,  20,  22,  24,  26,  28,  30,
-	32,  34,  36,  38,  40,  42,  44,  46,
-	48,  50,  52,  54,  56,  58,  59,  61,
-	63,  65,  67,  68,  70,  72,  74,  75,
-	77,  78,  80,  82,  83,  85,  86,  88,
-	89,  90,  92,  93,  95,  96,  97,  98,
-	100, 101, 102, 103, 104, 105, 106, 107,
-	108, 109, 110, 111, 112, 112, 113, 114,
-	115, 115, 116, 116, 117, 117, 118, 118,
-	119, 119, 119, 120, 120, 120, 120, 120,
-	121, 121, 121, 121, 121, 121, 120, 120,
-	120, 120, 120, 119, 119, 119, 118, 118,
-	117, 117, 116, 116, 115, 114, 114, 113,
-	112, 111, 111, 110, 109, 108, 107, 106,
-	105, 104, 103, 102, 100,  99,  98,  97,
-	95,  94,  93,  91,  90,  89,  87,  86,
-	84,  83,  81,  80,  78,  76,  75,  73,
-	71,  70,  68,  66,  64,  63,  61,  59,
-	57,  55,  53,  51,  49,  48,  46,  44,
-	42,  40,  38,  36,  34,  32,  30,  27,
-	25,  23,  21,  19,  17,  15,  13,  11,
-	9,   7,   4,   2,   0,  -1,  -3,  -5,
-	-7,  -9, -11, -14, -16, -18, -20, -22,
-	-24, -26, -28, -30, -32, -34, -36, -38,
-	-40, -42, -44, -46, -48, -50, -52, -54,
-	-56, -58, -59, -61, -63, -65, -67, -68,
-	-70, -72, -74, -75, -77, -78, -80, -82,
-	-83, -85, -86, -88, -89, -90, -92, -93,
-	-95, -96, -97, -98, -100, -101, -102, -103,
-	-104, -105, -106, -107, -108, -109, -110, -111,
-	-112, -112, -113, -114, -115, -115, -116, -116,
-	-117, -117, -118, -118, -119, -119, -119, -120,
-	-120, -120, -120, -120, -121, -121, -121, -121,
-	-121, -121, -120, -120, -120, -120, -120, -119,
-	-119, -119, -118, -118, -117, -117, -116, -116,
-	-115, -114, -114, -113, -112, -111, -111, -110,
-	-109, -108, -107, -106, -105, -104, -103, -102, -100
-};
-
-/**
- * @var BX
- *   Coordinate X aray for eliptic HSV corrections, conditionaly Blue pixel
- */
-static const int BX[] = {
-	112, 113, 114, 114, 115, 116, 117, 117,
-	118, 118, 119, 119, 120, 120, 120, 121,
-	121, 121, 122, 122, 122, 122, 122, 122,
-	122, 122, 122, 122, 122, 122, 121, 121,
-	121, 120, 120, 120, 119, 119, 118, 118,
-	117, 116, 116, 115, 114, 113, 113, 112,
-	111, 110, 109, 108, 107, 106, 105, 104,
-	103, 102, 100,  99,  98,  97,  95,  94,
-	93,  91,  90,  88,  87,  85,  84,  82,
-	80,  79,  77,  76,  74,  72,  70,  69,
-	67,  65,  63,  61,  60,  58,  56,  54,
-	52,  50,  48,  46,  44,  42,  40,  38,
-	36,  34,  32,  30,  28,  26,  24,  22,
-	19,  17,  15,  13,  11,   9,   7,   5,
-	2,   0,  -1,  -3,  -5,  -7,  -9, -12,
-	-14, -16, -18, -20, -22, -24, -26, -28,
-	-31, -33, -35, -37, -39, -41, -43, -45,
-	-47, -49, -51, -53, -54, -56, -58, -60,
-	-62, -64, -66, -67, -69, -71, -73, -74,
-	-76, -78, -79, -81, -83, -84, -86, -87,
-	-89, -90, -92, -93, -94, -96, -97, -98,
-	-99, -101, -102, -103, -104, -105, -106, -107,
-	-108, -109, -110, -111, -112, -113, -114, -114,
-	-115, -116, -117, -117, -118, -118, -119, -119,
-	-120, -120, -120, -121, -121, -121, -122, -122,
-	-122, -122, -122, -122, -122, -122, -122, -122,
-	-122, -122, -121, -121, -121, -120, -120, -120,
-	-119, -119, -118, -118, -117, -116, -116, -115,
-	-114, -113, -113, -112, -111, -110, -109, -108,
-	-107, -106, -105, -104, -103, -102, -100, -99,
-	-98, -97, -95, -94, -93, -91, -90, -88,
-	-87, -85, -84, -82, -80, -79, -77, -76,
-	-74, -72, -70, -69, -67, -65, -63, -61,
-	-60, -58, -56, -54, -52, -50, -48, -46,
-	-44, -42, -40, -38, -36, -34, -32, -30,
-	-28, -26, -24, -22, -19, -17, -15, -13,
-	-11,  -9,  -7,  -5,  -2,   0,   1,   3,
-	5,   7,   9,  12,  14,  16,  18,  20,
-	22,  24,  26,  28,  31,  33,  35,  37,
-	39,  41,  43,  45,  47,  49,  51,  53,
-	54,  56,  58,  60,  62,  64,  66,  67,
-	69,  71,  73,  74,  76,  78,  79,  81,
-	83,  84,  86,  87,  89,  90,  92,  93,
-	94,  96,  97,  98,  99, 101, 102, 103,
-	104, 105, 106, 107, 108, 109, 110, 111, 112
-};
-
-/**
- * @var BY
- *   Coordinate Y aray for eliptic HSV corrections, conditionaly Blue pixel
- */
-static const int BY[] = {
-	-11, -13, -15, -17, -19, -21, -23, -25,
-	-27, -29, -31, -33, -35, -37, -39, -41,
-	-43, -45, -46, -48, -50, -52, -54, -55,
-	-57, -59, -61, -62, -64, -66, -67, -69,
-	-71, -72, -74, -75, -77, -78, -80, -81,
-	-83, -84, -86, -87, -88, -90, -91, -92,
-	-93, -95, -96, -97, -98, -99, -100, -101,
-	-102, -103, -104, -105, -106, -106, -107, -108,
-	-109, -109, -110, -111, -111, -112, -112, -113,
-	-113, -114, -114, -114, -115, -115, -115, -115,
-	-116, -116, -116, -116, -116, -116, -116, -116,
-	-116, -115, -115, -115, -115, -114, -114, -114,
-	-113, -113, -112, -112, -111, -111, -110, -110,
-	-109, -108, -108, -107, -106, -105, -104, -103,
-	-102, -101, -100, -99, -98, -97, -96, -95,
-	-94, -93, -91, -90, -89, -88, -86, -85,
-	-84, -82, -81, -79, -78, -76, -75, -73,
-	-71, -70, -68, -67, -65, -63, -62, -60,
-	-58, -56, -55, -53, -51, -49, -47, -45,
-	-44, -42, -40, -38, -36, -34, -32, -30,
-	-28, -26, -24, -22, -20, -18, -16, -14,
-	-12, -10,  -8,  -6,  -4,  -2,   0,   1,
-	3,   5,   7,   9,  11,  13,  15,  17,
-	19,  21,  23,  25,  27,  29,  31,  33,
-	35,  37,  39,  41,  43,  45,  46,  48,
-	50,  52,  54,  55,  57,  59,  61,  62,
-	64,  66,  67,  69,  71,  72,  74,  75,
-	77,  78,  80,  81,  83,  84,  86,  87,
-	88,  90,  91,  92,  93,  95,  96,  97,
-	98,  99, 100, 101, 102, 103, 104, 105,
-	106, 106, 107, 108, 109, 109, 110, 111,
-	111, 112, 112, 113, 113, 114, 114, 114,
-	115, 115, 115, 115, 116, 116, 116, 116,
-	116, 116, 116, 116, 116, 115, 115, 115,
-	115, 114, 114, 114, 113, 113, 112, 112,
-	111, 111, 110, 110, 109, 108, 108, 107,
-	106, 105, 104, 103, 102, 101, 100,  99,
-	98,  97,  96,  95,  94,  93,  91,  90,
-	89,  88,  86,  85,  84,  82,  81,  79,
-	78,  76,  75,  73,  71,  70,  68,  67,
-	65,  63,  62,  60,  58,  56,  55,  53,
-	51,  49,  47,  45,  44,  42,  40,  38,
-	36,  34,  32,  30,  28,  26,  24,  22,
-	20,  18,  16,  14,  12,  10,   8,   6,
-	4,   2,   0,  -1,  -3,  -5,  -7,  -9, -11
-};
-
+#include "sn9c20x-matrix.h"
 
 int sn9c20x_set_camera_control(struct usb_sn9c20x *dev,
 	__u32 control, __s32 value)
@@ -834,32 +521,32 @@ int sn9c20x_set_color(struct usb_sn9c20x *dev)
 	value = 180 + dev->vsettings.hue;
 
 	/* Calculate HUE and SATURATION */
-	tmp_coordinate = (long)(RX[value]);
+	tmp_coordinate = (long)(sn9c20x_red_x[value]);
 	tmp_coordinate = (tmp_coordinate * dev->vsettings.colour) >> 8;
 	cmatrix[6] = (unsigned char)(tmp_coordinate & 0xff);
 	cmatrix[7] = (unsigned char)((tmp_coordinate >> 8) & 0x0f);
 
-	tmp_coordinate = (long)(RY[value]);
+	tmp_coordinate = (long)(sn9c20x_red_y[value]);
 	tmp_coordinate = (tmp_coordinate * dev->vsettings.colour) >> 8;
 	cmatrix[8] = (unsigned char)(tmp_coordinate & 0xff);
 	cmatrix[9] = (unsigned char)((tmp_coordinate >> 8) & 0x0f);
 
-	tmp_coordinate = (long)(GX[value]);
+	tmp_coordinate = (long)(sn9c20x_green_x[value]);
 	tmp_coordinate = (tmp_coordinate * dev->vsettings.colour) >> 8;
 	cmatrix[10] = (unsigned char)(tmp_coordinate & 0xff);
 	cmatrix[11] = (unsigned char)((tmp_coordinate >> 8) & 0x0f);
 
-	tmp_coordinate = (long)(GY[value]);
+	tmp_coordinate = (long)(sn9c20x_green_y[value]);
 	tmp_coordinate = (tmp_coordinate * dev->vsettings.colour) >> 8;
 	cmatrix[12] = (unsigned char)(tmp_coordinate & 0xff);
 	cmatrix[13] = (unsigned char)((tmp_coordinate >> 8) & 0x0f);
 
-	tmp_coordinate = (long)(BX[value]);
+	tmp_coordinate = (long)(sn9c20x_blue_x[value]);
 	tmp_coordinate = (tmp_coordinate * dev->vsettings.colour) >> 8;
 	cmatrix[14] = (unsigned char)(tmp_coordinate & 0xff);
 	cmatrix[15] = (unsigned char)((tmp_coordinate >> 8) & 0x0f);
 
-	tmp_coordinate = (long)(BY[value]);
+	tmp_coordinate = (long)(sn9c20x_blue_y[value]);
 	tmp_coordinate = (tmp_coordinate * dev->vsettings.colour) >> 8;
 	cmatrix[16] = (unsigned char)(tmp_coordinate & 0xff);
 	cmatrix[17] = (unsigned char)((tmp_coordinate >> 8) & 0x0f);
diff --git a/sn9c20x-matrix.h b/sn9c20x-matrix.h
new file mode 100644
index 0000000..813b60f
--- /dev/null
+++ b/sn9c20x-matrix.h
@@ -0,0 +1,341 @@
+/**
+ * @file sn9c20x-matrix.h
+ * @author Boris Borisov
+ * @date 2009-06-07
+ *
+ * @brief Contains data necessary to calculate saturation and hue
+ *
+ * @note Copyright (C) Boris Borisov
+ *
+ * @par Licences
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SN9C20X_MATRIX_H
+#define SN9C20X_MATRIX_H
+
+/**
+ * @var sn9c20x_red_x
+ *   Coordinate X aray for eliptic HSV corrections, conditionaly Red pixel
+ */
+static const int sn9c20x_red_x[] = {
+	41,  44,  46,  48,  50,  52,  54,  56,
+	58,  60,  62,  64,  66,  68,  70,  72,
+	74,  76,  78,  80,  81,  83,  85,  87,
+	88,  90,  92,  93,  95,  97,  98, 100,
+	101, 102, 104, 105, 107, 108, 109, 110,
+	112, 113, 114, 115, 116, 117, 118, 119,
+	120, 121, 122, 123, 123, 124, 125, 125,
+	126, 127, 127, 128, 128, 129, 129, 129,
+	130, 130, 130, 130, 131, 131, 131, 131,
+	131, 131, 131, 131, 130, 130, 130, 130,
+	129, 129, 129, 128, 128, 127, 127, 126,
+	125, 125, 124, 123, 122, 122, 121, 120,
+	119, 118, 117, 116, 115, 114, 112, 111,
+	110, 109, 107, 106, 105, 103, 102, 101,
+	99,  98,  96,  94,  93,  91,  90,  88,
+	86,  84,  83,  81,  79,  77,  75,  74,
+	72,  70,  68,  66,  64,  62,  60,  58,
+	56,  54,  52,  49,  47,  45,  43,  41,
+	39,  36,  34,  32,  30,  28,  25,  23,
+	21,  19,  16,  14,  12,   9,   7,   5,
+	3,   0,  -1,  -3,  -6,  -8, -10, -12,
+	-15, -17, -19, -22, -24, -26, -28, -30,
+	-33, -35, -37, -39, -41, -44, -46, -48,
+	-50, -52, -54, -56, -58, -60, -62, -64,
+	-66, -68, -70, -72, -74, -76, -78, -80,
+	-81, -83, -85, -87, -88, -90, -92, -93,
+	-95, -97, -98, -100, -101, -102, -104, -105,
+	-107, -108, -109, -110, -112, -113, -114, -115,
+	-116, -117, -118, -119, -120, -121, -122, -123,
+	-123, -124, -125, -125, -126, -127, -127, -128,
+	-128, -128, -128, -128, -128, -128, -128, -128,
+	-128, -128, -128, -128, -128, -128, -128, -128,
+	-128, -128, -128, -128, -128, -128, -128, -128,
+	-128, -127, -127, -126, -125, -125, -124, -123,
+	-122, -122, -121, -120, -119, -118, -117, -116,
+	-115, -114, -112, -111, -110, -109, -107, -106,
+	-105, -103, -102, -101, -99, -98, -96, -94,
+	-93, -91, -90, -88, -86, -84, -83, -81,
+	-79, -77, -75, -74, -72, -70, -68, -66,
+	-64, -62, -60, -58, -56, -54, -52, -49,
+	-47, -45, -43, -41, -39, -36, -34, -32,
+	-30, -28, -25, -23, -21, -19, -16, -14,
+	-12,  -9,  -7,  -5,  -3,   0,   1,   3,
+	6,   8,  10,  12,  15,  17,  19,  22,
+	24,  26,  28,  30,  33,  35,  37,  39, 41
+};
+/**
+ * @var sn9c20x_red_y
+ *   Coordinate Y aray for eliptic HSV corrections, conditionaly Red pixel
+ */
+static const int sn9c20x_red_y[] = {
+	82,  80,  78,  76,  74,  73,  71,  69,
+	67,  65,  63,  61,  58,  56,  54,  52,
+	50,  48,  46,  44,  41,  39,  37,  35,
+	32,  30,  28,  26,  23,  21,  19,  16,
+	14,  12,  10,   7,   5,   3,   0,  -1,
+	-3,  -6,  -8, -10, -13, -15, -17, -19,
+	-22, -24, -26, -29, -31, -33, -35, -38,
+	-40, -42, -44, -46, -48, -51, -53, -55,
+	-57, -59, -61, -63, -65, -67, -69, -71,
+	-73, -75, -77, -79, -81, -82, -84, -86,
+	-88, -89, -91, -93, -94, -96, -98, -99,
+	-101, -102, -104, -105, -106, -108, -109, -110,
+	-112, -113, -114, -115, -116, -117, -119, -120,
+	-120, -121, -122, -123, -124, -125, -126, -126,
+	-127, -128, -128, -128, -128, -128, -128, -128,
+	-128, -128, -128, -128, -128, -128, -128, -128,
+	-128, -128, -128, -128, -128, -128, -128, -128,
+	-128, -128, -128, -128, -128, -128, -128, -128,
+	-127, -127, -126, -125, -125, -124, -123, -122,
+	-121, -120, -119, -118, -117, -116, -115, -114,
+	-113, -111, -110, -109, -107, -106, -105, -103,
+	-102, -100, -99, -97, -96, -94, -92, -91,
+	-89, -87, -85, -84, -82, -80, -78, -76,
+	-74, -73, -71, -69, -67, -65, -63, -61,
+	-58, -56, -54, -52, -50, -48, -46, -44,
+	-41, -39, -37, -35, -32, -30, -28, -26,
+	-23, -21, -19, -16, -14, -12, -10,  -7,
+	-5,  -3,   0,   1,   3,   6,   8,  10,
+	13,  15,  17,  19,  22,  24,  26,  29,
+	31,  33,  35,  38,  40,  42,  44,  46,
+	48,  51,  53,  55,  57,  59,  61,  63,
+	65,  67,  69,  71,  73,  75,  77,  79,
+	81,  82,  84,  86,  88,  89,  91,  93,
+	94,  96,  98,  99, 101, 102, 104, 105,
+	106, 108, 109, 110, 112, 113, 114, 115,
+	116, 117, 119, 120, 120, 121, 122, 123,
+	124, 125, 126, 126, 127, 128, 128, 129,
+	129, 130, 130, 131, 131, 131, 131, 132,
+	132, 132, 132, 132, 132, 132, 132, 132,
+	132, 132, 132, 131, 131, 131, 130, 130,
+	130, 129, 129, 128, 127, 127, 126, 125,
+	125, 124, 123, 122, 121, 120, 119, 118,
+	117, 116, 115, 114, 113, 111, 110, 109,
+	107, 106, 105, 103, 102, 100,  99,  97,
+	96, 94, 92, 91, 89, 87, 85, 84, 82
+};
+
+/**
+ * @var sn9c20x_green_x
+ *   Coordinate X aray for eliptic HSV corrections, conditionaly Green pixel
+ */
+static const int sn9c20x_green_x[] = {
+	-124, -124, -125, -125, -125, -125, -125, -125,
+	-125, -126, -126, -125, -125, -125, -125, -125,
+	-125, -124, -124, -124, -123, -123, -122, -122,
+	-121, -121, -120, -120, -119, -118, -117, -117,
+	-116, -115, -114, -113, -112, -111, -110, -109,
+	-108, -107, -105, -104, -103, -102, -100, -99,
+	-98, -96, -95, -93, -92, -91, -89, -87,
+	-86, -84, -83, -81, -79, -77, -76, -74,
+	-72, -70, -69, -67, -65, -63, -61, -59,
+	-57, -55, -53, -51, -49, -47, -45, -43,
+	-41, -39, -37, -35, -33, -30, -28, -26,
+	-24, -22, -20, -18, -15, -13, -11,  -9,
+	-7,  -4,  -2,   0,   1,   3,   6,   8,
+	10,  12,  14,  17,  19,  21,  23,  25,
+	27,  29,  32,  34,  36,  38,  40,  42,
+	44,  46,  48,  50,  52,  54,  56,  58,
+	60,  62,  64,  66,  68,  70,  71,  73,
+	75,  77,  78,  80,  82,  83,  85,  87,
+	88,  90,  91,  93,  94,  96,  97,  98,
+	100, 101, 102, 104, 105, 106, 107, 108,
+	109, 111, 112, 113, 113, 114, 115, 116,
+	117, 118, 118, 119, 120, 120, 121, 122,
+	122, 123, 123, 124, 124, 124, 125, 125,
+	125, 125, 125, 125, 125, 126, 126, 125,
+	125, 125, 125, 125, 125, 124, 124, 124,
+	123, 123, 122, 122, 121, 121, 120, 120,
+	119, 118, 117, 117, 116, 115, 114, 113,
+	112, 111, 110, 109, 108, 107, 105, 104,
+	103, 102, 100,  99,  98,  96,  95,  93,
+	92,  91,  89,  87,  86,  84,  83,  81,
+	79,  77,  76,  74,  72,  70,  69,  67,
+	65,  63,  61,  59,  57,  55,  53,  51,
+	49,  47,  45,  43,  41,  39,  37,  35,
+	33,  30,  28,  26,  24,  22,  20,  18,
+	15,  13,  11,   9,   7,   4,   2,   0,
+	-1,  -3,  -6,  -8, -10, -12, -14, -17,
+	-19, -21, -23, -25, -27, -29, -32, -34,
+	-36, -38, -40, -42, -44, -46, -48, -50,
+	-52, -54, -56, -58, -60, -62, -64, -66,
+	-68, -70, -71, -73, -75, -77, -78, -80,
+	-82, -83, -85, -87, -88, -90, -91, -93,
+	-94, -96, -97, -98, -100, -101, -102, -104,
+	-105, -106, -107, -108, -109, -111, -112, -113,
+	-113, -114, -115, -116, -117, -118, -118, -119,
+	-120, -120, -121, -122, -122, -123, -123, -124, -124
+};
+
+/**
+ * @var sn9x20x_green_y
+ *   Coordinate Y aray for eliptic HSV corrections, conditionaly Green pixel
+ */
+static const int sn9c20x_green_y[] = {
+	-100, -99, -98, -97, -95, -94, -93, -91,
+	-90, -89, -87, -86, -84, -83, -81, -80,
+	-78, -76, -75, -73, -71, -70, -68, -66,
+	-64, -63, -61, -59, -57, -55, -53, -51,
+	-49, -48, -46, -44, -42, -40, -38, -36,
+	-34, -32, -30, -27, -25, -23, -21, -19,
+	-17, -15, -13, -11,  -9,  -7,  -4,  -2,
+	0,   1,   3,   5,   7,   9,  11,  14,
+	16,  18,  20,  22,  24,  26,  28,  30,
+	32,  34,  36,  38,  40,  42,  44,  46,
+	48,  50,  52,  54,  56,  58,  59,  61,
+	63,  65,  67,  68,  70,  72,  74,  75,
+	77,  78,  80,  82,  83,  85,  86,  88,
+	89,  90,  92,  93,  95,  96,  97,  98,
+	100, 101, 102, 103, 104, 105, 106, 107,
+	108, 109, 110, 111, 112, 112, 113, 114,
+	115, 115, 116, 116, 117, 117, 118, 118,
+	119, 119, 119, 120, 120, 120, 120, 120,
+	121, 121, 121, 121, 121, 121, 120, 120,
+	120, 120, 120, 119, 119, 119, 118, 118,
+	117, 117, 116, 116, 115, 114, 114, 113,
+	112, 111, 111, 110, 109, 108, 107, 106,
+	105, 104, 103, 102, 100,  99,  98,  97,
+	95,  94,  93,  91,  90,  89,  87,  86,
+	84,  83,  81,  80,  78,  76,  75,  73,
+	71,  70,  68,  66,  64,  63,  61,  59,
+	57,  55,  53,  51,  49,  48,  46,  44,
+	42,  40,  38,  36,  34,  32,  30,  27,
+	25,  23,  21,  19,  17,  15,  13,  11,
+	9,   7,   4,   2,   0,  -1,  -3,  -5,
+	-7,  -9, -11, -14, -16, -18, -20, -22,
+	-24, -26, -28, -30, -32, -34, -36, -38,
+	-40, -42, -44, -46, -48, -50, -52, -54,
+	-56, -58, -59, -61, -63, -65, -67, -68,
+	-70, -72, -74, -75, -77, -78, -80, -82,
+	-83, -85, -86, -88, -89, -90, -92, -93,
+	-95, -96, -97, -98, -100, -101, -102, -103,
+	-104, -105, -106, -107, -108, -109, -110, -111,
+	-112, -112, -113, -114, -115, -115, -116, -116,
+	-117, -117, -118, -118, -119, -119, -119, -120,
+	-120, -120, -120, -120, -121, -121, -121, -121,
+	-121, -121, -120, -120, -120, -120, -120, -119,
+	-119, -119, -118, -118, -117, -117, -116, -116,
+	-115, -114, -114, -113, -112, -111, -111, -110,
+	-109, -108, -107, -106, -105, -104, -103, -102, -100
+};
+
+/**
+ * @var sn9c20x_blue_x
+ *   Coordinate X aray for eliptic HSV corrections, conditionaly Blue pixel
+ */
+static const int sn9c20x_blue_x[] = {
+	112, 113, 114, 114, 115, 116, 117, 117,
+	118, 118, 119, 119, 120, 120, 120, 121,
+	121, 121, 122, 122, 122, 122, 122, 122,
+	122, 122, 122, 122, 122, 122, 121, 121,
+	121, 120, 120, 120, 119, 119, 118, 118,
+	117, 116, 116, 115, 114, 113, 113, 112,
+	111, 110, 109, 108, 107, 106, 105, 104,
+	103, 102, 100,  99,  98,  97,  95,  94,
+	93,  91,  90,  88,  87,  85,  84,  82,
+	80,  79,  77,  76,  74,  72,  70,  69,
+	67,  65,  63,  61,  60,  58,  56,  54,
+	52,  50,  48,  46,  44,  42,  40,  38,
+	36,  34,  32,  30,  28,  26,  24,  22,
+	19,  17,  15,  13,  11,   9,   7,   5,
+	2,   0,  -1,  -3,  -5,  -7,  -9, -12,
+	-14, -16, -18, -20, -22, -24, -26, -28,
+	-31, -33, -35, -37, -39, -41, -43, -45,
+	-47, -49, -51, -53, -54, -56, -58, -60,
+	-62, -64, -66, -67, -69, -71, -73, -74,
+	-76, -78, -79, -81, -83, -84, -86, -87,
+	-89, -90, -92, -93, -94, -96, -97, -98,
+	-99, -101, -102, -103, -104, -105, -106, -107,
+	-108, -109, -110, -111, -112, -113, -114, -114,
+	-115, -116, -117, -117, -118, -118, -119, -119,
+	-120, -120, -120, -121, -121, -121, -122, -122,
+	-122, -122, -122, -122, -122, -122, -122, -122,
+	-122, -122, -121, -121, -121, -120, -120, -120,
+	-119, -119, -118, -118, -117, -116, -116, -115,
+	-114, -113, -113, -112, -111, -110, -109, -108,
+	-107, -106, -105, -104, -103, -102, -100, -99,
+	-98, -97, -95, -94, -93, -91, -90, -88,
+	-87, -85, -84, -82, -80, -79, -77, -76,
+	-74, -72, -70, -69, -67, -65, -63, -61,
+	-60, -58, -56, -54, -52, -50, -48, -46,
+	-44, -42, -40, -38, -36, -34, -32, -30,
+	-28, -26, -24, -22, -19, -17, -15, -13,
+	-11,  -9,  -7,  -5,  -2,   0,   1,   3,
+	5,   7,   9,  12,  14,  16,  18,  20,
+	22,  24,  26,  28,  31,  33,  35,  37,
+	39,  41,  43,  45,  47,  49,  51,  53,
+	54,  56,  58,  60,  62,  64,  66,  67,
+	69,  71,  73,  74,  76,  78,  79,  81,
+	83,  84,  86,  87,  89,  90,  92,  93,
+	94,  96,  97,  98,  99, 101, 102, 103,
+	104, 105, 106, 107, 108, 109, 110, 111, 112
+};
+
+/**
+ * @var sn9c20x_blue_y
+ *   Coordinate Y aray for eliptic HSV corrections, conditionaly Blue pixel
+ */
+static const int sn9c20x_blue_y[] = {
+	-11, -13, -15, -17, -19, -21, -23, -25,
+	-27, -29, -31, -33, -35, -37, -39, -41,
+	-43, -45, -46, -48, -50, -52, -54, -55,
+	-57, -59, -61, -62, -64, -66, -67, -69,
+	-71, -72, -74, -75, -77, -78, -80, -81,
+	-83, -84, -86, -87, -88, -90, -91, -92,
+	-93, -95, -96, -97, -98, -99, -100, -101,
+	-102, -103, -104, -105, -106, -106, -107, -108,
+	-109, -109, -110, -111, -111, -112, -112, -113,
+	-113, -114, -114, -114, -115, -115, -115, -115,
+	-116, -116, -116, -116, -116, -116, -116, -116,
+	-116, -115, -115, -115, -115, -114, -114, -114,
+	-113, -113, -112, -112, -111, -111, -110, -110,
+	-109, -108, -108, -107, -106, -105, -104, -103,
+	-102, -101, -100, -99, -98, -97, -96, -95,
+	-94, -93, -91, -90, -89, -88, -86, -85,
+	-84, -82, -81, -79, -78, -76, -75, -73,
+	-71, -70, -68, -67, -65, -63, -62, -60,
+	-58, -56, -55, -53, -51, -49, -47, -45,
+	-44, -42, -40, -38, -36, -34, -32, -30,
+	-28, -26, -24, -22, -20, -18, -16, -14,
+	-12, -10,  -8,  -6,  -4,  -2,   0,   1,
+	3,   5,   7,   9,  11,  13,  15,  17,
+	19,  21,  23,  25,  27,  29,  31,  33,
+	35,  37,  39,  41,  43,  45,  46,  48,
+	50,  52,  54,  55,  57,  59,  61,  62,
+	64,  66,  67,  69,  71,  72,  74,  75,
+	77,  78,  80,  81,  83,  84,  86,  87,
+	88,  90,  91,  92,  93,  95,  96,  97,
+	98,  99, 100, 101, 102, 103, 104, 105,
+	106, 106, 107, 108, 109, 109, 110, 111,
+	111, 112, 112, 113, 113, 114, 114, 114,
+	115, 115, 115, 115, 116, 116, 116, 116,
+	116, 116, 116, 116, 116, 115, 115, 115,
+	115, 114, 114, 114, 113, 113, 112, 112,
+	111, 111, 110, 110, 109, 108, 108, 107,
+	106, 105, 104, 103, 102, 101, 100,  99,
+	98,  97,  96,  95,  94,  93,  91,  90,
+	89,  88,  86,  85,  84,  82,  81,  79,
+	78,  76,  75,  73,  71,  70,  68,  67,
+	65,  63,  62,  60,  58,  56,  55,  53,
+	51,  49,  47,  45,  44,  42,  40,  38,
+	36,  34,  32,  30,  28,  26,  24,  22,
+	20,  18,  16,  14,  12,  10,   8,   6,
+	4,   2,   0,  -1,  -3,  -5,  -7,  -9, -11
+};
+
+#endif
\ No newline at end of file
-- 
1.6.2.2

