reSWIGged
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
930a9efaf1
commit
195a89b47c
@ -829,52 +829,39 @@ class NativePixelData(PixelDataBase):
|
||||
return _gdi_.NativePixelData___nonzero__(*args, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
"""Create and return an iterator object for this pixel data object."""
|
||||
return self.PixelIterator(self)
|
||||
|
||||
class PixelIterator(object):
|
||||
"""
|
||||
Sequential iterator which returns pixel accessor objects starting at the
|
||||
the top-left corner, and going row-by-row until the bottom-right
|
||||
corner is reached.
|
||||
Create and return an iterator object for this pixel data
|
||||
object. (It's really a generator but I won't tell if you
|
||||
don't tell.)
|
||||
"""
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
pixels = self.GetPixels()
|
||||
|
||||
|
||||
class PixelAccessor(object):
|
||||
"""
|
||||
This class is what is returned by the iterator and allows the pixel
|
||||
to be Get or Set.
|
||||
"""
|
||||
def __init__(self, data, pixels, x, y):
|
||||
self.data = data
|
||||
self.pixels = pixels
|
||||
self.x = x
|
||||
self.y = y
|
||||
def Set(self, *args, **kw):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Set(*args, **kw)
|
||||
|
||||
|
||||
class PixelFacade(object):
|
||||
def Get(self):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Get()
|
||||
return pixels.Get()
|
||||
def Set(self, *args, **kw):
|
||||
return pixels.Set(*args, **kw)
|
||||
def __str__(self):
|
||||
return str(self.Get())
|
||||
def __repr__(self):
|
||||
return 'pixel(%d,%d): %s' % (x,y,self.Get())
|
||||
X = property(lambda self: x)
|
||||
Y = property(lambda self: y)
|
||||
|
||||
pf = PixelFacade()
|
||||
for y in xrange(height):
|
||||
for x in xrange(width):
|
||||
|
||||
def __init__(self, pixelData):
|
||||
self.x = self.y = 0
|
||||
self.w = pixelData.GetWidth()
|
||||
self.h = pixelData.GetHeight()
|
||||
self.data = pixelData
|
||||
self.pixels = pixelData.GetPixels()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.y >= self.h:
|
||||
raise StopIteration
|
||||
p = self.PixelAccessor(self.data, self.pixels, self.x, self.y)
|
||||
self.x += 1
|
||||
if self.x >= self.w:
|
||||
self.x = 0
|
||||
self.y += 1
|
||||
return p
|
||||
yield pf
|
||||
pixels.nextPixel()
|
||||
pixels.MoveTo(self, 0, y)
|
||||
|
||||
_gdi_.NativePixelData_swigregister(NativePixelData)
|
||||
|
||||
@ -957,52 +944,39 @@ class AlphaPixelData(PixelDataBase):
|
||||
return _gdi_.AlphaPixelData___nonzero__(*args, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
"""Create and return an iterator object for this pixel data object."""
|
||||
return self.PixelIterator(self)
|
||||
|
||||
class PixelIterator(object):
|
||||
"""
|
||||
Sequential iterator which returns pixel accessor objects starting at the
|
||||
the top-left corner, and going row-by-row until the bottom-right
|
||||
corner is reached.
|
||||
Create and return an iterator object for this pixel data
|
||||
object. (It's really a generator but I won't tell if you
|
||||
don't tell.)
|
||||
"""
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
pixels = self.GetPixels()
|
||||
|
||||
|
||||
class PixelAccessor(object):
|
||||
"""
|
||||
This class is what is returned by the iterator and allows the pixel
|
||||
to be Get or Set.
|
||||
"""
|
||||
def __init__(self, data, pixels, x, y):
|
||||
self.data = data
|
||||
self.pixels = pixels
|
||||
self.x = x
|
||||
self.y = y
|
||||
def Set(self, *args, **kw):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Set(*args, **kw)
|
||||
|
||||
|
||||
class PixelFacade(object):
|
||||
def Get(self):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Get()
|
||||
return pixels.Get()
|
||||
def Set(self, *args, **kw):
|
||||
return pixels.Set(*args, **kw)
|
||||
def __str__(self):
|
||||
return str(self.Get())
|
||||
def __repr__(self):
|
||||
return 'pixel(%d,%d): %s' % (x,y,self.Get())
|
||||
X = property(lambda self: x)
|
||||
Y = property(lambda self: y)
|
||||
|
||||
pf = PixelFacade()
|
||||
for y in xrange(height):
|
||||
for x in xrange(width):
|
||||
|
||||
def __init__(self, pixelData):
|
||||
self.x = self.y = 0
|
||||
self.w = pixelData.GetWidth()
|
||||
self.h = pixelData.GetHeight()
|
||||
self.data = pixelData
|
||||
self.pixels = pixelData.GetPixels()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.y >= self.h:
|
||||
raise StopIteration
|
||||
p = self.PixelAccessor(self.data, self.pixels, self.x, self.y)
|
||||
self.x += 1
|
||||
if self.x >= self.w:
|
||||
self.x = 0
|
||||
self.y += 1
|
||||
return p
|
||||
yield pf
|
||||
pixels.nextPixel()
|
||||
pixels.MoveTo(self, 0, y)
|
||||
|
||||
_gdi_.AlphaPixelData_swigregister(AlphaPixelData)
|
||||
|
||||
|
@ -2961,8 +2961,8 @@ SWIGINTERN bool wxBitmap___ne__(wxBitmap *self,wxBitmap const *other){ return ot
|
||||
// appears to me that the other platforms are already doing it, so I'll just
|
||||
// automatically do it for wxMSW here.
|
||||
#ifdef __WXMSW__
|
||||
#define wxPy_premultiply(p, a) ((p) * (a) / 256)
|
||||
#define wxPy_unpremultiply(p, a) ((a) ? ((p) * 256 / (a)) : (p))
|
||||
#define wxPy_premultiply(p, a) ((p) * (a) / 0xff)
|
||||
#define wxPy_unpremultiply(p, a) ((a) ? ((p) * 0xff / (a)) : (p))
|
||||
#else
|
||||
#define wxPy_premultiply(p, a) (p)
|
||||
#define wxPy_unpremultiply(p, a) (p)
|
||||
|
@ -833,52 +833,39 @@ class NativePixelData(PixelDataBase):
|
||||
return _gdi_.NativePixelData___nonzero__(*args, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
"""Create and return an iterator object for this pixel data object."""
|
||||
return self.PixelIterator(self)
|
||||
|
||||
class PixelIterator(object):
|
||||
"""
|
||||
Sequential iterator which returns pixel accessor objects starting at the
|
||||
the top-left corner, and going row-by-row until the bottom-right
|
||||
corner is reached.
|
||||
Create and return an iterator object for this pixel data
|
||||
object. (It's really a generator but I won't tell if you
|
||||
don't tell.)
|
||||
"""
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
pixels = self.GetPixels()
|
||||
|
||||
|
||||
class PixelAccessor(object):
|
||||
"""
|
||||
This class is what is returned by the iterator and allows the pixel
|
||||
to be Get or Set.
|
||||
"""
|
||||
def __init__(self, data, pixels, x, y):
|
||||
self.data = data
|
||||
self.pixels = pixels
|
||||
self.x = x
|
||||
self.y = y
|
||||
def Set(self, *args, **kw):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Set(*args, **kw)
|
||||
|
||||
|
||||
class PixelFacade(object):
|
||||
def Get(self):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Get()
|
||||
return pixels.Get()
|
||||
def Set(self, *args, **kw):
|
||||
return pixels.Set(*args, **kw)
|
||||
def __str__(self):
|
||||
return str(self.Get())
|
||||
def __repr__(self):
|
||||
return 'pixel(%d,%d): %s' % (x,y,self.Get())
|
||||
X = property(lambda self: x)
|
||||
Y = property(lambda self: y)
|
||||
|
||||
pf = PixelFacade()
|
||||
for y in xrange(height):
|
||||
for x in xrange(width):
|
||||
|
||||
def __init__(self, pixelData):
|
||||
self.x = self.y = 0
|
||||
self.w = pixelData.GetWidth()
|
||||
self.h = pixelData.GetHeight()
|
||||
self.data = pixelData
|
||||
self.pixels = pixelData.GetPixels()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.y >= self.h:
|
||||
raise StopIteration
|
||||
p = self.PixelAccessor(self.data, self.pixels, self.x, self.y)
|
||||
self.x += 1
|
||||
if self.x >= self.w:
|
||||
self.x = 0
|
||||
self.y += 1
|
||||
return p
|
||||
yield pf
|
||||
pixels.nextPixel()
|
||||
pixels.MoveTo(self, 0, y)
|
||||
|
||||
_gdi_.NativePixelData_swigregister(NativePixelData)
|
||||
|
||||
@ -961,52 +948,39 @@ class AlphaPixelData(PixelDataBase):
|
||||
return _gdi_.AlphaPixelData___nonzero__(*args, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
"""Create and return an iterator object for this pixel data object."""
|
||||
return self.PixelIterator(self)
|
||||
|
||||
class PixelIterator(object):
|
||||
"""
|
||||
Sequential iterator which returns pixel accessor objects starting at the
|
||||
the top-left corner, and going row-by-row until the bottom-right
|
||||
corner is reached.
|
||||
Create and return an iterator object for this pixel data
|
||||
object. (It's really a generator but I won't tell if you
|
||||
don't tell.)
|
||||
"""
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
pixels = self.GetPixels()
|
||||
|
||||
|
||||
class PixelAccessor(object):
|
||||
"""
|
||||
This class is what is returned by the iterator and allows the pixel
|
||||
to be Get or Set.
|
||||
"""
|
||||
def __init__(self, data, pixels, x, y):
|
||||
self.data = data
|
||||
self.pixels = pixels
|
||||
self.x = x
|
||||
self.y = y
|
||||
def Set(self, *args, **kw):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Set(*args, **kw)
|
||||
|
||||
|
||||
class PixelFacade(object):
|
||||
def Get(self):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Get()
|
||||
return pixels.Get()
|
||||
def Set(self, *args, **kw):
|
||||
return pixels.Set(*args, **kw)
|
||||
def __str__(self):
|
||||
return str(self.Get())
|
||||
def __repr__(self):
|
||||
return 'pixel(%d,%d): %s' % (x,y,self.Get())
|
||||
X = property(lambda self: x)
|
||||
Y = property(lambda self: y)
|
||||
|
||||
pf = PixelFacade()
|
||||
for y in xrange(height):
|
||||
for x in xrange(width):
|
||||
|
||||
def __init__(self, pixelData):
|
||||
self.x = self.y = 0
|
||||
self.w = pixelData.GetWidth()
|
||||
self.h = pixelData.GetHeight()
|
||||
self.data = pixelData
|
||||
self.pixels = pixelData.GetPixels()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.y >= self.h:
|
||||
raise StopIteration
|
||||
p = self.PixelAccessor(self.data, self.pixels, self.x, self.y)
|
||||
self.x += 1
|
||||
if self.x >= self.w:
|
||||
self.x = 0
|
||||
self.y += 1
|
||||
return p
|
||||
yield pf
|
||||
pixels.nextPixel()
|
||||
pixels.MoveTo(self, 0, y)
|
||||
|
||||
_gdi_.AlphaPixelData_swigregister(AlphaPixelData)
|
||||
|
||||
|
@ -2984,8 +2984,8 @@ SWIGINTERN bool wxBitmap___ne__(wxBitmap *self,wxBitmap const *other){ return ot
|
||||
// appears to me that the other platforms are already doing it, so I'll just
|
||||
// automatically do it for wxMSW here.
|
||||
#ifdef __WXMSW__
|
||||
#define wxPy_premultiply(p, a) ((p) * (a) / 256)
|
||||
#define wxPy_unpremultiply(p, a) ((a) ? ((p) * 256 / (a)) : (p))
|
||||
#define wxPy_premultiply(p, a) ((p) * (a) / 0xff)
|
||||
#define wxPy_unpremultiply(p, a) ((a) ? ((p) * 0xff / (a)) : (p))
|
||||
#else
|
||||
#define wxPy_premultiply(p, a) (p)
|
||||
#define wxPy_unpremultiply(p, a) (p)
|
||||
|
@ -853,52 +853,39 @@ class NativePixelData(PixelDataBase):
|
||||
return _gdi_.NativePixelData___nonzero__(*args, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
"""Create and return an iterator object for this pixel data object."""
|
||||
return self.PixelIterator(self)
|
||||
|
||||
class PixelIterator(object):
|
||||
"""
|
||||
Sequential iterator which returns pixel accessor objects starting at the
|
||||
the top-left corner, and going row-by-row until the bottom-right
|
||||
corner is reached.
|
||||
Create and return an iterator object for this pixel data
|
||||
object. (It's really a generator but I won't tell if you
|
||||
don't tell.)
|
||||
"""
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
pixels = self.GetPixels()
|
||||
|
||||
|
||||
class PixelAccessor(object):
|
||||
"""
|
||||
This class is what is returned by the iterator and allows the pixel
|
||||
to be Get or Set.
|
||||
"""
|
||||
def __init__(self, data, pixels, x, y):
|
||||
self.data = data
|
||||
self.pixels = pixels
|
||||
self.x = x
|
||||
self.y = y
|
||||
def Set(self, *args, **kw):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Set(*args, **kw)
|
||||
|
||||
|
||||
class PixelFacade(object):
|
||||
def Get(self):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Get()
|
||||
return pixels.Get()
|
||||
def Set(self, *args, **kw):
|
||||
return pixels.Set(*args, **kw)
|
||||
def __str__(self):
|
||||
return str(self.Get())
|
||||
def __repr__(self):
|
||||
return 'pixel(%d,%d): %s' % (x,y,self.Get())
|
||||
X = property(lambda self: x)
|
||||
Y = property(lambda self: y)
|
||||
|
||||
pf = PixelFacade()
|
||||
for y in xrange(height):
|
||||
for x in xrange(width):
|
||||
|
||||
def __init__(self, pixelData):
|
||||
self.x = self.y = 0
|
||||
self.w = pixelData.GetWidth()
|
||||
self.h = pixelData.GetHeight()
|
||||
self.data = pixelData
|
||||
self.pixels = pixelData.GetPixels()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.y >= self.h:
|
||||
raise StopIteration
|
||||
p = self.PixelAccessor(self.data, self.pixels, self.x, self.y)
|
||||
self.x += 1
|
||||
if self.x >= self.w:
|
||||
self.x = 0
|
||||
self.y += 1
|
||||
return p
|
||||
yield pf
|
||||
pixels.nextPixel()
|
||||
pixels.MoveTo(self, 0, y)
|
||||
|
||||
_gdi_.NativePixelData_swigregister(NativePixelData)
|
||||
|
||||
@ -981,52 +968,39 @@ class AlphaPixelData(PixelDataBase):
|
||||
return _gdi_.AlphaPixelData___nonzero__(*args, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
"""Create and return an iterator object for this pixel data object."""
|
||||
return self.PixelIterator(self)
|
||||
|
||||
class PixelIterator(object):
|
||||
"""
|
||||
Sequential iterator which returns pixel accessor objects starting at the
|
||||
the top-left corner, and going row-by-row until the bottom-right
|
||||
corner is reached.
|
||||
Create and return an iterator object for this pixel data
|
||||
object. (It's really a generator but I won't tell if you
|
||||
don't tell.)
|
||||
"""
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
pixels = self.GetPixels()
|
||||
|
||||
|
||||
class PixelAccessor(object):
|
||||
"""
|
||||
This class is what is returned by the iterator and allows the pixel
|
||||
to be Get or Set.
|
||||
"""
|
||||
def __init__(self, data, pixels, x, y):
|
||||
self.data = data
|
||||
self.pixels = pixels
|
||||
self.x = x
|
||||
self.y = y
|
||||
def Set(self, *args, **kw):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Set(*args, **kw)
|
||||
|
||||
|
||||
class PixelFacade(object):
|
||||
def Get(self):
|
||||
self.pixels.MoveTo(self.data, self.x, self.y)
|
||||
return self.pixels.Get()
|
||||
return pixels.Get()
|
||||
def Set(self, *args, **kw):
|
||||
return pixels.Set(*args, **kw)
|
||||
def __str__(self):
|
||||
return str(self.Get())
|
||||
def __repr__(self):
|
||||
return 'pixel(%d,%d): %s' % (x,y,self.Get())
|
||||
X = property(lambda self: x)
|
||||
Y = property(lambda self: y)
|
||||
|
||||
pf = PixelFacade()
|
||||
for y in xrange(height):
|
||||
for x in xrange(width):
|
||||
|
||||
def __init__(self, pixelData):
|
||||
self.x = self.y = 0
|
||||
self.w = pixelData.GetWidth()
|
||||
self.h = pixelData.GetHeight()
|
||||
self.data = pixelData
|
||||
self.pixels = pixelData.GetPixels()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.y >= self.h:
|
||||
raise StopIteration
|
||||
p = self.PixelAccessor(self.data, self.pixels, self.x, self.y)
|
||||
self.x += 1
|
||||
if self.x >= self.w:
|
||||
self.x = 0
|
||||
self.y += 1
|
||||
return p
|
||||
yield pf
|
||||
pixels.nextPixel()
|
||||
pixels.MoveTo(self, 0, y)
|
||||
|
||||
_gdi_.AlphaPixelData_swigregister(AlphaPixelData)
|
||||
|
||||
|
@ -2962,8 +2962,8 @@ SWIGINTERN bool wxBitmap___ne__(wxBitmap *self,wxBitmap const *other){ return ot
|
||||
// appears to me that the other platforms are already doing it, so I'll just
|
||||
// automatically do it for wxMSW here.
|
||||
#ifdef __WXMSW__
|
||||
#define wxPy_premultiply(p, a) ((p) * (a) / 256)
|
||||
#define wxPy_unpremultiply(p, a) ((a) ? ((p) * 256 / (a)) : (p))
|
||||
#define wxPy_premultiply(p, a) ((p) * (a) / 0xff)
|
||||
#define wxPy_unpremultiply(p, a) ((a) ? ((p) * 0xff / (a)) : (p))
|
||||
#else
|
||||
#define wxPy_premultiply(p, a) (p)
|
||||
#define wxPy_unpremultiply(p, a) (p)
|
||||
|
Loading…
Reference in New Issue
Block a user