Mamba C API reference
Version 2.0
Go to the source code of this file.
Functions | |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Create (MB_Image *image, Uint32 width, Uint32 height, Uint32 depth) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Destroy (MB_Image *image) |
MB_API_ENTRY Uint32 MB_API_CALL | MB_getImageCounter (void) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Load (MB_Image *image, PIX8 *indata, Uint32 len) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Extract (MB_Image *image, PIX8 **outdata, Uint32 *len) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Convert (MB_Image *src, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Copy (MB_Image *src, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_CopyLine (MB_Image *src, MB_Image *dest, Uint32 insrc_pos, Uint32 indest_pos) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_CropCopy (MB_Image *src, Uint32 x_src, Uint32 y_src, MB_Image *dest, Uint32 x_dest, Uint32 y_dest, Uint32 w, Uint32 h) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_PutPixel (MB_Image *dest, Uint32 pixVal, Uint32 x, Uint32 y) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_GetPixel (MB_Image *src, Uint32 *pixVal, Uint32 x, Uint32 y) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB3D_Create (MB3D_Image *image, Uint32 length) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB3D_Stack (MB3D_Image *image, MB_Image *stacked, Uint32 position) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB3D_Destroy (MB3D_Image *image) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB3D_Convert (MB3D_Image *src, MB3D_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL MB3D_Convert | ( | MB3D_Image * | src, |
MB3D_Image * | dest | ||
) |
Converts a 3D image of a given depth into another depth. Supported conversions are: 1->8, 8->1 and 32->8 (downscaling).
src | 3D source image |
dest | 3D destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB3D_Create | ( | MB3D_Image * | image, |
Uint32 | length | ||
) |
Creates a 3D image container. 3D images are just a list of 2D images stacked together.
image | the created image |
length | the length of the 3D image (number of images stacked) |
MB_API_ENTRY MB_errcode MB_API_CALL MB3D_Destroy | ( | MB3D_Image * | image | ) |
Destroys the 3D image (free memory).
image | the image to destroy |
MB_API_ENTRY MB_errcode MB_API_CALL MB3D_Stack | ( | MB3D_Image * | image, |
MB_Image * | stacked, | ||
Uint32 | position | ||
) |
Stack the 2D image at the given position.
image | the 3D image |
stacked | the 2D image stacked in the 3D image |
position | the position in the 3D image of the 2D image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Convert | ( | MB_Image * | src, |
MB_Image * | dest | ||
) |
Converts an image of a given depth into another depth. All possible conversions are supported.
src | source image |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Copy | ( | MB_Image * | src, |
MB_Image * | dest | ||
) |
Copies an image data contents into another image. This copy works with same size images.
src | the source image |
dest | the destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_CopyLine | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 | insrc_pos, | ||
Uint32 | indest_pos | ||
) |
Copies an image line contents into another image line.
src | the source image |
dest | the destination image |
insrc_pos | the position of the line copied from src |
indest_pos | the position in dest in which the line is copied |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Create | ( | MB_Image * | image, |
Uint32 | width, | ||
Uint32 | height, | ||
Uint32 | depth | ||
) |
Creates an image (memory allocation) with the correct size and depth given as argument. The size is deduced from the requested size given in argument. The size must be a multiple of MB_ROUND_W for width and MB_ROUND_H for height. The size cannot be greater than MB_MAX_IMAGE_SIZE.
image | the created image |
width | the width of the created image |
height | the height of the created image |
depth | the depth of the created image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_CropCopy | ( | MB_Image * | src, |
Uint32 | x_src, | ||
Uint32 | y_src, | ||
MB_Image * | dest, | ||
Uint32 | x_dest, | ||
Uint32 | y_dest, | ||
Uint32 | w, | ||
Uint32 | h | ||
) |
Copies an image data contents into another image. This copy can work with image of different sizes. As the size can be different the position where the copy occurs must be specified for both images as well as the size of the copy. The function will compute the actual crop inside the source and destination images. Works only with non binary images.
src | the source image |
x_src | the x position in the source image where the copy should begin |
y_src | the y position in the source image where the copy should begin |
dest | the destination image |
x_dest | the x position in the destination image where the copy should happen |
y_dest | the y position in the destination image where the copy should happen |
w | the width of the copy |
h | the height of the copy |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Destroy | ( | MB_Image * | image | ) |
Destroys an image (memory freeing).
image | the image to be destroyed |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Extract | ( | MB_Image * | image, |
PIX8 ** | outdata, | ||
Uint32 * | len | ||
) |
Reads an image data contents and put it in an array.
image | the image to read |
outdata | pointer to the array created (malloc) and filled with the pixel data of the image |
len | the length in bytes of data extracted (0 if an error occured) |
MB_API_ENTRY Uint32 MB_API_CALL MB_getImageCounter | ( | void | ) |
MB_API_ENTRY MB_errcode MB_API_CALL MB_GetPixel | ( | MB_Image * | src, |
Uint32 * | pixVal, | ||
Uint32 | x, | ||
Uint32 | y | ||
) |
Gets the pixel value inside the image at the given position.
src | the image |
pixVal | the returned pixel value |
x | position in x of the pixel targeted |
y | position in y of the pixel targeted |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Load | ( | MB_Image * | image, |
PIX8 * | indata, | ||
Uint32 | len | ||
) |
Loads an image data with data given in argument.
image | the image to fill |
indata | the data to fill the image with (complete pixels values) |
len | the length of data given |
MB_API_ENTRY MB_errcode MB_API_CALL MB_PutPixel | ( | MB_Image * | dest, |
Uint32 | pixVal, | ||
Uint32 | x, | ||
Uint32 | y | ||
) |
Puts the pixel value inside the image at the given position.
dest | the image |
pixVal | the pixel value |
x | position in x of the pixel targeted |
y | position in y of the pixel targeted |