SwscaleBindings to libswscale. The interface is the one of spec/swscale.md §4.
val version : Avutil.versionThe version of the libswscale loaded at run time, read once when the module is loaded.
type pixel_format = Avutil.Pixel_format.tA flag of a scaler; the flags of a list are combined. Fast_bilinear, Bilinear and Bicubic select the scaling algorithm. Print_info makes libswscale log its scaling parameters, through FFmpeg's logging.
A scaler bound to an input size and pixel format and an output size and pixel format. It scales on one thread and works on caller-supplied bigarrays, in place, with scale. It owns its native scaler, released when the value is collected.
val create :
flag list ->
int ->
int ->
pixel_format ->
int ->
int ->
pixel_format ->
tcreate flags in_width in_height in_format out_width out_height out_format creates a scaler. The arguments are, in order: the flags, the input width and height in pixels, the input pixel format, the output width and height in pixels and the output pixel format. Every other setting keeps FFmpeg's default.
The call releases the OCaml runtime lock while the scaler is initialised.
type planes = (Avutil.data * int) arrayThe buffers of an image: one (plane, line_size) pair per plane of the pixel format, in plane order. line_size is in bytes. A paletted format has its palette as one more buffer after the plane.
scale scaler src y h dst off scales a slice of the input image: the h rows that start at row y. src holds the planes of that slice and dst the planes the output is written to.
off is a number of rows: the output image starts at row off of the dst planes. For a plane with vertical chroma subsampling the row count is reduced accordingly.
libswscale reads src and writes dst in place; nothing is copied. The call releases the OCaml runtime lock and excludes every other operation on the scaler: a concurrent one raises Error (`Failure "Object in use!") at once. After a failure the scaler stays usable.
How a value of type 'a holds an image. Only the four data modules at the end of this interface provide values of this type.
module type VideoData = sig ... endA data type a scaler reads or writes: one of BigArray, PackedBigArray, Frame and Bytes. A program passes two of them to Make.
A scaler from images of type 'i to images of type 'o. It owns its native scaler, released when the value is collected, and keeps nothing of the values given to it or returned by it.
Scalers that read images of type I.t and return images of type O.t.
One (plane, line_size) pair per plane, the planes in bigarrays.
module PackedBigArray : VideoData with type t = Avutil.data array * int arrayThe planes in one array and their line sizes, in bytes, in a second array of the same length.
module Frame : VideoData with type t = Avutil.video Avutil.frameVideo frames.