git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2905 92316355-f0b4-4df1-b90c-862c8a59935fremotes/tiles
@@ -27,7 +27,7 @@ | |||||
/* DOS / Kernel driver */ | /* DOS / Kernel driver */ | ||||
#ifndef __intptr_t_defined | #ifndef __intptr_t_defined | ||||
#ifndef _UINTPTR_T | #ifndef _UINTPTR_T | ||||
typedef unsigned int uintptr_t; | |||||
typedef unsigned int uintptr_t; | |||||
#endif | #endif | ||||
#endif | #endif | ||||
@@ -25,7 +25,7 @@ | |||||
pipi_image_t *pipi_load_coreimage(const char *name) | pipi_image_t *pipi_load_coreimage(const char *name) | ||||
{ | { | ||||
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; | |||||
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; | |||||
NSString *n = [NSString stringWithCString: name]; | NSString *n = [NSString stringWithCString: name]; | ||||
CIImage *source; | CIImage *source; | ||||
NSURL *url = [NSURL fileURLWithPath:n]; | NSURL *url = [NSURL fileURLWithPath:n]; | ||||
@@ -60,7 +60,7 @@ pipi_image_t *pipi_load_coreimage(const char *name) | |||||
int pipi_save_coreimage(pipi_image_t *img, const char *name) | int pipi_save_coreimage(pipi_image_t *img, const char *name) | ||||
{ | { | ||||
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; | |||||
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; | |||||
printf("%d\n", img->last_modified); | printf("%d\n", img->last_modified); | ||||
pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); | pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); | ||||
@@ -56,7 +56,7 @@ struct color_table color_table[] = | |||||
pipi_pixel_t *pipi_get_color_from_string(const char* s) | pipi_pixel_t *pipi_get_color_from_string(const char* s) | ||||
{ | { | ||||
pipi_pixel_t *color; | |||||
pipi_pixel_t *color; | |||||
if(!s) return NULL; | if(!s) return NULL; | ||||
@@ -42,7 +42,7 @@ int pipi_get_image_histogram(pipi_image_t *img, pipi_histogram_t*h, int flags) | |||||
if(!h) return -1; | if(!h) return -1; | ||||
data = (uint8_t *)pipi_getpixels(img, PIPI_PIXELS_RGBA_C)->pixels; | |||||
data = (uint8_t *)pipi_getpixels(img, PIPI_PIXELS_RGBA_C)->pixels; | |||||
for(i=0; i< img->w*img->h*4; i+=4) | for(i=0; i< img->w*img->h*4; i+=4) | ||||
{ | { | ||||
@@ -154,7 +154,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) | |||||
for(i = 0; i < ncolors; i++) | for(i = 0; i < ncolors; i++) | ||||
{ | { | ||||
double k1[3]; | double k1[3]; | ||||
double yk1; | |||||
double yk1; | |||||
k1[R] = pal[i][R] - p0[R]; | k1[R] = pal[i][R] - p0[R]; | ||||
k1[G] = pal[i][G] - p0[G]; | k1[G] = pal[i][G] - p0[G]; | ||||
k1[B] = pal[i][B] - p0[B]; | k1[B] = pal[i][B] - p0[B]; | ||||
@@ -170,7 +170,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) | |||||
double k2[3]; | double k2[3]; | ||||
double yk2, s; | double yk2, s; | ||||
if(i == j) | |||||
if(i == j) | |||||
continue; | continue; | ||||
k2[R] = pal[j][R] - p0[R]; | k2[R] = pal[j][R] - p0[R]; | ||||
@@ -249,7 +249,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) | |||||
/* Remove points not in the convex hull */ | /* Remove points not in the convex hull */ | ||||
for(i = 2; i < npts; /* */) | for(i = 2; i < npts; /* */) | ||||
{ | { | ||||
double k1, k2; | |||||
double k1, k2; | |||||
if(i < 2) | if(i < 2) | ||||
{ | { | ||||
@@ -285,7 +285,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) | |||||
double aby = pts[i - 1][Y] - pts[0][Y]; | double aby = pts[i - 1][Y] - pts[0][Y]; | ||||
double acx = pts[i][X] - pts[0][X]; | double acx = pts[i][X] - pts[0][X]; | ||||
double acy = pts[i][Y] - pts[0][Y]; | double acy = pts[i][Y] - pts[0][Y]; | ||||
double area; | |||||
double area; | |||||
double sqarea = (abx * abx + aby * aby) * (acx * acx + acy * acy) | double sqarea = (abx * abx + aby * aby) * (acx * acx + acy * acy) | ||||
- (abx * acx + aby * acy) * (abx * acx + aby * acy); | - (abx * acx + aby * acy) * (abx * acx + aby * acy); | ||||
if(sqarea <= 0.) | if(sqarea <= 0.) | ||||
@@ -358,9 +358,9 @@ pipi_image_t *pipi_reduce(pipi_image_t *src, | |||||
}; | }; | ||||
pipi_image_t *dst; | pipi_image_t *dst; | ||||
pipi_pixels_t *srcp, *dstp; | |||||
float *srcdata, *dstdata; | |||||
hull_t *rgbhull, *myhull; | |||||
pipi_pixels_t *srcp, *dstp; | |||||
float *srcdata, *dstdata; | |||||
hull_t *rgbhull, *myhull; | |||||
int i, j, w, h; | int i, j, w, h; | ||||
init_uv(); | init_uv(); | ||||
@@ -96,7 +96,7 @@ pipi_image_t *pipi_render_halftone(int w, int h) | |||||
for(y = 0; y < h; y++) | for(y = 0; y < h; y++) | ||||
for(x = 0; x < w; x++) | for(x = 0; x < w; x++) | ||||
{ | { | ||||
double dy = ((double)y + .07) / h - .5; | |||||
double dy = ((double)y + .07) / h - .5; | |||||
double dx = (double)x / w - .5; | double dx = (double)x / w - .5; | ||||
/* Using dx²+dy² here creates another interesting halftone. */ | /* Using dx²+dy² here creates another interesting halftone. */ | ||||
double r = - cos(M_PI * (dx - dy)) - cos(M_PI * (dx + dy)); | double r = - cos(M_PI * (dx - dy)) - cos(M_PI * (dx + dy)); | ||||