[libbluray-devel] javax.tv.graphics.AlphaColor: improve compatibility

hpi1 git at videolan.org
Wed Apr 6 10:09:19 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Apr  5 12:23:23 2016 +0300| [3dc1a815906067eae64e7ba974f36809594c22dc] | committer: hpi1

javax.tv.graphics.AlphaColor: improve compatibility

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=3dc1a815906067eae64e7ba974f36809594c22dc
---

 .../bdj/java/javax/tv/graphics/AlphaColor.java     |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/javax/tv/graphics/AlphaColor.java b/src/libbluray/bdj/java/javax/tv/graphics/AlphaColor.java
index 4723c6e..86ec0e0 100644
--- a/src/libbluray/bdj/java/javax/tv/graphics/AlphaColor.java
+++ b/src/libbluray/bdj/java/javax/tv/graphics/AlphaColor.java
@@ -39,7 +39,25 @@ public class AlphaColor extends Color {
 
     public AlphaColor(Color c)
     {
-        super(c.getRGB());
+        super(c.getRGB(), true);
+    }
+
+    public Color brighter()
+    {
+        Color c = super.brighter();
+        int a = getAlpha();
+
+        // JSR927: "Returns: A new AlphaColor object"
+        return new AlphaColor(c.getRed(), c.getGreen(), c.getBlue(), a);
+    }
+
+    public Color darker()
+    {
+        Color c = super.darker();
+        int a = getAlpha();
+
+        // JSR927: "Returns: A new AlphaColor object"
+        return new AlphaColor(c.getRed(), c.getGreen(), c.getBlue(), a);
     }
 
     private static final long serialVersionUID = -3466072971590811211L;



More information about the libbluray-devel mailing list