![]() |
Image Quality Assessment (IQA) 1.1.2
A fast, accurate, and reliable C library for measuring image quality.
|
00001 /* 00002 * Copyright (c) 2011, Tom Distler (http://tdistler.com) 00003 * All rights reserved. 00004 * 00005 * The BSD License 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions are met: 00009 * 00010 * - Redistributions of source code must retain the above copyright notice, 00011 * this list of conditions and the following disclaimer. 00012 * 00013 * - Redistributions in binary form must reproduce the above copyright notice, 00014 * this list of conditions and the following disclaimer in the documentation 00015 * and/or other materials provided with the distribution. 00016 * 00017 * - Neither the name of the tdistler.com nor the names of its contributors may 00018 * be used to endorse or promote products derived from this software without 00019 * specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00022 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00023 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00024 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00025 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00026 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00027 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00028 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00029 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00030 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00031 * POSSIBILITY OF SUCH DAMAGE. 00032 */ 00033 00034 #ifndef _CONVOLVE_H_ 00035 #define _CONVOLVE_H_ 00036 00037 typedef float (*_iqa_get_pixel)(const float *img, int w, int h, int x, int y, float bnd_const); 00038 00040 float KBND_SYMMETRIC(const float *img, int w, int h, int x, int y, float bnd_const); 00042 float KBND_REPLICATE(const float *img, int w, int h, int x, int y, float bnd_const); 00044 float KBND_CONSTANT(const float *img, int w, int h, int x, int y, float bnd_const); 00045 00046 00048 struct _kernel { 00049 float *kernel; 00050 int w; 00051 int h; 00052 int normalized; 00053 _iqa_get_pixel bnd_opt; 00054 float bnd_const; 00055 }; 00056 00073 void _iqa_convolve(float *img, int w, int h, const struct _kernel *k, float *result, int *rw, int *rh); 00074 00092 int _iqa_img_filter(float *img, int w, int h, const struct _kernel *k, float *result); 00093 00108 float _iqa_filter_pixel(const float *img, int w, int h, int x, int y, const struct _kernel *k, const float kscale); 00109 00110 00111 #endif /*_CONVOLVE_H_*/