summaryrefslogtreecommitdiff
path: root/src/Fl_Bitmap.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-04-15 17:18:48 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-04-15 17:18:48 +0000
commitbcb2033a966c6a4c5b12605ab029b2ec86081454 (patch)
treed1e4663b8a98a533713775b3969e9c44b99c2216 /src/Fl_Bitmap.cxx
parente1828d045f5f80f6a70c6007abc0a1732cab8714 (diff)
Fix transparency stuff for MacOS X; currently it appears that CopyDeepMask
does not work with an 8-bit mask image, so we can't provide true alpha blending just yet... (just the screen-door transparency provided on X11 and WIN32...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2085 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Bitmap.cxx')
-rw-r--r--src/Fl_Bitmap.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index 38bd6cb97..767f237ab 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.12 2002/04/15 12:19:01 easysw Exp $"
+// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.13 2002/04/15 17:18:48 easysw Exp $"
//
// Bitmap drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -207,7 +207,12 @@ void fl_delete_bitmask(Fl_Bitmask bm) {
#endif // __APPLE__
-#ifdef __APPLE__
+// MRS: Currently it appears that CopyDeepMask() does not work with an 8-bit alpha mask.
+// If you want to test/fix this, uncomment the "#ifdef __APPLE__" and comment out
+// the "#if 0" here. Also see Fl_Image.cxx for a similar check...
+
+//#ifdef __APPLE__
+#if 0
// Create an 8-bit mask used for alpha blending
Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *array) {
Rect srcRect;
@@ -230,13 +235,14 @@ Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *array)
{
PixMapPtr pmp = *pm;
// verify the parameters for direct memory write
- if ( pmp->pixelType == 0 || pmp->pixelSize == 1 || pmp->cmpCount == 1 || pmp->cmpSize == 1 )
+ if ( pmp->pixelType == 0 || pmp->pixelSize == 8 || pmp->cmpCount == 1 || pmp->cmpSize == 8 )
{
// Copy alpha values from the source array to the pixmap...
array += d - 1;
- for (int y = h; y > 0; y --, array += ld) {
+ int rowoffset = (pmp->rowBytes & 0x3fff) - w;
+ for (int y = h; y > 0; y --, array += ld, base += rowoffset) {
for (int x = w; x > 0; x --, array += d) {
- *pmp++ = *array;
+ *base++ = 255 /*255 - *array*/;
}
}
}
@@ -456,5 +462,5 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) {
//
-// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.12 2002/04/15 12:19:01 easysw Exp $".
+// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.13 2002/04/15 17:18:48 easysw Exp $".
//