Package org.freedesktop.gstreamer.video
Class VideoScaler
java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.video.VideoScaler
- All Implemented Interfaces:
Proxy
GstVideoScaler is a utility object for rescaling and resampling
video frames using various interpolation / sampling methods.-
Constructor Summary
ConstructorsConstructorDescriptionVideoScaler(MemorySegment address) Create a VideoScaler proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid_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 insrcwithsrcStridetodestwithdestStrideusing the horizontal scalerhscalerand the vertical scalervscale.combinePackedYUV(VideoScaler uvScale, VideoFormat inFormat, VideoFormat outFormat) Combine a scaler for Y and UV into one scaler for the packedformat.voidfree()Free a previously allocatedGstVideoScalerscale.For a given pixel atoutOffset,get the first required input pixel atinOffsetand thenTapsfilter coefficients.intGet the maximum number of taps forscale.voidhorizontal(VideoFormat format, @Nullable MemorySegment src, @Nullable MemorySegment dest, int destOffset, int width) Horizontally scale the pixels insrctodest,starting fromdestOffsetforwidthsamples.static VideoScalernew_(VideoResamplerMethod method, Set<VideoScalerFlags> flags, int nTaps, int inSize, int outSize, @Nullable Structure options) Make a newmethodvideo scaler.static VideoScalernew_(VideoResamplerMethod method, VideoScalerFlags flags, int nTaps, int inSize, int outSize, @Nullable Structure options) Make a newmethodvideo scaler.voidvertical(VideoFormat format, @Nullable MemorySegment srcLines, @Nullable MemorySegment dest, int destOffset, int width) Vertically combinewidthpixels in the lines insrcLinestodest.destis the location of the target line atdestOffsetandsrcsare the input lines fordestOffset.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
VideoScaler
Create a VideoScaler proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
new_
public static VideoScaler new_(VideoResamplerMethod method, Set<VideoScalerFlags> flags, int nTaps, int inSize, int outSize, @Nullable Structure options) Make a newmethodvideo scaler.inSizesource lines/pixels will be scaled tooutSizedestination lines/pixels.nTapsspecifies 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 themethodandoutSize.- Parameters:
method- aGstVideoResamplerMethodflags-GstVideoScalerFlagsnTaps- number of taps to useinSize- number of source elementsoutSize- number of destination elementsoptions- 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 newmethodvideo scaler.inSizesource lines/pixels will be scaled tooutSizedestination lines/pixels.nTapsspecifies 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 themethodandoutSize.- Parameters:
method- aGstVideoResamplerMethodflags-GstVideoScalerFlagsnTaps- number of taps to useinSize- number of source elementsoutSize- number of destination elementsoptions- 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 insrcwithsrcStridetodestwithdestStrideusing the horizontal scalerhscalerand the vertical scalervscale.One or both of this VideoScaler and
vscalecan be NULL to only perform scaling in one dimension or do a copy without scaling.xandyare the coordinates in the destination image to process.- Parameters:
vscale- a verticalGstVideoScalerformat- aGstVideoFormatforsrcsanddestsrc- source pixelssrcStride- source pixels stridedest- destination pixelsdestStride- destination pixels stridex- the horizontal destination offsety- the vertical destination offsetwidth- the number of output pixels to scaleheight- 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 packedformat.- Parameters:
uvScale- a scaler for the U and V componentsinFormat- the input video formatoutFormat- the output video format- Returns:
- a new horizontal videoscaler for
format. - Since:
- 1.6
-
free
public void free()Free a previously allocatedGstVideoScalerscale. -
getCoeff
public MemorySegment getCoeff(int outOffset, @Nullable Out<Integer> inOffset, @Nullable Out<Integer> nTaps) For a given pixel atoutOffset,get the first required input pixel atinOffsetand thenTapsfilter coefficients.Note that for interlaced content,
inOffsetneeds to be incremented with 2 to get the next input line.- Parameters:
outOffset- an output offsetinOffset- result input offsetnTaps- result n_taps- Returns:
- an array of
nTapgdouble values with filter coefficients.
-
getMaxTaps
public int getMaxTaps()Get the maximum number of taps forscale.- 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 insrctodest,starting fromdestOffsetforwidthsamples.- Parameters:
format- aGstVideoFormatforsrcanddestsrc- source pixelsdest- destination pixelsdestOffset- the horizontal destination offsetwidth- the number of pixels to scale
-
vertical
public void vertical(VideoFormat format, @Nullable MemorySegment srcLines, @Nullable MemorySegment dest, int destOffset, int width) Vertically combinewidthpixels in the lines insrcLinestodest.destis the location of the target line atdestOffsetandsrcsare the input lines fordestOffset.- Parameters:
format- aGstVideoFormatforsrcsanddestsrcLines- source pixels linesdest- destination pixelsdestOffset- the vertical destination offsetwidth- the number of pixels to scale
-