The number of components of the image.
If the format is not 'image/raw', then components is set to 0, since data is encoded, and usually the number of components depends on the format, or the way data is read. If the format is 'image/raw', then components is usually 3 or 4, telling RGB or RGBA format is used.
The actual image data.
Data is compressed with the algorithm defined by the format ('image/png', 'image/jpeg').
If format is set to 'image/raw', then data contains the RGB or RGBA unsigned bytes data.
If base64 is set to true, then data is expressed as the base64 string of the actual byte data. If base64 is set to false, then data is expressed as the actual byte data in an Uint8Array. The top area is contained in the first bytes of the array.
If an error occurs, data is undefined.
The format of the image, at least 'image/png' is supported.
The format has the same values as the type parameter used by HTMLCanvasElement.toDataURL() or HTMLCanvasElement.toBlob() depending on your browser capabilities.
The API adds 'image/raw' type, for non encoded data in RGB or RGBA format.
The height of the image.
If an error occurs, height is set to 0.
The screenshot request id this image comes from.
This is the value returned by InfiniteEngineInterface.screenshot to allow matching the image with the requested screenshot.
The width of the image.
If an error occurs, width is set to 0.
The InfiniteImageInterface is a 2D image.
It is the attachment of the InfiniteEngineInterfaceSignal.ScreenshotReady signal sent by the InfiniteEngineInterface when the given screenshot request has terminated. There may be multiple screenshot requests running simultaneously.
This object stores information about an image (width, height, format, data). The format has the same values as the type parameter used by HTMLCanvasElement.toDataURL() or HTMLCanvasElement.toBlob() and thus depends on your browser capabilities: usually 'image/png', 'image/jpeg' are at least handled. The API adds the 'image/raw' type, which is the data in RGB or RGBA unsigned bytes. If the format is 'image/raw' type, then the components field tells the number of components the image is composed of (3 for RGB, 4 for RGBA). If the format is not 'image/raw', then components is set to 0, since data is encoded, depending on the format.
Obviously, the width and height parameters tells the size of the resulting image.
The base64 field tells about the type of data : if set to true, then data is base64 encoded, and thus data will be of the string type, if set to false, the data is an Uint8Array.
The screenshotid field is the value returned by InfiniteEngineInterface.screenshot to allow matching the result with the requested screenshot.
If an error occurs, an invalid image is returned, with a data equal to undefined, and width and height set to 0.
or asynchronously :
Please make sure the destination browser supports promises before using async calls.