summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-24 02:46:19 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-24 02:46:19 +0000
commit70abac1b8b995dc78ec312eb52f8724161b11b75 (patch)
tree4bf4d24e190a2a49e98c8fe3fdbecabe8c9cd2fa /src/Fl_Pixmap.cxx
parent4087b8cd9a139664420468c57489cae73c8b830a (diff)
Fix bugs in copy() methods.
Add Fl_Shared_Image class, with get() and release() methods. Update Fl_Help_View to use Fl_Shared_Image class. Update image demo to accept a filename, and to use the Fl_Shared_Image class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Pixmap.cxx')
-rw-r--r--src/Fl_Pixmap.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 0c6b5b74a..bf6e984d7 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.8 2001/11/23 12:06:36 easysw Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.9 2001/11/24 02:46:19 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -245,17 +245,12 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) {
}
}
- // Copy image data...
- for (i = 0; i < h(); i ++, new_row ++) {
- *new_row = new char[chars_per_line];
- memcpy(*new_row, data()[i + ncolors + 1], chars_per_line);
- }
// Scale the image using a nearest-neighbor algorithm...
- for (dy = h(), sy = 0, yerr = H / 2; dy > 0; dy --, new_row ++) {
+ for (dy = H, sy = 0, yerr = H / 2; dy > 0; dy --, new_row ++) {
*new_row = new char[chars_per_line];
new_ptr = *new_row;
- for (dx = w(), xerr = W / 2, old_ptr = data()[sy + ncolors + 1];
+ for (dx = W, xerr = W / 2, old_ptr = data()[sy + ncolors + 1];
dx > 0;
dx --) {
for (c = 0; c < chars_per_pixel; c ++) *new_ptr++ = old_ptr[c];
@@ -467,5 +462,5 @@ void Fl_Pixmap::desaturate() {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.8 2001/11/23 12:06:36 easysw Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.9 2001/11/24 02:46:19 easysw Exp $".
//