~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to wxPython/src/_bitmap.i

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
// Author:      Robin Dunn
6
6
//
7
7
// Created:     7-July-1997
8
 
// RCS-ID:      $Id: _bitmap.i 61434 2009-07-15 18:26:25Z RD $
 
8
// RCS-ID:      $Id: _bitmap.i 67461 2011-04-13 18:12:03Z RD $
9
9
// Copyright:   (c) 2003 by Total Control Software
10
10
// Licence:     wxWindows license
11
11
/////////////////////////////////////////////////////////////////////////////
352
352
                
353
353
                CHECK_BUFFERSIZE(stride * height);
354
354
                
355
 
                if (depth == 24) {
 
355
                if (useAlpha && depth == 32) {
 
356
                    MAKE_PIXDATA(wxAlphaPixelData);
 
357
                    for (int y=0; y<height; y++) {
 
358
                        p.MoveTo(pixData, 0, y);
 
359
                        bufptr = (wxUint32*)dataRow;
 
360
                        for (int x=0; x<width; x++) {
 
361
                            value =
 
362
                                (p.Alpha() << 24) |
 
363
                                (p.Red() << 16) |
 
364
                                (p.Green() << 8) |
 
365
                                (p.Blue());
 
366
                            *bufptr = value;
 
367
                            ++p;    
 
368
                            ++bufptr;
 
369
                        }
 
370
                        dataRow += stride;
 
371
                    }
 
372
                }
 
373
                else // if (!useAlpha /*depth == 24*/)
 
374
                {
356
375
                    MAKE_PIXDATA(wxNativePixelData);
357
376
                    for (int y=0; y<height; y++) {
358
377
                        p.MoveTo(pixData, 0, y);
370
389
                        dataRow += stride;
371
390
                    }
372
391
                }
373
 
                if (depth == 32) {
374
 
                    MAKE_PIXDATA(wxAlphaPixelData);
375
 
                    if (useAlpha)
376
 
                        pixData.UseAlpha();
377
 
                    for (int y=0; y<height; y++) {
378
 
                        p.MoveTo(pixData, 0, y);
379
 
                        bufptr = (wxUint32*)dataRow;
380
 
                        for (int x=0; x<width; x++) {
381
 
                            value =
382
 
                                (p.Alpha() << 24) |
383
 
                                (p.Red() << 16) |
384
 
                                (p.Green() << 8) |
385
 
                                (p.Blue());
386
 
                            *bufptr = value;
387
 
                            ++p;    
388
 
                            ++bufptr;
389
 
                        }
390
 
                        dataRow += stride;
391
 
                    }
392
 
                }
393
392
                break;
394
393
            }
395
394
        }