feat(#3, #5): support image operations

This commit is contained in:
Tomas Aparicio 2015-03-30 02:41:16 +02:00
parent 63f4b01c8d
commit 61997bc68b
7 changed files with 107 additions and 53 deletions

23
vips.h
View file

@ -20,6 +20,13 @@ vips_jpegload_buffer_seq(void *buf, size_t len, VipsImage **out)
return vips_jpegload_buffer(buf, len, out, "access", VIPS_ACCESS_SEQUENTIAL, NULL);
};
VipsImage*
vips_image_buffer_seq(void *buf, size_t len)
{
// todo: handle postclose callback
return vips_image_new_from_buffer(buf, len, "access", VIPS_ACCESS_SEQUENTIAL, NULL);
};
int
vips_jpegload_buffer_shrink(void *buf, size_t len, VipsImage **out, int shrink)
{
@ -32,6 +39,12 @@ vips_webpload_buffer_seq(void *buf, size_t len, VipsImage **out)
return vips_webpload_buffer(buf, len, out, "access", VIPS_ACCESS_SEQUENTIAL, NULL);
};
int
vips_flip_seq(VipsImage *in, VipsImage **out)
{
return vips_flip(in, out, VIPS_DIRECTION_HORIZONTAL, NULL);
};
int
vips_pngload_buffer_seq(void *buf, size_t len, VipsImage **out)
{
@ -48,7 +61,7 @@ int
vips_copy_0(VipsImage *in, VipsImage **out)
{
return vips_copy(in, out, NULL);
}
};
int
vips_rotate(VipsImage *in, VipsImage **buf, int angle)
@ -64,13 +77,13 @@ vips_rotate(VipsImage *in, VipsImage **buf, int angle)
}
return vips_rot(in, buf, rotate, NULL);
}
};
int
vips_embed_extend(VipsImage *in, VipsImage **out, int left, int top, int width, int height, int extend)
{
return vips_embed(in, out, left, top, width, height, "extend", extend, NULL);
}
};
int
vips_colourspace_0(VipsImage *in, VipsImage **out, VipsInterpretation space)
@ -82,10 +95,10 @@ int
vips_extract_area_0(VipsImage *in, VipsImage **out, int left, int top, int width, int height)
{
return vips_extract_area(in, out, left, top, width, height, NULL);
}
};
int
vips_jpegsave_custom(VipsImage *in, void **buf, size_t *len, int strip, int quality, int interlace)
{
return vips_jpegsave_buffer(in, buf, len, "strip", strip, "Q", quality, "optimize_coding", TRUE, "interlace", interlace, NULL);
}
};