MCPcopy Create free account
hub / github.com/PageBot/PageBot / drawColorBars

Method drawColorBars

Lib/pagebot/elements/views/mapview.py:915–937  ·  view source on GitHub ↗

Draw the color bars for offset printing color calibration. TODO: Add more types of color bars and switch from scaling PDF to drawing them by script TODO Get this to work for content of the parameter set.

(self, e, origin)

Source from the content-addressed store, hash-verified

913 self.context.line((x + w + cmDistance, y + fy), (x + w + cmSize, y + fy))
914
915 def drawColorBars(self, e, origin):
916 """Draw the color bars for offset printing color calibration.
917
918 TODO: Add more types of color bars and switch from scaling PDF to
919 drawing them by script
920 TODO Get this to work for content of the parameter set.
921 """
922
923 showColorBars = e.showColorBars or (e.isPage and self.showColorBars)
924 if not showColorBars:
925 # Nothing to do.
926 return
927
928 ox, oy = point2D(origin)
929
930 if ECI_GrayConL in showColorBars:
931 path = getResourcesPath() + '/' + ECI_GrayConL
932 if COLORBAR_LEFT in showColorBars:
933 self.context.image(path, p=(ox-self.pl+pt(3), oy), h=e.h)
934
935 # TODO: Does not generate the right position?
936 if COLORBAR_RIGHT in showColorBars:
937 self.context.image(path, p=(ox+e.w+self.pr*2/3, oy), h=e.h)
938
939if __name__ == "__main__":
940 import sys

Callers 1

drawPageMetaInfoMethod · 0.95

Calls 4

point2DFunction · 0.90
getResourcesPathFunction · 0.90
ptFunction · 0.90
imageMethod · 0.45

Tested by

no test coverage detected