チェンジセット 747

差分発生行の前後
無視リスト:
コミット日時:
2008/07/02 19:43:08 (2 ヶ月前)
コミッタ:
nutsu
ログメッセージ:

ゆれゆれ中

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/Frocessing/trunk/src/frocessing/bmp/BmpUtil.as

    r714 r747  
    5555                        var mt:Matrix    = dobj.transform.matrix; 
    5656                        var rt:Rectangle = ( dobj.parent ) ? dobj.getBounds( dobj.parent ) : dobj.getBounds( dobj ); 
    57                         var w:uint = Math.ceil( rt.width*scale ); 
     57                        var w:uint = Math.ceil( rt.width * scale ); 
    5858                        var h:uint = Math.ceil( rt.height * scale ); 
    5959                        mt.translate( -rt.x, -rt.y ); 
     
    6161                        mt.translate( margin, margin ); 
    6262                        if( bd==null ) 
    63                                 bd = new BitmapData( w+margin*2, h+margin*2, true, 0x00999999 ); 
     63                                bd = new BitmapData( w+margin*2, h+margin*2, true, 0x00000000 ); 
    6464                        bd.draw( dobj, mt, dobj.transform.colorTransform, null, null, smooth ); 
    6565                        return bd; 
  • as3/Frocessing/trunk/src/frocessing/color/ColorBlend.as

    r659 r747  
    100100         *  
    101101         * @author nutsu 
    102          * @version 0.1 
     102         * @version 0.1.4 
    103103         */ 
    104104        public class ColorBlend { 
    105105                 
     106                //ノーマル 
     107                public static const NORMAL      :String = "normal"; 
    106108                //加算 
    107109                public static const ADD         :String = "add"; 
     
    263265                 * <p>ブレンドモードは以下のモードから指定します.</p> 
    264266                 * <ul> 
     267                 * <li>ColorBlend.NORMAL : ノーマル</li> 
    265268                 * <li>ColorBlend.Add : 加算</li> 
    266269                 * <li>ColorBlend.SUBTRACT : 除算</li> 
     
    300303                                case BURN:                      return burn32( c1, c2 ); 
    301304                                case EXCLUSION:         return excl32( c1, c2 ); 
    302                                 default:                        return c2
     305                                default:                        return normal32( c1, c2 )
    303306                        } 
    304307                } 
    305308                 
    306309                //---------------------------------------------------------------------------------------------------BLEND PRC 
     310                 
     311                /** 
     312                 * 32bit Color (0xAARRGGBB) を ブレンドします. 
     313                 * @param       c1      backcolor 0xAARRGGBB 
     314                 * @param       c2      forecolor 0xAARRGGBB 
     315                 * @return      0xAARRGGBB 
     316                 */ 
     317                public static function normal32( c1:uint, c2:uint ):uint 
     318                { 
     319                        return normalRGBA( (c1 & 0x00ff0000) >>> 16, (c1 & 0x0000ff00) >>> 8, c1 & 0x000000ff, (c2 & 0x00ff0000) >>> 16, (c2 & 0x0000ff00) >>> 8, c2 & 0x000000ff, (c1 & 0xff000000) >>> 24, (c2 & 0xff000000) >>> 24 ); 
     320                } 
     321                /** 
     322                 * RGBA値をブレンドします. 
     323                 * @return 0xAARRGGBB 
     324                 */ 
     325                public static function normalRGBA( r1:uint, g1:uint, b1:uint, r2:uint, g2:uint, b2:uint, a1:uint=0xff, a2:uint=0xff ):uint 
     326                { 
     327                        return Math.min( a1 + a2, 0xff ) << 24 | _normal32(r1,r2,a2)>>16 | _normal32(g1,g2,a2)>>8 | _normal32(b1,b2,a2) ; 
     328                } 
     329                /** 
     330                 * @private 
     331                 */ 
     332                private static function _normal32( e1:uint, e2:uint, a2:uint ):uint 
     333                { 
     334                        return ( e1*(a2^0xff) + e2*a2 )>>8; 
     335                } 
     336                 
     337                //------------------------------- 
     338                 
    307339                /** 
    308340                 * 24bit Color (0xRRGGBB) を 加算(ADD) でブレンドします. 
  • as3/Frocessing/trunk/src/frocessing/core/F5BitmapData.as

    r734 r747  
    3636        import flash.display.Shape; 
    3737        import flash.geom.Rectangle; 
     38        import frocessing.bmp.FBitmapData; 
    3839         
    3940        /** 
     
    4142        *  
    4243        * @author nutsu 
    43         * @version 0.1.2 
     44        * @version 0.1.4 
    4445        */ 
    4546        public class F5BitmapData extends F5Graphics2D{ 
    4647                 
    47                 private var _bitmapData:BitmapData; 
     48                private var _bitmapData:FBitmapData; 
    4849                private var screenRect:Rectangle; 
    4950                private var _shape:Shape; 
     
    5758                 * @param       bgcolor                 BitmapData の 背景色( 32bit Color ) 
    5859                 */ 
    59                 public function F5BitmapData( width_:uint, height_:uint, transparent_:Boolean=true, bgcolor:uint=0xffcccccc ){ 
     60                public function F5BitmapData( width_:uint, height_:uint, transparent_:Boolean=false, bgcolor:uint=0xffcccccc ){ 
    6061                        super( (_shape = new Shape()).graphics ); 
    6162                        _width  = width_; 
    6263                        _height = height_; 
    63                         _bitmapData = new BitmapData( _width, _height, transparent_, _background.value32 ); 
     64                        screenRect = new Rectangle( 0, 0, width_, height_ ); 
     65                        _bitmapData = new FBitmapData( _width, _height, transparent_, _background.value32 ); 
    6466                } 
    6567                 
     
    6971                public function get bitmapData():BitmapData { return _bitmapData; } 
    7072                 
     73                public override function beginDraw():void 
     74                { 
     75                        super.beginDraw(); 
     76                        //_bitmapData.lock(); 
     77                } 
     78                 
    7179                /** 
    7280                 * 描画を終了するときに実行します.このメソッドにより Graphics の内容が BitmapData にドローされます. 
     
    7583                { 
    7684                        _bitmapData.draw( _shape, null, null, null, screenRect, _bmpGc.smooth ); 
     85                        //_bitmapData.unlock(); 
    7786                } 
    7887                 
     
    8695                        screenRect = new Rectangle( 0, 0, width_, height_ ); 
    8796                        _bitmapData.dispose(); 
    88                         _bitmapData = new BitmapData( _width, _height, _bitmapData.transparent, _background.value32 ); 
     97                        _bitmapData = new FBitmapData( _width, _height, _bitmapData.transparent, _background.value32 ); 
    8998                } 
    9099                 
     
    103112                protected override function $point( x:Number, y:Number, color:uint, alpha_:Number=1.0 ):void 
    104113                { 
    105                         if ( alpha_==1.0 ) 
     114                        if ( alpha_ < 1.0 ) 
     115                                _bitmapData.drawPixel( int(x), int(y), color, int(alpha_*0xff) ); 
     116                        else 
    106117                                _bitmapData.setPixel( int(x), int(y), color ); 
    107                         else 
    108                                 _bitmapData.setPixel32( int(x), int(y), (Math.round( alpha_*0xff ) & 0xff ) << 24 | color ); 
     118                         
    109119                } 
    110120                 
  • as3/Frocessing/trunk/src/frocessing/core/GraphicsBase.as

    r734 r747  
    6464                protected var _fill_alpha:Number; 
    6565                 
     66                private var __stroke:Boolean; 
     67                 
    6668                /** 
    6769                 * 新しい GraphicsBase クラスのインスタンスを生成します. 
     
    7476                        _lastCtrlY = _lastY = _startY = 0.0; 
    7577                        _gc = gc; 
     78                        __stroke = false; 
    7679                } 
    7780                 
     
    247250                protected function $point( x:Number, y:Number, color:uint, alpha:Number=1.0 ):void 
    248251                { 
    249                         _gc.beginFill( color, alpha );  
    250                         _gc.drawRect( x, y, 1, 1 ); 
    251                         _gc.endFill(); 
     252                        if ( __stroke ) 
     253                        { 
     254                                _gc.lineStyle(); 
     255                                _gc.beginFill( color, alpha );  
     256                                _gc.drawRect( x, y, 1, 1 ); 
     257                                _gc.endFill(); 
     258                                applyLineStyle(); 
     259                        } 
     260                        else 
     261                        { 
     262                                _gc.beginFill( color, alpha );  
     263                                _gc.drawRect( x, y, 1, 1 ); 
     264                                _gc.endFill(); 
     265                        } 
    252266                } 
    253267                 
     
    265279                 * @private 
    266280                 */ 
     281                /* 
    267282                protected function $beginBitmapFill(bitmap:BitmapData,matrix:Matrix=null,repeat:Boolean=true,smooth:Boolean=false):void 
    268283                { 
    269284                        _gc.beginBitmapFill( bitmap, matrix, repeat, smooth ); 
    270285                } 
    271                  
     286                */ 
    272287                /** 
    273288                 * @private 
    274289                 */ 
     290                /* 
    275291                public function $beginGradientFill(type:String, color:Array, alphas:Array, ratios:Array, matrix:Matrix=null, spreadMethod:String="pad", interpolationMethod:String="rgb",focalPointRation:Number=0.0):void 
    276292                { 
    277293                        _gc.beginGradientFill( type, color, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRation ); 
    278294                } 
     295                */ 
    279296                 
    280297                //--------------------------------------------------------------------------------------------------- BASIC 
     
    363380                public function applyLineStyle():void 
    364381                { 
     382                        __stroke = true; 
    365383                        _gc.lineStyle( _thickness, _stroke_color, _stroke_alpha, _pixelHinting, _scaleMode, _caps, _joints, _miterLimit ); 
    366384                } 
     
    371389                public function noLineStyle():void 
    372390                { 
     391                        __stroke = false; 
    373392                        _gc.lineStyle(); 
    374393                } 
  • as3/Frocessing/trunk/src/frocessing/f3d/model/F3DSphere.as

    r734 r747  
    2626 
    2727package frocessing.f3d.model { 
    28          
    2928         
    3029        /**