Fix image bug reported by Csaba in r7626 + fix regression in ps_image.cxx

inadvertently brought in by r7617.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7634 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-06-07 13:39:03 +00:00
parent 9416e3480a
commit da5042584a
4 changed files with 11 additions and 17 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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:

View File

@ -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];
}