ダミーの質問で申し訳ありませんが、私はこれに不慣れで、答えを見つけることができませんでした。
- イメージストライドとは何ですか?
- Bitframeからバッファbyte[]を作成しています(問題はありません)。ビットフレームの幅は1200、ビットフレームの高さは900です。したがって、(おそらく)バッファは1200 * 900=108,0000である必要があります。ただし、バッファサイズはストライド*高さ= 432,0000(4 * 108,0000)です。
ストライドは次のようbitFrame.PixelWidth * ((bitFrame.Format.BitsPerPixel + 7) / 8);
に計算します。次に使用しbitFrame.CopyPixels(pixels, stride, 0); //(byte[] pixels)
ます。現在のピクセル(つまり構造体)を処理する機能があります。
struct pixel {
float r;
float g;
float b;
};
また、ピクセル処理機能pixelもありprocessPixel(int x, int y)
ます。この関数をバッファでどのように使用できますか?私はそれがどういうわけかこのように呼ばれなければならないと思います:
for(int i = 0; i < height; i++) {
for(int j = 0; j < height; j++) {
processPixel(i, j);
// But how could I use this function with my byte[] buffer?
// And what exactly in this buffer?
// (why stride*height = 4*width*height? cause there are 3 values for pixel RGB)
}
}