• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /dokuwiki/vendor/splitbrain/slika/src/

Lines Matching defs:width

11     /** @var int width of the current image */
12 protected $width = 0;
95 list($this->width, $this->height) = [$this->height, $this->width];
98 list($this->width, $this->height) = [$this->height, $this->width];
123 public function resize($width, $height)
125 list($width, $height) = $this->boundingBox($width, $height);
126 $this->resizeOperation($width, $height);
134 public function crop($width, $height)
136 list($this->width, $this->height, $offsetX, $offsetY) = $this->cropPosition($width, $height);
137 $this->resizeOperation($width, $height, $offsetX, $offsetY);
181 $this->width = $info[0];
206 * @param int $width
211 protected function createImage($width, $height)
216 $canvas = @imagecreatetruecolor($width, $height);
219 $canvas = @imagecreate($width, $height);
264 * @param int $width width of the bounding box
266 * @return array (width, height)
269 protected function boundingBox($width, $height)
271 if ($width == 0 && $height == 0) {
276 // adjust to match width
277 $height = round(($width * $this->height) / $this->width);
278 } else if (!$width) {
280 $width = round(($height * $this->width) / $this->height);
283 $scale = min($width / $this->width, $height / $this->height);
284 $width = $this->width * $scale;
288 return [$width, $height];
297 * @param int $width
302 protected function cropPosition($width, $height)
304 if ($width == 0 && $height == 0) {
309 $height = $width;
312 if (!$width) {
313 $width = $height;
317 $oldRatio = $this->width / $this->height;
318 $newRatio = $width / $height;
323 $cropWidth = $this->width;
324 $cropHeight = (int)($this->width / $newRatio);
334 $cropWidth = $this->width;
335 $cropHeight = (int)($this->width / $newRatio);
340 $offsetX = (int)(($this->width - $cropWidth) / 2);
349 * @param int $toWidth desired width
371 $this->width,
384 $this->width,
392 $this->width = $toWidth;