class_docstr: PyVista wrapper for the VTK Camera class.
  
  Parameters
  ----------
  renderer : pyvista.Renderer, optional
      Renderer to attach the camera to.
  
  Examples
  --------
  Create a camera at the pyvista module level.
  
  >>> import pyvista as pv
  >>> camera = pv.Camera()
  
  Access the active camera of a plotter and get the position of the
  camera.
  
  >>> pl = pv.Plotter()
  >>> pl.camera.position
  (1.0, 1.0, 1.0)
class_docstr_tok: ["PyVista","wrapper","for","the","VTK","Camera","class",".","Parameters","--","--","--","--","--","renderer",":","pyvista.Renderer",",","optional","Renderer","to","attach","the","camera","to",".","Examples","--","--","--","--","Create","a","camera","at","the","pyvista","module","level",".",">",">",">","import","pyvista","as","pv",">",">",">","camera","=","pv.Camera","(",")","Access","the","active","camera","of","a","plotter","and","get","the","position","of","the","camera",".",">",">",">","pl","=","pv.Plotter","(",")",">",">",">","pl.camera.position","(","1.0",",","1.0",",","1.0",")"]
docstr: Adjust the camera position so that the actors fill the entire renderer.
  
  The camera view direction is reoriented to be normal to the ``view``
  plane. When ``negative=False``, The first letter of ``view`` refers
  to the axis that points to the right. The second letter of ``view``
  refers to axis that points up.  When ``negative=True``, the first
  letter refers to the axis that points left.  The up direction is
  unchanged.
  
  Parallel projection is enabled when using this function.
  
  Parameters
  ----------
  padding : float, default: 0.0
      Additional padding around the actor(s). This is effectively a zoom,
      where a value of 0.01 results in a zoom out of 1%.
  
  adjust_render_window : bool, default: True
      Adjust the size of the render window as to match the dimensions of
      the visible actors.
  
  view : {'xy', 'yx', 'xz', 'zx', 'yz', 'zy'}, default: 'xy'
      Plane to which the view is oriented.
  
  negative : bool, default: False
      Whether to view in opposite direction.
  
  Notes
  -----
  This resets the view direction to look at a plane with parallel projection.
  
  Examples
  --------
  Display the puppy image with a tight view.
  
  >>> import pyvista as pv
  >>> from pyvista import examples
  >>> puppy = examples.download_puppy()
  >>> pl = pv.Plotter(border=True, border_width=5)
  >>> _ = pl.add_mesh(puppy, rgb=True)
  >>> pl.camera.tight()
  >>> pl.show()
  
  Set the background to blue use a 5% padding around the image.
  
  >>> pl = pv.Plotter()
  >>> _ = pl.add_mesh(puppy, rgb=True)
  >>> pl.background_color = 'b'
  >>> pl.camera.tight(padding=0.05)
  >>> pl.show()
code: def tight(
      self,
      padding=0.0,
      adjust_render_window=True,
      view="xy",
      negative=False,
  ):
      """Adjust the camera position so that the actors fill the entire renderer.
  
      The camera view direction is reoriented to be normal to the ``view``
      plane. When ``negative=False``, The first letter of ``view`` refers
      to the axis that points to the right. The second letter of ``view``
      refers to axis that points up.  When ``negative=True``, the first
      letter refers to the axis that points left.  The up direction is
      unchanged.
  
      Parallel projection is enabled when using this function.
  
      Parameters
      ----------
      padding : float, default: 0.0
          Additional padding around the actor(s). This is effectively a zoom,
          where a value of 0.01 results in a zoom out of 1%.
  
      adjust_render_window : bool, default: True
          Adjust the size of the render window as to match the dimensions of
          the visible actors.
  
      view : {'xy', 'yx', 'xz', 'zx', 'yz', 'zy'}, default: 'xy'
          Plane to which the view is oriented.
  
      negative : bool, default: False
          Whether to view in opposite direction.
  
      Notes
      -----
      This resets the view direction to look at a plane with parallel projection.
  
      Examples
      --------
      Display the puppy image with a tight view.
  
      >>> import pyvista as pv
      >>> from pyvista import examples
      >>> puppy = examples.download_puppy()
      >>> pl = pv.Plotter(border=True, border_width=5)
      >>> _ = pl.add_mesh(puppy, rgb=True)
      >>> pl.camera.tight()
      >>> pl.show()
  
      Set the background to blue use a 5% padding around the image.
  
      >>> pl = pv.Plotter()
      >>> _ = pl.add_mesh(puppy, rgb=True)
      >>> pl.background_color = 'b'
      >>> pl.camera.tight(padding=0.05)
      >>> pl.show()
  
      """
      # Inspired by vedo resetCamera. Thanks @marcomusy.
      x0, x1, y0, y1, z0, z1 = self._renderer.ComputeVisiblePropBounds()
  
      self.enable_parallel_projection()
  
      self._renderer.ComputeAspect()
      aspect = self._renderer.GetAspect()
  
      position0 = np.array([x0, y0, z0])
      position1 = np.array([x1, y1, z1])
      objects_size = position1 - position0
      position = position0 + objects_size / 2
  
      direction, viewup = view_vectors(view, negative)
      horizontal = np.cross(direction, viewup)
  
      vert_dist = abs(objects_size @ viewup)
      horiz_dist = abs(objects_size @ horizontal)
  
      # set focal point to objects' center
      # offset camera position from objects center by dist in opposite of viewing direction
      # (actual distance doesn't matter due to parallel projection)
      dist = 1
      camera_position = position + dist * direction
  
      self.SetViewUp(*viewup)
      self.SetPosition(*camera_position)
      self.SetFocalPoint(*position)
  
      ps = max(horiz_dist / aspect[0], vert_dist) / 2
      self.parallel_scale = ps * (1 + padding)
      self._renderer.ResetCameraClippingRange(x0, x1, y0, y1, z0, z1)
  
      if adjust_render_window:
          ren_win = self._renderer.GetRenderWindow()
          size = list(ren_win.GetSize())
          size_ratio = size[0] / size[1]
          tight_ratio = horiz_dist / vert_dist
          resize_ratio = tight_ratio / size_ratio
          if resize_ratio < 1:
              size[0] = round(size[0] * resize_ratio)
          else:
              size[1] = round(size[1] / resize_ratio)
  
          ren_win.SetSize(size)
  
          # simply call tight again to reset the parallel scale due to the
          # resized window
          self.tight(
              padding=padding,
              adjust_render_window=False,
              view=view,
              negative=negative,
          )
  
      self.is_set = True
  
imports: from __future__ import annotations
  from pathlib import Path
  from typing import Union
  from weakref import proxy
  import xml.dom.minidom
  from xml.etree import ElementTree
  import numpy
  import pyvista
  from .None import _vtk
  from .helpers import view_vectors
label_desc: Use image node_id 42 for calling the Camera obj's underlying member method code with example usage: obj.tight(padding, adjust_render_window, view, negative) without return types