/Users/lyon/j4p/src/ip/color/Yuv.java
|
1 package ip.color;
2
3 import ip.gui.frames.ColorFrame;
4 import math.Mat3;
5
6 public class Yuv extends FloatPlane {
7
8 // From [Martindale].
9 double A[][] = {
10 {0.2989, 0.5866, 0.1144},
11 {-0.1473, -0.2891, 0.4364},
12 {0.6149, 0.5145, -0.1004}
13 };
14
15 Mat3 rgb2yuvMat = new Mat3(A);
16 Mat3 yuv2rgbMat = rgb2yuvMat.invert();
17
18 public Yuv(ColorFrame _cf) {
19 super(_cf);
20 }
21
22 public void fromRgb() {
23 convertSpace(rgb2yuvMat);
24 System.out.println("yuv");
25 rgb2yuvMat.print();
26 }
27
28 public void toRgb() {
29 convertSpace(yuv2rgbMat);
30 }
31
32 }
33
34
35
36
37
38
39
40