예제 #1
0
 def __init__(self, parent, Cp_name=None, Cp_name_src='default', createCp=0):
     #                                                             #
     ###############################################################
     # Initialize the colormap class and its members               #
     #                                                             #
     # The getCpmember function retrieves the values of the        #
     # colormap members in the C structure and passes back the     #
     # appropriate Python Object.                                  #
     ###############################################################
     #                                                             #
     if (createCp == 0):
        if (Cp_name == None):
           raise ValueError, 'Must provide a colormap name.'
        else:
           _vcs.copyCp(Cp_name_src, Cp_name)
           self.__dict__['name'] = Cp_name
     else:
           self.__dict__['name']=Cp_name_src
     self.__dict__['s_name']='Cp'
     self.__dict__['parent']=parent
     self.__dict__['index']=RGB_Table(self,self.__dict__['name']) # Create colormap dictionary
예제 #2
0
def copyCp(old_name, new_name):
     return _vcs.copyCp(old_name, new_name)