2 * PROJECT: NyARToolkit Quicktime utilities.
\r
3 * --------------------------------------------------------------------------------
\r
4 * Copyright (C)2008 arc@dmz
\r
6 * This program is free software; you can redistribute it and/or
\r
7 * modify it under the terms of the GNU General Public License
\r
8 * as published by the Free Software Foundation; either version 2
\r
9 * of the License, or (at your option) any later version.
\r
11 * This program is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this framework; if not, write to the Free Software
\r
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 * For further information please contact.
\r
22 * <arc(at)digitalmuseum.jp>
\r
25 package jp.nyatla.nyartoolkit.qt.utils;
\r
28 import jp.nyatla.nyartoolkit.NyARException;
\r
29 import jp.nyatla.nyartoolkit.core.raster.*;
\r
30 import jp.nyatla.nyartoolkit.core.raster.rgb.*;
\r
31 import jp.nyatla.nyartoolkit.core.rasterreader.*;
\r
32 import jp.nyatla.nyartoolkit.core.types.*;
\r
35 * RGB形式のbyte配列をラップするNyARRasterです。
\r
36 * 保持したデータからBufferedImageを出力する機能も持ちます。
\r
38 public class QtNyARRaster_RGB implements INyARRgbRaster
\r
40 private NyARIntSize _size;
\r
41 private byte[] _buffer;
\r
42 private NyARRgbPixelReader_BYTE1D_R8G8B8_24 _reader;
\r
43 private int _buffer_type;
\r
46 * QuickTimeオブジェクトからイメージを取得するラスタオブジェクトを作ります。
\r
51 public QtNyARRaster_RGB(int i_width, int i_height)
\r
53 this._size=new NyARIntSize(i_width,i_height);
\r
55 this._buffer_type=NyARBufferType.BYTE1D_R8G8B8_24;
\r
56 this._reader = new NyARRgbPixelReader_BYTE1D_R8G8B8_24(null,this._size);
\r
59 final public int getWidth()
\r
61 return this._size.w;
\r
64 final public int getHeight()
\r
66 return this._size.h;
\r
69 final public NyARIntSize getSize()
\r
73 final public int getBufferType()
\r
75 return this._buffer_type;
\r
77 final public INyARRgbPixelReader getRgbPixelReader()
\r
79 return this._reader;
\r
81 final public boolean hasBuffer()
\r
83 return this._buffer!=null;
\r
85 final public Object getBuffer()
\r
87 assert(this._buffer!=null);
\r
88 return this._buffer;
\r
90 final public boolean isEqualBufferType(int i_type_value)
\r
92 return this._buffer_type==i_type_value;
\r
94 final public void wrapBuffer(Object i_ref_buf) throws NyARException
\r
96 this._buffer=(byte[])i_ref_buf;
\r
97 this._reader.switchBuffer(i_ref_buf);
\r
100 * @deprecated hasBuffer()関数を使ってください。
\r
103 final public boolean hasData()
\r
105 return this.hasBuffer();
\r