Esempio n. 1
0
 def set_cmx_const(self):
     cont = self.cmx_model.chunk_map[cmx_const.CONT_ID]
     self.v1 = self.cmx_cfg.v1
     self.rifx = self.cmx_cfg.rifx
     # Trafo & unit definition
     unit = CMX_SK2_UNITS.get(cont.data['unit'], uc2const.UNIT_MM)
     self.sk2_model.doc_units = unit
     factor = utils.double2py_float(cont.data['factor'], self.cmx_cfg.rifx)
     self.scale = factor * uc2const.unit_dict[unit]
     self.trafo = [self.scale, 0.0, 0.0, self.scale, 0.0, 0.0]
     # Color processing
     if self.v1:
         self.set_v1_colors()
Esempio n. 2
0
def parse_matrix(data):
    """
    Parses CDR affine transformation matrix and
    returns matrix as a list.
    """
    m11 = double2py_float(data[0:8])
    m12 = double2py_float(data[8:16])
    dx = double2py_float(data[16:24]) * cdrunit_to_pt
    m21 = double2py_float(data[24:32])
    m22 = double2py_float(data[32:40])
    dy = double2py_float(data[40:48]) * cdrunit_to_pt
    return [m11, m21, m12, m22, dx, dy]
Esempio n. 3
0
def parse_matrix(data):
	"""
	Parses CDR affine transformation matrix and 
	returns matrix as a list.
	"""
	m11 = double2py_float(data[0:8])
	m12 = double2py_float(data[8:16])
	dx = double2py_float(data[16:24]) * cdrunit_to_pt
	m21 = double2py_float(data[24:32])
	m22 = double2py_float(data[32:40])
	dy = double2py_float(data[40:48]) * cdrunit_to_pt
	return [m11, m21, m12, m22, dx, dy]