image_ffmpeg_scale_rgba function

  1. @Native<Int32 Function(Pointer<Uint8>, Uint32, Uint32, Uint32, Uint32, Uint32, Uint32, Uint32, Uint32, Uint32, Uint32, Uint32, Pointer<image_ffmpeg_image>)>(ffi.Pointer<ffi.Uint8>, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Uint32, ffi.Pointer<image_ffmpeg_image>)>()
int image_ffmpeg_scale_rgba(
  1. Pointer<Uint8> rgba,
  2. int rgba_length,
  3. int width,
  4. int height,
  5. int stride,
  6. int crop_x,
  7. int crop_y,
  8. int crop_width,
  9. int crop_height,
  10. int output_width,
  11. int output_height,
  12. int filter,
  13. Pointer<image_ffmpeg_image> output,
)

Crops RGBA8888 pixels, then scales the crop to exactly output_width x output_height with the filter, an image_ffmpeg_scale_filter. A zero crop width and height use the whole image. The output may be larger or smaller than the crop, and its aspect ratio may differ. Alpha is not premultiplied: the colors of transparent pixels can bleed into their neighbors.

Implementation

@ffi.Native<
  ffi.Int32 Function(
    ffi.Pointer<ffi.Uint8>,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Uint32,
    ffi.Pointer<image_ffmpeg_image>,
  )
>()
external int image_ffmpeg_scale_rgba(
  ffi.Pointer<ffi.Uint8> rgba,
  int rgba_length,
  int width,
  int height,
  int stride,
  int crop_x,
  int crop_y,
  int crop_width,
  int crop_height,
  int output_width,
  int output_height,
  int filter,
  ffi.Pointer<image_ffmpeg_image> output,
);