Package org.freedesktop.gstreamer.video
Class VideoScaler
java.lang.Object
io.github.jwharm.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
ConstructorDescriptionVideoScaler
(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 insrc
withsrcStride
todest
withdestStride
using the horizontal scalerhscaler
and the vertical scalervscale
.combinePackedYUV
(VideoScaler uvScale, VideoFormat inFormat, VideoFormat outFormat) Combine a scaler for Y and UV into one scaler for the packedformat
.void
free()
Free a previously allocatedGstVideoScaler
this VideoScaler.For a given pixel atoutOffset
, get the first required input pixel atinOffset
and thenTaps
filter coefficients.int
Get the maximum number of taps for this VideoScaler.void
horizontal
(VideoFormat format, @Nullable MemorySegment src, @Nullable MemorySegment dest, int destOffset, int width) Horizontally scale the pixels insrc
todest
, starting fromdestOffset
forwidth
samples.static VideoScaler
new_
(VideoResamplerMethod method, Set<VideoScalerFlags> flags, int nTaps, int inSize, int outSize, @Nullable Structure options) Make a newmethod
video scaler.static VideoScaler
new_
(VideoResamplerMethod method, VideoScalerFlags flags, int nTaps, int inSize, int outSize, @Nullable Structure options) Make a newmethod
video scaler.void
vertical
(VideoFormat format, @Nullable MemorySegment srcLines, @Nullable MemorySegment dest, int destOffset, int width) Vertically combinewidth
pixels in the lines insrcLines
todest
.Methods inherited from class io.github.jwharm.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 @Nullable Structure options) Make a newmethod
video scaler.inSize
source lines/pixels will be scaled tooutSize
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 themethod
andinSize
/outSize
.- Parameters:
method
- aGstVideoResamplerMethod
flags
-GstVideoScalerFlags
nTaps
- 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 @Nullable Structure options) Make a newmethod
video scaler.inSize
source lines/pixels will be scaled tooutSize
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 themethod
andinSize
/outSize
.- Parameters:
method
- aGstVideoResamplerMethod
flags
-GstVideoScalerFlags
nTaps
- 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 @Nullable MemorySegment src, int srcStride, @Nullable @Nullable MemorySegment dest, int destStride, int x, int y, int width, int height) Scale a rectangle of pixels insrc
withsrcStride
todest
withdestStride
using the horizontal scalerhscaler
and the vertical scalervscale
.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
andy
are the coordinates in the destination image to process.- Parameters:
vscale
- a verticalGstVideoScaler
format
- aGstVideoFormat
forsrcs
anddest
src
- 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
.
-
free
public void free()Free a previously allocatedGstVideoScaler
this VideoScaler. -
getCoeff
public MemorySegment getCoeff(int outOffset, @Nullable @Nullable Out<Integer> inOffset, @Nullable @Nullable Out<Integer> nTaps) For a given pixel atoutOffset
, get the first required input pixel atinOffset
and thenTaps
filter coefficients.Note that for interlaced content,
inOffset
needs 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
nTap
gdouble values with filter coefficients.
-
getMaxTaps
public int getMaxTaps()Get the maximum number of taps for this VideoScaler.- Returns:
- the maximum number of taps
-
horizontal
public void horizontal(VideoFormat format, @Nullable @Nullable MemorySegment src, @Nullable @Nullable MemorySegment dest, int destOffset, int width) Horizontally scale the pixels insrc
todest
, starting fromdestOffset
forwidth
samples.- Parameters:
format
- aGstVideoFormat
forsrc
anddest
src
- source pixelsdest
- destination pixelsdestOffset
- the horizontal destination offsetwidth
- the number of pixels to scale
-
vertical
public void vertical(VideoFormat format, @Nullable @Nullable MemorySegment srcLines, @Nullable @Nullable MemorySegment dest, int destOffset, int width) Vertically combinewidth
pixels in the lines insrcLines
todest
.dest
is the location of the target line atdestOffset
andsrcs
are the input lines fordestOffset
.- Parameters:
format
- aGstVideoFormat
forsrcs
anddest
srcLines
- source pixels linesdest
- destination pixelsdestOffset
- the vertical destination offsetwidth
- the number of pixels to scale
-