Skip to main content


XR8.CameraPixelArray.pipelineModule({ luminance, maxDimension, width, height })


A pipeline module that provides the camera texture as an array of RGBA or grayscale pixel values that can be used for CPU image processing.


luminance [Optional]falseIf true, output grayscale instead of RGBA
maxDimension: [Optional]The size in pixels of the longest dimension of the output image. The shorter dimension will be scaled relative to the size of the camera input so that the image is resized without cropping or distortion.
width [Optional]The width of the camera feed texture.Width of the output image. Ignored if maxDimension is specified.
height [Optional]The height of the camera feed texture.Height of the output image. Ignored if maxDimension is specified.


Return value is an object made available to onProcessCpu and onUpdate as:

processGpuResult.camerapixelarray: {rows, cols, rowBytes, pixels}

rowsHeight in pixels of the output image.
colsWidth in pixels of the output image.
rowBytesNumber of bytes per row of the output image.
pixelsA UInt8Array of pixel data.
srcTexA texture containing the source image for the returned pixels.


XR8.addCameraPipelineModule(XR8.CameraPixelArray.pipelineModule({ luminance: true }))
name: 'mycamerapipelinemodule',
onProcessCpu: ({ processGpuResult }) => {
const { camerapixelarray } = processGpuResult
if (!camerapixelarray || !camerapixelarray.pixels) {
const { rows, cols, rowBytes, pixels } = camerapixelarray