Class VideoScaler

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.video.VideoScaler
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class VideoScaler extends ProxyInstance
GstVideoScaler is a utility object for rescaling and resampling video frames using various interpolation / sampling methods.
  • Constructor Details

    • VideoScaler

      public VideoScaler(MemorySegment address)
      Create a VideoScaler proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • new_

      public static VideoScaler new_(VideoResamplerMethod method, Set<VideoScalerFlags> flags, int nTaps, int inSize, int outSize, @Nullable Structure options)

      Make a new method video scaler. inSize source lines/pixels will be scaled to outSize destination lines/pixels.

      nTaps specifies the amount of pixels to use from the source for one output pixel. If n_taps is 0, this function chooses a good value automatically based on the method and outSize.

      Parameters:
      method - a GstVideoResamplerMethod
      flags - GstVideoScalerFlags
      nTaps - number of taps to use
      inSize - number of source elements
      outSize - number of destination elements
      options - extra options
      Returns:
      a GstVideoScaler
    • new_

      public static VideoScaler new_(VideoResamplerMethod method, VideoScalerFlags flags, int nTaps, int inSize, int outSize, @Nullable Structure options)

      Make a new method video scaler. inSize source lines/pixels will be scaled to outSize destination lines/pixels.

      nTaps specifies the amount of pixels to use from the source for one output pixel. If n_taps is 0, this function chooses a good value automatically based on the method and outSize.

      Parameters:
      method - a GstVideoResamplerMethod
      flags - GstVideoScalerFlags
      nTaps - number of taps to use
      inSize - number of source elements
      outSize - number of destination elements
      options - extra options
      Returns:
      a GstVideoScaler
    • _2d

      public void _2d(VideoScaler vscale, VideoFormat format, @Nullable MemorySegment src, int srcStride, @Nullable MemorySegment dest, int destStride, int x, int y, int width, int height)

      Scale a rectangle of pixels in src with srcStride to dest with destStride using the horizontal scaler hscaler and the vertical scaler vscale.

      One or both of this VideoScaler and vscale can be NULL to only perform scaling in one dimension or do a copy without scaling.

      x and y are the coordinates in the destination image to process.

      Parameters:
      vscale - a vertical GstVideoScaler
      format - a GstVideoFormat for srcs and dest
      src - source pixels
      srcStride - source pixels stride
      dest - destination pixels
      destStride - destination pixels stride
      x - the horizontal destination offset
      y - the vertical destination offset
      width - the number of output pixels to scale
      height - the number of output lines to scale
    • combinePackedYUV

      public VideoScaler combinePackedYUV(VideoScaler uvScale, VideoFormat inFormat, VideoFormat outFormat)
      Combine a scaler for Y and UV into one scaler for the packed format.
      Parameters:
      uvScale - a scaler for the U and V components
      inFormat - the input video format
      outFormat - the output video format
      Returns:
      a new horizontal videoscaler for format.
      Since:
      1.6
    • free

      public void free()
      Free a previously allocated GstVideoScaler scale.
    • getCoeff

      public MemorySegment getCoeff(int outOffset, @Nullable Out<Integer> inOffset, @Nullable Out<Integer> nTaps)

      For a given pixel at outOffset, get the first required input pixel at inOffset and the nTaps filter coefficients.

      Note that for interlaced content, inOffset needs to be incremented with 2 to get the next input line.

      Parameters:
      outOffset - an output offset
      inOffset - result input offset
      nTaps - result n_taps
      Returns:
      an array of nTap gdouble values with filter coefficients.
    • getMaxTaps

      public int getMaxTaps()
      Get the maximum number of taps for scale.
      Returns:
      the maximum number of taps
    • horizontal

      public void horizontal(VideoFormat format, @Nullable MemorySegment src, @Nullable MemorySegment dest, int destOffset, int width)
      Horizontally scale the pixels in src to dest, starting from destOffset for width samples.
      Parameters:
      format - a GstVideoFormat for src and dest
      src - source pixels
      dest - destination pixels
      destOffset - the horizontal destination offset
      width - the number of pixels to scale
    • vertical

      public void vertical(VideoFormat format, @Nullable MemorySegment srcLines, @Nullable MemorySegment dest, int destOffset, int width)
      Vertically combine width pixels in the lines in srcLines to dest. dest is the location of the target line at destOffset and srcs are the input lines for destOffset.
      Parameters:
      format - a GstVideoFormat for srcs and dest
      srcLines - source pixels lines
      dest - destination pixels
      destOffset - the vertical destination offset
      width - the number of pixels to scale