Lines Matching refs:gdimg

78     public function Bevel(&$gdimg, $width, $hexcolor1, $hexcolor2) {  argument
83 imagealphablending($gdimg, true);
86 $color1 = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor1, false, $alpha);
87 $color2 = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor2, false, $alpha);
89 …imageline($gdimg, $i, $i + 1, $i, imagesy($g…
90 …imageline($gdimg, $i, $i , imagesx($gdimg) - $i, …
91 …imageline($gdimg, imagesx($gdimg) - $i, imagesy($gdimg) - $i - 1, imagesx($gdimg) - $i, …
92 …imageline($gdimg, imagesx($gdimg) - $i, imagesy($gdimg) - $i , $i, imagesy($g…
98 public function Blur(&$gdimg, $radius=0.5) { argument
106 $w = imagesx($gdimg);
107 $h = imagesy($gdimg);
117 imagecopy ($imgBlur, $gdimg, 0, 0, 1, 1, $w - 1, $h - 1); // up left
118 imagecopymerge($imgBlur, $gdimg, 1, 1, 0, 0, $w, $h, 50.00000); // down right
119 imagecopymerge($imgBlur, $gdimg, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left
120 imagecopymerge($imgBlur, $gdimg, 1, 0, 0, 1, $w, $h - 1, 25.00000); // up right
121 imagecopymerge($imgBlur, $gdimg, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left
122 imagecopymerge($imgBlur, $gdimg, 1, 0, 0, 0, $w, $h, 25.00000); // right
123 imagecopymerge($imgBlur, $gdimg, 0, 0, 0, 1, $w, $h - 1, 20.00000); // up
124 imagecopymerge($imgBlur, $gdimg, 0, 1, 0, 0, $w, $h, 16.666667); // down
125 imagecopymerge($imgBlur, $gdimg, 0, 0, 0, 0, $w, $h, 50.000000); // center
126 imagecopy ($gdimg, $imgBlur, 0, 0, 0, 0, $w, $h);
134 public function BlurGaussian(&$gdimg) { argument
136 if (imagefilter($gdimg, IMG_FILTER_GAUSSIAN_BLUR)) {
143 return $this->Blur($gdimg, 0.5);
147 public function BlurSelective(&$gdimg) { argument
149 if (imagefilter($gdimg, IMG_FILTER_SELECTIVE_BLUR)) {
161 public function Brightness(&$gdimg, $amount=0) { argument
168 if (imagefilter($gdimg, IMG_FILTER_BRIGHTNESS, $amount)) {
177 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
178 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
179 $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
184 $newColor = imagecolorallocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']);
185 imagesetpixel($gdimg, $x, $y, $newColor);
192 public function Contrast(&$gdimg, $amount=0) { argument
201 if (imagefilter($gdimg, IMG_FILTER_CONTRAST, $amount)) {
213 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
214 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
215 $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
220 $newColor = imagecolorallocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']);
221 imagesetpixel($gdimg, $x, $y, $newColor);
228 public function Colorize(&$gdimg, $amount, $targetColor) { argument
244 if (imagefilter($gdimg, IMG_FILTER_COLORIZE, $r, $g, $b)) {
259 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
260 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
261 $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
270 $newColor = imagecolorallocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']);
271 imagesetpixel($gdimg, $x, $y, $newColor);
278 public function Crop(&$gdimg, $left=0, $right=0, $top=0, $bottom=0) { argument
282 $oldW = imagesx($gdimg);
283 $oldH = imagesy($gdimg);
294 imagecopy($imgCropped, $gdimg, 0, 0, $left, $top, $newW, $newH);
295 if ($gdimg = imagecreatetruecolor($newW, $newH)) {
296 imagecopy($gdimg, $imgCropped, 0, 0, 0, 0, $newW, $newH);
306 public function Desaturate(&$gdimg, $amount, $color='') { argument
310 …return $this->Colorize($gdimg, $amount, (phpthumb_functions::IsHexColor($color) ? $color : 'gray')…
314 public function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha) { argument
344 $tempImageWidth = imagesx($gdimg) + abs($Offset['x']);
345 $tempImageHeight = imagesy($gdimg) + abs($Offset['y']);
355 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
356 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
357 $PixelMap[$x][$y] = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
366 …$thisColor = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor, false, $PixelMap[$x + $O…
375 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
376 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
384 imagesavealpha($gdimg, true);
385 imagealphablending($gdimg, false);
387 $transparent2 = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 0, 0, 0, 127);
388 imagefilledrectangle($gdimg, 0, 0, imagesx($gdimg), imagesy($gdimg), $transparent2);
389 …imagecopyresampled($gdimg, $gdimg_dropshadow_temp, 0, 0, 0, 0, imagesx($gdimg), imagesy($gdimg), i…
397 public function EdgeDetect(&$gdimg) { argument
399 if (imagefilter($gdimg, IMG_FILTER_EDGEDETECT)) {
411 public function Ellipse($gdimg) { argument
416 …emask_double = phpthumb_functions::ImageCreateFunction(imagesx($gdimg) * 2, imagesy($gdimg) * 2)) {
417 …if ($gdimg_ellipsemask = phpthumb_functions::ImageCreateFunction(imagesx($gdimg), imagesy($gdimg))…
420 …llipse($gdimg_ellipsemask_double, imagesx($gdimg), imagesy($gdimg), (imagesx($gdimg) - 1) * 2, (im…
421 …dimg_ellipsemask_double, 0, 0, 0, 0, imagesx($gdimg), imagesy($gdimg), imagesx($gdimg) * 2, images…
423 $this->ApplyMask($gdimg_ellipsemask, $gdimg);
438 public function Emboss(&$gdimg) { argument
440 if (imagefilter($gdimg, IMG_FILTER_EMBOSS)) {
452 public function Flip(&$gdimg, $x=false, $y=false) { argument
456 if ($tempImage = phpthumb_functions::ImageCreateFunction(imagesx($gdimg), imagesy($gdimg))) {
458 imagecopy($tempImage, $gdimg, 0, 0, 0, 0, imagesx($gdimg), imagesy($gdimg));
459 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
460 imagecopy($gdimg, $tempImage, imagesx($gdimg) - 1 - $x, 0, $x, 0, 1, imagesy($gdimg));
464 imagecopy($tempImage, $gdimg, 0, 0, 0, 0, imagesx($gdimg), imagesy($gdimg));
465 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
466 imagecopy($gdimg, $tempImage, 0, imagesy($gdimg) - 1 - $y, 0, $y, imagesx($gdimg), 1);
475 …public function Frame(&$gdimg, $frame_width, $edge_width, $hexcolor_frame, $hexcolor1, $hexcolor2)… argument
482 $color_frame = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor_frame);
483 $color1 = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor1);
484 $color2 = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor2);
487 …imageline($gdimg, $i, $i, $i, imagesy($gdimg
488 …imageline($gdimg, $i, $i, imagesx($gdimg) - $i, …
489 …imageline($gdimg, imagesx($gdimg) - $i, imagesy($gdimg) - $i, imagesx($gdimg) - $i, …
490 …imageline($gdimg, imagesx($gdimg) - $i, imagesy($gdimg) - $i, $i, imagesy($gdimg
494 …imagerectangle($gdimg, $edge_width + $i, $edge_width + $i, imagesx($gdimg) - $edge_width - $i, ima…
498gdimg, $frame_width + $edge_width + $i, $frame_width + $edge_w…
499 …imageline($gdimg, $frame_width + $edge_width + $i, $frame_widt…
500 …imageline($gdimg, imagesx($gdimg) - $frame_width - $edge_width - $i, imagesy($gdimg) - $frame_widt…
501gdimg, imagesx($gdimg) - $frame_width - $edge_width - $i, imagesy($gdimg) - $frame_width - $edge_w…
507 public function Gamma(&$gdimg, $amount) { argument
511 return imagegammacorrect($gdimg, 1.0, $amount);
515 public function Grayscale(&$gdimg) { argument
517 if (imagefilter($gdimg, IMG_FILTER_GRAYSCALE)) {
523 return $this->Colorize($gdimg, 100, 'gray');
527 public function HistogramAnalysis(&$gdimg, $calculateGray=false) { argument
528 $ImageSX = imagesx($gdimg);
529 $ImageSY = imagesy($gdimg);
533 $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
555 public function HistogramStretch(&$gdimg, $band='*', $method=0, $threshold=0.1) { argument
559 $Analysis = $this->HistogramAnalysis($gdimg, true);
572 $clip_threshold = imagesx($gdimg) * imagesx($gdimg) * $threshold;
610 $ImageSX = imagesx($gdimg);
611 $ImageSY = imagesy($gdimg);
614 $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
624 …$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, $new['red'], $new['green'], $n…
625 imagesetpixel($gdimg, $x, $y, $newColor);
633 …public function HistogramOverlay(&$gdimg, $bands='*', $colors='', $width=0.25, $height=0.25, $alig… argument
636 $Analysis = $this->HistogramAnalysis($gdimg, true);
637 $histW = round(($width > 1) ? min($width, imagesx($gdimg)) : imagesx($gdimg) * $width);
638 $histH = round(($width > 1) ? min($width, imagesx($gdimg)) : imagesx($gdimg) * $width);
675 $this->WatermarkOverlay($gdimg, $gdHist, $alignment, $opacity, $margin_x, $margin_y);
683 public function ImageBorder(&$gdimg, $border_width, $radius_x, $radius_y, $hexcolor_border) { argument
688 $output_width = imagesx($gdimg);
689 $output_height = imagesy($gdimg);
734 …$this->phpThumbObject->ImageResizeFunction($gd_border_canvas, $gdimg, floor(($output_width - $new_…
736 imagedestroy($gdimg);
737 $gdimg = phpthumb_functions::ImageCreateFunction($output_width, $output_height);
738 imagesavealpha($gdimg, true);
739 imagealphablending($gdimg, false);
740 …$gdimg_color_background = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 255, 255, 255, 1…
741 imagefilledrectangle($gdimg, 0, 0, $output_width, $output_height, $gdimg_color_background);
743 imagecopy($gdimg, $gd_border_canvas, 0, 0, 0, 0, $output_width, $output_height);
852 public function MeanRemoval(&$gdimg) { argument
854 if (imagefilter($gdimg, IMG_FILTER_MEAN_REMOVAL)) {
866 public function Negative(&$gdimg) { argument
868 if (imagefilter($gdimg, IMG_FILTER_NEGATE)) {
874 $ImageSX = imagesx($gdimg);
875 $ImageSY = imagesy($gdimg);
878 $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
879 …$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, ~$currentPixel[ 'red'] & 0xFF,…
880 imagesetpixel($gdimg, $x, $y, $newColor);
887 public function RoundedImageCorners(&$gdimg, $radius_x, $radius_y) { argument
892 …if ($gdimg_cornermask = phpthumb_functions::ImageCreateFunction(imagesx($gdimg), imagesy($gdimg)))…
897 …imagefilledrectangle($gdimg_cornermask, 0, 0, imagesx($gdimg), imagesy($gdimg), $color_transparent…
900 …rnermask, $gdimg_cornermask_triple, 0, imagesy($gdimg) - $radius_y, …
901 …pled($gdimg_cornermask, $gdimg_cornermask_triple, imagesx($gdimg) - $radius_x, imagesy($gdimg) - $…
902 …imagecopyresampled($gdimg_cornermask, $gdimg_cornermask_triple, imagesx($gdimg) - $radius_x, …
904 $this->ApplyMask($gdimg_cornermask, $gdimg);
910 …ornermask = phpthumb_functions::ImageCreateFunction('.imagesx($gdimg).', '.imagesy($gdimg).')', __…
921 public function Saturation(&$gdimg, $amount, $color='') { argument
929 return $this->Desaturate($gdimg, $amount, $color);
933 public function Sepia(&$gdimg, $amount, $targetColor) { argument
943 if (imagefilter($gdimg, IMG_FILTER_GRAYSCALE)) {
948 if (imagefilter($gdimg, IMG_FILTER_COLORIZE, $r, $g, $b)) {
966 $ImageSX = imagesx($gdimg);
967 $ImageSY = imagesy($gdimg);
970 $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
982 …$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, $NewPixel['red'], $NewPixel['g…
983 imagesetpixel($gdimg, $x, $y, $newColor);
990 public function Smooth(&$gdimg, $amount=6) { argument
996 if (imagefilter($gdimg, IMG_FILTER_SMOOTH, $amount)) {
1008 public function SourceTransparentColorMask(&$gdimg, $hexcolor, $min_limit=5, $max_limit=10) { argument
1009 $width = imagesx($gdimg);
1010 $height = imagesy($gdimg);
1019 $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
1032 public function Threshold(&$gdimg, $cutoff) { argument
1033 $width = imagesx($gdimg);
1034 $height = imagesy($gdimg);
1038 $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
1041 …$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 0x00, 0x00, 0x00, $currentPixe…
1043 …$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 0xFF, 0xFF, 0xFF, $currentPixe…
1045 imagesetpixel($gdimg, $x, $y, $newColor);
1066 public function ReduceColorDepth(&$gdimg, $colors=256, $dither=true) { argument
1070 $this->ImageTrueColorToPalette2($gdimg, $dither, $colors);
1075 public function WhiteBalance(&$gdimg, $targetColor='') { argument
1083 $Analysis = $this->HistogramAnalysis($gdimg, false);
1095 for ($x = 0, $xMax = imagesx($gdimg); $x < $xMax; $x++) {
1096 for ($y = 0, $yMax = imagesy($gdimg); $y < $yMax; $y++) {
1097 $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
1099 $gdimg,
1105 imagesetpixel($gdimg, $x, $y, $newColor);
1112 …public function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ttffont='',… argument
1117 imagealphablending($gdimg, true);
1136 '^x' => imagesx($gdimg),
1137 '^y' => imagesy($gdimg),
1152 …$letter_color_text = phpthumb_functions::ImageHexColorAllocate($gdimg, $hex_color, false, $opacity…
1176 while (($text_origin_y - $text_height) < imagesy($gdimg)) {
1178 while ($text_origin_x < imagesx($gdimg)) {
1179 …imagettftext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, …
1197 …originOffsetX ? $originOffsetX - round($text_width / 2) : round((imagesx($gdimg) - $text_width) / …
1202 …originOffsetX ? $originOffsetX - round($text_width / 2) : round((imagesx($gdimg) - $text_width) / …
1203 $text_origin_y = imagesy($gdimg) + $TTFbox[1] - $margin + $originOffsetY;
1208 …$text_origin_y = ($originOffsetY ? $originOffsetY : round((imagesy($gdimg) - $text_height) / 2) + …
1212 …$text_origin_x = ($originOffsetX ? $originOffsetX - $text_width : imagesx($gdimg) - $text_width +…
1213 …$text_origin_y = ($originOffsetY ? $originOffsetY : round((imagesy($gdimg) - $text_height) / 2) + …
1217 …originOffsetX ? $originOffsetX - round($text_width / 2) : round((imagesx($gdimg) - $text_width) / …
1218 …$text_origin_y = ($originOffsetY ? $originOffsetY : round((imagesy($gdimg) - $text_height) / 2) + …
1227 …$text_origin_x = ($originOffsetX ? $originOffsetX - $text_width : imagesx($gdimg) - $text_width +…
1233 $text_origin_y = imagesy($gdimg) + $TTFbox[1] - $margin + $originOffsetY;
1238 …$text_origin_x = ($originOffsetX ? $originOffsetX - $text_width : imagesx($gdimg) - $text_width +…
1239 $text_origin_y = imagesy($gdimg) + $TTFbox[1] - $margin + $originOffsetY;
1245 …$text_color_background = phpthumb_functions::ImageHexColorAllocate($gdimg, $bg_color, false, $text…
1247 … $text_color_background = phpthumb_functions::ImageHexColorAllocate($gdimg, 'FFFFFF', false, 127);
1255 $x_BR = false !== stripos($fillextend, 'x') ? imagesx($gdimg) : max($x1, $x2);
1256 $y_BR = false !== stripos($fillextend, 'y') ? imagesy($gdimg) : max($y1, $y2);
1258 imagefilledrectangle($gdimg, $x_TL, $y_TL, $x_BR, $y_BR, $text_color_background);
1283 …nOffsetX ? $originOffsetX - round($text_width_line / 2) : round((imagesx($gdimg) - $text_width_lin…
1289 …$text_origin_x = ($originOffsetX ? $originOffsetX - $text_width_line : imagesx($gdimg) - $text_wid…
1295 …imagettftext($gdimg, $size, $angle, $text_origin_x, $text_origin_y + $y_offset, $letter_color_text…
1344 $originOffsetX = (imagesx($gdimg) - imagesx($img_watermark)) / 2;
1345 $originOffsetY = (imagesy($gdimg) - imagesy($img_watermark)) / 2;
1350 $originOffsetX = (imagesx($gdimg) - imagesx($img_watermark)) / 2;
1356 $originOffsetX = (imagesx($gdimg) - imagesx($img_watermark)) / 2;
1357 $originOffsetY = imagesy($gdimg) - imagesy($img_watermark) - $margin;
1363 $originOffsetY = (imagesy($gdimg) - imagesy($img_watermark)) / 2;
1375 $originOffsetY = imagesy($gdimg) - imagesy($img_watermark) - $margin;
1380 $originOffsetX = imagesx($gdimg) - imagesx($img_watermark) - $margin;
1381 $originOffsetY = (imagesy($gdimg) - imagesy($img_watermark)) / 2;
1386 $originOffsetX = imagesx($gdimg) - imagesx($img_watermark) - $margin;
1396 $originOffsetX = imagesx($gdimg) - imagesx($img_watermark) - $margin;
1397 $originOffsetY = imagesy($gdimg) - imagesy($img_watermark) - $margin;
1415 $this->WatermarkOverlay($gdimg, $img_watermark, $originOffsetX.'x'.$originOffsetY, $opacity, 0);