LoginSignup
1
1

More than 5 years have passed since last update.

BytesPerRowとは

Posted at

CoreVideoのPixelBufferから取得できる値にBytesPerRowというものがある。

CVPixelBufferGetBytesPerRow(pixelBuffer:) -> Int

BytesPerRowは、その名の通り、ピクセルバッファの1行あたりのバイト数のことである。

例えば1920x1080のPixelBufferの場合は7680を得る。
これは1ピクセルが4byteで表現されているからである。

余談だが、bytePerRowを4で割れば横幅を導き出せる。(が、CVPixelBufferGetWidth(pixelBuffer:)を使えばよい)

ちなみにPixelBufferがplanerの場合は、横幅x高さの画像全部のbyte数が返ってくるらしい

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1