]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/image.py
added functions to read/write several elements at once (patch 754986)
[wxWidgets.git] / wxPython / src / mac / image.py
index d2200ceafb679cfb5248d46f4a3315d01306e31b..c4d1896bd29a81204043e43483a9d1c799a94c45 100644 (file)
@@ -4,6 +4,27 @@ import imagec
 from misc import *
 
 from gdi import *
+
+from fonts import *
+
+from streams import *
+class wxImageHistogramPtr :
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def FindFirstUnusedColour(self, *_args, **_kwargs):
+        val = apply(imagec.wxImageHistogram_FindFirstUnusedColour,(self,) + _args, _kwargs)
+        return val
+    def __repr__(self):
+        return "<C wxImageHistogram instance at %s>" % (self.this,)
+class wxImageHistogram(wxImageHistogramPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(imagec.new_wxImageHistogram,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxImageHandlerPtr(wxObjectPtr):
     def __init__(self,this):
         self.this = this
@@ -100,6 +121,34 @@ class wxICOHandler(wxICOHandlerPtr):
 
 
 
+class wxCURHandlerPtr(wxICOHandlerPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def __repr__(self):
+        return "<C wxCURHandler instance at %s>" % (self.this,)
+class wxCURHandler(wxCURHandlerPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(imagec.new_wxCURHandler,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
+class wxANIHandlerPtr(wxCURHandlerPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def __repr__(self):
+        return "<C wxANIHandler instance at %s>" % (self.this,)
+class wxANIHandler(wxANIHandlerPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(imagec.new_wxANIHandler,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxGIFHandlerPtr(wxImageHandlerPtr):
     def __init__(self,this):
         self.this = this
@@ -160,13 +209,12 @@ class wxImagePtr(wxObjectPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
-    def __del__(self,imagec=imagec):
-        if self.thisown == 1 :
-            imagec.delete_wxImage(self)
-    def ConvertToBitmap(self, *_args, **_kwargs):
-        val = apply(imagec.wxImage_ConvertToBitmap,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) ; val.thisown = 1
-        return val
+    def __del__(self, delfunc=imagec.delete_wxImage):
+        if self.thisown == 1:
+            try:
+                delfunc(self)
+            except:
+                pass
     def Create(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_Create,(self,) + _args, _kwargs)
         return val
@@ -177,6 +225,10 @@ class wxImagePtr(wxObjectPtr):
         val = apply(imagec.wxImage_Scale,(self,) + _args, _kwargs)
         if val: val = wxImagePtr(val) ; val.thisown = 1
         return val
+    def ShrinkBy(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_ShrinkBy,(self,) + _args, _kwargs)
+        if val: val = wxImagePtr(val) ; val.thisown = 1
+        return val
     def Rescale(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_Rescale,(self,) + _args, _kwargs)
         if val: val = wxImagePtr(val) 
@@ -193,6 +245,21 @@ class wxImagePtr(wxObjectPtr):
     def GetBlue(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_GetBlue,(self,) + _args, _kwargs)
         return val
+    def SetAlpha(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_SetAlpha,(self,) + _args, _kwargs)
+        return val
+    def GetAlpha(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_GetAlpha,(self,) + _args, _kwargs)
+        return val
+    def HasAlpha(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_HasAlpha,(self,) + _args, _kwargs)
+        return val
+    def FindFirstUnusedColour(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_FindFirstUnusedColour,(self,) + _args, _kwargs)
+        return val
+    def SetMaskFromImage(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_SetMaskFromImage,(self,) + _args, _kwargs)
+        return val
     def LoadFile(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_LoadFile,(self,) + _args, _kwargs)
         return val
@@ -205,6 +272,12 @@ class wxImagePtr(wxObjectPtr):
     def SaveMimeFile(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_SaveMimeFile,(self,) + _args, _kwargs)
         return val
+    def LoadStream(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_LoadStream,(self,) + _args, _kwargs)
+        return val
+    def LoadMimeStream(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_LoadMimeStream,(self,) + _args, _kwargs)
+        return val
     def Ok(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_Ok,(self,) + _args, _kwargs)
         return val
@@ -231,6 +304,24 @@ class wxImagePtr(wxObjectPtr):
     def SetData(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_SetData,(self,) + _args, _kwargs)
         return val
+    def GetDataBuffer(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_GetDataBuffer,(self,) + _args, _kwargs)
+        return val
+    def SetDataBuffer(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_SetDataBuffer,(self,) + _args, _kwargs)
+        return val
+    def GetAlphaData(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_GetAlphaData,(self,) + _args, _kwargs)
+        return val
+    def SetAlphaData(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_SetAlphaData,(self,) + _args, _kwargs)
+        return val
+    def GetAlphaBuffer(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_GetAlphaBuffer,(self,) + _args, _kwargs)
+        return val
+    def SetAlphaBuffer(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_SetAlphaBuffer,(self,) + _args, _kwargs)
+        return val
     def SetMaskColour(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_SetMaskColour,(self,) + _args, _kwargs)
         return val
@@ -286,6 +377,17 @@ class wxImagePtr(wxObjectPtr):
     def CountColours(self, *_args, **_kwargs):
         val = apply(imagec.wxImage_CountColours,(self,) + _args, _kwargs)
         return val
+    def ComputeHistogram(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_ComputeHistogram,(self,) + _args, _kwargs)
+        return val
+    def ConvertToBitmap(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_ConvertToBitmap,(self,) + _args, _kwargs)
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
+        return val
+    def ConvertToMonoBitmap(self, *_args, **_kwargs):
+        val = apply(imagec.wxImage_ConvertToMonoBitmap,(self,) + _args, _kwargs)
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
+        return val
     def __repr__(self):
         return "<C wxImage instance at %s>" % (self.this,)
 class wxImage(wxImagePtr):
@@ -320,6 +422,16 @@ def wxImageFromData(*_args, **_kwargs):
     if val: val = wxImagePtr(val); val.thisown = 1
     return val
 
+def wxImageFromStream(*_args, **_kwargs):
+    val = apply(imagec.wxImageFromStream,_args,_kwargs)
+    if val: val = wxImagePtr(val); val.thisown = 1
+    return val
+
+def wxImageFromStreamMime(*_args, **_kwargs):
+    val = apply(imagec.wxImageFromStreamMime,_args,_kwargs)
+    if val: val = wxImagePtr(val); val.thisown = 1
+    return val
+
 wxInitAllImageHandlers = imagec.wxInitAllImageHandlers
 
 def wxBitmapFromImage(*_args, **_kwargs):
@@ -327,10 +439,14 @@ def wxBitmapFromImage(*_args, **_kwargs):
     if val: val = wxBitmapPtr(val); val.thisown = 1
     return val
 
+wxImageHistogram_MakeKey = imagec.wxImageHistogram_MakeKey
+
 wxImage_CanRead = imagec.wxImage_CanRead
 
 wxImage_GetImageCount = imagec.wxImage_GetImageCount
 
+wxImage_CanReadStream = imagec.wxImage_CanReadStream
+
 wxImage_AddHandler = imagec.wxImage_AddHandler
 
 wxImage_InsertHandler = imagec.wxImage_InsertHandler