Home | Trees | Index | Help |
|
---|
Package wx :: Class Image |
|
object
--+ |Object
--+ | Image
Method Summary | |
---|---|
Image | __init__(self,
name,
type,
index)
|
__del__(self)
| |
__nonzero__(self)
| |
__repr__(self)
| |
AddHandler(handler)
(Static method) | |
bool | CanRead(name)
(Static method) |
bool | CanReadStream(stream)
(Static method) |
unsigned long | ComputeHistogram(self,
h)
|
bool |
If the image has alpha channel, this method converts it to mask. |
ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool | |
Bitmap | ConvertToBitmap(self,
depth)
|
ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image | |
ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap | |
Image | Copy(self)
|
CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long | |
Create(self,
width,
height)
| |
Deletes the C++ object this Python object is a proxy for. | |
(success, r, g, b) |
Find first colour that is not used in the image and has higher RGB values than startR, startG, startB. |
unsigned char | GetAlpha(self,
x,
y)
|
PyObject | GetAlphaBuffer(self)
|
PyObject |
Returns a string containing a copy of the alpha bytes of the image. |
unsigned char | GetBlue(self,
x,
y)
|
PyObject |
Returns a string containing a copy of the RGB bytes of the image. |
PyObject |
Returns a writable Python buffer object that is pointing at the RGB image data buffer inside the wx.Image. |
unsigned char | GetGreen(self,
x,
y)
|
int | GetHeight(self)
|
int | GetImageCount(name,
type)
(Static method) |
String | GetImageExtWildcard()
(Static method) |
unsigned char | GetMaskBlue(self)
|
unsigned char | GetMaskGreen(self)
|
unsigned char | GetMaskRed(self)
|
String | GetOption(self,
name)
|
int | GetOptionInt(self,
name)
|
(r,g,b) |
Get the current mask colour or find a suitable colour. |
unsigned char | GetRed(self,
x,
y)
|
Size | GetSize(self)
|
Image | GetSubImage(self,
rect)
|
int | GetWidth(self)
|
bool | HasAlpha(self)
|
bool | HasMask(self)
|
bool | HasOption(self,
name)
|
Initializes the image alpha channel data. | |
InsertHandler(handler)
(Static method) | |
IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool | |
bool | LoadFile(self,
name,
type,
index)
|
bool | LoadMimeFile(self,
name,
mimetype,
index)
|
bool | LoadMimeStream(self,
stream,
mimetype,
index)
|
bool | LoadStream(self,
stream,
type,
index)
|
Image | Mirror(self,
horizontally)
|
bool | Ok(self)
|
Paste(self,
image,
x,
y)
| |
bool | RemoveHandler(name)
(Static method) |
unsigned char r2, unsigned char g2, unsigned char b2) | |
Image | Rescale(self,
width,
height)
|
Image | Resize(self,
size,
pos,
r,
g,
b)
|
Image | Rotate(self,
angle,
centre_of_rotation,
interpolating,
offset_after_rotation)
|
Image | Rotate90(self,
clockwise)
|
bool | SaveFile(self,
name,
type)
|
bool | SaveMimeFile(self,
name,
mimetype)
|
Image | Scale(self,
width,
height)
|
SetAlpha(self, int x, int y, unsigned char alpha) | |
SetAlphaBuffer(self,
alpha)
| |
Resets the Image's alpha data from a buffer of bytes. | |
Resets the Image's RGB data from a buffer of RGB bytes. | |
Sets the internal image data pointer to point at a Python buffer object. | |
SetMask(self,
mask)
| |
SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b) | |
bool | SetMaskFromImage(self,
mask,
mr,
mg,
mb)
|
SetOption(self,
name,
value)
| |
SetOptionInt(self,
name,
value)
| |
SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b) | |
SetRGBRect(self, Rect rect, unsigned char r, unsigned char g, unsigned char b) | |
Image | ShrinkBy(self,
xFactor,
yFactor)
|
Image | Size(self,
size,
pos,
r,
g,
b)
|
Instance Method Details |
---|
ConvertAlphaToMask(self, threshold=IMAGE_ALPHA_THRESHOLD)If the image has alpha channel, this method converts it to mask. All pixels
with alpha value less than threshold are replaced with mask colour and the
alpha channel is removed. Mask colour is chosen automatically using
If the image image doesn't have alpha channel, ConvertAlphaToMask does nothing.
|
ConvertColourToAlpha(*args, **kwargs)ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool This method converts an image where the original alpha information is only available as a shades of a colour (actually shades of grey) typically when you draw anti-aliased text into a bitmap. The DC drawing routines draw grey values on the black background although they actually mean to draw white with differnt alpha values. This method reverses it, assuming a black (!) background and white text. The method will then fill up the whole image with the colour given. |
ConvertToMono(*args, **kwargs)ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image |
ConvertToMonoBitmap(*args, **kwargs)ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap |
CountColours(*args, **kwargs)CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long |
Destroy(self)Deletes the C++ object this Python object is a proxy for.
|
FindFirstUnusedColour(startR=1, startG=0, startB=0)Find first colour that is not used in the image and has higher RGB values than startR, startG, startB. Returns a tuple consisting of a success flag and rgb values.
|
GetAlphaData(self)Returns a string containing a copy of the alpha bytes of the image.
|
GetData(self)Returns a string containing a copy of the RGB bytes of the image.
|
GetDataBuffer(self)Returns a writable Python buffer object that is pointing at the RGB image data buffer inside the wx.Image.
|
GetOrFindMaskColour()Get the current mask colour or find a suitable colour.
|
InitAlpha(self)Initializes the image alpha channel data. It is an error to call it if the image already has alpha data. If it doesn't, alpha data will be by default initialized to all pixels being fully opaque. But if the image has a a mask colour, all mask pixels will be completely transparent. |
IsTransparent(*args, **kwargs)IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool Returns True if this pixel is masked or has an alpha value less than the spcified threshold. |
Replace(*args, **kwargs)
|
SetAlpha(*args, **kwargs)SetAlpha(self, int x, int y, unsigned char alpha) |
SetAlphaData(self, alpha)Resets the Image's alpha data from a buffer of bytes. Accepts either a string or a buffer object holding the data and the length of the data must be width*height.
|
SetData(self, data)Resets the Image's RGB data from a buffer of RGB bytes. Accepts either a string or a buffer object holding the data and the length of the data must be width*height*3.
|
SetDataBuffer(self, data)Sets the internal image data pointer to point at a Python buffer object. This can save a copy of the data but you must ensure that the buffer object lives longer than the wx.Image does.
|
SetMaskColour(*args, **kwargs)SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b) |
SetRGB(*args, **kwargs)SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b) |
SetRGBRect(*args, **kwargs)SetRGBRect(self, Rect rect, unsigned char r, unsigned char g, unsigned char b) |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20040428.rpd on Tue Apr 26 14:24:58 2005 | http://epydoc.sf.net |