From bb926c7a95488ef1e5d270ecaa6637aa70456737 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 12 Jan 2009 23:51:07 +0000 Subject: [PATCH] Rename pipi_getpixel into pipi_get_pixels. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3340 92316355-f0b4-4df1-b90c-862c8a59935f --- examples/edd.c | 2 +- examples/img2rubik.c | 2 +- pipi-php/php_pipi.c | 4 ++-- pipi-php/php_pipi.h | 2 +- pipi-sharp/Picture.cs | 4 ++-- pipi/analysis/histogram.c | 2 +- pipi/analysis/measure.c | 4 ++-- pipi/codec/coreimage.m | 4 ++-- pipi/codec/gdi.c | 4 ++-- pipi/codec/gdiplus.cpp | 4 ++-- pipi/codec/imlib.c | 2 +- pipi/codec/modular/jpeg.c | 2 +- pipi/codec/opencv.c | 2 +- pipi/codec/oric.c | 6 +++--- pipi/codec/sdl.c | 2 +- pipi/combine/mean.c | 6 +++--- pipi/combine/minmax.c | 12 ++++++------ pipi/combine/mulscreen.c | 24 +++++++++++------------ pipi/combine/rgb.c | 20 +++++++++---------- pipi/combine/subadd.c | 18 ++++++++--------- pipi/context.c | 2 +- pipi/dither/dbs.c | 8 ++++---- pipi/dither/ediff.c | 4 ++-- pipi/dither/ordered.c | 8 ++++---- pipi/dither/ostromoukhov.c | 2 +- pipi/dither/random.c | 2 +- pipi/filter/autocontrast.c | 8 ++++---- pipi/filter/blur.c | 8 ++++---- pipi/filter/color.c | 32 +++++++++++++++--------------- pipi/filter/convolution.c | 16 +++++++-------- pipi/filter/dilate.c | 16 +++++++-------- pipi/filter/median.c | 8 ++++---- pipi/filter/transform.c | 40 +++++++++++++++++++------------------- pipi/paint/floodfill.c | 6 +++--- pipi/paint/line.c | 8 ++++---- pipi/paint/tile.c | 4 ++-- pipi/pipi.h | 2 +- pipi/pixels.c | 10 +++++----- pipi/quantize/reduce.c | 4 ++-- pipi/render/noise.c | 2 +- pipi/render/screen.c | 4 ++-- pipi/resize.c | 4 ++-- pipi/stock.c | 2 +- test/u8tof32tou8.c | 6 +++--- 44 files changed, 166 insertions(+), 166 deletions(-) diff --git a/examples/edd.c b/examples/edd.c index 5fdc852..b783a03 100644 --- a/examples/edd.c +++ b/examples/edd.c @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) /* Load image, convert it to grayscale, dither it with Floyd-Steinberg */ img = pipi_load(argv[1]); - pipi_getpixels(img, PIPI_PIXELS_Y_F); + pipi_get_pixels(img, PIPI_PIXELS_Y_F); gauss = pipi_gaussian_blur(img, sigma); kernel = pipi_load("ediff:fs"); dither = pipi_dither_ediff(img, kernel, PIPI_SCAN_RASTER); diff --git a/examples/img2rubik.c b/examples/img2rubik.c index c4c46af..afd8249 100644 --- a/examples/img2rubik.c +++ b/examples/img2rubik.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) pipi_image_t *src = pipi_load(argv[1]); pipi_image_t *dst = pipi_reduce(src, NCOLORS, mypal); - pipi_pixels_t *p = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + pipi_pixels_t *p = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); float *data = (float *)p->pixels; w = p->w; h = p->h; diff --git a/pipi-php/php_pipi.c b/pipi-php/php_pipi.c index 6800334..9f80536 100644 --- a/pipi-php/php_pipi.c +++ b/pipi-php/php_pipi.c @@ -29,7 +29,7 @@ static function_entry pipi_functions[] = { PHP_FE(pipi_copy, NULL) PHP_FE(pipi_save, NULL) PHP_FE(pipi_set_gamma, NULL) - PHP_FE(pipi_getpixels, NULL) + PHP_FE(pipi_get_pixels, NULL) PHP_FE(pipi_get_image_width, NULL) PHP_FE(pipi_get_image_height, NULL) PHP_FE(pipi_get_image_pitch, NULL) @@ -294,7 +294,7 @@ PHP_FUNCTION(pipi_set_gamma) { pipi_set_gamma(value); } -PHP_FUNCTION(pipi_getpixels) { +PHP_FUNCTION(pipi_get_pixels) { } PHP_FUNCTION(pipi_get_image_width) { diff --git a/pipi-php/php_pipi.h b/pipi-php/php_pipi.h index 59cfc09..a843ba9 100644 --- a/pipi-php/php_pipi.h +++ b/pipi-php/php_pipi.h @@ -41,7 +41,7 @@ PHP_FUNCTION(pipi_new); PHP_FUNCTION(pipi_copy); PHP_FUNCTION(pipi_save); PHP_FUNCTION(pipi_set_gamma); -PHP_FUNCTION(pipi_getpixels); +PHP_FUNCTION(pipi_get_pixels); PHP_FUNCTION(pipi_get_image_width); PHP_FUNCTION(pipi_get_image_height); PHP_FUNCTION(pipi_get_image_pitch); diff --git a/pipi-sharp/Picture.cs b/pipi-sharp/Picture.cs index 339f45f..fa2afaa 100644 --- a/pipi-sharp/Picture.cs +++ b/pipi-sharp/Picture.cs @@ -89,11 +89,11 @@ namespace Pipi [DllImport("libpipi-0.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] - private static extern IntPtr pipi_getpixels(IntPtr img, int type); + private static extern IntPtr pipi_get_pixels(IntPtr img, int type); public byte[] GetPixels(int w, int h, int x, int y) { byte[] array = new byte[w * h * 4]; - IntPtr pixels = pipi_getpixels(_picture, 0); + IntPtr pixels = pipi_get_pixels(_picture, 0); PixelsStruct p; Int64 address; diff --git a/pipi/analysis/histogram.c b/pipi/analysis/histogram.c index 4f1caed..30dc356 100644 --- a/pipi/analysis/histogram.c +++ b/pipi/analysis/histogram.c @@ -42,7 +42,7 @@ int pipi_get_image_histogram(pipi_image_t *img, pipi_histogram_t*h, int flags) if(!h) return -1; - data = (uint8_t *)pipi_getpixels(img, PIPI_PIXELS_RGBA_C)->pixels; + data = (uint8_t *)pipi_get_pixels(img, PIPI_PIXELS_RGBA_C)->pixels; memset(h->a, 0, 256*(sizeof(unsigned int))); memset(h->r, 0, 256*(sizeof(unsigned int))); memset(h->g, 0, 256*(sizeof(unsigned int))); diff --git a/pipi/analysis/measure.c b/pipi/analysis/measure.c index 3231d05..a226d3e 100644 --- a/pipi/analysis/measure.c +++ b/pipi/analysis/measure.c @@ -41,8 +41,8 @@ double pipi_measure_msd(pipi_image_t *i1, pipi_image_t *i2) f1 = i1->last_modified; f2 = i2->last_modified; - pipi_getpixels(i1, PIPI_PIXELS_Y_F); - pipi_getpixels(i2, PIPI_PIXELS_Y_F); + pipi_get_pixels(i1, PIPI_PIXELS_Y_F); + pipi_get_pixels(i2, PIPI_PIXELS_Y_F); p1 = (float *)i1->p[PIPI_PIXELS_Y_F].pixels; p2 = (float *)i2->p[PIPI_PIXELS_Y_F].pixels; diff --git a/pipi/codec/coreimage.m b/pipi/codec/coreimage.m index 4b4f337..ba35827 100644 --- a/pipi/codec/coreimage.m +++ b/pipi/codec/coreimage.m @@ -97,7 +97,7 @@ pipi_image_t *pipi_load_coreimage(const char *name) struct pipi_codec_coreimage *infos = (struct pipi_codec_coreimage *) img->codec_priv; infos->format = [myImage bitmapFormat]; - pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); img->codec_free = pipi_free_coreimage; @@ -109,7 +109,7 @@ pipi_image_t *pipi_load_coreimage(const char *name) int pipi_save_coreimage(pipi_image_t *img, const char *name) { NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; - pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); int i; char *data = p->pixels; diff --git a/pipi/codec/gdi.c b/pipi/codec/gdi.c index cfbc9bc..262bffe 100644 --- a/pipi/codec/gdi.c +++ b/pipi/codec/gdi.c @@ -53,7 +53,7 @@ pipi_image_t *pipi_load_gdi(const char *name) } img = pipi_new(binfo.bmiHeader.biWidth, binfo.bmiHeader.biHeight); - p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); data = p->pixels; binfo.bmiHeader.biBitCount = 32; @@ -92,7 +92,7 @@ int pipi_save_gdi(pipi_image_t *img, const char *name) uint8_t *data; int x, y, padding; - p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); data = p->pixels; padding = ((img->w * 3) + 3) / 4 * 4 - img->w * 3; diff --git a/pipi/codec/gdiplus.cpp b/pipi/codec/gdiplus.cpp index fea7caf..9a526b1 100755 --- a/pipi/codec/gdiplus.cpp +++ b/pipi/codec/gdiplus.cpp @@ -65,7 +65,7 @@ extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) } pipi_image_t *img = pipi_new(b->GetWidth(), b->GetHeight()); - pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); memcpy(p->pixels, bdata.Scan0, bdata.Width * bdata.Height * 4); b->UnlockBits(&bdata); @@ -138,7 +138,7 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) return -1; } - pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); memcpy(bdata.Scan0, p->pixels, bdata.Width * bdata.Height * 4); b->UnlockBits(&bdata); diff --git a/pipi/codec/imlib.c b/pipi/codec/imlib.c index 8083d52..0e33a05 100644 --- a/pipi/codec/imlib.c +++ b/pipi/codec/imlib.c @@ -98,7 +98,7 @@ int pipi_save_imlib2(pipi_image_t *img, const char *name) img->u8 = 1; } - pipi_getpixels(img, img->codec_format); + pipi_get_pixels(img, img->codec_format); imlib_context_set_image(img->codec_priv); imlib_save_image(name); diff --git a/pipi/codec/modular/jpeg.c b/pipi/codec/modular/jpeg.c index 5b44238..33136d4 100644 --- a/pipi/codec/modular/jpeg.c +++ b/pipi/codec/modular/jpeg.c @@ -143,7 +143,7 @@ int pipi_save_jpeg(pipi_image_t *img, const char *name) unsigned char *data = NULL; unsigned char *line = NULL; - pipi_pixels_t *pixels = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + pipi_pixels_t *pixels = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); if (!pixels) return 0; diff --git a/pipi/codec/opencv.c b/pipi/codec/opencv.c index c6c605f..a9ea884 100644 --- a/pipi/codec/opencv.c +++ b/pipi/codec/opencv.c @@ -91,7 +91,7 @@ int pipi_save_opencv(pipi_image_t *img, const char *name) img->u8 = 1; } - pipi_getpixels(img, img->codec_format); + pipi_get_pixels(img, img->codec_format); cvSaveImage(name, img->codec_priv); return 0; diff --git a/pipi/codec/oric.c b/pipi/codec/oric.c index a594a8e..b63da16 100644 --- a/pipi/codec/oric.c +++ b/pipi/codec/oric.c @@ -64,7 +64,7 @@ pipi_image_t *pipi_load_oric(char const *name) } img = pipi_new(WIDTH, HEIGHT); - p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); + p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_C); data = p->pixels; for(y = 0; y < HEIGHT; y++) @@ -141,10 +141,10 @@ int pipi_save_oric(pipi_image_t *img, char const *name) if(img->w != WIDTH || img->h != HEIGHT) { tmp = pipi_resize(img, WIDTH, HEIGHT); - p = pipi_getpixels(tmp, PIPI_PIXELS_RGBA_F); + p = pipi_get_pixels(tmp, PIPI_PIXELS_RGBA_F); } else - p = pipi_getpixels(img, PIPI_PIXELS_RGBA_F); + p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_F); data = p->pixels; screen = malloc(WIDTH * HEIGHT / 6); write_screen(data, screen); diff --git a/pipi/codec/sdl.c b/pipi/codec/sdl.c index 983daaa..1b265d1 100644 --- a/pipi/codec/sdl.c +++ b/pipi/codec/sdl.c @@ -95,7 +95,7 @@ int pipi_save_sdl(pipi_image_t *img, const char *name) img->u8 = 1; } - pipi_getpixels(img, img->codec_format); + pipi_get_pixels(img, img->codec_format); SDL_SaveBMP(img->codec_priv, name); return 0; diff --git a/pipi/combine/mean.c b/pipi/combine/mean.c index eccdc92..9a8264a 100644 --- a/pipi/combine/mean.c +++ b/pipi/combine/mean.c @@ -37,12 +37,12 @@ pipi_image_t *pipi_mean(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) diff --git a/pipi/combine/minmax.c b/pipi/combine/minmax.c index f1f6f64..2dd7220 100644 --- a/pipi/combine/minmax.c +++ b/pipi/combine/minmax.c @@ -37,12 +37,12 @@ pipi_image_t *pipi_min(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) @@ -86,12 +86,12 @@ pipi_image_t *pipi_max(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) diff --git a/pipi/combine/mulscreen.c b/pipi/combine/mulscreen.c index d9fd3c3..fde1c35 100644 --- a/pipi/combine/mulscreen.c +++ b/pipi/combine/mulscreen.c @@ -37,12 +37,12 @@ pipi_image_t *pipi_multiply(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) @@ -86,12 +86,12 @@ pipi_image_t *pipi_divide(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) @@ -135,12 +135,12 @@ pipi_image_t *pipi_screen(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) @@ -184,12 +184,12 @@ pipi_image_t *pipi_overlay(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) diff --git a/pipi/combine/rgb.c b/pipi/combine/rgb.c index fc9afbe..5a771d7 100644 --- a/pipi/combine/rgb.c +++ b/pipi/combine/rgb.c @@ -37,14 +37,14 @@ pipi_image_t *pipi_rgb(pipi_image_t *i1, pipi_image_t *i2, pipi_image_t *i3) h = i1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - i1p = pipi_getpixels(i1, PIPI_PIXELS_Y_F); + i1p = pipi_get_pixels(i1, PIPI_PIXELS_Y_F); i1data = (float *)i1p->pixels; - i2p = pipi_getpixels(i2, PIPI_PIXELS_Y_F); + i2p = pipi_get_pixels(i2, PIPI_PIXELS_Y_F); i2data = (float *)i2p->pixels; - i3p = pipi_getpixels(i3, PIPI_PIXELS_Y_F); + i3p = pipi_get_pixels(i3, PIPI_PIXELS_Y_F); i3data = (float *)i3p->pixels; for(y = 0; y < h; y++) @@ -72,10 +72,10 @@ pipi_image_t *pipi_red(pipi_image_t *src) h = src->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; - srcp = pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; for(y = 0; y < h; y++) @@ -96,10 +96,10 @@ pipi_image_t *pipi_green(pipi_image_t *src) h = src->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; - srcp = pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; for(y = 0; y < h; y++) @@ -120,10 +120,10 @@ pipi_image_t *pipi_blue(pipi_image_t *src) h = src->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; - srcp = pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/combine/subadd.c b/pipi/combine/subadd.c index 14c6b4a..2391340 100644 --- a/pipi/combine/subadd.c +++ b/pipi/combine/subadd.c @@ -38,12 +38,12 @@ pipi_image_t *pipi_add(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) @@ -87,12 +87,12 @@ pipi_image_t *pipi_sub(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) @@ -136,12 +136,12 @@ pipi_image_t *pipi_difference(pipi_image_t *img1, pipi_image_t *img2) h = img1->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - img1p = pipi_getpixels(img1, PIPI_PIXELS_RGBA_F); + img1p = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_F); img1data = (float *)img1p->pixels; - img2p = pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); + img2p = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); img2data = (float *)img2p->pixels; for(y = 0; y < h; y++) diff --git a/pipi/context.c b/pipi/context.c index eb302ad..226982c 100644 --- a/pipi/context.c +++ b/pipi/context.c @@ -703,7 +703,7 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) { if(ctx->nimages < 1) return -1; - pipi_getpixels(ctx->images[ctx->nimages - 1], PIPI_PIXELS_Y_F); + pipi_get_pixels(ctx->images[ctx->nimages - 1], PIPI_PIXELS_Y_F); } else if(!strcmp(cmd, "free")) { diff --git a/pipi/dither/dbs.c b/pipi/dither/dbs.c index 520a8c3..5bf4e9d 100644 --- a/pipi/dither/dbs.c +++ b/pipi/dither/dbs.c @@ -69,20 +69,20 @@ pipi_image_t *pipi_dither_dbs(pipi_image_t *img) memset(changelist, 0, cw * ch * sizeof(int)); src = pipi_copy(img); - pipi_getpixels(src, PIPI_PIXELS_Y_F); + pipi_get_pixels(src, PIPI_PIXELS_Y_F); tmp1 = pipi_convolution(src, NN, NN, kernel); - tmp1p = pipi_getpixels(tmp1, PIPI_PIXELS_Y_F); + tmp1p = pipi_get_pixels(tmp1, PIPI_PIXELS_Y_F); tmp1data = (float *)tmp1p->pixels; dst = pipi_dither_random(src); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; pipi_free(src); tmp2 = pipi_convolution(dst, NN, NN, kernel); - tmp2p = pipi_getpixels(tmp2, PIPI_PIXELS_Y_F); + tmp2p = pipi_get_pixels(tmp2, PIPI_PIXELS_Y_F); tmp2data = (float *)tmp2p->pixels; for(;;) diff --git a/pipi/dither/ediff.c b/pipi/dither/ediff.c index 4b20977..c33ea44 100644 --- a/pipi/dither/ediff.c +++ b/pipi/dither/ediff.c @@ -41,10 +41,10 @@ pipi_image_t *pipi_dither_ediff(pipi_image_t *img, pipi_image_t *ker, kh = ker->h; dst = pipi_copy(img); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; - kerp = pipi_getpixels(ker, PIPI_PIXELS_Y_F); + kerp = pipi_get_pixels(ker, PIPI_PIXELS_Y_F); kerdata = (float *)kerp->pixels; for(kx = 0; kx < kw; kx++) if(kerdata[kx] > 0) diff --git a/pipi/dither/ordered.c b/pipi/dither/ordered.c index e1a8a01..0026f13 100644 --- a/pipi/dither/ordered.c +++ b/pipi/dither/ordered.c @@ -63,10 +63,10 @@ pipi_image_t *pipi_dither_ordered_ext(pipi_image_t *img, pipi_image_t *kernel, sint = sin(angle * (M_PI / 180)); dst = pipi_copy(img); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; - kernelp = pipi_getpixels(kernel, PIPI_PIXELS_Y_F); + kernelp = pipi_get_pixels(kernel, PIPI_PIXELS_Y_F); kerneldata = (float *)kernelp->pixels; for(y = 0; y < h; y++) @@ -112,11 +112,11 @@ pipi_image_t *pipi_order(pipi_image_t *src) h = src->h; epsilon = 1. / (w * h + 1); - srcp = pipi_getpixels(src, PIPI_PIXELS_Y_F); + srcp = pipi_get_pixels(src, PIPI_PIXELS_Y_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; circle = malloc(w * h * sizeof(dot_t)); diff --git a/pipi/dither/ostromoukhov.c b/pipi/dither/ostromoukhov.c index 0396daa..c98a6e6 100644 --- a/pipi/dither/ostromoukhov.c +++ b/pipi/dither/ostromoukhov.c @@ -76,7 +76,7 @@ pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *img, pipi_scan_t scan) h = img->h; dst = pipi_copy(img); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/dither/random.c b/pipi/dither/random.c index 3417ac2..dda07d3 100644 --- a/pipi/dither/random.c +++ b/pipi/dither/random.c @@ -33,7 +33,7 @@ pipi_image_t *pipi_dither_random(pipi_image_t *img) h = img->h; dst = pipi_copy(img); - dstp = pipi_getpixels(dst, PIPI_PIXELS_Y_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_Y_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/filter/autocontrast.c b/pipi/filter/autocontrast.c index 4b9f4d1..1e5702f 100644 --- a/pipi/filter/autocontrast.c +++ b/pipi/filter/autocontrast.c @@ -41,8 +41,8 @@ pipi_image_t *pipi_autocontrast(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; for(y = 0; y < h; y++) @@ -80,8 +80,8 @@ pipi_image_t *pipi_autocontrast(pipi_image_t *src) t = 1. / (max - min); dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/filter/blur.c b/pipi/filter/blur.c index a5dad77..9aa4209 100644 --- a/pipi/filter/blur.c +++ b/pipi/filter/blur.c @@ -163,13 +163,13 @@ static pipi_image_t *T(boxblur)(pipi_image_t *src, int m, int n) h = src->h; size = (2 * m + 1) * (2 * n + 1); - srcp = FLAG_GRAY ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = FLAG_GRAY ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = FLAG_GRAY ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = FLAG_GRAY ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; acc = malloc(w * (FLAG_GRAY ? 1 : 4) * sizeof(double)); diff --git a/pipi/filter/color.c b/pipi/filter/color.c index beff471..ada89b6 100644 --- a/pipi/filter/color.c +++ b/pipi/filter/color.c @@ -38,13 +38,13 @@ pipi_image_t *pipi_brightness(pipi_image_t *src, double val) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; if(val >= 0.0) @@ -119,13 +119,13 @@ pipi_image_t *pipi_contrast(pipi_image_t *src, double val) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; if(val >= 0.0) @@ -210,13 +210,13 @@ pipi_image_t *pipi_invert(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -254,13 +254,13 @@ pipi_image_t *pipi_threshold(pipi_image_t *src, double val) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/filter/convolution.c b/pipi/filter/convolution.c index 6fe9ae7..d1ae38e 100644 --- a/pipi/filter/convolution.c +++ b/pipi/filter/convolution.c @@ -121,13 +121,13 @@ static pipi_image_t *T(conv)(pipi_image_t *src, int m, int n, double mat[]) w = src->w; h = src->h; - srcp = FLAG_GRAY ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = FLAG_GRAY ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = FLAG_GRAY ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = FLAG_GRAY ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -189,13 +189,13 @@ static pipi_image_t *T(sepconv)(pipi_image_t *src, w = src->w; h = src->h; - srcp = FLAG_GRAY ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = FLAG_GRAY ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = FLAG_GRAY ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = FLAG_GRAY ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; buffer = malloc(w * h * (FLAG_GRAY ? 1 : 4) * sizeof(double)); diff --git a/pipi/filter/dilate.c b/pipi/filter/dilate.c index 01cbbc4..b6692d0 100644 --- a/pipi/filter/dilate.c +++ b/pipi/filter/dilate.c @@ -42,13 +42,13 @@ pipi_image_t *pipi_dilate(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -111,13 +111,13 @@ pipi_image_t *pipi_erode(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/filter/median.c b/pipi/filter/median.c index 884a3c2..17bd04f 100644 --- a/pipi/filter/median.c +++ b/pipi/filter/median.c @@ -57,13 +57,13 @@ pipi_image_t *pipi_median_ext(pipi_image_t *src, int rx, int ry) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; list = malloc(size * (gray ? 1 : 4) * sizeof(double)); diff --git a/pipi/filter/transform.c b/pipi/filter/transform.c index dafd837..c980806 100644 --- a/pipi/filter/transform.c +++ b/pipi/filter/transform.c @@ -38,13 +38,13 @@ pipi_image_t *pipi_hflip(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -84,13 +84,13 @@ pipi_image_t *pipi_vflip(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -124,13 +124,13 @@ pipi_image_t *pipi_rotate90(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(h, w); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -170,13 +170,13 @@ pipi_image_t *pipi_rotate180(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) @@ -216,13 +216,13 @@ pipi_image_t *pipi_rotate270(pipi_image_t *src) gray = (src->last_modified == PIPI_PIXELS_Y_F); - srcp = gray ? pipi_getpixels(src, PIPI_PIXELS_Y_F) - : pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = gray ? pipi_get_pixels(src, PIPI_PIXELS_Y_F) + : pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(h, w); - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(y = 0; y < h; y++) diff --git a/pipi/paint/floodfill.c b/pipi/paint/floodfill.c index a59c44a..1512de7 100644 --- a/pipi/paint/floodfill.c +++ b/pipi/paint/floodfill.c @@ -82,7 +82,7 @@ int pipi_flood_fill(pipi_image_t *src, unsigned char nr, ng, nb, na; /* Get ARGB32 pointer */ - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_C); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_C); dstdata = (uint32_t *)dstp->pixels; nr = r*255.0f; @@ -99,8 +99,8 @@ int pipi_flood_fill(pipi_image_t *src, float *dstdata; float or, og, ob, oa; - dstp = gray ? pipi_getpixels(dst, PIPI_PIXELS_Y_F) - : pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = gray ? pipi_get_pixels(dst, PIPI_PIXELS_Y_F) + : pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; diff --git a/pipi/paint/line.c b/pipi/paint/line.c index 452e5aa..d2c29a0 100644 --- a/pipi/paint/line.c +++ b/pipi/paint/line.c @@ -72,7 +72,7 @@ int pipi_draw_line(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t if(!aa) { uint32_t *dstdata; - dstdata = (uint32_t *)pipi_getpixels(img, PIPI_PIXELS_RGBA_C)->pixels; + dstdata = (uint32_t *)pipi_get_pixels(img, PIPI_PIXELS_RGBA_C)->pixels; s.color32 = c; s.buf_u32 = dstdata; s.draw = line_8bit; @@ -80,7 +80,7 @@ int pipi_draw_line(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t else { float *dstdata; - dstdata = (float *)pipi_getpixels(img, PIPI_PIXELS_RGBA_F)->pixels; + dstdata = (float *)pipi_get_pixels(img, PIPI_PIXELS_RGBA_F)->pixels; s.colorf[2] = ((c&0x00FF0000)>>16)/255.0f; /* XXX FIXME */ s.colorf[1] = ((c&0x0000FF00)>>8)/255.0f; /* XXX FIXME */ s.colorf[0] = (c&0x000000FF)/255.0f; /* XXX FIXME */ @@ -91,7 +91,7 @@ int pipi_draw_line(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t else if(img->last_modified == PIPI_PIXELS_Y_F) { float *dstdata; - dstdata = (float *)pipi_getpixels(img, PIPI_PIXELS_Y_F)->pixels; + dstdata = (float *)pipi_get_pixels(img, PIPI_PIXELS_Y_F)->pixels; s.colorf[0] = (c & 0xff) / 255.0f; /* XXX FIXME */ s.buf_f = dstdata; s.draw = aa ? aaline_gray : line_gray; @@ -99,7 +99,7 @@ int pipi_draw_line(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t else { float *dstdata; - dstdata = (float *)pipi_getpixels(img, PIPI_PIXELS_RGBA_F)->pixels; + dstdata = (float *)pipi_get_pixels(img, PIPI_PIXELS_RGBA_F)->pixels; s.colorf[2] = ((c&0x00FF0000)>>16)/255.0f; /* XXX FIXME */ s.colorf[1] = ((c&0x0000FF00)>>8)/255.0f; /* XXX FIXME */ s.colorf[0] = (c&0x000000FF)/255.0f; /* XXX FIXME */ diff --git a/pipi/paint/tile.c b/pipi/paint/tile.c index fd13711..a58cf2c 100644 --- a/pipi/paint/tile.c +++ b/pipi/paint/tile.c @@ -34,10 +34,10 @@ pipi_image_t *pipi_tile(pipi_image_t *tile, int w, int h) th = tile->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; - tilep = pipi_getpixels(tile, PIPI_PIXELS_RGBA_F); + tilep = pipi_get_pixels(tile, PIPI_PIXELS_RGBA_F); tiledata = (float *)tilep->pixels; for(y = 0; y < h; y++) diff --git a/pipi/pipi.h b/pipi/pipi.h index 69d4356..cbd6f3a 100644 --- a/pipi/pipi.h +++ b/pipi/pipi.h @@ -143,7 +143,7 @@ __extern void pipi_free(pipi_image_t *); __extern int pipi_save(pipi_image_t *, const char *); __extern void pipi_set_gamma(double); -__extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t); +__extern pipi_pixels_t *pipi_get_pixels(pipi_image_t *, pipi_format_t); __extern int pipi_get_image_width(pipi_image_t *img); __extern int pipi_get_image_height(pipi_image_t *img); __extern int pipi_get_image_pitch(pipi_image_t *img); diff --git a/pipi/pixels.c b/pipi/pixels.c index 56b1928..69f5444 100644 --- a/pipi/pixels.c +++ b/pipi/pixels.c @@ -36,7 +36,7 @@ static float u8tof32_table[256]; static inline float u8tof32(uint8_t p) { return u8tof32_table[(int)p]; } /* Return a direct pointer to an image's pixels. */ -pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type) +pipi_pixels_t *pipi_get_pixels(pipi_image_t *img, pipi_format_t type) { size_t bytes = 0; int x, y, i, bpp = 0; @@ -54,16 +54,16 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type) /* Preliminary conversions */ if(img->last_modified == PIPI_PIXELS_RGBA_C && type == PIPI_PIXELS_Y_F) - pipi_getpixels(img, PIPI_PIXELS_RGBA_F); + pipi_get_pixels(img, PIPI_PIXELS_RGBA_F); else if(img->last_modified == PIPI_PIXELS_BGR_C && type == PIPI_PIXELS_Y_F) - pipi_getpixels(img, PIPI_PIXELS_RGBA_F); + pipi_get_pixels(img, PIPI_PIXELS_RGBA_F); else if(img->last_modified == PIPI_PIXELS_Y_F && type == PIPI_PIXELS_RGBA_C) - pipi_getpixels(img, PIPI_PIXELS_RGBA_F); + pipi_get_pixels(img, PIPI_PIXELS_RGBA_F); else if(img->last_modified == PIPI_PIXELS_Y_F && type == PIPI_PIXELS_BGR_C) - pipi_getpixels(img, PIPI_PIXELS_RGBA_F); + pipi_get_pixels(img, PIPI_PIXELS_RGBA_F); /* Allocate pixels if necessary */ if(!img->p[type].pixels) diff --git a/pipi/quantize/reduce.c b/pipi/quantize/reduce.c index 0237b5b..df06bc0 100644 --- a/pipi/quantize/reduce.c +++ b/pipi/quantize/reduce.c @@ -378,14 +378,14 @@ pipi_image_t *pipi_reduce(pipi_image_t *src, debug("### PROCESSING IMAGE ###"); debug(""); - srcp = pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; w = srcp->w; h = srcp->h; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; for(j = 0; j < h; j++) diff --git a/pipi/render/noise.c b/pipi/render/noise.c index aaa03cd..f69768e 100644 --- a/pipi/render/noise.c +++ b/pipi/render/noise.c @@ -34,7 +34,7 @@ pipi_image_t *pipi_render_random(int w, int h) int x, y, t; ret = pipi_new(w, h); - pix = pipi_getpixels(ret, PIPI_PIXELS_RGBA_F); + pix = pipi_get_pixels(ret, PIPI_PIXELS_RGBA_F); data = (float *)pix->pixels; for(y = 0; y < h; y++) diff --git a/pipi/render/screen.c b/pipi/render/screen.c index b220885..e2c9d15 100644 --- a/pipi/render/screen.c +++ b/pipi/render/screen.c @@ -44,7 +44,7 @@ pipi_image_t *pipi_render_bayer(int w, int h) ; ret = pipi_new(w, h); - pix = pipi_getpixels(ret, PIPI_PIXELS_Y_F); + pix = pipi_get_pixels(ret, PIPI_PIXELS_Y_F); data = (float *)pix->pixels; for(j = 0; j < h; j++) @@ -107,7 +107,7 @@ pipi_image_t *pipi_render_halftone(int w, int h) qsort(circle, w * h, sizeof(dot_t), cmpdot); ret = pipi_new(w * 2, h * 2); - pix = pipi_getpixels(ret, PIPI_PIXELS_Y_F); + pix = pipi_get_pixels(ret, PIPI_PIXELS_Y_F); data = (float *)pix->pixels; for(n = 0; n < w * h; n++) diff --git a/pipi/resize.c b/pipi/resize.c index f9bb409..706fe69 100644 --- a/pipi/resize.c +++ b/pipi/resize.c @@ -31,11 +31,11 @@ pipi_image_t *pipi_resize(pipi_image_t *src, int w, int h) pipi_pixels_t *srcp, *dstp; int x, y, x0, y0, sw, dw, sh, dh, remy; - srcp = pipi_getpixels(src, PIPI_PIXELS_RGBA_F); + srcp = pipi_get_pixels(src, PIPI_PIXELS_RGBA_F); srcdata = (float *)srcp->pixels; dst = pipi_new(w, h); - dstp = pipi_getpixels(dst, PIPI_PIXELS_RGBA_F); + dstp = pipi_get_pixels(dst, PIPI_PIXELS_RGBA_F); dstdata = (float *)dstp->pixels; sw = src->w; sh = src->h; diff --git a/pipi/stock.c b/pipi/stock.c index 9c6c8f6..480ca36 100644 --- a/pipi/stock.c +++ b/pipi/stock.c @@ -173,7 +173,7 @@ pipi_image_t *pipi_load_stock(char const *name) return NULL; ret = pipi_new(w, h); - pix = pipi_getpixels(ret, PIPI_PIXELS_Y_F); + pix = pipi_get_pixels(ret, PIPI_PIXELS_Y_F); memcpy(pix->pixels, ker, w * h * sizeof(float)); return ret; diff --git a/test/u8tof32tou8.c b/test/u8tof32tou8.c index e13a124..55de574 100644 --- a/test/u8tof32tou8.c +++ b/test/u8tof32tou8.c @@ -34,11 +34,11 @@ int main(int argc, char *argv[]) img1 = pipi_load("mona.png"); img2 = pipi_load("mona.png"); - pix1 = pipi_getpixels(img1, PIPI_PIXELS_RGBA_C); + pix1 = pipi_get_pixels(img1, PIPI_PIXELS_RGBA_C); data1 = (uint32_t *)pix1->pixels; - pipi_getpixels(img2, PIPI_PIXELS_RGBA_F); - pix2 = pipi_getpixels(img2, PIPI_PIXELS_RGBA_C); + pipi_get_pixels(img2, PIPI_PIXELS_RGBA_F); + pix2 = pipi_get_pixels(img2, PIPI_PIXELS_RGBA_C); data2 = (uint32_t *)pix2->pixels; for(y = 0; y < pix1->h; y++)