OSDN Git Service

[更新]NyARToolkit/nyatlaブランチ
[nyartoolkit-and/nyartoolkit-and.git] / src / jp / nyatla / nyartoolkit / core / raster / rgb / NyARRgbRaster_Blank.java
1 /* \r
2  * PROJECT: NyARToolkit\r
3  * --------------------------------------------------------------------------------\r
4  * The NyARToolkit is Java version ARToolkit class library.\r
5  * Copyright (C)2008 R.Iizuka\r
6  *\r
7  * This program is free software; you can redistribute it and/or\r
8  * modify it under the terms of the GNU General Public License\r
9  * as published by the Free Software Foundation; either version 2\r
10  * of the License, or (at your option) any later version.\r
11  * \r
12  * This program is distributed in the hope that it will be useful,\r
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15  * GNU General Public License for more details.\r
16  * \r
17  * You should have received a copy of the GNU General Public License\r
18  * along with this framework; if not, write to the Free Software\r
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
20  * \r
21  * For further information please contact.\r
22  *      http://nyatla.jp/nyatoolkit/\r
23  *      <airmail(at)ebony.plala.or.jp>\r
24  * \r
25  */\r
26 package jp.nyatla.nyartoolkit.core.raster.rgb;\r
27 \r
28 \r
29 import jp.nyatla.nyartoolkit.core.raster.TNyRasterType;\r
30 import jp.nyatla.nyartoolkit.core.rasterreader.INyARRgbPixelReader;\r
31 \r
32 \r
33 /*\r
34  * 真っ黒の矩形を定義する。\r
35  *\r
36  */\r
37 public class NyARRgbRaster_Blank extends NyARRgbRaster_BasicClass\r
38 {\r
39     private class PixelReader implements INyARRgbPixelReader{\r
40         public void getPixel(int i_x,int i_y,int[] o_rgb)\r
41         {\r
42             o_rgb[0]=0;//R\r
43             o_rgb[1]=0;//G\r
44             o_rgb[2]=0;//B\r
45             return;\r
46         }\r
47         public void getPixelSet(int[] i_x,int i_y[],int i_num,int[] o_rgb)\r
48         {\r
49             for(int i=i_num-1;i>=0;i--){\r
50                 o_rgb[i*3+0]=0;//R\r
51                 o_rgb[i*3+1]=0;//G\r
52                 o_rgb[i*3+2]=0;//B\r
53             }\r
54         }       \r
55     }    \r
56     private INyARRgbPixelReader _reader;\r
57     public NyARRgbRaster_Blank(int i_width,int i_height)\r
58     {\r
59         this._size.w=i_width;\r
60         this._size.h=i_height;\r
61         this._reader=new PixelReader();\r
62     }\r
63     public int getBufferType()\r
64     {\r
65         return TNyRasterType.BUFFERFORMAT_NULL_ALLZERO;\r
66     }\r
67     public byte[] getBufferObject()\r
68     {\r
69         return null;\r
70     }\r
71     public INyARRgbPixelReader getRgbPixelReader()\r
72     {\r
73         return this._reader;\r
74     }     \r
75 }\r