MCPcopy Create free account
hub / github.com/clips/pattern / LTImage

Class LTImage

pattern/web/pdf/layout.py:169–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167## LTImage
168##
169class LTImage(LTComponent):
170
171 def __init__(self, name, stream, bbox):
172 LTComponent.__init__(self, bbox)
173 self.name = name
174 self.stream = stream
175 self.srcsize = (stream.get_any(('W', 'Width')),
176 stream.get_any(('H', 'Height')))
177 self.imagemask = stream.get_any(('IM', 'ImageMask'))
178 self.bits = stream.get_any(('BPC', 'BitsPerComponent'), 1)
179 self.colorspace = stream.get_any(('CS', 'ColorSpace'))
180 if not isinstance(self.colorspace, list):
181 self.colorspace = [self.colorspace]
182 return
183
184 def __repr__(self):
185 return ('<%s(%s) %s %r>' %
186 (self.__class__.__name__, self.name,
187 bbox2str(self.bbox), self.srcsize))
188
189
190## LTAnon

Callers 1

render_imageMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…