Revision: 56761
http://sourceforge.net/p/brlcad/code/56761
Author: mohitdaga
Date: 2013-08-12 21:39:57 +0000 (Mon, 12 Aug 2013)
Log Message:
-----------
As per Sean's suggestion, Change the name of icv api (load to read).
Modified Paths:
--------------
brlcad/trunk/include/icv.h
brlcad/trunk/src/libicv/bw.c
brlcad/trunk/src/libicv/fileformat.c
brlcad/trunk/src/libicv/pix.c
brlcad/trunk/src/util/bwrect.c
Modified: brlcad/trunk/include/icv.h
===================================================================
--- brlcad/trunk/include/icv.h 2013-08-12 20:48:13 UTC (rev 56760)
+++ brlcad/trunk/include/icv.h 2013-08-12 21:39:57 UTC (rev 56761)
@@ -55,9 +55,9 @@
/** @{ */
/** @file libicv/fileformat.c
*
- * image save/load routines
+ * image save/read routines
*
- * save or load images in a variety of formats.
+ * save or read images in a variety of formats.
*
*/
@@ -200,14 +200,14 @@
* square at first, then looking through a set of common sizes, finally
assuming
* 512x512.
*
- * @param filename File to load
+ * @param filename File to read
* @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_load(const char *filename, int format, int
width, int height);
+ICV_EXPORT extern icv_image_t *icv_read(const char *filename, int format, int
width, int height);
/**
* This function zeroes all the data entries of an image
Modified: brlcad/trunk/src/libicv/bw.c
===================================================================
--- brlcad/trunk/src/libicv/bw.c 2013-08-12 20:48:13 UTC (rev 56760)
+++ brlcad/trunk/src/libicv/bw.c 2013-08-12 21:39:57 UTC (rev 56761)
@@ -80,7 +80,7 @@
}
HIDDEN icv_image_t *
-bw_load(const char *filename, int width, int height)
+bw_read(const char *filename, int width, int height)
{
int fd;
unsigned char *data = 0;
@@ -97,20 +97,20 @@
if(filename==NULL)
fd = fileno(stdin);
else if ((fd = open(filename, O_RDONLY, WRMODE)) < 0) {
- bu_log("bw_load: Cannot open file for reading\n");
+ bu_log("bw_read: Cannot open file for reading\n");
return NULL;
}
- data = (unsigned char *)bu_malloc(size, "bw_load : unsigned char data");
+ data = (unsigned char *)bu_malloc(size, "bw_read : unsigned char data");
if (read(fd, data, size) != size) {
- bu_log("bw_load: Error Occurred while Reading\n");
+ bu_log("bw_read: Error Occurred while Reading\n");
bu_free(data, "icv_image data");
return NULL;
}
BU_ALLOC(bif, struct icv_image);
ICV_IMAGE_INIT(bif);
bif->data = uchar2double(data, size);
- bu_free(data, "bw_load : unsigned char data");
+ bu_free(data, "bw_read : unsigned char data");
bif->magic = ICV_IMAGE_MAGIC;
bif->height = height;
bif->width = width;
Modified: brlcad/trunk/src/libicv/fileformat.c
===================================================================
--- brlcad/trunk/src/libicv/fileformat.c 2013-08-12 20:48:13 UTC (rev
56760)
+++ brlcad/trunk/src/libicv/fileformat.c 2013-08-12 21:39:57 UTC (rev
56761)
@@ -49,11 +49,11 @@
/* defined in bw.c */
extern HIDDEN int bw_write(icv_image_t *bif, const char *filename);
-extern HIDDEN icv_image_t *bw_load(const char *filename, int width, int
height);
+extern HIDDEN icv_image_t *bw_read(const char *filename, int width, int
height);
/* defined in pix.c */
extern HIDDEN int pix_write(icv_image_t *bif, const char *filename);
-extern HIDDEN icv_image_t *pix_load(const char* filename, int width, int
height);
+extern HIDDEN icv_image_t *pix_read(const char* filename, int width, int
height);
/* private functions */
@@ -195,7 +195,7 @@
/* begin public functions */
icv_image_t *
-icv_load(const char *filename, int format, int width, int height)
+icv_read(const char *filename, int format, int width, int height)
{
if (format == ICV_IMAGE_AUTO) {
/* do some voodoo with the file magic or something... */
@@ -204,11 +204,11 @@
switch(format) {
case ICV_IMAGE_PIX:
- return pix_load(filename, width, height);
+ return pix_read(filename, width, height);
case ICV_IMAGE_BW :
- return bw_load(filename, width, height);
+ return bw_read(filename, width, height);
default:
- bu_log("icv_load not implemented for this format\n");
+ bu_log("icv_read not implemented for this format\n");
return NULL;
}
}
Modified: brlcad/trunk/src/libicv/pix.c
===================================================================
--- brlcad/trunk/src/libicv/pix.c 2013-08-12 20:48:13 UTC (rev 56760)
+++ brlcad/trunk/src/libicv/pix.c 2013-08-12 21:39:57 UTC (rev 56761)
@@ -75,7 +75,7 @@
HIDDEN icv_image_t *
-pix_load(const char* filename, int width, int height)
+pix_read(const char* filename, int width, int height)
{
int fd;
unsigned char *data = 0;
@@ -93,20 +93,20 @@
if(filename == NULL)
fd = fileno(stdin);
else if ((fd = open(filename, O_RDONLY, WRMODE))<0) {
- bu_log("bw_load: Cannot open file for reading\n");
+ bu_log("bw_read: Cannot open file for reading\n");
return NULL;
}
- data = (unsigned char *)bu_malloc(size, "pix_load : unsigned char data");
+ data = (unsigned char *)bu_malloc(size, "pix_read : unsigned char data");
if (read(fd, data, size) != size) {
- bu_log("pix_load: Error Occurred while Reading\n");
+ bu_log("pix_read: Error Occurred while Reading\n");
bu_free(data, "icv_image data");
return NULL;
}
BU_ALLOC(bif, struct icv_image);
ICV_IMAGE_INIT(bif);
bif->data = uchar2double(data, size);
- bu_free(data, "pix_load : unsigned char data");
+ bu_free(data, "pix_read : unsigned char data");
bif->magic = ICV_IMAGE_MAGIC;
bif->height = height;
bif->width = width;
Modified: brlcad/trunk/src/util/bwrect.c
===================================================================
--- brlcad/trunk/src/util/bwrect.c 2013-08-12 20:48:13 UTC (rev 56760)
+++ brlcad/trunk/src/util/bwrect.c 2013-08-12 21:39:57 UTC (rev 56761)
@@ -118,7 +118,7 @@
return 1;
}
- if((img = icv_load(in_file, ICV_IMAGE_BW, inx, iny))==NULL)
+ if((img = icv_read(in_file, ICV_IMAGE_BW, inx, iny))==NULL)
return 1;
icv_rect(img, xorig, yorig, outx, outy);
icv_write(img, out_file , ICV_IMAGE_BW);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits