Changes between Version 8 and Version 9 of SCENE_COMMONS_R1


Ignore:
Timestamp:
06/15/09 19:44:17 (16 years ago)
Author:
deni
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SCENE_COMMONS_R1

    v8 v9  
    7070        } 
    7171}}} 
    72  * a method drawing the image multiplied by a given color 
     72 * a method multiplying the image by a given color [[BR]] 
     73It 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        } 
    7386 
    74 {{{ 
    75          * Multiplies all image pixels by given color and draws the resulting image. 
    76          * @param g2d 
    77          *              The graphics where the image will be drawn. 
    78          * @param color 
    79          *              The color which by which to multiply.  
    80          *              Usually this will be the background color or the color of elements  
    81          *              above which the image is drawn.   
    82          */ 
    83         public void paint(Graphics2D g2d, ImmColor color) { 
    84                 // implementation 
    85         } 
    8687}}} 
    8788 
    8889'''Caching ImmImages multiplied by recently used colours''' will make drawing of images above other elements (including background) faster 
    8990 * 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. It 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.  
    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 
    9293 
    9394'''Caching recently loaded ImmImages''' will prevent us from loading the same image more than once.