~ubuntu-branches/ubuntu/karmic/fltk1.1/karmic

« back to all changes in this revision

Viewing changes to src/Fl_PNG_Image.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-05-22 13:57:06 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050522135706-mchag24yf42lu7bu
Tags: 1.1.6-5
* Revert previous change, which seems to have been ineffective for some
  reason, in favor of commenting out the problematic Makefile rule
  altogether.  (Closes: #310151.)
* debian/control: Go back to specifying the URL as part of the
  description rather than via a non-standard field that doesn't seem to
  have caught on.  (Closes: #310240.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: Fl_PNG_Image.cxx,v 1.1.2.11 2004/04/11 04:38:58 easysw Exp $"
 
2
// "$Id: Fl_PNG_Image.cxx,v 1.1.2.12 2004/10/18 20:22:24 easysw Exp $"
3
3
//
4
4
// Fl_PNG_Image routines.
5
5
//
108
108
  else if (info->bit_depth == 16)
109
109
    png_set_strip_16(pp);
110
110
 
111
 
#  if defined(HAVE_PNG_GET_VALID) && defined(HAVE_SET_TRNS_TO_ALPHA)
 
111
#  if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA)
112
112
  // Handle transparency...
113
113
  if (png_get_valid(pp, info, PNG_INFO_tRNS))
114
114
    png_set_tRNS_to_alpha(pp);
115
 
#  endif // HAVE_PNG_GET_VALID && HAVE_SET_TRNS_TO_ALPHA
 
115
#  endif // HAVE_PNG_GET_VALID && HAVE_PNG_SET_TRNS_TO_ALPHA
116
116
 
117
117
  array = new uchar[w() * h() * d()];
118
118
  alloc_array = 1;
127
127
  for (i = png_set_interlace_handling(pp); i > 0; i --)
128
128
    png_read_rows(pp, rows, NULL, h());
129
129
 
 
130
#ifdef WIN32
 
131
  // Some Windows graphics drivers don't honor transparency when RGB == white
 
132
  if (channels == 4) {
 
133
    // Convert RGB to 0 when alpha == 0...
 
134
    uchar *ptr = (uchar *)array;
 
135
    for (i = w() * h(); i > 0; i --, ptr += 4)
 
136
      if (!ptr[3]) ptr[0] = ptr[1] = ptr[2] = 0;
 
137
  }
 
138
#endif // WIN32
 
139
 
130
140
  // Free memory and return...
131
141
  delete[] rows;
132
142
 
139
149
 
140
150
 
141
151
//
142
 
// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.11 2004/04/11 04:38:58 easysw Exp $".
 
152
// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.12 2004/10/18 20:22:24 easysw Exp $".
143
153
//