~ubuntu-branches/debian/stretch/pngquant/stretch

« back to all changes in this revision

Viewing changes to lib/blur.c

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2014-10-07 09:19:38 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20141007091938-jmu20wvmi6hd2nb3
Tags: 2.3.0-1
* New upstream version
* cme fix dpkg-control
* d/copyright: Fix some DEP5 names
* d/rules: cope with hand-written configure script

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
/**
47
47
 * Picks maximum of neighboring pixels (blur + lighten)
48
48
 */
49
 
LIQ_PRIVATE void max3(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height)
 
49
LIQ_PRIVATE void liq_max3(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height)
50
50
{
51
51
    for(unsigned int j=0; j < height; j++) {
52
52
        const unsigned char *row = src + j*width,
73
73
/**
74
74
 * Picks minimum of neighboring pixels (blur + darken)
75
75
 */
76
 
LIQ_PRIVATE void min3(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height)
 
76
LIQ_PRIVATE void liq_min3(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height)
77
77
{
78
78
    for(unsigned int j=0; j < height; j++) {
79
79
        const unsigned char *row = src + j*width,
101
101
 Filters src image and saves it to dst, overwriting tmp in the process.
102
102
 Image must be width*height pixels high. Size controls radius of box blur.
103
103
 */
104
 
LIQ_PRIVATE void blur(unsigned char *src, unsigned char *tmp, unsigned char *dst, unsigned int width, unsigned int height, unsigned int size)
 
104
LIQ_PRIVATE void liq_blur(unsigned char *src, unsigned char *tmp, unsigned char *dst, unsigned int width, unsigned int height, unsigned int size)
105
105
{
106
106
    assert(size > 0);
107
 
    if (width < 2*size+1 || height < 2*size+1) return;
 
107
    if (width < 2*size+1 || height < 2*size+1) {
 
108
        return;
 
109
    }
108
110
    transposing_1d_blur(src, tmp, width, height, size);
109
111
    transposing_1d_blur(tmp, dst, height, width, size);
110
112
}