Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 17759 Details for
Bug 84726
[JFace] CompositeImageDescriptor ignores aplha channel data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch based on 3.0.1 version of CompositeImageDescription
CompositeImageDescriptor.patch (text/plain), 1.93 KB, created by
Pawel Piech
on 2005-02-08 14:12:04 EST
(
hide
)
Description:
Patch based on 3.0.1 version of CompositeImageDescription
Filename:
MIME Type:
Creator:
Pawel Piech
Created:
2005-02-08 14:12:04 EST
Size:
1.93 KB
patch
obsolete
>Index: CompositeImageDescriptor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/resource/CompositeImageDescriptor.java,v >retrieving revision 1.4 >diff -u -r1.4 CompositeImageDescriptor.java >--- CompositeImageDescriptor.java 10 Mar 2003 21:56:30 -0000 1.4 >+++ CompositeImageDescriptor.java 8 Feb 2005 18:48:39 -0000 >@@ -12,6 +12,7 @@ > > import org.eclipse.swt.SWT; > import org.eclipse.swt.graphics.*; >+import org.eclipse.swt.widgets.Display; > > /** > * Abstract base class for image descriptors that synthesize >@@ -91,6 +92,10 @@ > > PaletteData palette = src.palette; > if (palette.isDirect) { >+ Display display = Display.getCurrent(); >+ RGB bckRGB = display != null >+ ? display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB() >+ : new RGB(0xff, 0xff, 0xff); > > ImageData mask = src.getTransparencyMask(); > >@@ -110,9 +115,19 @@ > int b = pixel & palette.blueMask; > b = (palette.blueShift < 0) ? b >>> -palette.blueShift : b << palette.blueShift; > >- pixel = alloc(out, r, g, b); >- >- imageData.setPixel(xx, yy, pixel); >+ int a = src.getAlpha(x, y); >+ if (a != 0) { >+ if (a != 0xff) { >+ int ap = 0xff - a; >+ int dPixel = imageData.getPixel(xx, yy); >+ RGB dRGB = dPixel != 0 ? out[dPixel] : bckRGB; >+ r = (dRGB.red * ap + r * a) / 256; >+ g = (dRGB.green * ap + g * a) / 256; >+ b = (dRGB.blue * ap + b * a) / 256; >+ } >+ pixel = alloc(out, r, g, b); >+ imageData.setPixel(xx, yy, pixel); >+ } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 84726
: 17759 |
17760