__safe_for_unpickling__ = True
def __reduce__(self): return (Colour, self.Get(True))
+ Pixel = property(GetPixel,doc="See `GetPixel`")
+ RGB = property(GetRGB,SetRGB,doc="See `GetRGB` and `SetRGB`")
_gdi_.Colour_swigregister(Colour)
def NamedColour(*args, **kwargs):
return _gdi_.Brush_Ok(*args, **kwargs)
def __nonzero__(self): return self.Ok()
+ Colour = property(GetColour,SetColour,doc="See `GetColour` and `SetColour`")
+ Stipple = property(GetStipple,SetStipple,doc="See `GetStipple` and `SetStipple`")
+ Style = property(GetStyle,SetStyle,doc="See `GetStyle` and `SetStyle`")
_gdi_.Brush_swigregister(Brush)
def BrushFromBitmap(*args, **kwargs):
"""__ne__(self, Bitmap other) -> bool"""
return _gdi_.Bitmap___ne__(*args, **kwargs)
+ Depth = property(GetDepth,SetDepth,doc="See `GetDepth` and `SetDepth`")
+ Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
+ Mask = property(GetMask,SetMask,doc="See `GetMask` and `SetMask`")
+ Palette = property(GetPalette,doc="See `GetPalette`")
+ Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
+ SubBitmap = property(GetSubBitmap,doc="See `GetSubBitmap`")
+ Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
_gdi_.Bitmap_swigregister(Bitmap)
def EmptyBitmap(*args, **kwargs):
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.
- """
-
- 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)
+ """
+ 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 PixelFacade(object):
def Get(self):
- self.pixels.MoveTo(self.data, self.x, self.y)
- return self.pixels.Get()
-
- 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
+ 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):
+
+
+
+ yield pf
+ pixels.nextPixel()
+ pixels.MoveTo(self, 0, y)
+ Pixels = property(GetPixels,doc="See `GetPixels`")
_gdi_.NativePixelData_swigregister(NativePixelData)
class NativePixelData_Accessor(object):
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.
- """
-
- 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)
+ """
+ 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 PixelFacade(object):
def Get(self):
- self.pixels.MoveTo(self.data, self.x, self.y)
- return self.pixels.Get()
-
- 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
+ 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):
+
+
+
+ yield pf
+ pixels.nextPixel()
+ pixels.MoveTo(self, 0, y)
+ Pixels = property(GetPixels,doc="See `GetPixels`")
_gdi_.AlphaPixelData_swigregister(AlphaPixelData)
class AlphaPixelData_Accessor(object):
# to the default catalog path.
if wx.Platform == "__WXMSW__":
import os
- _localedir = os.path.join(os.path.split(__file__)[0], "locale")
+ _localedir = os.path.join(os.path.split(__file__)[0], "i18n")
Locale.AddCatalogLookupPathPrefix(_localedir)
del os
raise ValueError('backgrounds and coords must have same length')
return self._DrawTextList(textList, coords, foregrounds, backgrounds)
+ Background = property(GetBackground,SetBackground,doc="See `GetBackground` and `SetBackground`")
+ BackgroundMode = property(GetBackgroundMode,SetBackgroundMode,doc="See `GetBackgroundMode` and `SetBackgroundMode`")
+ BoundingBox = property(GetBoundingBox,doc="See `GetBoundingBox`")
+ Brush = property(GetBrush,SetBrush,doc="See `GetBrush` and `SetBrush`")
+ CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
+ CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
+ ClippingBox = property(GetClippingBox,doc="See `GetClippingBox`")
+ ClippingRect = property(GetClippingRect,SetClippingRect,doc="See `GetClippingRect` and `SetClippingRect`")
+ Depth = property(GetDepth,doc="See `GetDepth`")
+ DeviceOrigin = property(GetDeviceOrigin,SetDeviceOrigin,doc="See `GetDeviceOrigin` and `SetDeviceOrigin`")
+ Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
+ FullTextExtent = property(GetFullTextExtent,doc="See `GetFullTextExtent`")
+ LogicalFunction = property(GetLogicalFunction,SetLogicalFunction,doc="See `GetLogicalFunction` and `SetLogicalFunction`")
+ LogicalOrigin = property(GetLogicalOrigin,SetLogicalOrigin,doc="See `GetLogicalOrigin` and `SetLogicalOrigin`")
+ LogicalScale = property(GetLogicalScale,SetLogicalScale,doc="See `GetLogicalScale` and `SetLogicalScale`")
+ MapMode = property(GetMapMode,SetMapMode,doc="See `GetMapMode` and `SetMapMode`")
+ MultiLineTextExtent = property(GetMultiLineTextExtent,doc="See `GetMultiLineTextExtent`")
+ Optimization = property(GetOptimization,SetOptimization,doc="See `GetOptimization` and `SetOptimization`")
+ PPI = property(GetPPI,doc="See `GetPPI`")
+ PartialTextExtents = property(GetPartialTextExtents,doc="See `GetPartialTextExtents`")
+ Pen = property(GetPen,SetPen,doc="See `GetPen` and `SetPen`")
+ Pixel = property(GetPixel,doc="See `GetPixel`")
+ PixelPoint = property(GetPixelPoint,doc="See `GetPixelPoint`")
+ Size = property(GetSize,doc="See `GetSize`")
+ SizeMM = property(GetSizeMM,doc="See `GetSizeMM`")
+ TextBackground = property(GetTextBackground,SetTextBackground,doc="See `GetTextBackground` and `SetTextBackground`")
+ TextExtent = property(GetTextExtent,doc="See `GetTextExtent`")
+ TextForeground = property(GetTextForeground,SetTextForeground,doc="See `GetTextForeground` and `SetTextForeground`")
+ UserScale = property(GetUserScale,SetUserScale,doc="See `GetUserScale` and `SetUserScale`")
_gdi_.DC_swigregister(DC)
#---------------------------------------------------------------------------