Author: manolo
Date: 2010-06-07 06:39:03 -0700 (Mon, 07 Jun 2010)
New Revision: 7634
Log:
Fix image bug reported by Csaba in r7626 + fix regression in ps_image.cxx 
inadvertently brought in by r7617.

Modified:
   branches/branch-1.3/src/Fl_Bitmap.cxx
   branches/branch-1.3/src/Fl_Image.cxx
   branches/branch-1.3/src/Fl_Pixmap.cxx
   branches/branch-1.3/src/ps_image.cxx

Modified: branches/branch-1.3/src/Fl_Bitmap.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Bitmap.cxx       2010-06-07 01:57:34 UTC (rev 
7633)
+++ branches/branch-1.3/src/Fl_Bitmap.cxx       2010-06-07 13:39:03 UTC (rev 
7634)
@@ -252,7 +252,7 @@
   fl_device->draw(this, XP, YP, WP, HP, cx, cy);
 }
 
-static int start(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int w, int h, 
int cx, int cy, 
+static int start(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int w, int h, 
int &cx, int &cy, 
                 int &X, int &Y, int &W, int &H)
 {
   // account for current clip region (faster on Irix):

Modified: branches/branch-1.3/src/Fl_Image.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Image.cxx        2010-06-07 01:57:34 UTC (rev 
7633)
+++ branches/branch-1.3/src/Fl_Image.cxx        2010-06-07 13:39:03 UTC (rev 
7634)
@@ -544,7 +544,7 @@
 #endif
 }*/
 
-static int start(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int w, int 
h, int cx, int cy, 
+static int start(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int w, int 
h, int &cx, int &cy, 
                 int &X, int &Y, int &W, int &H)
 {
   // account for current clip region (faster on Irix):

Modified: branches/branch-1.3/src/Fl_Pixmap.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Pixmap.cxx       2010-06-07 01:57:34 UTC (rev 
7633)
+++ branches/branch-1.3/src/Fl_Pixmap.cxx       2010-06-07 13:39:03 UTC (rev 
7634)
@@ -78,7 +78,7 @@
   fl_device->draw(this, XP, YP, WP, HP, cx, cy);
 }
 
-static int start(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int w, int h, 
int cx, int cy, 
+static int start(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int w, int h, 
int &cx, int &cy, 
                 int &X, int &Y, int &W, int &H)
 {
   // ignore empty or bad pixmap data:

Modified: branches/branch-1.3/src/ps_image.cxx
===================================================================
--- branches/branch-1.3/src/ps_image.cxx        2010-06-07 01:57:34 UTC (rev 
7633)
+++ branches/branch-1.3/src/ps_image.cxx        2010-06-07 13:39:03 UTC (rev 
7634)
@@ -20,8 +20,10 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA.
 //
-// Please report all bugs and problems to "[email protected]".
+// Please report all bugs and problems on the following page:
 //
+//     http://www.fltk.org/str.php
+//
 
 #ifndef FL_DOXYGEN
 
@@ -182,20 +184,12 @@
   return 0;
 }
 
+// bitwise inversion of all 4-bit quantities
+static const unsigned char swapped[16] = 
{0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15};
 
-
-// TODO: anybody has more efficient algoritm?
-static inline uchar swap_byte(const uchar i){
-  uchar b =0;
-  if(i & 1) b |= 128;
-  if(i & 2) b |= 64;
-  if(i & 4) b |= 32;
-  if(i & 8) b |= 16;
-  if(i & 16) b |= 8;
-  if(i & 32) b |= 4;
-  if(i & 64) b |= 2;
-  if(i & 128) b |= 1;
-  return b;
+// bitwise inversion of a byte
+static inline uchar swap_byte(const uchar b) {
+  return (swapped[b & 0xF] << 4) | swapped[b >> 4];
 }
 
 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to