Added GetCount, GetCountRGB, and GetCountColour methods to

wx.ImageHistogram.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-03-25 19:54:29 +00:00
parent 28dd2407e1
commit 41c48dbbe1
2 changed files with 51 additions and 0 deletions

View File

@@ -68,6 +68,37 @@ public:
"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.", "");
%extend {
DocStr(GetCount,
"Returns the pixel count for the given key. Use `MakeKey` to create a
key value from a RGB tripple.", "");
unsigned long GetCount(unsigned long key) {
wxImageHistogramEntry e = (*self)[key];
return e.value;
}
DocStr(GetCountRGB,
"Returns the pixel count for the given RGB values.", "");
unsigned long GetCountRGB(unsigned char r,
unsigned char g,
unsigned char b) {
unsigned long key = wxImageHistogram::MakeKey(r, g, b);
wxImageHistogramEntry e = (*self)[key];
return e.value;
}
DocStr(GetCountColour,
"Returns the pixel count for the given `wx.Colour` value.", "");
unsigned long GetCountColour(const wxColour& colour) {
unsigned long key = wxImageHistogram::MakeKey(colour.Red(),
colour.Green(),
colour.Blue());
wxImageHistogramEntry e = (*self)[key];
return e.value;
}
}
};