mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-06 00:26:52 +08:00

* Draft implementation for SWS scale
* Update go.mod
* Revert "Update go.mod"
This reverts commit 760fb8c427
.
* Renaming to AllocSwsContext and remove ChangeResolution this should handled by users
* update example to use new name and remove ChangeResolution
* Follow scaling example from libav, update readme, improve sws
Change scaling example to an similar libav example
Update readme
Add func to UpdateScalingParameters
Rename AllocSwsContext to SwsGetContext
Using a type for scaling algos/flags
* Fix Errors in scale example
* Review Changes
Now using sws context flags
Restructer sws context and adding ned simpler methods to update the ctx
Update the example
Update the test
* Correctly handle error for buffer alloc in PrepareDestinationFrameForScaling
* Add more getter and setter for sws
Get/Set source w,h,pixfmt
Get/Set dst w,h,pixfmt
Get/Set sws flags
* Adding resolution get/set
* Use CachedContext when updating sws ctx
* Review changes
Reorder flags, and update them
# Update Example
Use renaming function to create sws context
Clean up
Use new framdata image funcs
# Sws scale context
New way to update the context
Use sws_scale_frame instead of sws_scale
Reordering funcs for get and set
# Sws sclate context flag
Add "Flag" for algo name
# Update sws test
* fix fmt error args bug
* Review Changes
Simpfy sws update
Use c.int for sws flags
update test
23 lines
1.1 KiB
Go
23 lines
1.1 KiB
Go
package astiav
|
|
|
|
//#cgo pkg-config: libswscale
|
|
//#include <libswscale/swscale.h>
|
|
import "C"
|
|
|
|
type SoftwareScaleContextFlag int
|
|
|
|
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libswscale/swscale.h#L59
|
|
const (
|
|
SoftwareScaleContextFlagArea = SoftwareScaleContextFlag(C.SWS_AREA)
|
|
SoftwareScaleContextFlagBicubic = SoftwareScaleContextFlag(C.SWS_BICUBIC)
|
|
SoftwareScaleContextFlagBicublin = SoftwareScaleContextFlag(C.SWS_BICUBLIN)
|
|
SoftwareScaleContextFlagBilinear = SoftwareScaleContextFlag(C.SWS_BILINEAR)
|
|
SoftwareScaleContextFlagFastBilinear = SoftwareScaleContextFlag(C.SWS_FAST_BILINEAR)
|
|
SoftwareScaleContextFlagGauss = SoftwareScaleContextFlag(C.SWS_GAUSS)
|
|
SoftwareScaleContextFlagLanczos = SoftwareScaleContextFlag(C.SWS_LANCZOS)
|
|
SoftwareScaleContextFlagPoint = SoftwareScaleContextFlag(C.SWS_POINT)
|
|
SoftwareScaleContextFlagSinc = SoftwareScaleContextFlag(C.SWS_SINC)
|
|
SoftwareScaleContextFlagSpline = SoftwareScaleContextFlag(C.SWS_SPLINE)
|
|
SoftwareScaleContextFlagX = SoftwareScaleContextFlag(C.SWS_X)
|
|
)
|