diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-09-05 04:51:49 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-09-05 04:51:49 +0200 |
commit | 237bedc5e228e6b06f53762c65c638789c2d29e7 (patch) | |
tree | ff93f936ff9d34110c4f778c49443d2cb08fb86a /src/libgamma | |
parent | m (diff) | |
download | jlibgamma-237bedc5e228e6b06f53762c65c638789c2d29e7.tar.gz jlibgamma-237bedc5e228e6b06f53762c65c638789c2d29e7.tar.bz2 jlibgamma-237bedc5e228e6b06f53762c65c638789c2d29e7.tar.xz |
add test and fix some small errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/libgamma')
-rw-r--r-- | src/libgamma/CRTC.java | 4 | ||||
-rw-r--r-- | src/libgamma/GammaRamps.java | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/libgamma/CRTC.java b/src/libgamma/CRTC.java index 15a0672..5bbb445 100644 --- a/src/libgamma/CRTC.java +++ b/src/libgamma/CRTC.java @@ -109,7 +109,7 @@ public class CRTC * * @param output The gamma ramp structure to fill. */ - public void get_gamma(GammaRamps<Ramp> output) throws LibgammaException + public <T extends Ramp> void get_gamma(GammaRamps<T> output) throws LibgammaException { int r = 0; if (output.depth == 8) r = libgamma_crtc_get_gamma_ramps8(this.address, output.address); @@ -127,7 +127,7 @@ public class CRTC * * @param values The gamma ramps to apply. */ - public void set_gamma(GammaRamps<Ramp> values) throws LibgammaException + public <T extends Ramp> void set_gamma(GammaRamps<T> values) throws LibgammaException { int r = 0; if (values.depth == 8) r = libgamma_crtc_set_gamma_ramps8(this.address, values.address); diff --git a/src/libgamma/GammaRamps.java b/src/libgamma/GammaRamps.java index 35f9d4b..61352e2 100644 --- a/src/libgamma/GammaRamps.java +++ b/src/libgamma/GammaRamps.java @@ -54,6 +54,21 @@ public class GammaRamps<T extends Ramp> * -1 for single precision floating point, and -2 for * double precision floating point. */ + public GammaRamps(int red_size, int green_size, int blue_size, int depth) throws LibgammaException + { + this(red_size, green_size, blue_size, (short)depth); + } + + /** + * Constructor. + * + * @param red_size The size of the encoding axis of the red gamma ramp. + * @param green_size The size of the encoding axis of the green gamma ramp. + * @param blue_size The size of the encoding axis of the blue gamma ramp. + * @param depth The bit-depth of the value axes of gamma ramps, + * -1 for single precision floating point, and -2 for + * double precision floating point. + */ @SuppressWarnings("unchecked") public GammaRamps(int red_size, int green_size, int blue_size, short depth) throws LibgammaException { |