Changeset 20335
- Timestamp:
- Jan 22, 2013, 8:16:36 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/derivative_params.inc.php
r19703 r20335 71 71 } 72 72 73 /** crops horizontally this rectangle by increasing left side and/or reducing the right side. 74 @param pixels the amount to substract from the width 75 @param coi a 4 character string (or null) containing the center of interest*/ 73 76 function crop_h($pixels, $coi) 74 77 { … … 99 102 } 100 103 104 /** crops vertically this rectangle by increasing top side and/or reducing the bottom side. 105 @param pixels the amount to substract from the height 106 @param coi a 4 character string (or null) containing the center of interest*/ 101 107 function crop_v($pixels, $coi) 102 108 { … … 130 136 131 137 132 /* how we crop and/or resize an image*/138 /** Paramaters for derivative scaling and cropping. Instance of this class contained by DerivativeParams class.*/ 133 139 final class SizingParams 134 140 { 141 /** 142 @param ideal_size two element array of maximum output dimensions (width, height) 143 @param max_crop range 0=no cropping ... 1= max cropping (100% of width/height); expressed as a factor of the input width/height 144 @param min_size used only if max_crop != 0 - two element array of output dimensions (width, height) 145 */ 135 146 function __construct($ideal_size, $max_crop = 0, $min_size = null) 136 147 { 137 148 $this->ideal_size = $ideal_size; 138 $this->max_crop = $max_crop; 149 $this->max_crop = $max_crop; // range 0=no cropping ... 1= max cropping (100% of width/height) 139 150 $this->min_size = $min_size; 140 151 } … … 168 179 } 169 180 181 /* calculate the cropping rectangle and the scaled size for an input image size 182 @param in_size two element array of input dimensions (width, height) 183 @param coi empty or a four character encoded string containing the center of interest (unused if max_crop=0) 184 @param crop_rect output ImageRect containing the cropping rectangle or null if cropping is not required 185 @param scale_size output two element array containing width and height of the scaled image 186 */ 170 187 function compute($in_size, $coi, &$crop_rect, &$scale_size) 171 188 { … … 233 250 234 251 235 /* how we generate a derivative image*/252 /** All needed parameters to generate a derivative image.*/ 236 253 final class DerivativeParams 237 254 { 238 public $type = IMG_CUSTOM; 255 public $type = IMG_CUSTOM; // string IMG_xxx 239 256 public $last_mod_time = 0; // used for non-custom images to regenerate the cached files 240 257 public $use_watermark = false; 241 public $sizing; 242 public $sharpen = 0; 258 public $sizing; // of type SizingParams 259 public $sharpen = 0; // range 0= no sharpening ... 1= max sharpening 243 260 244 261 function __construct($sizing) … … 282 299 return true; 283 300 } 284 301 285 302 function will_watermark($out_size) 286 303 {
Note: See TracChangeset
for help on using the changeset viewer.