git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3340 92316355-f0b4-4df1-b90c-862c8a59935fmaster
@@ -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); | |||
@@ -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; | |||
@@ -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) { | |||
@@ -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); | |||
@@ -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; | |||
@@ -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))); | |||
@@ -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; | |||
@@ -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; | |||
@@ -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; | |||
@@ -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); | |||
@@ -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); | |||
@@ -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; | |||
@@ -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; | |||
@@ -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); | |||
@@ -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; | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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")) | |||
{ | |||
@@ -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(;;) | |||
@@ -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) | |||
@@ -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)); | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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)); | |||
@@ -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++) | |||
@@ -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)); | |||
@@ -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++) | |||
@@ -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)); | |||
@@ -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++) | |||
@@ -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; | |||
@@ -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 */ | |||
@@ -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++) | |||
@@ -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); | |||
@@ -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) | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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++) | |||
@@ -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; | |||
@@ -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; | |||
@@ -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++) | |||