Resample
Resize and resampling operations.
Function Mapping
| libvips C | Dart Binding | Pipeline Method | PipelineSpec |
|---|---|---|---|
vips_resize() | apiBindings.resize() | pipeline.resize() | spec.resize() |
vips_thumbnail() | apiBindings.thumbnail() | - | - |
vips_thumbnail_image() | apiBindings.thumbnailImage() | pipeline.thumbnail() | spec.thumbnail() |
vips_thumbnail_buffer() | apiBindings.thumbnailBuffer() | - | - |
vips_reduce() | apiBindings.reduce() | pipeline.reduce() | spec.reduce() |
vips_shrink() | apiBindings.shrink() | pipeline.shrink() | spec.shrink() |
vips_rotate() | apiBindings.rotate() | pipeline.rotate() | spec.rotate() |
vips_affine() | resampleBindings.affine() | - | - |
vips_similarity() | resampleBindings.similarity() | - | - |
vips_mapim() | resampleBindings.mapim() | - | - |
vips_quadratic() | resampleBindings.quadratic() | - | - |
resize
Resize an image by scale factor.
C API
int vips_resize(VipsImage *in, VipsImage **out, double scale, ...);
Dart Binding
int resize(
Pointer<VipsImage> in1,
Pointer<Pointer<VipsImage>> out,
double scale,
);
Pipeline API
// By scale factor (0.5 = 50% size, 2.0 = double size)
pipeline.resize(0.5)
thumbnail_image
Create a thumbnail with smart cropping.
C API
int vips_thumbnail_image(VipsImage *in, VipsImage **out, int width, ...);
Dart Binding
int thumbnailImage(
Pointer<VipsImage> in1,
Pointer<Pointer<VipsImage>> out,
int width,
);
Pipeline API
// Create thumbnail with target width
pipeline.thumbnail(200)
rotate
Rotate an image by any angle.
C API
int vips_rotate(VipsImage *in, VipsImage **out, double angle, ...);
Dart Binding
int rotate(
Pointer<VipsImage> in1,
Pointer<Pointer<VipsImage>> out,
double angle,
);
Pipeline API
// Rotate by angle in degrees (positive = counter-clockwise)
pipeline.rotate(45)
reduce
Reduce an image by shrink factors.
C API
int vips_reduce(VipsImage *in, VipsImage **out, double hshrink, double vshrink, ...);
Dart Binding
int reduce(
Pointer<VipsImage> in1,
Pointer<Pointer<VipsImage>> out,
double hshrink,
double vshrink,
);
shrink
Shrink an image (fast, lower quality).
C API
int vips_shrink(VipsImage *in, VipsImage **out, double hshrink, double vshrink, ...);
Dart Binding
int shrink(
Pointer<VipsImage> in1,
Pointer<Pointer<VipsImage>> out,
double hshrink,
double vshrink,
);