| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions
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

  *p | image file.
  size | new size.
  fill_type | FILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
  fill | value 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

  *p | image file.
  size | new size.
  fill_type | FILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
  fill | value 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

  *p | image (modified).
  newsize | new image size three-value vector.
  translate | three-value translation vector.
  wrap | wrapping flag: 0 = no wrapping, 1 = wrapping.
  fill_type | FILL_AVERAGE, FILL_BACKGROUND, FILL_USER
  fill | value 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

  *p | image (modified).
  fill_type | FILL_AVERAGE, FILL_BACKGROUND, FILL_USER
  fill | value 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

  *p | image.
  newsize | new image size three-value vector.
  translate | three-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.