| 1 |
/* |
|---|
| 2 |
* PROJECT: FLARToolKit |
|---|
| 3 |
* -------------------------------------------------------------------------------- |
|---|
| 4 |
* This work is based on the FLARToolKit developed by |
|---|
| 5 |
* R.Iizuka (nyatla) |
|---|
| 6 |
* http://nyatla.jp/nyatoolkit/ |
|---|
| 7 |
* |
|---|
| 8 |
* The FLARToolKit is ActionScript 3.0 version ARToolkit class library. |
|---|
| 9 |
* Copyright (C)2008 Saqoosha |
|---|
| 10 |
* |
|---|
| 11 |
* This program is free software: you can redistribute it and/or modify |
|---|
| 12 |
* it under the terms of the GNU General Public License as published by |
|---|
| 13 |
* the Free Software Foundation, either version 3 of the License, or |
|---|
| 14 |
* (at your option) any later version. |
|---|
| 15 |
* |
|---|
| 16 |
* This program is distributed in the hope that it will be useful, |
|---|
| 17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 19 |
* GNU General Public License for more details. |
|---|
| 20 |
* |
|---|
| 21 |
* You should have received a copy of the GNU General Public License |
|---|
| 22 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 23 |
* |
|---|
| 24 |
* For further information please contact. |
|---|
| 25 |
* http://www.libspark.org/wiki/saqoosha/FLARToolKit |
|---|
| 26 |
* <saq(at)saqoosha.net> |
|---|
| 27 |
* |
|---|
| 28 |
*/ |
|---|
| 29 |
package org.libspark.flartoolkit.core.raster |
|---|
| 30 |
{ |
|---|
| 31 |
import org.libspark.flartoolkit.core.raster.*; |
|---|
| 32 |
import org.libspark.flartoolkit.core.types.*; |
|---|
| 33 |
import org.libspark.flartoolkit.utils.*; |
|---|
| 34 |
import org.libspark.flartoolkit.core.*; |
|---|
| 35 |
import org.libspark.flartoolkit.*; |
|---|
| 36 |
import flash.display.*; |
|---|
| 37 |
import org.libspark.flartoolkit.core.pixeldriver.*; |
|---|
| 38 |
import org.libspark.flartoolkit.core.labeling.rlelabeling.*; |
|---|
| 39 |
import org.libspark.flartoolkit.core.squaredetect.*; |
|---|
| 40 |
/** |
|---|
| 41 |
* このRasterは、明点を0xffffff,暗点を0xff000000であらわします。 |
|---|
| 42 |
*/ |
|---|
| 43 |
public final class FLARBinRaster extends FLARBinRaster_BaseClass_ |
|---|
| 44 |
{ |
|---|
| 45 |
public function FLARBinRaster(i_width:int,i_height:int) |
|---|
| 46 |
{ |
|---|
| 47 |
super(i_width,i_height,FLARBufferType.OBJECT_AS3_BitmapData,true); |
|---|
| 48 |
} |
|---|
| 49 |
protected override function initInstance(i_size:FLARIntSize,i_buf_type:int,i_is_alloc:Boolean):void |
|---|
| 50 |
{ |
|---|
| 51 |
if (i_buf_type != FLARBufferType.OBJECT_AS3_BitmapData) { |
|---|
| 52 |
throw new FLARException(); |
|---|
| 53 |
} |
|---|
| 54 |
this._buf = i_is_alloc?new BitmapData(i_size.w, i_size.h, false):null; |
|---|
| 55 |
this._pixdrv = new FLARGsPixelDriver_AsBitmap(); |
|---|
| 56 |
this._pixdrv.switchRaster(this); |
|---|
| 57 |
this._is_attached_buffer = i_is_alloc; |
|---|
| 58 |
return; |
|---|
| 59 |
} |
|---|
| 60 |
public function getBitmapData():BitmapData |
|---|
| 61 |
{ |
|---|
| 62 |
return BitmapData(this._buf); |
|---|
| 63 |
} |
|---|
| 64 |
public override function createInterface(i_iid:Class):Object |
|---|
| 65 |
{ |
|---|
| 66 |
if (this.isEqualBufferType(FLARBufferType.OBJECT_AS3_BitmapData)) { |
|---|
| 67 |
if(i_iid==FLARContourPickup_IRasterDriver){ |
|---|
| 68 |
return FLARContourPickupFactory.createDriver(this); |
|---|
| 69 |
} |
|---|
| 70 |
} |
|---|
| 71 |
return super.createInterface(i_iid); |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
} |
|---|
| 75 |
} |
|---|