summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Bitmap.cxx2
-rw-r--r--src/Fl_Image.cxx2
-rw-r--r--src/Fl_Pixmap.cxx2
-rw-r--r--src/ps_image.cxx22
4 files changed, 11 insertions, 17 deletions
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index d80d810a1..0148b0156 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -252,7 +252,7 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
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):
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index 65636c73c..26c45b471 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -544,7 +544,7 @@ void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
#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):
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index a6049760a..5440310f0 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -78,7 +78,7 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
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:
diff --git a/src/ps_image.cxx b/src/ps_image.cxx
index fa4a6fe2c..51646efa6 100644
--- a/src/ps_image.cxx
+++ b/src/ps_image.cxx
@@ -20,7 +20,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
-// Please report all bugs and problems to "fltk-bugs@fltk.org".
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
//
#ifndef FL_DOXYGEN
@@ -182,20 +184,12 @@ int Fl_PostScript_Graphics_Driver::alpha_mask(const uchar * data, int w, int h,
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];
}