Пример #1
0
 def mergeRotatedScaledTranslatedPage(self, page2, rotation, scale, tx, ty):
     translation = [[1, 0, 0], [0, 1, 0], [tx, ty, 1]]
     rotation = math.radians(rotation)
     rotating = [[math.cos(rotation), math.sin(rotation), 0], [-math.sin(rotation), math.cos(rotation), 0], [0, 0, 1]]
     scaling = [[scale, 0, 0], [0, scale, 0], [0, 0, 1]]
     ctm = utils.matrixMultiply(rotating, scaling)
     ctm = utils.matrixMultiply(ctm, translation)
     return self.mergeTransformedPage(page2, [ctm[0][0],
      ctm[0][1],
      ctm[1][0],
      ctm[1][1],
      ctm[2][0],
      ctm[2][1]])
Пример #2
0
    def mergeRotatedScaledTranslatedPage(self, page2, rotation, scale, tx, ty):
        translation = [[1, 0, 0], [0, 1, 0], [tx, ty, 1]]
        rotation = math.radians(rotation)
        rotating = [[math.cos(rotation),
                     math.sin(rotation), 0],
                    [-math.sin(rotation),
                     math.cos(rotation), 0], [0, 0, 1]]
        scaling = [[scale, 0, 0], [0, scale, 0], [0, 0, 1]]
        ctm = utils.matrixMultiply(rotating, scaling)
        ctm = utils.matrixMultiply(ctm, translation)

        return self.mergeTransformedPage(
            page2,
            [ctm[0][0], ctm[0][1], ctm[1][0], ctm[1][1], ctm[2][0], ctm[2][1]])
Пример #3
0
    def mergeScaledTranslatedPage(self, page2, scale, tx, ty):
        translation = [[1, 0, 0], [0, 1, 0], [tx, ty, 1]]
        scaling = [[scale, 0, 0], [0, scale, 0], [0, 0, 1]]
        ctm = utils.matrixMultiply(scaling, translation)

        return self.mergeTransformedPage(
            page2,
            [ctm[0][0], ctm[0][1], ctm[1][0], ctm[1][1], ctm[2][0], ctm[2][1]])
Пример #4
0
 def mergeScaledTranslatedPage(self, page2, scale, tx, ty):
     translation = [[1, 0, 0], [0, 1, 0], [tx, ty, 1]]
     scaling = [[scale, 0, 0], [0, scale, 0], [0, 0, 1]]
     ctm = utils.matrixMultiply(scaling, translation)
     return self.mergeTransformedPage(page2, [ctm[0][0],
      ctm[0][1],
      ctm[1][0],
      ctm[1][1],
      ctm[2][0],
      ctm[2][1]])