本文整理汇总了C#中INyARRaster.getSize方法的典型用法代码示例。如果您正苦于以下问题:C# INyARRaster.getSize方法的具体用法?C# INyARRaster.getSize怎么用?C# INyARRaster.getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INyARRaster
的用法示例。
在下文中一共展示了INyARRaster.getSize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doFilter
/**
* 入力ラスタをHSV形式に変換して、出力ラスタへ書込みます。
* 画素形式は、コンストラクタに指定した形式に合せてください。
*/
public void doFilter(INyARRgbRaster i_input, INyARRaster i_output)
{
Debug.Assert(i_input.getSize().isEqualSize(i_output.getSize()) == true);
if (!this._do_filter_impl.isSupport(i_input, i_output))
{
this._do_filter_impl = this.createFilter(i_input, i_output);
}
this._do_filter_impl.doFilter(i_input, i_output, i_input.getSize());
}
开发者ID:mlakhal,项目名称:CollaborativeAugmentedRealityEnvironment,代码行数:13,代码来源:NyARRasterFilter_Rgb2Hsv.cs
示例2: doFilter
public void doFilter(INyARRaster i_input, INyARRaster i_output)
{
Debug.Assert (i_input!=i_output);
this._do_filter_impl.doFilter(i_input,i_output,i_input.getSize());
}
示例3: doFilter
public virtual void doFilter(INyARRaster i_input, INyARRaster i_output)
{
Debug.Assert (i_input.getSize().isEqualSize(i_output.getSize()) == true);
this._dofilterimpl.doFilter(i_input,i_output,i_input.getSize());
}
示例4: switchRaster
public void switchRaster(INyARRaster i_ref_raster)
{
this._ref_buf = (int[])i_ref_raster.getBuffer();
this._ref_size = i_ref_raster.getSize();
}
示例5: NyARVectorReader_INT1D_GRAY_8
public NyARVectorReader_INT1D_GRAY_8(INyARRaster i_ref_raster)
{
Debug.Assert(i_ref_raster.getBufferType() == NyARBufferType.INT1D_GRAY_8);
this._ref_buf = (int[])(i_ref_raster.getBuffer());
this._ref_size = i_ref_raster.getSize();
}
示例6: doFilter
public void doFilter(INyARRaster i_input, INyARRaster i_output)
{
this._do_filter_impl.doFilter(i_input,i_output,i_input.getSize());
}
示例7: doThFilter
public void doThFilter(INyARRaster i_raster, int i_l, int i_t, int i_w, int i_h, int i_th, INyARRaster o_raster)
{
byte[] input = (byte[])i_raster.getBuffer();
int[] output = (int[])o_raster.getBuffer();
NyARIntSize s = i_raster.getSize();
int th = i_th;
int skip_dst = (s.w - i_w);
int skip_src = skip_dst * 4;
int pix_count = i_w;
int pix_mod_part = pix_count - (pix_count % 8);
//左上から1行づつ走査していく
int pt_dst = (i_t * s.w + i_l);
int pt_src = pt_dst * 4;
for (int y = i_h - 1; y >= 0; y -= 1)
{
int x;
for (x = pix_count - 1; x >= pix_mod_part; x--)
{
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
}
for (; x >= 0; x -= 8)
{
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
output[pt_dst++] = input[pt_src + 0] <= th ? 0 : 1;
pt_src += 4;
}
//スキップ
pt_src += skip_src;
pt_dst += skip_dst;
}
return;
}
示例8: setRaster
/**
* NyARRasterからパターンデータをセットします。
* この関数は、データを元に所有するデータ領域を更新します。
* @param i_buffer
*/
public void setRaster(INyARRaster i_raster)
{
//画素フォーマット、サイズ制限
Debug.Assert(i_raster.isEqualBufferType(NyARBufferType.INT1D_X8R8G8B8_32));
Debug.Assert(i_raster.getSize().isEqualSize(i_raster.getSize()));
int[] buf = (int[])i_raster.getBuffer();
//i_buffer[XRGB]→差分[R,G,B]変換
int i;
int ave;//<PV/>
int rgb;//<PV/>
int[] linput = this._data;//<PV/>
// input配列のサイズとwhも更新// input=new int[height][width][3];
int number_of_pixels = this._number_of_pixels;
int for_mod = this._optimize_for_mod;
//<平均値計算(FORの1/8展開)>
ave = 0;
for (i = number_of_pixels - 1; i >= for_mod; i--)
{
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff);
}
for (; i >= 0; )
{
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
rgb = buf[i]; ave += ((rgb >> 16) & 0xff) + ((rgb >> 8) & 0xff) + (rgb & 0xff); i--;
}
//<平均値計算(FORの1/8展開)/>
ave = number_of_pixels * 255 * 3 - ave;
ave = 255 - (ave / (number_of_pixels * 3));//(255-R)-ave を分解するための事前計算
int sum = 0, w_sum;
int input_ptr = number_of_pixels * 3 - 1;
//<差分値計算(FORの1/8展開)>
for (i = number_of_pixels - 1; i >= for_mod; i--)
{
rgb = buf[i];
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
}
for (; i >= 0; )
{
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
rgb = buf[i]; i--;
w_sum = (ave - (rgb & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//B
w_sum = (ave - ((rgb >> 8) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//G
w_sum = (ave - ((rgb >> 16) & 0xff)); linput[input_ptr--] = w_sum; sum += w_sum * w_sum;//R
}
//<差分値計算(FORの1/8展開)/>
double p = Math.Sqrt((double)sum);
this._pow = p != 0.0 ? p : 0.0000001;
return;
}
示例9: analyzeRaster
/**
* o_histogramにヒストグラムを出力します。
* @param i_input
* @param o_histogram
* @return
* @throws NyARException
*/
public int analyzeRaster(INyARRaster i_input,NyARHistogram o_histogram)
{
NyARIntSize size=i_input.getSize();
//最大画像サイズの制限
Debug.Assert(size.w*size.h<0x40000000);
Debug.Assert(o_histogram.length==256);//現在は固定
int[] h=o_histogram.data;
//ヒストグラム初期化
for (int i = o_histogram.length-1; i >=0; i--){
h[i] = 0;
}
o_histogram.total_of_data=size.w*size.h/this._vertical_skip;
return this._histImpl.createHistogram(i_input, size,h,this._vertical_skip);
}