java.lang.Object
imagingbook.spectral.dct.Dct2dDirect
- All Implemented Interfaces:
Dct2d
- Direct Known Subclasses:
Dct2dDirect.Double
,Dct2dDirect.Float
Direct (slow) implementation of the 2-dimensional DCT using tabulated cosine values.
Note that this class has no public constructor -
instantiate sub-class Dct2dDirect.Float
or Dct2dDirect.Double
instead, as shown below. See Ch. 20 of [1] for additional details.
Usage example (for float
data):
float[][] data = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {-2, -1, 0}}; int w = data.length; // w = 4 int h = data[0].length; // h = 3 Dct2d.Float dct = new Dct2dDirect.Float(w, h); dct.forward(data); // data now is the 2D DCT spectrum dct.inverse(data); // data now is the original 2D signal ...
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Two-dimensional DCT implementation usingdouble
data.static class
Two-dimensional DCT implementation usingfloat
data. -
Method Summary
-
Method Details
-
getWidth
public int getWidth()Description copied from interface:Dct2d
Returns the 'width' of the 2D data array (length of dimension 0). Data arrays are indexed asdata[x][y]
, with 0 ≤ x < width and 0 ≤ y < height. -
getHeight
public int getHeight()Description copied from interface:Dct2d
Returns the 'height' of the 2D data array (length of dimension 1). Data arrays are indexed asdata[x][y]
, with 0 ≤ x < width and 0 ≤ y < height.
-