comparison servlet/src/digilib/image/ImageSize.java @ 486:a92f319aec1c

Servlet version 1.16.1 - now with absolute scaling: mo=ascale&scale=X - reworked scale factor and resolution selection so that absolute scale can use prescaled images (osize can do that too) ASSIGNED - # 23: display thumbnails with absolute scaling https://itgroup.mpiwg-berlin.mpg.de:8080/tracs/cdli/ticket/23
author robcast
date Sat, 12 May 2007 14:23:34 +0200
parents eec0d8c9c3c9
children
comparison
equal deleted inserted replaced
485:351c5924b7a6 486:a92f319aec1c
208 */ 208 */
209 public float getAspect() { 209 public float getAspect() {
210 return (height > 0) ? ((float) width / (float) height) : 0; 210 return (height > 0) ? ((float) width / (float) height) : 0;
211 } 211 }
212 212
213 /**
214 * Returns a scaled copy of this image size.
215 *
216 * @param scale
217 * @return
218 */
219 public ImageSize getScaled(float scale) {
220 return new ImageSize((int) (width * scale), (int) (height * scale));
221 }
222
213 /* (non-Javadoc) 223 /* (non-Javadoc)
214 * @see java.lang.Object#toString() 224 * @see java.lang.Object#toString()
215 */ 225 */
216 public String toString() { 226 public String toString() {
217 String s = "[" + width + "x" + height + "]"; 227 String s = "[" + width + "x" + height + "]";