[brlcad-commits] SF.net SVN: brlcad:[56244] brlcad/trunk/include/icv.h
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <moh...@us...> - 2013-07-26 22:31:13
|
Revision: 56244 http://sourceforge.net/p/brlcad/code/56244 Author: mohitdaga Date: 2013-07-26 22:31:09 +0000 (Fri, 26 Jul 2013) Log Message: ----------- Added DOXYGEN comments to the tweaked functions Modified Paths: -------------- brlcad/trunk/include/icv.h Modified: brlcad/trunk/include/icv.h =================================================================== --- brlcad/trunk/include/icv.h 2013-07-26 22:15:33 UTC (rev 56243) +++ brlcad/trunk/include/icv.h 2013-07-26 22:31:09 UTC (rev 56244) @@ -132,18 +132,76 @@ */ ICV_EXPORT extern int icv_guess_file_format(const char *filename, char *trimmedname); +/** + * This function allocates memory for an image and returns the + * resultant image. + * @param width Width of the image to be created + * @param height Height of the image to be created. + * @param color_space Specifies the color_space of the image to be + * created + * @return Image structure with allocated space and zeroed data array + */ ICV_EXPORT extern icv_image_t* icv_image_create(int width, int height, ICV_COLOR_SPACE color_space); +/** + * Write an image line to the data of ICV struct. Can handle unsinged char buffers. + * @param bif ICV struct where data is to be written + * @param y Index of the line at which data is to be written. 0 for the first line + * @data Line Data to be written + * @type Type of data, for unsigned char data specify ICV_DATA_UCHAR or 1 + * @return on success 0, on failure -1 + */ ICV_EXPORT int icv_image_writeline(icv_image_t *bif, int y, void *data, ICV_DATA type); +/** + * Writes a pixel to the specified coordinates in the data of ICV struct. + * @param bif ICV struct where data is to be written + * @param x x-dir coordinate of the pixel + * @param y y-dir coordinate of the pixel. (0,0) coordinate is taken as bottom left + * @data Data to be written + * @return on success 0, on failure -1 + */ ICV_EXPORT int icv_image_writepixel(icv_image_t *bif, int x, int y, double *data); +/** + * Saves Image to a file of respective format + * @param bif Image structure of file. + * @param filename Filename of the file to be saved + * @param format Specific format of the file to be saved. + * @return on success 0, on failure -1 with log messages. + */ ICV_EXPORT extern int icv_image_save(icv_image_t* bif, const char*filename, ICV_IMAGE_FORMAT format); +/** + * Load a file into an ICV struct. For most formats, this will be called with + * format=ICV_IMAGE_AUTO, hint_format=0, hint_width=0, hint_height=0 and + * hint_depth=0 for default values. At the moment, the data is packed into the + * data field as rgb24 (raw pix style). + * + * For pix and bw files, having width and height set to 0 will trigger a + * heuristic sizing algorithm based on file size, assuming that the image is + * square at first, then looking through a set of common sizes, finally assuming + * 512x512. + * + * @param filename File to load + * @param hint_format Probable format of the file, typically ICV_IMAGE_AUTO + * @param hint_width Width when passed as parameter from calling program. 0 for default + * @param hint_height Height when passed as parameter from calling program. 0 for default + * @param hint_depth Default depth field, 0 for default. + * @return A newly allocated struct holding the loaded image info. + */ ICV_EXPORT extern icv_image_t* icv_image_load(const char *filename, int format, int width, int height); +/** + * This function zeroes all the data enteries of an image + * @param img Image Strucure + */ ICV_EXPORT extern icv_image_t* icv_image_zero(icv_image_t* bif); +/** + * This function frees the allocated memory for a ICV Structure and + * data. + */ ICV_EXPORT extern void icv_image_free(icv_image_t* bif); /** @} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |