pybitmessage.qidenticon module¶
Usage¶
>>> import qidenticon
>>> qidenticon.render_identicon(code, size)
Returns an instance of QPixmap which have generated identicon image.
size specifies patch size. Generated image size is 3 * size.
-
class
IdenticonRendererBase(code)[source]¶ Bases:
objectEncapsulate methods around rendering identicons
-
PATH_SET= []¶
-
render(size, twoColor, opacity, penwidth)¶ render identicon to QPixmap
Parameters: size – identicon patchsize. (image size is 3 * [size]) Returns: QPixmap
-
drawPatchQt(pos, turn, invert, patch_type, image, size, foreColor, backColor, penwidth)¶ Parameters: size – patch size
-
decode(code, twoColor)¶ virtual functions
-
-
class
DonRenderer(code)[source]¶ Bases:
pybitmessage.qidenticon.IdenticonRendererBaseDon Park’s implementation of identicon, see: https://blog.docuverse.com/2007/01/18/identicon-updated-and-source-released
-
PATH_SET= [[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0), (0.0, 0.0)], [(0.0, 0.0), (1.0, 0.0), (0.0, 1.0), (0.0, 0.0)], [(0.5, 0.0), (1.0, 1.0), (0.0, 1.0), (0.5, 0.0)], [(0.0, 0.0), (0.5, 0.0), (0.5, 1.0), (0.0, 1.0), (0.0, 0.0)], [(0.5, 0.0), (1.0, 0.5), (0.5, 1.0), (0.0, 0.5), (0.5, 0.0)], [(0.0, 0.0), (1.0, 0.5), (1.0, 1.0), (0.5, 1.0), (0.0, 0.0)], [(0.5, 0.0), (1.0, 1.0), (0.5, 1.0), (0.75, 0.5), (0.25, 0.5), (0.5, 1.0), (0.0, 1.0), (0.5, 0.0)], [(0.0, 0.0), (1.0, 0.5), (0.5, 1.0), (0.0, 0.0)], [(0.25, 0.25), (0.75, 0.25), (0.75, 0.75), (0.25, 0.75), (0.25, 0.25)], [(0.5, 0.0), (1.0, 0.0), (0.0, 1.0), (0.0, 0.5), (0.5, 0.5), (0.5, 0.0)], [(0.0, 0.0), (0.5, 0.0), (0.5, 0.5), (0.0, 0.5), (0.0, 0.0)], [(0.0, 0.5), (1.0, 0.5), (0.5, 1.0), (0.0, 0.5)], [(0.5, 0.5), (1.0, 1.0), (0.0, 1.0), (0.5, 0.5)], [(0.5, 0.0), (0.5, 0.5), (0.0, 0.5), (0.5, 0.0)], [(0.0, 0.0), (0.5, 0.0), (0.0, 0.5), (0.0, 0.0)], []]¶
-
MIDDLE_PATCH_SET= [0, 4, 8, 15]¶
-
p= [(0.0, 0.0), (0.5, 0.0), (0.0, 0.5)]¶
-
decode(code, twoColor)¶ decode the code
-
idx= 15¶
-
path= []¶
-
vec= (0, 2)¶
-