PVRCamera Classes#

CameraInterface#

Class Documentation#

class CameraInterface#

A class design to provide you with a Texture handle to the Camera’s image.

Public Functions

CameraInterface()#

Constructor.

~CameraInterface()#

Destructor.

void initializeSession(HWCamera::Enum eCamera, int preferredResX = 0, int preferredResY = 0)#

Initializes the capture session using the given hardware camera, if it is available.

Parameters
  • eCamera – The hardware camera to attempt to stream from

  • preferredResX,preferredResY – If supported by the implementation, set a preferred resolution

void destroySession()#

Shutdown the AV capture session and release associated objects.

bool updateImage()#

Checks to see if the image has been updated.

Returns

True if the image has been updated, otherwise false

bool hasProjectionMatrixChanged()#

Checks to see if the projection matrix has changed.

Returns

True if the projection matrix changed, otherwise false

const glm::mat4 &getProjectionMatrix()#

Retrieves the current texture projection matrix and resets the ‘changed’ flag.

Returns

pointer to 16 float values representing the matrix

GLuint getRgbTexture()#

Retrieves the texture name for the YUV camera texture.

Returns

A native API handle that can be used to get the texture.

bool hasRgbTexture()#

Query if this implementation supports a single RGB texture for the camera streaming interface.

This function will return true if the getRgbTexture() can be used. In implementations where this is not supported (e.g. iOS), this function will return false, and the getRgbTexture() function will return an empty (invalid) texture if used. See hasLumaChromaTextures(). In implementations where RGB textures are supported (e.g. Android) this function will return true and the getRgbTexture() will return a valid texture handle (if called after this interface was successfully initialized).

Returns

True if the implementation supports an RGB texture, false otherwise

bool hasLumaChromaTextures()#

Query if this implementation supports YUV (Luma/Chroma)planar textures.

This function will return true if the getLuminanceTexture() and and getChrominanceTexture() can be used. In implementations where this is not supported (e.g. Android), this function will return false, and the getLuminanceTexture/getChrominanceTexture will return empty (invalid) textures if used. In implementations where Luminance/Chrominance textures are supported (e.g. iOS) this function will return true and the getLuminanceTexture(), getChrominanceTexture()

will return valid texture handles that can each be used to directly query the Luminance texture (Y channel of the format) and the Chrominance texture(UV channels of the

format)

Returns

True if the implementation supports Luminance/Chrominance textures, false otherwise

GLuint getLuminanceTexture()#

Retrieves the texture name for the YUV camera texture.

Returns

GL texture ID

GLuint getChrominanceTexture()#

Retrieves the texture name for the YUV camera texture.

Returns

GL texture ID

bool getCameraResolution(uint32_t &width, uint32_t &height)#

Returns the resolution of the currently active camera.

Parameters
  • width – The horizontal resolution of the currently active camera will be saved here

  • height – The vertical resolution of the currently active camera will be saved here

inline bool isReady()#

Friends

friend class ::pvr::CameraInterfaceImpl