MCPcopy Index your code
hub / github.com/lincolnloop/python-qrcode / __init__

Method __init__

qrcode/image/styledpil.py:42–68  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

40 default_drawer_class = SquareModuleDrawer
41
42 def __init__(self, *args, **kwargs):
43 self.color_mask = kwargs.get("color_mask", SolidFillColorMask())
44 # allow embeded_ parameters with typos for backwards compatibility
45 embedded_image_path = kwargs.get(
46 "embedded_image_path", kwargs.get("embeded_image_path", None)
47 )
48 self.embedded_image = kwargs.get(
49 "embedded_image", kwargs.get("embeded_image", None)
50 )
51 self.embedded_image_ratio = kwargs.get(
52 "embedded_image_ratio", kwargs.get("embeded_image_ratio", 0.25)
53 )
54 self.embedded_image_resample = kwargs.get(
55 "embedded_image_resample",
56 kwargs.get("embeded_image_resample", Image.Resampling.LANCZOS),
57 )
58 if not self.embedded_image and embedded_image_path:
59 self.embedded_image = Image.open(embedded_image_path)
60
61 # the paint_color is the color the module drawer will use to draw upon
62 # a canvas During the color mask process, pixels that are paint_color
63 # are replaced by a newly-calculated color
64 self.paint_color = tuple(0 for i in self.color_mask.back_color)
65 if self.color_mask.has_transparency:
66 self.paint_color = tuple([*self.color_mask.back_color[:3], 255])
67
68 super().__init__(*args, **kwargs)
69
70 def new_image(self, **kwargs):
71 mode = (

Callers

nothing calls this directly

Calls 2

SolidFillColorMaskClass · 0.90
getMethod · 0.80

Tested by

no test coverage detected