/Users/lyon/j4p/src/ip/color/Ccir601_2cbcr.java
|
1 package ip.color;
2
3 import ip.gui.frames.ColorFrame;
4 import math.Mat3;
5
6 public class Ccir601_2cbcr extends FloatPlane {
7
8 // See CCIR 601-2
9 // available at
10 // http://www.igd.fhg.de/icib/tv/ccir/rec_601-2/scan.gui.html
11 static double A[][] = {
12 {0.299, 0.587, 0.114},
13 {0.701, -0.587, -0.114},
14 {0.299, -0.587, 0.886}
15 };
16
17
18 Mat3 rgb2cycbcrMat = new Mat3(A);
19 Mat3 cycbcr2rgbMat = rgb2cycbcrMat.invert();
20
21 public Ccir601_2cbcr(ColorFrame _cf) {
22 super(_cf);
23 }
24
25 public void fromRgb() {
26 convertSpace(rgb2cycbcrMat);
27 System.out.println("cycbcr");
28 rgb2cycbcrMat.print();
29 }
30
31 public void toRgb() {
32 convertSpace(cycbcr2rgbMat);
33 cycbcr2rgbMat.print();
34 }
35
36 }
37
38
39
40
41
42
43
44