Changes between Version 8 and Version 9 of SCENE_COMMONS_R1
- Timestamp:
- 06/15/09 19:44:17 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SCENE_COMMONS_R1
v8 v9 70 70 } 71 71 }}} 72 * a method drawing the image multiplied by a given color 72 * a method multiplying the image by a given color [[BR]] 73 It already exists in ElementHelper, but will be moved here for the same reasons as paint(Graphics) 74 {{{ 75 /** 76 * Multiplies all image pixels by given color. 77 * 78 * @param color 79 * The color by which to multiply. 80 * @return 81 * The image multiplied by the given color. 82 */ 83 public ImmImage transformColor(ImmColor color) { 84 // implementation 85 } 73 86 74 {{{75 * Multiplies all image pixels by given color and draws the resulting image.76 * @param g2d77 * The graphics where the image will be drawn.78 * @param color79 * The color which by which to multiply.80 * Usually this will be the background color or the color of elements81 * above which the image is drawn.82 */83 public void paint(Graphics2D g2d, ImmColor color) {84 // implementation85 }86 87 }}} 87 88 88 89 '''Caching ImmImages multiplied by recently used colours''' will make drawing of images above other elements (including background) faster 89 90 * A new private field will be added in ImmImage to store the image multiplied by recently used colours - HashMap<ImmColor, ImmImage> colorImgCache. 90 * A new method for multiplying the image by given color will be added in ImmImage. Itwill check if the image multiplied by the given color is already cached. If it is it will return the cached value. If not - it will compute it and put it in the cache.91 There is a method that multiplies the image pixels by a color in ElementHelper, it will be copied here and removed from ElementHelper. 91 * The method transformColors(ImmColor) will check if the image multiplied by the given color is already cached. If it is it will return the cached value. If not - it will compute it and put it in the cache. 92 92 93 93 94 '''Caching recently loaded ImmImages''' will prevent us from loading the same image more than once.