Develop and Download Open Source Software

Browse Subversion Repository

Diff of /dvibrowser-1.2.0/trunk/dvicore/src/main/java/jp/sourceforge/dvibrowser/dvicore/render/IntRGBImage.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 122 by nagaotakeyuki, Mon Jan 10 11:46:29 2011 UTC revision 123 by nagaotakeyuki, Fri Mar 4 13:56:55 2011 UTC
# Line 65  public class IntRGBImage Line 65  public class IntRGBImage
65    
66    public void fill(int c) {    public void fill(int c) {
67      for (int i=0; i<buf.length; i++)      for (int i=0; i<buf.length; i++)
68    //      buf[i] = 0xff000000 | c;
69        buf[i] = c;        buf[i] = c;
70    }    }
71    
# Line 128  public class IntRGBImage Line 129  public class IntRGBImage
129      }      }
130    }    }
131    
132    private static int blend(int c1, int c2, final int alpha10) {    private static int blendARGB(int c1, int c2, final int alpha10) {
133      int r, g, b;      int r, g, b;
134    
135      b = c1 & 0xff;      b = c1 & 0xff;
# Line 147  public class IntRGBImage Line 148  public class IntRGBImage
148      r += (alpha10 * ((c2 & 0xff) - r)) >>> 10;      r += (alpha10 * ((c2 & 0xff) - r)) >>> 10;
149      r &= 0xff;      r &= 0xff;
150    
151      return (r << 16) | (g << 8) | b;      return 0xff000000 | (r << 16) | (g << 8) | b;
152    }    }
153      
154      private static int blend(int c1, int c2, final int alpha10) {
155                int r, g, b;
156    
157                b = c1 & 0xff;
158                b += (alpha10 * ((c2 & 0xff) - b)) >>> 10;
159                b &= 0xff;
160                c1 >>>= 8;
161                c2 >>>= 8;
162    
163                g = c1 & 0xff;
164                g += (alpha10 * ((c2 & 0xff) - g)) >>> 10;
165                g &= 0xff;
166                c1 >>>= 8;
167                c2 >>>= 8;
168    
169                r = c1 & 0xff;
170                r += (alpha10 * ((c2 & 0xff) - r)) >>> 10;
171                r &= 0xff;
172    
173                return (r << 16) | (g << 8) | b;
174              }
175    
176  }  }
177  //BenchMark: dvidump: 535 samples in 19.174 sec. 27.902 samples/sec.  35.839 msec./sample.  //BenchMark: dvidump: 535 samples in 19.174 sec. 27.902 samples/sec.  35.839 msec./sample.

Legend:
Removed from v.122  
changed lines
  Added in v.123

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26