Check whether the given dimension is the same as the instance.

@param WebDriverDimension $dimension The dimension to be compared with.
@return bool Whether the height and the width are the same as the instance.
199276
public function equals(self $dimension)
    {
        return $this->height === $dimension->getHeight() && $this->width === $dimension->getWidth();
    }
507478
public function do_resize($width, $height)
    {
        if (version_compare(PHP_VERSION, '5.5.0') < 0) {
            $image = imagecreatetruecolor($width, $height);
            imagealphablending($image, false);
            imagesavealpha($image, true);

            imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);
        } else {
            $image = imagescale($this->_image, $width, $height);
        }

        imagedestroy($this->_image);
        $this->_image = $image;
        $this->_width = imagesx($image);
        $this->_height = imagesy($image);

        return $this;
    }
1284062
protected function isSingelton($id)
    {
        return (isset($this->binds[$id]['singleton']) && $this->binds[$id]['singleton'] === true);
    }
236591
def has_equivalent(self, equiv):
        
        try:
            this_equiv = equivalence_registry[equiv]()
        except KeyError:
            raise KeyError('No such equivalence "%s".' % equiv)
        old_dims = self.dimensions
        return old_dims in this_equiv._dims
670559
public function setHeight($height){
        if(!is_int($height)){
            throw new \Exception("Falscher Dateityp (".gettype($height).") integer expected!");
        }
        $this->height = $height;
        return true;
    }
1004758
def _compare_dimensions_to_fields(self) -> bool:
        
        for name, item in self._dimension_fields.items():
            if item.value != self._nested_items[name].value:
                return False
        return True
881592
public function matches(ImageSource $imageSource): bool {
		if ($this->imageDimension->getWidth() == $imageSource->getWidth()
				&& $this->imageDimension->getHeight() == $imageSource->getHeight()) {
			return true;
		}

		if ($this->scaleUpAllowed) return false;

		return $this->imageDimension->getWidth() >= $imageSource->getWidth()
				&& $this->imageDimension->getHeight() >= $imageSource->getHeight();
	}
77733
public final function containsSize( $widthOrSize, int $height = null ) : bool
   {

      $width = $widthOrSize;

      if ( $width instanceof Size )
      {
         $height = $width->height;
         $width  = $width->width;
      }
      else if ( \is_integer( $widthOrSize ) )
      {
         $width = $widthOrSize;
      }
      else if ( TypeTool::IsInteger( $widthOrSize ) )
      {
         $width = \intval( $widthOrSize );
      }
      else
      {
         $width = 0;
      }

      if ( ! \is_int( $height ) )
      {
         $height = \intval( $height );
      }

      return
         $this->size->width  >= $width
         &&
         $this->size->height >= $height;

   }
600916
public function checkMatrixDimensions($B = null)
    {
        if (is_a($B, 'Matrix')) {
            if (($this->m == $B->m) && ($this->n == $B->n)) {
                return true;
            } else {
                trigger_error(MatrixDimensionException, ERROR);
            }
        } else {
            trigger_error(ArgumentTypeException, ERROR);
        }
    }
527920
public function isEqualByInstance(CollectionInstanceInterface $instance_in)
    {
        $this->rewind();
        while (!empty($this->current())) {
            if ($this->hasEqualArrays($this->current()->toArray(), $instance_in->toArray())) {
                return true;
            }
            $this->next();
        }
        $this->rewind();
        return false;
    }
216907
public static function getProvisionalVersionForDimension(int $dimension) : self
    {
        if (1 !== $dimension % 4) {
            throw new InvalidArgumentException('Dimension is not 1 mod 4');
        }

        return self::getVersionForNumber(intdiv($dimension - 17, 4));
    }
1304418
public function isDimensionallyValid( $context, $hypercubeDimensions, $closed )
	{
		if ( is_string( $context ) )
		{
			$context = $this->getContext( $context );
		}

		// The context dimensions must be hypercube dimensions
		$contextDimensions = $this->getContextDimensions( $context );
		// $hypercubeDimensions = $details['details']['dimensions'];

		$invalidDimensions = array_diff_key( $contextDimensions, $hypercubeDimensions );

		// If there are any dimensions required by the context that are
		// not supported by the hypercube then the context is not valid
		if ( $invalidDimensions ) return false;

		// The dimension validity must take into account that any
		// of the hypercube dimension may have a default member
		$validDimensions = array_intersect_key( $contextDimensions, $hypercubeDimensions );

		if ( count( $validDimensions ) < count( $hypercubeDimensions ) )
		{
			// The order of the parameters is important.  The result should
			// have the missing members of the $reportInfoDimensions array.
			$missingDimensions = array_diff_key( $hypercubeDimensions, $validDimensions );

			// If there are no defaults an all missing dimensions then lose this context
			foreach ( $missingDimensions as $dimensionId => $dimension )
			{
				if ( ! isset( $dimension['default'] ) ) return false;
			}
		}
		elseif ( count( $contextDimensions ) > count( $hypercubeDimensions ) )
		{
			// If there are more context dimensions than report info dimensions then the dimension match is wrong
			return false;
		}

		return true;
	}
1115847
protected function calcImageSizeStrict($width, $height)
    {
        // first, we need to determine what the longest resize dimension is..
        if ($this->maxWidth >= $this->maxHeight) {
            // and determine the longest original dimension
            if ($width > $height) {
                $newDimensions = $this->calcHeight($width, $height);

                if ($newDimensions['newWidth'] < $this->maxWidth) {
                    $newDimensions = $this->calcWidth($width, $height);
                }
            } elseif ($height >= $width) {
                $newDimensions = $this->calcWidth($width, $height);

                if ($newDimensions['newHeight'] < $this->maxHeight) {
                    $newDimensions = $this->calcHeight($width, $height);
                }
            }
        } elseif ($this->maxHeight > $this->maxWidth) {
            if ($width >= $height) {
                $newDimensions = $this->calcWidth($width, $height);

                if ($newDimensions['newHeight'] < $this->maxHeight) {
                    $newDimensions = $this->calcHeight($width, $height);
                }
            } elseif ($height > $width) {
                $newDimensions = $this->calcHeight($width, $height);

                if ($newDimensions['newWidth'] < $this->maxWidth) {
                    $newDimensions = $this->calcWidth($width, $height);
                }
            }
        }

        $this->newDimensions = $newDimensions;
    }
682890
protected function failsBasicDimensionChecks($parameters, $width, $height)
    {
        return (isset($parameters['width']) && $parameters['width'] != $width) ||
               (isset($parameters['min_width']) && $parameters['min_width'] > $width) ||
               (isset($parameters['max_width']) && $parameters['max_width'] < $width) ||
               (isset($parameters['height']) && $parameters['height'] != $height) ||
               (isset($parameters['min_height']) && $parameters['min_height'] > $height) ||
               (isset($parameters['max_height']) && $parameters['max_height'] < $height);
    }
10435
public function getSize()
    {
        $size = $this->executor->execute(
            DriverCommand::GET_ELEMENT_SIZE,
            [':id' => $this->id]
        );

        return new WebDriverDimension($size['width'], $size['height']);
    }
657695
private function normalizeUnits(&$dimension, &$units, $baseUnit = 'in')
    {
        $dimension = $this->dimension;
        $units     = [];

        foreach ($this->units as $unit => $exp) {
            if (isset(static::$unitTable[$baseUnit][$unit])) {
                $factor = pow(static::$unitTable[$baseUnit][$unit], $exp);

                $unit = $baseUnit;
                $dimension /= $factor;
            }

            $units[$unit] = $exp + (isset($units[$unit]) ? $units[$unit] : 0);
        }
    }
309754
public function scale($new_width = null, $new_height = null)
        {
            if(!is_null($new_width) && is_null($new_height))
                $new_height = $new_width * $this->height / $this->width;
            elseif(is_null($new_width) && !is_null($new_height))
                $new_width = $this->width / $this->height * $new_height;
            elseif(!is_null($new_width) && !is_null($new_height)) {
                if($this->width < $this->height)
                    $new_width = $this->width / $this->height * $new_height;
                else
                    $new_height = $new_width * $this->height / $this->width;
            } else
                return false;

            return $this->resize($new_width, $new_height);
        }