class_docstr: Antigrain Geometry Segment Collection
  
  This collection provides antialiased and accurate segments with caps. It
  consume x2 more memory than regular lines and is a bit slower, but the
  quality of the output is worth the cost.
docstr: 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'
docstr_tok: ["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","'"]
code: 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
  
file_path: vispy/vispy/visuals/collections/agg_segment_collection.py
imports: import numpy
  from ...None import glsl
  from .collection import Collection
  from ..transforms import NullTransform
label_desc: Use image node_id 1 to create a new AggSegmentCollection object from inherited base classes: Collection with example: obj = AggSegmentCollection(user_dtype, transform, vertex, fragment)