Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_resize.h File Reference

Header file for image resizing. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
#include "rwimg.h"
#include "Vector3.h"

Go to the source code of this file.

Functions

Bimage * img_resize (Bimage *p, Vector3< int > newsize, Vector3< int > translate, int wrap, int fill_type, float fill)
 Resizes without interpolation or rescaling. More...
 
Bimage * img_resize_to_next_power2 (Bimage *p, int fill_type, float fill)
 Resizes without interpolation or rescaling to the next power of 2. More...
 
int img_shrink_wrap (Bimage *p, Vector3< int > newsize, Vector3< int > translate)
 Shrinks an image to a new size with wrapping of the excluded edges. More...
 
Bimage * img_pad (Bimage *p, int size, int fill_type, float fill)
 Pads an image to a new size with a given fill value. More...
 
Bimage * img_pad (Bimage *p, Vector3< int > size, int fill_type, float fill)
 Pads an image to a new size with a given fill value. More...
 

Detailed Description

Header file for image resizing.

Author
Bernard Heymann
Date
Created: 20000430 Modified: 20111115

Definition in file img_resize.h.

Function Documentation

Bimage* img_pad ( Bimage *  p,
int  size,
int  fill_type,
float  fill 
)

Pads an image to a new size with a given fill value.

Author
Dan Krainak and Bernard Heymann
Parameters
*pimage file.
sizenew size.
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
fillvalue to use when padding the image.
Returns
Bimage* padded image.
The image is enlarged with padding only on one side in each
dimension with an input size greater than one.
The data type is preserved.

Definition at line 228 of file img_resize.cpp.

Bimage* img_pad ( Bimage *  p,
Vector3< int >  size,
int  fill_type,
float  fill 
)

Pads an image to a new size with a given fill value.

Author
Dan Krainak and Bernard Heymann
Parameters
*pimage file.
sizenew size.
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
fillvalue to use when padding the image.
Returns
Bimage* padded image.

The image is enlarged with padding only on one side in each dimension with an input size greater than one. The data type is preserved.

Definition at line 254 of file img_resize.cpp.

Bimage* img_resize ( Bimage *  p,
Vector3< int >  newsize,
Vector3< int >  translate,
int  wrap,
int  fill_type,
float  fill 
)

Resizes without interpolation or rescaling.

Parameters
*pimage (modified).
newsizenew image size three-value vector.
translatethree-value translation vector.
wrapwrapping flag: 0 = no wrapping, 1 = wrapping.
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER
fillvalue to fill in new regions.
Returns
Bimage* resized image.
An image is resized with translation and filling of new regions with 
a given value.

Definition at line 30 of file img_resize.cpp.

Bimage* img_resize_to_next_power2 ( Bimage *  p,
int  fill_type,
float  fill 
)

Resizes without interpolation or rescaling to the next power of 2.

Parameters
*pimage (modified).
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER
fillvalue to fill in new regions.
Returns
Bimage* resized image.
An image is resized to the next power of two in each dimension
greater than 1 with translation and filling of new regions with 
a given value.
The new data replaces the old data.

Definition at line 124 of file img_resize.cpp.

int img_shrink_wrap ( Bimage *  p,
Vector3< int >  newsize,
Vector3< int >  translate 
)

Shrinks an image to a new size with wrapping of the excluded edges.

Parameters
*pimage.
newsizenew image size three-value vector.
translatethree-value translation vector.
Returns
int 0.
An image is resized to a smaller size with translation and wrapping
of the excluded edges to complete periodic boundaries. The image is
first converted to floating point to prevent overflows of smaller 
data types. The new image is finally converted back to the original
data type.
The new data replaces the old data.

Definition at line 155 of file img_resize.cpp.