[brlcad-commits] SF.net SVN: brlcad:[55808] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <eri...@us...> - 2013-06-20 23:58:31
|
Revision: 55808 http://sourceforge.net/p/brlcad/code/55808 Author: erikgreenwald Date: 2013-06-20 23:58:28 +0000 (Thu, 20 Jun 2013) Log Message: ----------- stub out an icv_image_load() prototype with some docs Modified Paths: -------------- brlcad/trunk/include/icv.h brlcad/trunk/src/libicv/fileformat.c Modified: brlcad/trunk/include/icv.h =================================================================== --- brlcad/trunk/include/icv.h 2013-06-20 19:56:55 UTC (rev 55807) +++ brlcad/trunk/include/icv.h 2013-06-20 23:58:28 UTC (rev 55808) @@ -87,7 +87,7 @@ int fd; int format; /* ICV_IMAGE_* */ int width, height, depth; /* pixel, pixel, byte */ - unsigned char *data; + unsigned char *data; /* this should be considered private */ unsigned long flags; }; typedef struct icv_image_file icv_image_file_t; @@ -147,6 +147,26 @@ char *filename, int filetype); +/** + * 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 struct icv_image_file *icv_image_load(const char *filename, int hint_format, int hint_width, int hint_height, int hint_depth); + /** @} */ /* end image utilities */ Modified: brlcad/trunk/src/libicv/fileformat.c =================================================================== --- brlcad/trunk/src/libicv/fileformat.c 2013-06-20 19:56:55 UTC (rev 55807) +++ brlcad/trunk/src/libicv/fileformat.c 2013-06-20 23:58:28 UTC (rev 55808) @@ -239,8 +239,8 @@ /* begin public functions */ -int -icv_image_load() +struct icv_image_file * +icv_image_load(const char *UNUSED(filename), int UNUSED(hint_format), int UNUSED(hint_width), int UNUSED(hint_height), int UNUSED(hint_depth)) { bu_log("icv_image_load not implemented\n"); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |