diff options
| author | Manolo Gouy <Manolo> | 2018-03-22 16:38:38 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-03-22 16:38:38 +0000 |
| commit | 9f9631e6856f56d9439ae5f91ed94dda0f19b568 (patch) | |
| tree | 9a7be15f89cf25588f6ebd4e27a7fcd5ea47f8d8 /src/Fl_Bitmap.cxx | |
| parent | 0b8116ff72145816c3e1d4909038c126327e7bf2 (diff) | |
Rename Fl_Image::pixel_w() and pixel_h() to Fl_Image::data_w() and data_h().
The docs of class Fl_Image and of Fl_Image::scale() are beefed up.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Bitmap.cxx')
| -rw-r--r-- | src/Fl_Bitmap.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx index 4324b5367..c3cbaea2a 100644 --- a/src/Fl_Bitmap.cxx +++ b/src/Fl_Bitmap.cxx @@ -158,7 +158,7 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) { uchar *new_array; // New array for image data // Optimize the simple copy where the width and height are the same... - if (W == pixel_w() && H == pixel_h()) { + if (W == data_w() && H == data_h()) { new_array = new uchar [H * ((W + 7) / 8)]; memcpy(new_array, array, H * ((W + 7) / 8)); @@ -182,10 +182,10 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) { // Figure out Bresenham step/modulus values... - xmod = pixel_w() % W; - xstep = pixel_w() / W; - ymod = pixel_h() % H; - ystep = pixel_h() / H; + xmod = data_w() % W; + xstep = data_w() / W; + ymod = data_h() % H; + ystep = data_h() / H; // Allocate memory for the new image... new_array = new uchar [H * ((W + 7) / 8)]; @@ -196,7 +196,7 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) { // Scale the image using a nearest-neighbor algorithm... for (dy = H, sy = 0, yerr = H, new_ptr = new_array; dy > 0; dy --) { - for (dx = W, xerr = W, old_ptr = array + sy * ((pixel_w() + 7) / 8), sx = 0, new_bit = 1; + for (dx = W, xerr = W, old_ptr = array + sy * ((data_w() + 7) / 8), sx = 0, new_bit = 1; dx > 0; dx --) { old_bit = (uchar)(1 << (sx & 7)); |
