class_docstr: Class to handle camera geometry.
class_docstr_tok: ["Class","to","handle","camera","geometry","."]
docstr: Returns a copy of the camera with adjusted image bounds.
  
  Args:
    left: number of pixels by which to reduce (or augment, if negative) the
      image domain at the associated boundary.
    right: likewise.
    top: likewise.
    bottom: likewise.
  
  The crop parameters may not cause the camera image domain dimensions to
  become non-positive.
  
  Returns:
    A camera with adjusted image dimensions.  The focal length is unchanged,
    and the principal point is updated to preserve the original principal
    axis.
docstr_tok: ["Returns","a","copy","of","the","camera","with","adjusted","image","bounds",".","Args",":","left",":","number","of","pixels","by","which","to","reduce","(","or","augment",",","if","negative",")","the","image","domain","at","the","associated","boundary",".","right",":","likewise",".","top",":","likewise",".","bottom",":","likewise",".","The","crop","parameters","may","not","cause","the","camera","image","domain","dimensions","to","become","non-positive",".","Returns",":","A","camera","with","adjusted","image","dimensions",".","The","focal","length","is","unchanged",",","and","the","principal","point","is","updated","to","preserve","the","original","principal","axis","."]
code: def crop_image_domain(
      self, left: int = 0, right: int = 0, top: int = 0, bottom: int = 0
  ):
      """Returns a copy of the camera with adjusted image bounds.
  
      Args:
        left: number of pixels by which to reduce (or augment, if negative) the
          image domain at the associated boundary.
        right: likewise.
        top: likewise.
        bottom: likewise.
  
      The crop parameters may not cause the camera image domain dimensions to
      become non-positive.
  
      Returns:
        A camera with adjusted image dimensions.  The focal length is unchanged,
        and the principal point is updated to preserve the original principal
        axis.
      """
  
      crop_left_top = np.array([left, top])
      crop_right_bottom = np.array([right, bottom])
      new_resolution = (
          self.image_size - crop_left_top - crop_right_bottom
      )
      new_principal_point = self.principal_point - crop_left_top
      if np.any(new_resolution <= 0):
          raise ValueError(
              "Crop would result in non-positive image dimensions."
          )
  
      new_camera = self.copy()
      new_camera.image_size = np.array(
          [int(new_resolution[0]), int(new_resolution[1])]
      )
      new_camera.principal_point = np.array(
          [new_principal_point[0], new_principal_point[1]]
      )
      return new_camera
  
imports: import copy
  import json
  from typing import Tuple, Union, Optional
  import numpy
  from nerfies import gpath
  from nerfies import types
label_desc: Use image node_id 24 for calling the Camera obj's underlying member method code with example usage: obj.crop_image_domain(left, right, top, bottom) and returns: new_camera