JWS C Library
C language utility library
image_util.h
Go to the documentation of this file.
00001 /*
00002  * This work is licensed under a Creative Commons 
00003  * Attribution-Noncommercial-Share Alike 3.0 United States License.
00004  * 
00005  *    http://creativecommons.org/licenses/by-nc-sa/3.0/us/
00006  * 
00007  * You are free:
00008  * 
00009  *    to Share - to copy, distribute, display, and perform the work
00010  *    to Remix - to make derivative works
00011  * 
00012  * Under the following conditions:
00013  * 
00014  *    Attribution. You must attribute the work in the manner specified by the
00015  *    author or licensor (but not in any way that suggests that they endorse you
00016  *    or your use of the work).
00017  * 
00018  *    Noncommercial. You may not use this work for commercial purposes.
00019  * 
00020  *    Share Alike. If you alter, transform, or build upon this work, you may
00021  *    distribute the resulting work only under the same or similar license to
00022  *    this one.
00023  * 
00024  * For any reuse or distribution, you must make clear to others the license
00025  * terms of this work. The best way to do this is by including this header.
00026  * 
00027  * Any of the above conditions can be waived if you get permission from the
00028  * copyright holder.
00029  * 
00030  * Apart from the remix rights granted under this license, nothing in this
00031  * license impairs or restricts the author's moral rights.
00032  */
00033 
00034 
00046 #ifndef IMAGE_UTIL_H
00047 #define IMAGE_UTIL_H
00048 
00049 
00050 #include <jwsc/config.h>
00051 
00052 #include <stdlib.h>
00053 
00054 #include "jwsc/base/error.h"
00055 #include "jwsc/matrix/matrix.h"
00056 #include "jwsc/image/image.h"
00057 
00058 
00059 #ifdef __cplusplus
00060 namespace jwsc {
00061 extern "C" {
00062 #endif
00063 
00064 
00073 Error* down_sample_image_f
00074 (
00075     Image_f**      img_out, 
00076     const Image_f* img_in, 
00077     float          row_factor,
00078     float          col_factor
00079 );
00080 
00094 void extend_image_f
00095 (
00096     Image_f**      img_out, 
00097     const Image_f* img_in, 
00098     uint32_t       row_padding,
00099     uint32_t       col_padding
00100 );
00101 
00115 Error* crop_image_f
00116 (
00117     Image_f**      img_out, 
00118     const Image_f* img_in, 
00119     uint32_t       row,
00120     uint32_t       col,
00121     uint32_t       num_rows,
00122     uint32_t       num_cols
00123 );
00124 
00138 void threshold_image_f
00139 (
00140     Matrix_f**     mat_out, 
00141     const Image_f* img_in,
00142     float          t
00143 );
00144 
00158 void threshold_matrix_f
00159 (
00160     Matrix_f**      mat_out, 
00161     const Matrix_f* mat_in,
00162     float           t
00163 );
00164 
00178 void dynamically_threshold_image_f
00179 (
00180     Matrix_f**     mat_out, 
00181     const Image_f* img_in
00182 );
00183 
00197 void dynamically_threshold_matrix_f
00198 (
00199     Matrix_f**      mat_out, 
00200     const Matrix_f* mat_in
00201 );
00202 
00206 #ifdef __cplusplus
00207 }
00208 }
00209 #endif
00210 
00211 
00212 #endif