Revision: 56362
          http://sourceforge.net/p/brlcad/code/56362
Author:   mohitdaga
Date:     2013-07-30 20:53:04 +0000 (Tue, 30 Jul 2013)
Log Message:
-----------
Renaming the icv api functions.

Modified Paths:
--------------
    brlcad/trunk/include/icv.h
    brlcad/trunk/src/libged/screengrab.c
    brlcad/trunk/src/libicv/color_space.c
    brlcad/trunk/src/libicv/fileformat.c
    brlcad/trunk/src/libicv/filter.c
    brlcad/trunk/src/rt/do.c
    brlcad/trunk/src/rt/view.c
    brlcad/trunk/src/rt/viewedge.c
    brlcad/trunk/src/rt/viewxray.c

Modified: brlcad/trunk/include/icv.h
===================================================================
--- brlcad/trunk/include/icv.h  2013-07-30 20:51:34 UTC (rev 56361)
+++ brlcad/trunk/include/icv.h  2013-07-30 20:53:04 UTC (rev 56362)
@@ -140,7 +140,7 @@
  * 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);
+ICV_EXPORT extern icv_image_t *icv_create(int width, int height, 
ICV_COLOR_SPACE color_space);
 
 /**
  * Write an image line to the data of ICV struct. Can handle unsigned char 
buffers.
@@ -154,7 +154,7 @@
  * @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);
+ICV_EXPORT int icv_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.
@@ -164,7 +164,7 @@
  * @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);
+ICV_EXPORT int icv_writepixel(icv_image_t *bif, int x, int y, double *data);
 
 /**
  * Saves Image to a file of respective format
@@ -173,7 +173,7 @@
  * @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);
+ICV_EXPORT extern int icv_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
@@ -193,19 +193,19 @@
  * @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);
+ICV_EXPORT extern icv_image_t *icv_load(const char *filename, int format, int 
width, int height);
 
 /**
  * This function zeroes all the data entries of an image
  * @param img Image Structure
  */
-ICV_EXPORT extern icv_image_t *icv_image_zero(icv_image_t *bif);
+ICV_EXPORT extern icv_image_t *icv_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);
+ICV_EXPORT extern void icv_free(icv_image_t *bif);
 
 /** @file libicv/color_space.c
  *
@@ -220,7 +220,7 @@
  * returns a three channel image.
  * If a three channel image is passed, this function returns the same image.
  */
-ICV_EXPORT int icv_image_gray2rgb(icv_image_t *img);
+ICV_EXPORT int icv_gray2rgb(icv_image_t *img);
 
 typedef enum {
     ICV_PIX_NTSC,
@@ -277,7 +277,7 @@
  *  weights.
  *
  */
-ICV_EXPORT int icv_image_rgb2gray(icv_image_t *img,
+ICV_EXPORT int icv_rgb2gray(icv_image_t *img,
                                  ICV_DEPTH_METHOD method,
                                  ICV_COLOR color,
                                  double rweight,

Modified: brlcad/trunk/src/libged/screengrab.c
===================================================================
--- brlcad/trunk/src/libged/screengrab.c        2013-07-30 20:51:34 UTC (rev 
56361)
+++ brlcad/trunk/src/libged/screengrab.c        2013-07-30 20:53:04 UTC (rev 
56362)
@@ -96,8 +96,8 @@
 
     /* create image file */
 
-   if ((bif = icv_image_create(width, height, ICV_COLOR_SPACE_RGB)) == NULL) {
-       bu_vls_printf(gedp->ged_result_str, "%s: could not create icv_image_ 
write structure.", argv[1]);
+   if ((bif = icv_create(width, height, ICV_COLOR_SPACE_RGB)) == NULL) {
+       bu_vls_printf(gedp->ged_result_str, "%s: could not create icv_image 
write structure.", argv[1]);
        return GED_ERROR;
     }
 
@@ -108,12 +108,12 @@
     for (i = 0; i < height; ++i) {
        rows[i] = (unsigned char *)(idata + ((height-i-1)*bytes_per_line));
        /* TODO : Add double type data to maintain resolution */
-       icv_image_writeline(bif, i, rows[i], ICV_DATA_UCHAR);
+       icv_writeline(bif, i, rows[i], ICV_DATA_UCHAR);
     }
 
     if (bif != NULL) {
-       icv_image_save(bif, argv[1], ICV_IMAGE_AUTO);
-       icv_image_free(bif);
+       icv_save(bif, argv[1], ICV_IMAGE_AUTO);
+       icv_free(bif);
        bif = NULL;
     }
 

Modified: brlcad/trunk/src/libicv/color_space.c
===================================================================
--- brlcad/trunk/src/libicv/color_space.c       2013-07-30 20:51:34 UTC (rev 
56361)
+++ brlcad/trunk/src/libicv/color_space.c       2013-07-30 20:53:04 UTC (rev 
56362)
@@ -33,7 +33,7 @@
 #include "icv.h"
 
 int
-icv_image_gray2rgb(icv_image_t *img)
+icv_gray2rgb(icv_image_t *img)
 {
     double *out_data,*op;
     double *in_data;
@@ -72,7 +72,7 @@
 }
 
 int
-icv_image_rgb2gray(icv_image_t *img, ICV_DEPTH_METHOD method, ICV_COLOR color, 
double rweight, double gweight, double bweight)
+icv_rgb2gray(icv_image_t *img, ICV_DEPTH_METHOD method, ICV_COLOR color, 
double rweight, double gweight, double bweight)
 {
     double *out_data, *in_data;
     size_t in, out, size;

Modified: brlcad/trunk/src/libicv/fileformat.c
===================================================================
--- brlcad/trunk/src/libicv/fileformat.c        2013-07-30 20:51:34 UTC (rev 
56361)
+++ brlcad/trunk/src/libicv/fileformat.c        2013-07-30 20:53:04 UTC (rev 
56362)
@@ -241,7 +241,7 @@
     size_t ret, size;
 
     if (bif->color_space == ICV_COLOR_SPACE_GRAY) {
-       icv_image_gray2rgb(bif);
+       icv_gray2rgb(bif);
     } else if (bif->color_space != ICV_COLOR_SPACE_RGB) {
        bu_log("pix_save : Color Space conflict");
        return -1;
@@ -266,7 +266,7 @@
     size_t ret, size;
 
     if (bif->color_space == ICV_COLOR_SPACE_RGB) {
-       icv_image_rgb2gray(bif, 0, 0, 0, 0, 0);
+       icv_rgb2gray(bif, 0, 0, 0, 0, 0);
     } else if (bif->color_space != ICV_COLOR_SPACE_GRAY) {
        bu_log("bw_save : Color Space conflict");
        return -1;
@@ -302,7 +302,7 @@
     char buf[BUFSIZ] = {0};
 
     if (bif->color_space == ICV_COLOR_SPACE_GRAY) {
-       icv_image_gray2rgb(bif);
+       icv_gray2rgb(bif);
     } else if (bif->color_space != ICV_COLOR_SPACE_RGB) {
        bu_log("ppm_save : Color Space conflict");
        return -1;
@@ -409,7 +409,7 @@
 /* begin public functions */
 
 icv_image_t *
-icv_image_load(const char *filename, int format, int width, int height)
+icv_load(const char *filename, int format, int width, int height)
 {
     if (format == ICV_IMAGE_AUTO) {
        /* do some voodoo with the file magic or something... */
@@ -422,14 +422,14 @@
        case ICV_IMAGE_BW :
            return bw_load(filename, width, height);
        default:
-           bu_log("icv_image_load not implemented for this format\n");
+           bu_log("icv_load not implemented for this format\n");
            return NULL;
     }
 }
 
 
 int
-icv_image_save(icv_image_t *bif, const char *filename, ICV_IMAGE_FORMAT format)
+icv_save(icv_image_t *bif, const char *filename, ICV_IMAGE_FORMAT format)
 {
     /* FIXME: should not be introducing fixed size buffers */
     char buf[BUFSIZ] = {0};
@@ -458,7 +458,7 @@
 
 
 int
-icv_image_writeline(icv_image_t *bif, int y, void *data, ICV_DATA type)
+icv_writeline(icv_image_t *bif, int y, void *data, ICV_DATA type)
 {
     double *dst, *p;
     size_t width_size;
@@ -480,14 +480,14 @@
     memcpy(dst, p, width_size*sizeof(double));
 
     if (flag)
-       bu_free(p, "icv_image_writeline : double data");
+       bu_free(p, "icv__writeline : double data");
 
     return 0;
 }
 
 
 int
-icv_image_writepixel(icv_image_t *bif, int x, int y, double *data)
+icv_writepixel(icv_image_t *bif, int x, int y, double *data)
 {
     double *dst;
     if (bif == NULL) {
@@ -503,7 +503,7 @@
 
 
 icv_image_t *
-icv_image_create(int width, int height, ICV_COLOR_SPACE color_space)
+icv_create(int width, int height, ICV_COLOR_SPACE color_space)
 {
     icv_image_t *bif;
     BU_ALLOC(bif, struct icv_image);
@@ -526,12 +526,12 @@
            bu_exit(1, "icv_create_image : Color Space Not Defined");
            break;
     }
-    return icv_image_zero(bif);
+    return icv_zero(bif);
 }
 
 
 icv_image_t *
-icv_image_zero(icv_image_t *bif)
+icv_zero(icv_image_t *bif)
 {
     double *data;
     long size, i;
@@ -546,7 +546,7 @@
 
 
 void
-icv_image_free(icv_image_t *bif)
+icv_free(icv_image_t *bif)
 {
     bu_free(bif->data, "Image Data");
     bu_free(bif, "ICV IMAGE Structure");

Modified: brlcad/trunk/src/libicv/filter.c
===================================================================
--- brlcad/trunk/src/libicv/filter.c    2013-07-30 20:51:34 UTC (rev 56361)
+++ brlcad/trunk/src/libicv/filter.c    2013-07-30 20:53:04 UTC (rev 56362)
@@ -240,7 +240,7 @@
 
     size = old_img->height*old_img->width*old_img->channels;
 
-    out_img = icv_image_create(old_img->width, old_img->height, 
old_img->color_space);
+    out_img = icv_create(old_img->width, old_img->height, 
old_img->color_space);
 
     out_data = out_img->data;
 

Modified: brlcad/trunk/src/rt/do.c
===================================================================
--- brlcad/trunk/src/rt/do.c    2013-07-30 20:51:34 UTC (rev 56361)
+++ brlcad/trunk/src/rt/do.c    2013-07-30 20:53:04 UTC (rev 56362)
@@ -788,7 +788,7 @@
            /* FIXME: in the case of rtxray, this is wrong.  it writes
             * out a bw image so depth should be just 1, not 3.
             */
-           bif = icv_image_create(width, height, ICV_COLOR_SPACE_RGB);
+           bif = icv_create(width, height, ICV_COLOR_SPACE_RGB);
 
            if (bif == NULL && (outfp = fopen(framename, "w+b")) == NULL) {
                perror(framename);
@@ -920,8 +920,8 @@
               wallclock, ((double)(rtip->rti_nrays))/wallclock);
     }
     if (bif != NULL) {
-       icv_image_save(bif, framename, ICV_IMAGE_AUTO);
-       icv_image_free(bif);
+       icv_save(bif, framename, ICV_IMAGE_AUTO);
+       icv_free(bif);
        bif = NULL;
     }
 

Modified: brlcad/trunk/src/rt/view.c
===================================================================
--- brlcad/trunk/src/rt/view.c  2013-07-30 20:51:34 UTC (rev 56361)
+++ brlcad/trunk/src/rt/view.c  2013-07-30 20:53:04 UTC (rev 56362)
@@ -315,7 +315,7 @@
                p[2] = b;
 
                if (bif != NULL) {
-                   icv_image_writepixel(bif, ap->a_x, ap->a_y, ap->a_color);
+                   icv_writepixel(bif, ap->a_x, ap->a_y, ap->a_color);
                } else if (outfp != NULL) {
                    bu_semaphore_acquire(BU_SEM_SYSCALL);
                    if (bu_fseek(outfp, (ap->a_y*width*pwidth) + 
(ap->a_x*pwidth), 0) != 0)
@@ -566,7 +566,7 @@
            }
            if (bif != NULL) {
                /* TODO : Add double type data to maintain resolution */
-               icv_image_writeline(bif, ap->a_y, (unsigned char 
*)scanline[ap->a_y].sl_buf, ICV_DATA_UCHAR);
+               icv_writeline(bif, ap->a_y, (unsigned char 
*)scanline[ap->a_y].sl_buf, ICV_DATA_UCHAR);
            } else if (outfp != NULL) {
                size_t count;
 

Modified: brlcad/trunk/src/rt/viewedge.c
===================================================================
--- brlcad/trunk/src/rt/viewedge.c      2013-07-30 20:51:34 UTC (rev 56361)
+++ brlcad/trunk/src/rt/viewedge.c      2013-07-30 20:53:04 UTC (rev 56362)
@@ -817,7 +817,7 @@
         * Write to a file.
         */
        /* TODO : Add double type data to maintain resolution */
-       icv_image_writeline(bif, ap->a_y, scanline[cpu],  ICV_DATA_UCHAR);
+       icv_writeline(bif, ap->a_y, scanline[cpu],  ICV_DATA_UCHAR);
     }
     if (fbp == FBIO_NULL && outputfile == NULL)
        bu_log("rtedge: strange, no end of line actions taken.\n");

Modified: brlcad/trunk/src/rt/viewxray.c
===================================================================
--- brlcad/trunk/src/rt/viewxray.c      2013-07-30 20:51:34 UTC (rev 56361)
+++ brlcad/trunk/src/rt/viewxray.c      2013-07-30 20:53:04 UTC (rev 56362)
@@ -176,7 +176,7 @@
                bu_semaphore_acquire( BU_SEM_SYSCALL );
            }
            /* TODO : Add double type data to maintain resolution */
-           icv_image_writeline(bif, ap->a_y, scanbuf, ICV_DATA_UCHAR);
+           icv_writeline(bif, ap->a_y, scanbuf, ICV_DATA_UCHAR);
            if (rt_g.rtg_parallel) {
                bu_semaphore_release( BU_SEM_SYSCALL );
            }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to