def __init__(self, user_dtype=None, transform=None,
                 vertex=None, fragment=None, **kwargs):
        """
        Initialize the collection.

        Parameters
        ----------

        user_dtype: list
            The base dtype can be completed (appended) by the used_dtype. It
            only make sense if user also provide vertex and/or fragment shaders

        transform : string
            GLSL Transform code defining the vec4 transform(vec3) function

        vertex: string
            Vertex shader code

        fragment: string
            Fragment  shader code

        caps : string
            'local', 'shared' or 'global'

        color : string
            'local', 'shared' or 'global'

        linewidth : string
            'local', 'shared' or 'global'

        antialias : string
            'local', 'shared' or 'global'
        """

        base_dtype = [('P0',        (np.float32, 3), '!local', (0, 0, 0)),
                      ('P1',        (np.float32, 3), '!local', (0, 0, 0)),
                      ('index',     (np.float32, 1), '!local', 0),
                      ('color',     (np.float32, 4), 'shared', (0, 0, 0, 1)),
                      ('linewidth', (np.float32, 1), 'shared', 1),
                      ('antialias', (np.float32, 1), 'shared', 1),
                      ('viewport',  (np.float32, 4), 'global', (0, 0, 512, 512))]  # noqa

        dtype = base_dtype
        if user_dtype:
            dtype.extend(user_dtype)

        if vertex is None:
            vertex = glsl.get('collections/agg-segment.vert')
        if transform is None:
            transform = NullTransform()
        self.transform = transform        
        if fragment is None:
            fragment = glsl.get('collections/agg-segment.frag')

        Collection.__init__(self, dtype=dtype, itype=np.uint32,
                            mode="triangles",
                            vertex=vertex, fragment=fragment, **kwargs)
        self._programs[0].vert['transform'] = self.transform
def __init__ ( self , user_dtype = None , transform = None , vertex = None , fragment = None , ** kwargs ) : base_dtype = [ ( 'P0' , ( np . float32 , 3 ) , '!local' , ( 0 , 0 , 0 ) ) , ( 'P1' , ( np . float32 , 3 ) , '!local' , ( 0 , 0 , 0 ) ) , ( 'index' , ( np . float32 , 1 ) , '!local' , 0 ) , ( 'color' , ( np . float32 , 4 ) , 'shared' , ( 0 , 0 , 0 , 1 ) ) , ( 'linewidth' , ( np . float32 , 1 ) , 'shared' , 1 ) , ( 'antialias' , ( np . float32 , 1 ) , 'shared' , 1 ) , ( 'viewport' , ( np . float32 , 4 ) , 'global' , ( 0 , 0 , 512 , 512 ) ) ] dtype = base_dtype if user_dtype : dtype . extend ( user_dtype ) if vertex is None : vertex = glsl . get ( 'collections/agg-segment.vert' ) if transform is None : transform = NullTransform ( ) self . transform = transform if fragment is None : fragment = glsl . get ( 'collections/agg-segment.frag' ) Collection . __init__ ( self , dtype = dtype , itype = np . uint32 , mode = "triangles" , vertex = vertex , fragment = fragment , ** kwargs ) self . _programs [ 0 ] . vert [ 'transform' ] = self . transform
Initialize the collection.

        Parameters
        ----------

        user_dtype: list
            The base dtype can be completed (appended) by the used_dtype. It
            only make sense if user also provide vertex and/or fragment shaders

        transform : string
            GLSL Transform code defining the vec4 transform(vec3) function

        vertex: string
            Vertex shader code

        fragment: string
            Fragment  shader code

        caps : string
            'local', 'shared' or 'global'

        color : string
            'local', 'shared' or 'global'

        linewidth : string
            'local', 'shared' or 'global'

        antialias : string
            'local', 'shared' or 'global'