BRL-CAD
icv.h
Go to the documentation of this file.
1 /* I C V . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2011-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file icv.h
21  *
22  * Functions provided by the LIBICV image processing library.
23  *
24  */
25 
26 #ifndef ICV_H
27 #define ICV_H
28 
29 #include "common.h"
30 #include <stddef.h> /* for size_t */
31 
33 
34 #ifndef ICV_EXPORT
35 # if defined(ICV_DLL_EXPORTS) && defined(ICV_DLL_IMPORTS)
36 # error "Only ICV_DLL_EXPORTS or ICV_DLL_IMPORTS can be defined, not both."
37 # elif defined(ICV_DLL_EXPORTS)
38 # define ICV_EXPORT __declspec(dllexport)
39 # elif defined(ICV_DLL_IMPORTS)
40 # define ICV_EXPORT __declspec(dllimport)
41 # else
42 # define ICV_EXPORT
43 # endif
44 #endif
45 
46 /** @addtogroup image */
47 /** @ingroup data */
48 /** @{ */
49 
50 typedef enum {
68 
69 typedef enum {
72  /* Add here for format addition like CMYKA, HSV, others */
74 
75 typedef enum {
78 } ICV_DATA;
79 
80 /* Define Various Flags */
81 #define ICV_NULL_IMAGE 0X0001
82 #define ICV_SANITIZED 0X0002
83 #define ICV_OPERATIONS_MODE 0x0004
84 #define ICV_UNDEFINED_1 0x0008
85 
86 struct icv_image {
87  uint32_t magic;
89  double *data;
90  float gamma_corr;
92  uint16_t flags;
93 };
94 
95 
96 typedef struct icv_image icv_image_t;
97 #define ICV_IMAGE_NULL ((struct icv_image *)0)
98 
99 /**
100  * asserts the integrity of a icv_image_file struct.
101  */
102 #define ICV_CK_IMAGE(_i) ICV_CKMAG(_i, ICV_IMAGE_MAGIC, "icv_image")
103 
104 /**
105  * initializes a icv_image_file struct without allocating any memory.
106  */
107 #define ICV_IMAGE_INIT(_i) { \
108  (_i)->magic = ICV_IMAGE_MAGIC; \
109  (_i)->width = (_i)->height = (_i)->channels = (_i)->alpha_channel = 0; \
110  (_i)->gamma_corr = 0.0; \
111  (_i)->data = NULL; \
112  }
113 
114 /**
115  * returns truthfully whether a icv_image_file has been initialized.
116  */
117 #define ICV_IMAGE_IS_INITIALIZED(_i) (((struct icv_image *)(_i) != ICV_IMAGE_NULL) && LIKELY((_i)->magic == ICV_IMAGE_MAGIC))
118 
119 /* Validation Macros */
120 /**
121  * Validates input icv_struct, if failure (in validation) returns -1
122  */
123 #define ICV_IMAGE_VAL_INT(_i) if (!ICV_IMAGE_IS_INITIALIZED(_i)) return -1
124 
125 /**
126  * Validates input icv_struct, if failure (in validation) returns NULL
127  */
128 #define ICV_IMAGE_VAL_PTR(_i) if (!ICV_IMAGE_IS_INITIALIZED(_i)) return NULL
129 
130 
131 /* Data conversion MACROS */
132 /**
133  * Converts to double (icv data) type from unsigned char(8bit).
134  */
135 #define ICV_CONV_8BIT(data) ((double)(data))/255.0
136 
137 /** @file libicv/fileformat.c
138  *
139  * image read/write routines
140  *
141  * read/write images in a variety of formats.
142  *
143  */
144 
145 /**
146  * Finds the Image format based on heuristics depending on the file
147  * name.
148  * @param filename Filename of the image whose format is to be know
149  * @param trimmedname Buffer for storing filename after removing
150  * extensions
151  * @return File Format
152  */
153 ICV_EXPORT extern ICV_IMAGE_FORMAT icv_guess_file_format(const char *filename, char *trimmedname);
154 
155 /**
156  * This function allocates memory for an image and returns the
157  * resultant image.
158  *
159  * @param width Width of the image to be created
160  * @param height Height of the image to be created
161  * @param color_space Color space of the image (RGB, grayscale)
162  * @return Image structure with allocated space and zeroed data array
163  */
164 ICV_EXPORT extern icv_image_t *icv_create(int width, int height, ICV_COLOR_SPACE color_space);
165 
166 /**
167  * Write an image line to the data of ICV struct. Can handle unsigned
168  * char buffers.
169  *
170  * Note : This function requires memory allocation for ICV_UCHAR_DATA,
171  * which in turn acquires BU_SEM_SYSCALL semaphore.
172  *
173  * @param bif ICV struct where data is to be written
174  * @param y Index of the line at which data is to be written. 0 for
175  * the first line
176  * @data Line Data to be written
177  * @type Type of data, e.g., uint8 data specify ICV_DATA_UCHAR or 1
178  * @return on success 0, on failure -1
179  */
180 ICV_EXPORT int icv_writeline(icv_image_t *bif, int y, void *data, ICV_DATA type);
181 
182 /**
183  * Writes a pixel to the specified coordinates in the data of ICV
184  * struct.
185  *
186  * @param bif ICV struct where data is to be written
187  * @param x x-dir coordinate of the pixel
188  * @param y y-dir coordinate of the pixel. (0,0) coordinate is taken
189  * as bottom left
190  * @data Data to be written
191  * @return on success 0, on failure -1
192  */
193 ICV_EXPORT int icv_writepixel(icv_image_t *bif, int x, int y, double *data);
194 
195 /**
196  * Saves Image to a file or streams to stdout in respective format
197  *
198  * To stream it to stdout pass NULL pointer for filename.
199  *
200  * @param bif Image structure of file.
201  * @param filename Filename of the file to be written.
202  * @param format Specific format of the file to be written.
203  * @return on success 0, on failure -1 with log messages.
204  */
205 ICV_EXPORT extern int icv_write(icv_image_t *bif, const char*filename, ICV_IMAGE_FORMAT format);
206 
207 /**
208  * Load a file into an ICV struct. For most formats, this will be
209  * called with format=ICV_IMAGE_AUTO.
210  *
211  * The data is packed in icv_image struct in double format with varied
212  * channels as per the specification of image to be loaded.
213  *
214  * To read stream from stdin pass NULL pointer for filename.
215  *
216  * In case of bw and pix image if size is unknown pass 0 for width and
217  * height. This will read the image till EOF is reached. The image
218  * size of the output image will be : height = 1; width = size; where
219  * size = total bytes read
220  *
221  * @param filename File to read
222  * @param hint_format Probable format of the file, typically
223  * ICV_IMAGE_AUTO
224  * @param hint_width Width when passed as parameter from calling
225  * program.
226  * @param hint_height Height when passed as parameter from calling
227  * program.
228  * @return A newly allocated struct holding the loaded image info.
229  */
230 ICV_EXPORT extern icv_image_t *icv_read(const char *filename, int format, int width, int height);
231 
232 /**
233  * This function zeroes all the data entries of an image
234  * @param img Image Structure
235  */
236 ICV_EXPORT extern icv_image_t *icv_zero(icv_image_t *bif);
237 
238 /**
239  * This function frees the allocated memory for a ICV Structure and
240  * data.
241  */
242 ICV_EXPORT extern int icv_destroy(icv_image_t *bif);
243 
244 /** @file libicv/color_space.c
245  *
246  * This file contains routines to change the icv image from one
247  * colorspace to other.
248  *
249  */
250 
251 /**
252  * Converts a single channel image to three channel image. Replicates
253  * the pixel as done by bw-pix utility returns a three channel image.
254  * If a three channel image is passed, this function returns the same
255  * image.
256  */
257 ICV_EXPORT int icv_gray2rgb(icv_image_t *img);
258 
259 typedef enum {
267 } ICV_COLOR;
268 
269 /**
270  * converts image to single channel image by combining three weights
271  * based on NTSC primaries and 6500 white.
272  */
273 #define icv_rgb2gray_ntsc(_a) icv_rgb2gray(_a, ICV_COLOR_RGB, 0.30, 0.59, 0.11)
274 
275 /**
276  * converts image to single channel image by combining three weights
277  * based on CRT phosphor and D6500 white.
278  */
279 #define icv_rgb2gray_crt(_a) icv_rgb2gray(_a, ICV_COLOR_RGB, 0.26, 0.66, 0.08)
280 
281 /**
282  * converts a three channel rgb image to single channel gray-image.
283  * This function will combine or select planes of the image based on
284  * the input arguments.
285  *
286  * A normal calling of this functions is as follows:
287  * icv_image_rgb2gray(bif, 0, 0, 0, 0); where bif is the rgb image
288  * to be converted.
289  *
290  * @param color Chooses color planes to be selected for combination.
291  * This function will need color to be specified from
292  * ICV_COLOR_R
293  * ICV_COLOR_G
294  * ICV_COLOR_B
295  * ICV_COLOR_RG
296  * ICV_COLOR_RB
297  * ICV_COLOR_BG
298  * ICV_COLOR_RGB
299  * @param rweight Weight for r-plane
300  * @param gweight Weight for g-plane
301  * @param bweight Weight for b-plane
302  * @return 0 on success; on failure return 1
303  *
304  * User can specify weights in the arguments, for the selected color
305  * planes. If 0 weight is chosen this utility assigns equal weights.
306  *
307  */
308 ICV_EXPORT int icv_rgb2gray(icv_image_t *img,
309  ICV_COLOR color,
310  double rweight,
311  double gweight,
312  double bweight);
313 
314 /** @file libicv/crop.c
315  *
316  * This file contains functions for cropping images.
317  * There are two types of cropping: rectangular and skeyed.
318  */
319 
320 /**
321  * This function crops an input image.
322  * Note : (0,0) corresponds to the Bottom Left of an Image.
323  *
324  * @param img Input image struct to be cropped.
325  * @param xorig X-Coordinate of offset of image to be extracted from.
326  * @param yorig Y-Coordinate of offset of image to be extracted from.
327  * @param xnum Length of the output image to be extracted from input
328  * data in horizontal direction.
329  * @param ynum Length of the output image to be extracted from input
330  * data in vertical direction.
331  * @return 0 on success.
332  */
333 ICV_EXPORT extern int icv_rect(icv_image_t *img, int xorig, int yorig, int xnum, int ynum);
334 
335 /**
336  * This function crops an input image.
337  *
338  * This can do a screwed cropping, i.e. given any four points of
339  * quadrilateral in an image, map it to a rectangle of xnumXynum
340  * dimension.
341  *
342  * (ulx,uly) (urx,ury)
343  * __________________
344  * / |
345  * / |
346  * / |
347  * / |
348  * / |
349  * /______________________|
350  * (llx,lly) (lrx,lry)
351  *
352  * @return 0 on success; on failure -1; and logs the error message.
353  */
354 ICV_EXPORT extern int icv_crop(icv_image_t *img,
355  int ulx, int uly,
356  int urx, int ury,
357  int lrx, int lry,
358  int llx, int lly,
359  unsigned int ynum,
360  unsigned int xnum);
361 
362 /** @file libicv/operations.c
363  *
364  * This file contains routines for operations.
365  *
366  */
367 
368 /**
369  * This function sanitizes the image.
370  *
371  * It forces the image pixels to be in the prescribed range.
372  *
373  * All the pixels higher than the max range are set to MAX (1.0).
374  * All the pixels lower than the min range are set to MIN (0.0).
375  *
376  * Note if an image(bif) is sanitized then,
377  * (bif->flags&&ICV_SANITIZED) is true.
378  *
379  */
380 ICV_EXPORT int icv_sanitize(icv_image_t* img);
381 
382 /**
383  * This adds a constant value to all the pixels of the image. Also if
384  * the flag ICV_OPERATIONS_MODE is set this doesn't sanitize the
385  * image.
386  *
387  * Note to set the flag for a bif (icv_image struct);
388  * bif->flags |= ICV_OPERATIONS_MODE;
389  *
390  */
391 ICV_EXPORT int icv_add_val(icv_image_t* img, double val);
392 
393 /**
394  * This multiplies all the pixels of the image with a constant Value.
395  * Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize
396  * the image.
397  */
398 ICV_EXPORT int icv_multiply_val(icv_image_t* img, double val);
399 
400 /**
401  * This divides all the pixels of the image with a constant Value.
402  * Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize
403  * the image.
404  */
405 ICV_EXPORT int icv_divide_val(icv_image_t* img, double val);
406 
407 /**
408  * This raises all the pixels of the image to a constant exponential
409  * power. Also if the flag ICV_OPERATIONS_MODE is set this doesn't
410  * sanitize the image.
411  */
412 ICV_EXPORT int icv_pow_val(icv_image_t* img, double val);
413 
414 /**
415  * This routine adds pixel value of one image to pixel value of other
416  * pixel and inserts in the same index of the output image.
417  *
418  * Also it sanitizes the image.
419  */
420 ICV_EXPORT icv_image_t *icv_add(icv_image_t *img1, icv_image_t *img2);
421 
422 /**
423  * This routine subtracts pixel value of one image from pixel value of
424  * other pixel and inserts the result at the same index of the output
425  * image.
426  *
427  * Also it sanitizes the image.
428  *
429  * @param img1 First Image.
430  * @param img2 Second Image.
431  * @return New icv_image (img1 - img2)
432  *
433  */
434 ICV_EXPORT icv_image_t *icv_sub(icv_image_t *img1, icv_image_t *img2);
435 
436 /**
437  * This routine multiplies pixel value of one image to pixel value of
438  * other pixel and inserts the result at the same index of the output
439  * image.
440  *
441  * Also it sanitizes the image.
442  *
443  * @param img1 First Image.
444  * @param img2 Second Image.
445  * @return New icv_image (img1 * img2)
446  *
447  */
448 ICV_EXPORT icv_image_t *icv_multiply(icv_image_t *img1, icv_image_t *img2);
449 
450 /**
451  * This routine divides pixel value of one image from pixel value of
452  * other pixel and inserts the result at the same index of the output
453  * image.
454  *
455  * Also it sanitizes the image.
456  *
457  * @param img1 First Image.
458  * @param img2 Second Image.
459  * @return New icv_image (img1 / img2)
460  *
461  */
462 ICV_EXPORT icv_image_t *icv_divide(icv_image_t *img1, icv_image_t *img2);
463 
464 /**
465  * Change the saturation of image pixels. If sat is set to 0.0 the
466  * result will be monochromatic; if sat is made 1.0, the color will
467  * not change; if sat is made greater than 1.0, the amount of color is
468  * increased.
469  *
470  * @param img RGB Image to be saturated.
471  * @param sat Saturation value.
472  */
473 ICV_EXPORT int icv_saturate(icv_image_t* img, double sat);
474 
475 
476 /** @file libicv/filter.c
477  *
478  * This file contains routines for image filtering. This is done
479  * mainly using the convolution of images. Both Gray Scale and RGB
480  * images are taken care.
481  *
482  */
483 
484 
485 typedef enum {
493 } ICV_FILTER;
494 
495 typedef enum {
501 } ICV_FILTER3;
502 
503 /**
504  * Filters an image with the specified filter type. Basically
505  * convolves kernel with the image. Does zero_padding for outbound
506  * pixels.
507  *
508  * @param img Image to be filtered.
509  * @param filter_type Type of filter to be used.
510  *
511  */
512 ICV_EXPORT extern int icv_filter(icv_image_t *img, ICV_FILTER filter_type);
513 
514 
515 /**
516  * Filters a set of three image with the specified filter type. Does
517  * zero_padding for outbound pixels. Finds the resultant pixel with
518  * the help of neighboring pixels in all the three images.
519  *
520  *
521  * @return Resultant image.
522  *
523  */
524 ICV_EXPORT extern icv_image_t *icv_filter3(icv_image_t *old_img,
525  icv_image_t *curr_img,
526  icv_image_t *new_img,
527  ICV_FILTER3 filter_type);
528 
529 
530 /**
531  * icv_fade will darken a pix by a certain fraction.
532  *
533  * Fades an image in place.
534  *
535  * @param img ICV Image to be faded.
536  * @param fraction should be between 0 to 1. Amount by which the image
537  * is needed to faded.
538  */
539 ICV_EXPORT extern int icv_fade(icv_image_t *img, double fraction);
540 
541 /** @file libicv/stat.c
542  *
543  * This file contains image statistics and histogram routines.
544  *
545  */
546 
547 
548 /**
549  * This function calculates the histogram of different channels
550  * separately.
551  *
552  * @param img Image of which histogram is to found.
553  * @param n_bins number of bins required.
554  * @return Histogram of size_t type array. This 2-dimension array
555  * is of size c X n_bins where c is the channels in the image.
556  *
557  */
558 ICV_EXPORT size_t **icv_hist(icv_image_t* img, int n_bins);
559 
560 /**
561  * Finds the minimum value in each channel of the image.
562  *
563  * @return a double array of size channels. Each element contains min
564  * value of the channel.
565  *
566  * e.g. min = icv_min(bif);
567  * min[0] gives the minimum value of all the pixels in first bin.
568  * and so on.
569  *
570  */
571 ICV_EXPORT double *icv_min(icv_image_t* img);
572 
573 /**
574  * Finds the average value in each channel of the image.
575  *
576  * @return a double array of size channels. Each elements contains
577  * average value of the channel.
578  *
579  * e.g. mean = icv_mean(bif);
580  * mean[0] gives the average value of all the pixels in first channel
581  * and so on.
582  *
583  */
584 ICV_EXPORT double *icv_mean(icv_image_t* img);
585 
586 /**
587  * Finds the sum of all the pixel values for each channel of the image
588  *
589  * @return a double array of size channels. Each element contains sum
590  * value of the channel.
591  *
592  * e.g. sum = icv_sum(bif);
593  * sum[0] gives the sum of all the pixels in first channel
594  * and so on.
595  *
596  */
597 ICV_EXPORT double *icv_sum(icv_image_t* img);
598 
599 /**
600  * Finds the max value in each channel of the image.
601  *
602  * @return a double array of size channels. Each element contains max
603  * value of the channel.
604  *
605  * e.g. max = icv_max(bif);
606  * max[0] gives the maximum value of all the pixels in first bin.
607  * and so on.
608  *
609  */
610 ICV_EXPORT double *icv_max(icv_image_t* img);
611 
612 /**
613  * Calculates mode of the values of each channel.
614  * Mode value are calculated for quantified data which is sent as
615  * bins(histogram Information). For any image mode is a 'c' length
616  * array where c is the number of channels.
617  *
618  * To calculate the mode of an icv_image, a default call is as follows
619  * icv_mode(img, icv_hist(img, n_bins), n_bins);
620  *
621  * This call first calculates the histogram of the image. then finds
622  * the mode values from histogram of each channel.
623  *
624  */
625 ICV_EXPORT int *icv_mode(icv_image_t* img, size_t** bins, int n_bins);
626 
627 /**
628  * Calculates median of the values of each channel.
629  * Median value are calculated for quantified data which is sent as
630  * bins(histogram information). For any image mode is a 'c' length
631  * array, where c is the number of channels.
632  *
633  * To calculate the median of an icv_image, a default call is as
634  * follows :
635  * icv_median(img, icv_hist(img, n_bins), n_bins);
636  *
637  * This call first calculates the histogram of the image. then finds
638  * the mode values from histogram of each channel.
639  *
640  */
641 ICV_EXPORT int *icv_median(icv_image_t* img, size_t** bins, int n_bins);
642 
643 /**
644  * Calculates the skewness in data.
645  *
646  * To calculate the skewness in an icv_image, a default call is as
647  * follows :
648  * icv_skew(img, icv_hist(img, n_bins), n_bins);
649  *
650  * @return c length double array where c is the number of channels in
651  * the img
652  */
653 ICV_EXPORT double *icv_skew(icv_image_t* img, size_t** bins, int n_bins);
654 
655 /**
656  * Calculates the variance in data.
657  *
658  * To calculate the variance in an icv_image, a default call is as
659  * follows :
660  * icv_variance(img, icv_hist(img, n_bins), n_bins);
661  *
662  * @return c length double array where c is the number of channels in
663  * the img
664  */
665 ICV_EXPORT double *icv_var(icv_image_t* img, size_t** bins, int n_bins);
666 
667 
668 /** @file size.c
669  *
670  * This file contains routines to scale down an image to a lower
671  * resolution or scale up an image to an higher Resolution.
672  *
673  */
674 
675 typedef enum {
681 
682 /**
683  * This function resizes the given input image.
684  * Mode of usage:
685  * a) ICV_RESIZE_UNDERSAMPLE : This method undersamples the said image
686  * e.g. icv_resize(bif, ICV_RESIZE_UNDERSAMPLE, 0, 0, 2);
687  * undersamples the image with a factor of 2.
688  *
689  * b) ICV_RESIZE_SHRINK : This Shrinks the image, keeping the light
690  * energy per square area as constant.
691  * e.g. icv_resize(bif, ICV_RESIZE_SHRINK,0,0,2);
692  * shrinks the image with a factor of 2.
693  *
694  * c) ICV_RESIZE_NINTERP : This interpolates using nearest neighbor
695  * method.
696  * e.g. icv_resize(bif, ICV_RESIZE_NINTERP,1024,1024,0);
697  * interpolates the output image to have the size of 1024X1024.
698  *
699  * d) ICV_RESIZE_BINTERP : This interpolates using bilinear
700  * Interpolation Method.
701  * e.g. icv_resize(bif, ICV_RESIZE_BINTERP,1024,1024,0);
702  * interpolates the output image to have the size of 1024X1024.
703  *
704  * resizes the image inplace.
705  *
706  * @param bif Image (packed in icv_image struct)
707  * @param method One of the modes.
708  * @param out_width Out Width.
709  * @param out_height Out Height.
710  * @param factor Integer type data representing the factor to be
711  * shrunken
712  * @return 0 on success and -1 on failure.
713  */
714 ICV_EXPORT int icv_resize(icv_image_t *bif, ICV_RESIZE_METHOD method, unsigned int out_width, unsigned int out_height, unsigned int factor);
715 
716 /** @} */
717 /* end image utilities */
718 
719 /**
720  * Rotate an image.
721  * %s [-rifb | -a angle] [-# bytes] [-s squaresize] [-w width] [-n height] [-o outputfile] inputfile [> outputfile]
722  *
723  */
724 ICV_EXPORT extern int icv_rot(int argv, char **argc);
725 
727 
728 #endif /* ICV_H */
729 
730 /*
731  * Local Variables:
732  * tab-width: 8
733  * mode: C
734  * indent-tabs-mode: t
735  * c-file-style: "stroustrup"
736  * End:
737  * ex: shiftwidth=4 tabstop=8
738  */
Definition: db_flip.c:35
ICV_COLOR_SPACE
Definition: icv.h:69
double * data
Definition: icv.h:89
double * icv_var(icv_image_t *img, size_t **bins, int n_bins)
Definition: stat.c:174
icv_image_t * icv_read(const char *filename, int format, int width, int height)
Definition: fileformat.c:162
char filename[MAXLENGTH]
Definition: human.c:105
ICV_DATA
Definition: icv.h:75
int icv_filter(icv_image_t *img, ICV_FILTER filter_type)
Definition: filter.c:168
int icv_rot(int argv, char **argc)
Definition: rot.c:285
int width
Definition: icv.h:91
icv_image_t * icv_divide(icv_image_t *img1, icv_image_t *img2)
Definition: operations.c:234
int icv_fade(icv_image_t *img, double fraction)
Definition: filter.c:326
size_t ** icv_hist(icv_image_t *img, int n_bins)
Definition: stat.c:49
int * icv_mode(icv_image_t *img, size_t **bins, int n_bins)
Definition: stat.c:267
uint32_t magic
Definition: icv.h:87
int icv_destroy(icv_image_t *bif)
Definition: fileformat.c:321
Header file for the BRL-CAD common definitions.
int icv_crop(icv_image_t *img, int ulx, int uly, int urx, int ury, int lrx, int lry, int llx, int lly, unsigned int ynum, unsigned int xnum)
Definition: crop.c:81
int channels
Definition: icv.h:91
Definition: icv.h:86
ICV_FILTER3
Definition: icv.h:495
int icv_sanitize(icv_image_t *img)
Definition: operations.c:38
int height
Definition: icv.h:91
ustring width
int icv_rect(icv_image_t *img, int xorig, int yorig, int xnum, int ynum)
Definition: crop.c:32
int icv_write(icv_image_t *bif, const char *filename, ICV_IMAGE_FORMAT format)
Definition: fileformat.c:186
int icv_pow_val(icv_image_t *img, double val)
Definition: operations.c:124
double * icv_skew(icv_image_t *img, size_t **bins, int n_bins)
Definition: stat.c:205
COMPLEX data[64]
Definition: fftest.c:34
uint16_t flags
Definition: icv.h:92
int icv_writeline(icv_image_t *bif, int y, void *data, ICV_DATA type)
Definition: fileformat.c:219
#define __BEGIN_DECLS
Definition: common.h:73
double * icv_min(icv_image_t *img)
Definition: stat.c:147
int icv_divide_val(icv_image_t *img, double val)
Definition: operations.c:100
int icv_gray2rgb(icv_image_t *img)
Definition: color_space.c:37
int alpha_channel
Definition: icv.h:91
double * icv_mean(icv_image_t *img)
Definition: stat.c:128
icv_image_t * icv_filter3(icv_image_t *old_img, icv_image_t *curr_img, icv_image_t *new_img, ICV_FILTER3 filter_type)
Definition: filter.c:244
ICV_COLOR_SPACE color_space
Definition: icv.h:88
ICV_IMAGE_FORMAT icv_guess_file_format(const char *filename, char *trimmedname)
Definition: fileformat.c:82
int icv_rgb2gray(icv_image_t *img, ICV_COLOR color, double rweight, double gweight, double bweight)
Definition: color_space.c:75
icv_image_t * icv_create(int width, int height, ICV_COLOR_SPACE color_space)
Definition: fileformat.c:276
int icv_saturate(icv_image_t *img, double sat)
Definition: operations.c:263
int * icv_median(icv_image_t *img, size_t **bins, int n_bins)
Definition: stat.c:236
ICV_IMAGE_FORMAT
Definition: icv.h:50
ICV_COLOR
Definition: icv.h:259
int icv_multiply_val(icv_image_t *img, double val)
Definition: operations.c:79
int icv_resize(icv_image_t *bif, ICV_RESIZE_METHOD method, unsigned int out_width, unsigned int out_height, unsigned int factor)
Definition: size.c:213
double * icv_sum(icv_image_t *img)
Definition: stat.c:101
#define __END_DECLS
Definition: common.h:74
icv_image_t * icv_zero(icv_image_t *bif)
Definition: fileformat.c:304
ICV_FILTER
Definition: icv.h:485
icv_image_t * icv_multiply(icv_image_t *img1, icv_image_t *img2)
Definition: operations.c:204
double * icv_max(icv_image_t *img)
Definition: stat.c:75
ICV_RESIZE_METHOD
Definition: icv.h:675
float gamma_corr
Definition: icv.h:90
int icv_add_val(icv_image_t *img, double val)
Definition: operations.c:57
icv_image_t * icv_add(icv_image_t *img1, icv_image_t *img2)
Definition: operations.c:146
int icv_writepixel(icv_image_t *bif, int x, int y, double *data)
Definition: fileformat.c:252
icv_image_t * icv_sub(icv_image_t *img1, icv_image_t *img2)
Definition: operations.c:175