BRL-CAD
|
Files | |
file | ops.h |
Enumerations | |
enum | ICV_RESIZE_METHOD { ICV_RESIZE_UNDERSAMPLE , ICV_RESIZE_SHRINK , ICV_RESIZE_NINTERP , ICV_RESIZE_BINTERP } |
Functions | |
int | icv_sanitize (icv_image_t *img) |
int | icv_add_val (icv_image_t *img, double val) |
int | icv_multiply_val (icv_image_t *img, double val) |
int | icv_divide_val (icv_image_t *img, double val) |
int | icv_pow_val (icv_image_t *img, double val) |
icv_image_t * | icv_add (icv_image_t *img1, icv_image_t *img2) |
icv_image_t * | icv_sub (icv_image_t *img1, icv_image_t *img2) |
icv_image_t * | icv_multiply (icv_image_t *img1, icv_image_t *img2) |
icv_image_t * | icv_divide (icv_image_t *img1, icv_image_t *img2) |
int | icv_saturate (icv_image_t *img, double sat) |
int | icv_resize (icv_image_t *bif, ICV_RESIZE_METHOD method, size_t out_width, size_t out_height, size_t factor) |
int | icv_rot (size_t argc, const char *argv[]) |
Various routines to perform operations on images.
enum ICV_RESIZE_METHOD |
int icv_sanitize | ( | icv_image_t * | img | ) |
This function sanitizes the image.
It forces the image pixels to be in the prescribed range.
All the pixels higher than the max range are set to MAX (1.0). All the pixels lower than the min range are set to MIN (0.0).
Note if an image(bif) is sanitized then, (bif->flags&&ICV_SANITIZED) is true.
int icv_add_val | ( | icv_image_t * | img, |
double | val | ||
) |
This adds a constant value to all the pixels of the image. Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize the image.
Note to set the flag for a bif (icv_image struct); bif->flags |= ICV_OPERATIONS_MODE;
int icv_multiply_val | ( | icv_image_t * | img, |
double | val | ||
) |
This multiplies all the pixels of the image with a constant Value. Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize the image.
int icv_divide_val | ( | icv_image_t * | img, |
double | val | ||
) |
This divides all the pixels of the image with a constant Value. Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize the image.
int icv_pow_val | ( | icv_image_t * | img, |
double | val | ||
) |
This raises all the pixels of the image to a constant exponential power. Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize the image.
icv_image_t * icv_add | ( | icv_image_t * | img1, |
icv_image_t * | img2 | ||
) |
This routine adds pixel value of one image to pixel value of other pixel and inserts in the same index of the output image.
Also it sanitizes the image.
icv_image_t * icv_sub | ( | icv_image_t * | img1, |
icv_image_t * | img2 | ||
) |
This routine subtracts pixel value of one image from pixel value of other pixel and inserts the result at the same index of the output image.
Also it sanitizes the image.
img1 | First Image. |
img2 | Second Image. |
icv_image_t * icv_multiply | ( | icv_image_t * | img1, |
icv_image_t * | img2 | ||
) |
This routine multiplies pixel value of one image to pixel value of other pixel and inserts the result at the same index of the output image.
Also it sanitizes the image.
img1 | First Image. |
img2 | Second Image. |
icv_image_t * icv_divide | ( | icv_image_t * | img1, |
icv_image_t * | img2 | ||
) |
This routine divides pixel value of one image from pixel value of other pixel and inserts the result at the same index of the output image.
Also it sanitizes the image.
img1 | First Image. |
img2 | Second Image. |
int icv_saturate | ( | icv_image_t * | img, |
double | sat | ||
) |
Change the saturation of image pixels. If sat is set to 0.0 the result will be monochromatic; if sat is made 1.0, the color will not change; if sat is made greater than 1.0, the amount of color is increased.
img | RGB Image to be saturated. |
sat | Saturation value. |
int icv_resize | ( | icv_image_t * | bif, |
ICV_RESIZE_METHOD | method, | ||
size_t | out_width, | ||
size_t | out_height, | ||
size_t | factor | ||
) |
This function resizes the given input image. Mode of usage: a) ICV_RESIZE_UNDERSAMPLE : This method undersamples the said image e.g. icv_resize(bif, ICV_RESIZE_UNDERSAMPLE, 0, 0, 2); undersamples the image with a factor of 2.
b) ICV_RESIZE_SHRINK : This Shrinks the image, keeping the light energy per square area as constant. e.g. icv_resize(bif, ICV_RESIZE_SHRINK,0,0,2); shrinks the image with a factor of 2.
c) ICV_RESIZE_NINTERP : This interpolates using nearest neighbor method. e.g. icv_resize(bif, ICV_RESIZE_NINTERP,1024,1024,0); interpolates the output image to have the size of 1024X1024.
d) ICV_RESIZE_BINTERP : This interpolates using bilinear Interpolation Method. e.g. icv_resize(bif, ICV_RESIZE_BINTERP,1024,1024,0); interpolates the output image to have the size of 1024X1024.
resizes the image inplace.
bif | Image (packed in icv_image struct) |
method | One of the modes. |
out_width | Out Width. |
out_height | Out Height. |
factor | Integer type data representing the factor to be shrunken |
int icv_rot | ( | size_t | argc, |
const char * | argv[] | ||
) |
Rotate an image. s [-rifb | -a angle] [-# bytes] [-s squaresize] [-w width] [-n height] [-o outputfile] inputfile [> outputfile]