JWS C Library
C language utility library
imgblock_util.c File Reference

Definitions for image block utility functions. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include <inttypes.h>
#include <math.h>
#include <assert.h>
#include "jwsc/base/error.h"
#include "jwsc/matblock/matblock.h"
#include "jwsc/filter/3d.h"
#include "jwsc/imgblock/imgblock.h"
Include dependency graph for imgblock_util.c:

Go to the source code of this file.

Functions

down_sample_imgblock

Down samples an image block.

Errordown_sample_imgblock_f (Imgblock_f **img_out, const Imgblock_f *img_in, float img_factor, float row_factor, float col_factor)
 Down samples a single precision image block.

Detailed Description

Definitions for image block utility functions.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file imgblock_util.c.


Function Documentation

Error* down_sample_imgblock_f ( Imgblock_f **  img_out,
const Imgblock_f img_in,
float  img_factor,
float  row_factor,
float  col_factor 
)

Down samples a single precision image block.

Uses a Gaussian smoothing function to down sample.

Parameters:
img_outResult parameter. If *img_out is NULL, an image block is allocated; otherwise its space is re-used.
img_inImage to down sample.
img_factorPercentage of current number of images to down sample the number of images in the image block to, in the range (0,1].
row_factorPercentage of current number of rows to down sample the number of rows in the image block to, in the range (0,1].
col_factorPercentage of current number of columns to down sample the number of columns in the image block to, in the range (0,1].
Returns:
On success, NULL is returned. On error, an Error is returned and *img_out is freed and set to NULL (if it is not img_in).
  • ERROR_INV_ARG Down sampling row_factor or col_factor are not in (0, 1].
Note:
If *img_out == img_in, then img_in is overwritten.

Definition at line 89 of file imgblock_util.c.