public void createHistogram(int i_l, int i_t, int i_w, int i_h, int i_skip, NyARHistogram o_histogram) { o_histogram.reset(); int[] data_ptr = o_histogram.data; INyARGsPixelDriver drv = this._gsr.getGsPixelDriver(); int pix_count = i_w; int pix_mod_part = pix_count - (pix_count % 8); //左上から1行づつ走査していく for (int y = i_h - 1; y >= 0; y -= i_skip) { for (int x = pix_count - 1; x >= pix_mod_part; x--) { data_ptr[drv.getPixel(x, y)]++; } } o_histogram.total_of_data = i_w * i_h / i_skip; return; }
public void createHistogram(int i_l, int i_t, int i_w, int i_h, int i_skip, NyARHistogram o_histogram) { o_histogram.reset(); int[] data_ptr = o_histogram.data; INyARRgbRaster drv = this._gsr; int pix_count = i_w; int pix_mod_part = pix_count - (pix_count % 8); //左上から1行づつ走査していく for (int y = i_h - 1; y >= 0; y -= i_skip) { for (int x = pix_count - 1; x >= pix_mod_part; x--) { drv.getPixel(x, y, tmp); data_ptr[(tmp[0] + tmp[1] + tmp[2]) / 3]++; } } o_histogram.total_of_data = i_w * i_h / i_skip; return; }
public void createHistogram(int i_l, int i_t, int i_w, int i_h, int i_skip, NyARHistogram o_histogram) { o_histogram.reset(); int[] input = (int[])this._gsr.getBuffer(); NyARIntSize s = this._gsr.getSize(); int skip = (i_skip * s.w - i_w); int pix_count = i_w; int pix_mod_part = pix_count - (pix_count % 8); //左上から1行づつ走査していく int pt = (i_t * s.w + i_l); int[] data = o_histogram.data; for (int y = i_h - 1; y >= 0; y -= i_skip) { int x; for (x = pix_count - 1; x >= pix_mod_part; x--) { data[input[pt++]]++; } for (; x >= 0; x -= 8) { data[input[pt++]]++; data[input[pt++]]++; data[input[pt++]]++; data[input[pt++]]++; data[input[pt++]]++; data[input[pt++]]++; data[input[pt++]]++; data[input[pt++]]++; } //スキップ pt += skip; } o_histogram.total_of_data = i_w * i_h / i_skip; return; }