-
Notifications
You must be signed in to change notification settings - Fork 2
Oscar Software Framework Manual Bitmap Module
scs edited this page Jul 13, 2012
·
2 revisions
The bitmap module provides functions to read and write uncompressed bitmap (.bmp) images from the file system. Supported are 24 bit BGR as well as greyscale images.
None.
None.
Following code segment demonstrates the usage of the bmp module. For the sake of simplicity, error checking as well as framework creation and destruction are neglected.
memset(&pic, 0, sizeof(struct OSC_PICTURE); OscBmpRead(&pic, "example.bmp"); /* (1) */ /************** Modify image ********************/ DoFFT(pic.data, pic.width, pic.height); /* (2) */ /************************************************/ pic.width = 752; pic.height = 480; pic.type = OSC_PICTURE_GREYSCALE; OscBmpWrite(&pic, "example_modified.bmp"); /* (3) */
- Read in an image from a bitmap file. If the OSC_PICTURE structure is empty, the members will be filled and memory for the image will be allocated automatically. Otherwise, checks will be made if the image with the given file name matches the expected size and type.
- Modify and use the image data.
- Fill out the OSC_PICTURE structure and write the modified image to a new file name.