cocoa - raw data from CVImageBuffer without rendering? -


i'm getting cvimagebufferref avcapturesession, , i'd take image buffer , upload on network. save space , time, without rendering image ciimage , nsbitmapimage, solution i've seen everywhere (like here: how can obtain raw data cvimagebuffer object).

this because impression cvimagebuffer might compressed, awesome me, , if render it, have uncompress full bitmap , upload whole bitmap. take compressed data (realizing single compressed frame might unrenderable later itself) sits within cvimagebuffer. think means want cvimagebuffer's base data pointer , length, doesn't appear there's way within api. have ideas?

cvimagebuffer abstract type. image should instance of either cvpixelbuffer, cvopenglbuffer, or cvopengltexture. documentation types lists functions can use accessing data.

to tell type have use gettypeid methods:

cvimagebufferref image = …; cftypeid imagetype = cfgettypeid(image);  if (imagetype == cvpixelbuffergettypeid()) {   // pixel data } else if (imagetype == cvopenglbuffergettypeid()) {   // opengl pbuffer } else if (imagetype == cvopengltexturegettypeid()) {   // opengl texture } 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -