Multipipe SDK 3.2 Reference

Name

MPKImage - MPKImage functional interface.

Header File

#include <mpk/image.h>

Synopsis

Creating and Destroying

MPKImage* mpkImageNew(void );
void mpkImageDelete(MPKImage* image);

Fields Access

int mpkImageSetPixel(MPKImage* image, int format, int type);
void mpkImageGetPixel(MPKImage* image, int* format, int* type);
int mpkImageGetPixelSize(MPKImage* image);
void mpkImageSetSize(MPKImage* image, int size[2]);
void mpkImageGetSize(MPKImage* image, int size[2]);
void mpkImageSetOffset(MPKImage* image, int offset[2]);
void mpkImageGetOffset(MPKImage* image, int offset[2]);
void mpkImageSetBuffer(MPKImage* image, void* buffer, size_t size);
void* mpkImageGetBuffer(MPKImage* image, size_t* size);
void mpkImageSetUserData(MPKImage* image, void* data);
void* mpkImageGetUserData(MPKImage* image);

Description

The MPKImage data structure primarily describes raw pixel data. See mpkChannelDrawImage() for a detailed explanation on how to use MPKFrame and MPKImage structures.

Function descriptions

Creating and Destroying

mpkImageNew creates and returns a handle to an MPKImage.

mpkImageDelete deletes the passed MPKImage.
Fields Access

mpkImageSetPixel set the format and type of the image.

format specifies the format of the pixel data. The following symbolic values are accepted: GL_RGBA, GL_ABGR_EXT, GL_RGB, GL_LUMINANCE_ALPHA, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT24_SGIX.

type specifies the data type of the pixel data. Must be one of GL_UNSIGNED_BYTE_3_3_2_EXT, GL_UNSIGNED_SHORT_4_4_4_4_EXT, GL_UNSIGNED_SHORT_5_5_5_1_EXT, GL_UNSIGNED_INT_8_8_8_8_EXT, GL_UNSIGNED_INT_10_10_10_2_EXT, GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT.

All other symbolic format or type value not listed above are not allowed by MPK.

mpkImageGetPixel returns the format and type of the image. See mpkImageSetPixel() for a list of symbolic values returned by this function.

mpkImageGetPixelSize returns the size of one pixel data in byte. If the current format and/or type of this image is not supported by MPK, this function returns 0.

mpkImageSetSize set the size of the image. If the new size is bigger than the initial one, a new array is not reallocated for the pixels.

mpkImageGetSize returns the size of the image.

mpkImageSetOffset set the offset in pixels of the image, with respect to the position defined by the frame region, specified using mpkFrameSetRegion().

mpkImageGetOffset returns the offset in pixels of the image with respect to the position defined by the frame region, specified using mpkFrameSetRegion().

mpkImageSetBuffer set the buffer of the image. The buffer must be allocated before and has a size of size bytes.

mpkImageGetBuffer returns a pointer to the pixel data of the image. The pixels format and type can be retrieve with mpkImageGetPixel(). The function also returns the current allocated size of the buffer.

mpkImageSetUserData enables the application to specify passthrough data to be transported within the image structure. Transport is done by reference and not by copy.

mpkImageGetUserData enables the application to retrieve the passthrough data specified by mpkImageSetUserData().