#ifndef __AVISYNTH_6_H__
#define __AVISYNTH_6_H__
#include <avs/config.h>
#include <avs/capi.h>
#include <avs/types.h>
enum { AVISYNTH_INTERFACE_VERSION = 6 };
#ifdef _MSC_VER
#pragma hdrstop
#endif
#ifdef _MSC_VER
#include <crtdbg.h>
#else
#undef _RPT0
#undef _RPT1
#undef _RPT2
#undef _RPT3
#undef _RPT4
#undef _RPT5
#define _RPT0(a,b) ((void)0)
#define _RPT1(a,b,c) ((void)0)
#define _RPT2(a,b,c,d) ((void)0)
#define _RPT3(a,b,c,d,e) ((void)0)
#define _RPT4(a,b,c,d,e,f) ((void)0)
#define _RPT5(a,b,c,d,e,f,g) ((void)0)
#include <cassert>
#undef _ASSERTE
#undef _ASSERT
#define _ASSERTE(x) assert(x)
#define _ASSERT(x) assert(x)
#endif
#pragma pack(push,8)
enum {SAMPLE_INT8 = 1<<0,
SAMPLE_INT16 = 1<<1,
SAMPLE_INT24 = 1<<2, SAMPLE_INT32 = 1<<3,
SAMPLE_FLOAT = 1<<4};
enum {
PLANAR_Y=1<<0,
PLANAR_U=1<<1,
PLANAR_V=1<<2,
PLANAR_ALIGNED=1<<3,
PLANAR_Y_ALIGNED=PLANAR_Y|PLANAR_ALIGNED,
PLANAR_U_ALIGNED=PLANAR_U|PLANAR_ALIGNED,
PLANAR_V_ALIGNED=PLANAR_V|PLANAR_ALIGNED,
PLANAR_A=1<<4,
PLANAR_R=1<<5,
PLANAR_G=1<<6,
PLANAR_B=1<<7,
PLANAR_A_ALIGNED=PLANAR_A|PLANAR_ALIGNED,
PLANAR_R_ALIGNED=PLANAR_R|PLANAR_ALIGNED,
PLANAR_G_ALIGNED=PLANAR_G|PLANAR_ALIGNED,
PLANAR_B_ALIGNED=PLANAR_B|PLANAR_ALIGNED,
};
class AvisynthError {
public:
const char* const msg;
AvisynthError(const char* _msg) : msg(_msg) {}
private:
AvisynthError& operator=(const AvisynthError&);
};
#if defined(MSVC)
#define SINGLE_INHERITANCE __single_inheritance
#else
#define SINGLE_INHERITANCE
#endif
struct SINGLE_INHERITANCE VideoInfo;
class SINGLE_INHERITANCE VideoFrameBuffer;
class SINGLE_INHERITANCE VideoFrame;
class IClip;
class SINGLE_INHERITANCE PClip;
class SINGLE_INHERITANCE PVideoFrame;
class IScriptEnvironment;
class SINGLE_INHERITANCE AVSValue;
struct AVS_Linkage {
int Size;
bool (VideoInfo::*HasVideo)() const;
bool (VideoInfo::*HasAudio)() const;
bool (VideoInfo::*IsRGB)() const;
bool (VideoInfo::*IsRGB24)() const;
bool (VideoInfo::*IsRGB32)() const;
bool (VideoInfo::*IsYUV)() const;
bool (VideoInfo::*IsYUY2)() const;
bool (VideoInfo::*IsYV24)() const;
bool (VideoInfo::*IsYV16)() const;
bool (VideoInfo::*IsYV12)() const;
bool (VideoInfo::*IsYV411)() const;
bool (VideoInfo::*IsY8)() const;
bool (VideoInfo::*IsColorSpace)(int c_space) const;
bool (VideoInfo::*Is)(int property) const;
bool (VideoInfo::*IsPlanar)() const;
bool (VideoInfo::*IsFieldBased)() const;
bool (VideoInfo::*IsParityKnown)() const;
bool (VideoInfo::*IsBFF)() const;
bool (VideoInfo::*IsTFF)() const;
bool (VideoInfo::*IsVPlaneFirst)() const;
int (VideoInfo::*BytesFromPixels)(int pixels) const;
int (VideoInfo::*RowSize)(int plane) const;
int (VideoInfo::*BMPSize)() const;
__int64 (VideoInfo::*AudioSamplesFromFrames)(int frames) const;
int (VideoInfo::*FramesFromAudioSamples)(__int64 samples) const;
__int64 (VideoInfo::*AudioSamplesFromBytes)(__int64 bytes) const;
__int64 (VideoInfo::*BytesFromAudioSamples)(__int64 samples) const;
int (VideoInfo::*AudioChannels)() const;
int (VideoInfo::*SampleType)() const;
bool (VideoInfo::*IsSampleType)(int testtype) const;
int (VideoInfo::*SamplesPerSecond)() const;
int (VideoInfo::*BytesPerAudioSample)() const;
void (VideoInfo::*SetFieldBased)(bool isfieldbased);
void (VideoInfo::*Set)(int property);
void (VideoInfo::*Clear)(int property);
int (VideoInfo::*GetPlaneWidthSubsampling)(int plane) const;
int (VideoInfo::*GetPlaneHeightSubsampling)(int plane) const;
int (VideoInfo::*BitsPerPixel)() const;
int (VideoInfo::*BytesPerChannelSample)() const;
void (VideoInfo::*SetFPS)(unsigned numerator, unsigned denominator);
void (VideoInfo::*MulDivFPS)(unsigned multiplier, unsigned divisor);
bool (VideoInfo::*IsSameColorspace)(const VideoInfo& vi) const;
const BYTE* (VideoFrameBuffer::*VFBGetReadPtr)() const;
BYTE* (VideoFrameBuffer::*VFBGetWritePtr)();
int (VideoFrameBuffer::*GetDataSize)() const;
int (VideoFrameBuffer::*GetSequenceNumber)() const;
int (VideoFrameBuffer::*GetRefcount)() const;
int (VideoFrame::*GetPitch)(int plane) const;
int (VideoFrame::*GetRowSize)(int plane) const;
int (VideoFrame::*GetHeight)(int plane) const;
VideoFrameBuffer* (VideoFrame::*GetFrameBuffer)() const;
size_t (VideoFrame::*GetOffset)(int plane) const;
const BYTE* (VideoFrame::*VFGetReadPtr)(int plane) const;
bool (VideoFrame::*IsWritable)() const;
BYTE* (VideoFrame::*VFGetWritePtr)(int plane) const;
void (VideoFrame::*VideoFrame_DESTRUCTOR)();
void (PClip::*PClip_CONSTRUCTOR0)();
void (PClip::*PClip_CONSTRUCTOR1)(const PClip& x);
void (PClip::*PClip_CONSTRUCTOR2)(IClip* x);
void (PClip::*PClip_OPERATOR_ASSIGN0)(IClip* x);
void (PClip::*PClip_OPERATOR_ASSIGN1)(const PClip& x);
void (PClip::*PClip_DESTRUCTOR)();
void (PVideoFrame::*PVideoFrame_CONSTRUCTOR0)();
void (PVideoFrame::*PVideoFrame_CONSTRUCTOR1)(const PVideoFrame& x);
void (PVideoFrame::*PVideoFrame_CONSTRUCTOR2)(VideoFrame* x);
void (PVideoFrame::*PVideoFrame_OPERATOR_ASSIGN0)(VideoFrame* x);
void (PVideoFrame::*PVideoFrame_OPERATOR_ASSIGN1)(const PVideoFrame& x);
void (PVideoFrame::*PVideoFrame_DESTRUCTOR)();
void (AVSValue::*AVSValue_CONSTRUCTOR0)();
void (AVSValue::*AVSValue_CONSTRUCTOR1)(IClip* c);
void (AVSValue::*AVSValue_CONSTRUCTOR2)(const PClip& c);
void (AVSValue::*AVSValue_CONSTRUCTOR3)(bool b);
void (AVSValue::*AVSValue_CONSTRUCTOR4)(int i);
void (AVSValue::*AVSValue_CONSTRUCTOR5)(float f);
void (AVSValue::*AVSValue_CONSTRUCTOR6)(double f);
void (AVSValue::*AVSValue_CONSTRUCTOR7)(const char* s);
void (AVSValue::*AVSValue_CONSTRUCTOR8)(const AVSValue* a, int size);
void (AVSValue::*AVSValue_CONSTRUCTOR9)(const AVSValue& v);
void (AVSValue::*AVSValue_DESTRUCTOR)();
AVSValue& (AVSValue::*AVSValue_OPERATOR_ASSIGN)(const AVSValue& v);
const AVSValue& (AVSValue::*AVSValue_OPERATOR_INDEX)(int index) const;
bool (AVSValue::*Defined)() const;
bool (AVSValue::*IsClip)() const;
bool (AVSValue::*IsBool)() const;
bool (AVSValue::*IsInt)() const;
bool (AVSValue::*IsFloat)() const;
bool (AVSValue::*IsString)() const;
bool (AVSValue::*IsArray)() const;
PClip (AVSValue::*AsClip)() const;
bool (AVSValue::*AsBool1)() const;
int (AVSValue::*AsInt1)() const;
const char* (AVSValue::*AsString1)() const;
double (AVSValue::*AsFloat1)() const;
bool (AVSValue::*AsBool2)(bool def) const;
int (AVSValue::*AsInt2)(int def) const;
double (AVSValue::*AsDblDef)(double def) const;
double (AVSValue::*AsFloat2)(float def) const;
const char* (AVSValue::*AsString2)(const char* def) const;
int (AVSValue::*ArraySize)() const;
void (VideoInfo::*reserved[32])();
int (VideoInfo::*NumComponents)() const;
int (VideoInfo::*ComponentSize)() const;
int (VideoInfo::*BitsPerComponent)() const;
bool (VideoInfo::*Is444)() const;
bool (VideoInfo::*Is422)() const;
bool (VideoInfo::*Is420)() const;
bool (VideoInfo::*IsY)() const;
bool (VideoInfo::*IsRGB48)() const;
bool (VideoInfo::*IsRGB64)() const;
bool (VideoInfo::*IsYUVA)() const;
bool (VideoInfo::*IsPlanarRGB)() const;
bool (VideoInfo::*IsPlanarRGBA)() const;
};
#ifdef BUILDING_AVSCORE
# define AVS_BakedCode(arg) ;
# define AVS_LinkCall(arg)
# define AVS_LinkCallV(arg)
# define AVS_LinkCallOpt(arg, argOpt) AVSLinkCall(arg)
# define AVS_LinkCallOptDefault(arg, argDefaultValue) AVSLinkCall(arg())
# define CALL_MEMBER_FN(object,ptrToMember)
#else
# ifdef AVS_LINKAGE_DLLIMPORT
extern __declspec(dllimport) const AVS_Linkage* const AVS_linkage;
# else
extern const AVS_Linkage* AVS_linkage;
# endif
# ifndef offsetof
# include <stddef.h>
# endif
# define AVS_BakedCode(arg) { arg ; }
# define AVS_LinkCall(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? 0 : (this->*(AVS_linkage->arg))
# define AVS_LinkCallV(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? *this : (this->*(AVS_linkage->arg))
#define CALL_MEMBER_FN(object,ptrToMember) ((object)->*(ptrToMember))
#define AVS_LinkCallOpt(arg, argOpt) !AVS_linkage ? 0 : \
( offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? \
(offsetof(AVS_Linkage, argOpt) >= AVS_linkage->Size ? 0 : CALL_MEMBER_FN(this, AVS_linkage->argOpt)() ) : \
CALL_MEMBER_FN(this, AVS_linkage->arg)() )
# define AVS_LinkCallOptDefault(arg, argDefaultValue) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? (argDefaultValue) : ((this->*(AVS_linkage->arg))())
#endif
struct VideoInfo {
int width, height; unsigned fps_numerator, fps_denominator;
int num_frames;
enum {
CS_YUVA = 1<<27,
CS_BGR = 1<<28,
CS_YUV = 1<<29,
CS_INTERLEAVED = 1<<30,
CS_PLANAR = 1<<31,
CS_Shift_Sub_Width = 0,
CS_Shift_Sub_Height = 8,
CS_Shift_Sample_Bits = 16,
CS_Sub_Width_Mask = 7 << CS_Shift_Sub_Width,
CS_Sub_Width_1 = 3 << CS_Shift_Sub_Width, CS_Sub_Width_2 = 0 << CS_Shift_Sub_Width, CS_Sub_Width_4 = 1 << CS_Shift_Sub_Width,
CS_VPlaneFirst = 1 << 3, CS_UPlaneFirst = 1 << 4,
CS_Sub_Height_Mask = 7 << CS_Shift_Sub_Height,
CS_Sub_Height_1 = 3 << CS_Shift_Sub_Height, CS_Sub_Height_2 = 0 << CS_Shift_Sub_Height, CS_Sub_Height_4 = 1 << CS_Shift_Sub_Height,
CS_Sample_Bits_Mask = 7 << CS_Shift_Sample_Bits,
CS_Sample_Bits_8 = 0 << CS_Shift_Sample_Bits,
CS_Sample_Bits_10 = 5 << CS_Shift_Sample_Bits,
CS_Sample_Bits_12 = 6 << CS_Shift_Sample_Bits,
CS_Sample_Bits_14 = 7 << CS_Shift_Sample_Bits,
CS_Sample_Bits_16 = 1 << CS_Shift_Sample_Bits,
CS_Sample_Bits_32 = 2 << CS_Shift_Sample_Bits,
CS_PLANAR_MASK = CS_PLANAR | CS_INTERLEAVED | CS_YUV | CS_BGR | CS_YUVA | CS_Sample_Bits_Mask
| CS_Sub_Height_Mask | CS_Sub_Width_Mask,
CS_PLANAR_FILTER = ~( CS_VPlaneFirst | CS_UPlaneFirst ),
CS_RGB_TYPE = 1 << 0,
CS_RGBA_TYPE = 1 << 1,
CS_UNKNOWN = 0,
CS_BGR24 = CS_RGB_TYPE | CS_BGR | CS_INTERLEAVED,
CS_BGR32 = CS_RGBA_TYPE | CS_BGR | CS_INTERLEAVED,
CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED,
CS_RAW32 = 1<<5 | CS_INTERLEAVED,
CS_GENERIC_YUV420 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, CS_GENERIC_YUV422 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, CS_GENERIC_YUV444 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, CS_GENERIC_Y = CS_PLANAR | CS_INTERLEAVED | CS_YUV, CS_GENERIC_RGBP = CS_PLANAR | CS_BGR | CS_RGB_TYPE, CS_GENERIC_RGBAP = CS_PLANAR | CS_BGR | CS_RGBA_TYPE, CS_GENERIC_YUVA420 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, CS_GENERIC_YUVA422 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, CS_GENERIC_YUVA444 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1,
CS_YV24 = CS_GENERIC_YUV444 | CS_Sample_Bits_8, CS_YV16 = CS_GENERIC_YUV422 | CS_Sample_Bits_8, CS_YV12 = CS_GENERIC_YUV420 | CS_Sample_Bits_8, CS_I420 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_UPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, CS_IYUV = CS_I420,
CS_YUV9 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_4 | CS_Sub_Width_4, CS_YV411 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_4,
CS_Y8 = CS_GENERIC_Y | CS_Sample_Bits_8,
CS_YUV444P10 = CS_GENERIC_YUV444 | CS_Sample_Bits_10, CS_YUV422P10 = CS_GENERIC_YUV422 | CS_Sample_Bits_10, CS_YUV420P10 = CS_GENERIC_YUV420 | CS_Sample_Bits_10, CS_Y10 = CS_GENERIC_Y | CS_Sample_Bits_10,
CS_YUV444P12 = CS_GENERIC_YUV444 | CS_Sample_Bits_12, CS_YUV422P12 = CS_GENERIC_YUV422 | CS_Sample_Bits_12, CS_YUV420P12 = CS_GENERIC_YUV420 | CS_Sample_Bits_12, CS_Y12 = CS_GENERIC_Y | CS_Sample_Bits_12,
CS_YUV444P14 = CS_GENERIC_YUV444 | CS_Sample_Bits_14, CS_YUV422P14 = CS_GENERIC_YUV422 | CS_Sample_Bits_14, CS_YUV420P14 = CS_GENERIC_YUV420 | CS_Sample_Bits_14, CS_Y14 = CS_GENERIC_Y | CS_Sample_Bits_14,
CS_YUV444P16 = CS_GENERIC_YUV444 | CS_Sample_Bits_16, CS_YUV422P16 = CS_GENERIC_YUV422 | CS_Sample_Bits_16, CS_YUV420P16 = CS_GENERIC_YUV420 | CS_Sample_Bits_16, CS_Y16 = CS_GENERIC_Y | CS_Sample_Bits_16,
CS_YUV444PS = CS_GENERIC_YUV444 | CS_Sample_Bits_32, CS_YUV422PS = CS_GENERIC_YUV422 | CS_Sample_Bits_32, CS_YUV420PS = CS_GENERIC_YUV420 | CS_Sample_Bits_32, CS_Y32 = CS_GENERIC_Y | CS_Sample_Bits_32,
CS_BGR48 = CS_RGB_TYPE | CS_BGR | CS_INTERLEAVED | CS_Sample_Bits_16, CS_BGR64 = CS_RGBA_TYPE | CS_BGR | CS_INTERLEAVED | CS_Sample_Bits_16,
CS_RGBP = CS_GENERIC_RGBP | CS_Sample_Bits_8, CS_RGBP10 = CS_GENERIC_RGBP | CS_Sample_Bits_10, CS_RGBP12 = CS_GENERIC_RGBP | CS_Sample_Bits_12, CS_RGBP14 = CS_GENERIC_RGBP | CS_Sample_Bits_14, CS_RGBP16 = CS_GENERIC_RGBP | CS_Sample_Bits_16, CS_RGBPS = CS_GENERIC_RGBP | CS_Sample_Bits_32,
CS_RGBAP = CS_GENERIC_RGBAP | CS_Sample_Bits_8, CS_RGBAP10 = CS_GENERIC_RGBAP | CS_Sample_Bits_10, CS_RGBAP12 = CS_GENERIC_RGBAP | CS_Sample_Bits_12, CS_RGBAP14 = CS_GENERIC_RGBAP | CS_Sample_Bits_14, CS_RGBAP16 = CS_GENERIC_RGBAP | CS_Sample_Bits_16, CS_RGBAPS = CS_GENERIC_RGBAP | CS_Sample_Bits_32,
CS_YUVA444 = CS_GENERIC_YUVA444 | CS_Sample_Bits_8, CS_YUVA422 = CS_GENERIC_YUVA422 | CS_Sample_Bits_8, CS_YUVA420 = CS_GENERIC_YUVA420 | CS_Sample_Bits_8,
CS_YUVA444P10 = CS_GENERIC_YUVA444 | CS_Sample_Bits_10, CS_YUVA422P10 = CS_GENERIC_YUVA422 | CS_Sample_Bits_10, CS_YUVA420P10 = CS_GENERIC_YUVA420 | CS_Sample_Bits_10,
CS_YUVA444P12 = CS_GENERIC_YUVA444 | CS_Sample_Bits_12, CS_YUVA422P12 = CS_GENERIC_YUVA422 | CS_Sample_Bits_12, CS_YUVA420P12 = CS_GENERIC_YUVA420 | CS_Sample_Bits_12,
CS_YUVA444P14 = CS_GENERIC_YUVA444 | CS_Sample_Bits_14, CS_YUVA422P14 = CS_GENERIC_YUVA422 | CS_Sample_Bits_14, CS_YUVA420P14 = CS_GENERIC_YUVA420 | CS_Sample_Bits_14,
CS_YUVA444P16 = CS_GENERIC_YUVA444 | CS_Sample_Bits_16, CS_YUVA422P16 = CS_GENERIC_YUVA422 | CS_Sample_Bits_16, CS_YUVA420P16 = CS_GENERIC_YUVA420 | CS_Sample_Bits_16,
CS_YUVA444PS = CS_GENERIC_YUVA444 | CS_Sample_Bits_32, CS_YUVA422PS = CS_GENERIC_YUVA422 | CS_Sample_Bits_32, CS_YUVA420PS = CS_GENERIC_YUVA420 | CS_Sample_Bits_32,
};
int pixel_type;
int audio_samples_per_second; int sample_type; __int64 num_audio_samples; int nchannels;
int image_type;
enum {
IT_BFF = 1<<0,
IT_TFF = 1<<1,
IT_FIELDBASED = 1<<2
};
enum {
CS_UNKNOWN_CHROMA_PLACEMENT = 0 << 20,
CS_MPEG1_CHROMA_PLACEMENT = 1 << 20,
CS_MPEG2_CHROMA_PLACEMENT = 2 << 20,
CS_YUY2_CHROMA_PLACEMENT = 3 << 20,
CS_TOPLEFT_CHROMA_PLACEMENT = 4 << 20
};
bool HasVideo() const AVS_BakedCode(return AVS_LinkCall(HasVideo)())
bool HasAudio() const AVS_BakedCode(return AVS_LinkCall(HasAudio)())
bool IsRGB() const AVS_BakedCode(return AVS_LinkCall(IsRGB)())
bool IsRGB24() const AVS_BakedCode(return AVS_LinkCall(IsRGB24)())
bool IsRGB32() const AVS_BakedCode(return AVS_LinkCall(IsRGB32)())
bool IsYUV() const AVS_BakedCode(return AVS_LinkCall(IsYUV)())
bool IsYUY2() const AVS_BakedCode(return AVS_LinkCall(IsYUY2)())
bool IsYV24() const AVS_BakedCode(return AVS_LinkCall(IsYV24)())
bool IsYV16() const AVS_BakedCode(return AVS_LinkCall(IsYV16)())
bool IsYV12() const AVS_BakedCode(return AVS_LinkCall(IsYV12)())
bool IsYV411() const AVS_BakedCode(return AVS_LinkCall(IsYV411)())
bool IsY8() const AVS_BakedCode(return AVS_LinkCall(IsY8)())
bool IsColorSpace(int c_space) const AVS_BakedCode(return AVS_LinkCall(IsColorSpace)(c_space))
bool Is(int property) const AVS_BakedCode(return AVS_LinkCall(Is)(property))
bool IsPlanar() const AVS_BakedCode(return AVS_LinkCall(IsPlanar)())
bool IsFieldBased() const AVS_BakedCode(return AVS_LinkCall(IsFieldBased)())
bool IsParityKnown() const AVS_BakedCode(return AVS_LinkCall(IsParityKnown)())
bool IsBFF() const AVS_BakedCode(return AVS_LinkCall(IsBFF)())
bool IsTFF() const AVS_BakedCode(return AVS_LinkCall(IsTFF)())
bool IsVPlaneFirst() const AVS_BakedCode(return AVS_LinkCall(IsVPlaneFirst)()) int BytesFromPixels(int pixels) const AVS_BakedCode(return AVS_LinkCall(BytesFromPixels)(pixels))
int RowSize(int plane = 0) const AVS_BakedCode(return AVS_LinkCall(RowSize)(plane))
int BMPSize() const AVS_BakedCode(return AVS_LinkCall(BMPSize)())
__int64 AudioSamplesFromFrames(int frames) const AVS_BakedCode(return AVS_LinkCall(AudioSamplesFromFrames)(frames))
int FramesFromAudioSamples(__int64 samples) const AVS_BakedCode(return AVS_LinkCall(FramesFromAudioSamples)(samples))
__int64 AudioSamplesFromBytes(__int64 bytes) const AVS_BakedCode(return AVS_LinkCall(AudioSamplesFromBytes)(bytes))
__int64 BytesFromAudioSamples(__int64 samples) const AVS_BakedCode(return AVS_LinkCall(BytesFromAudioSamples)(samples))
int AudioChannels() const AVS_BakedCode(return AVS_LinkCall(AudioChannels)())
int SampleType() const AVS_BakedCode(return AVS_LinkCall(SampleType)())
bool IsSampleType(int testtype) const AVS_BakedCode(return AVS_LinkCall(IsSampleType)(testtype))
int SamplesPerSecond() const AVS_BakedCode(return AVS_LinkCall(SamplesPerSecond)())
int BytesPerAudioSample() const AVS_BakedCode(return AVS_LinkCall(BytesPerAudioSample)())
void SetFieldBased(bool isfieldbased) AVS_BakedCode(AVS_LinkCall(SetFieldBased)(isfieldbased))
void Set(int property) AVS_BakedCode(AVS_LinkCall(Set)(property))
void Clear(int property) AVS_BakedCode(AVS_LinkCall(Clear)(property))
int GetPlaneWidthSubsampling(int plane) const AVS_BakedCode(return AVS_LinkCall(GetPlaneWidthSubsampling)(plane))
int GetPlaneHeightSubsampling(int plane) const AVS_BakedCode(return AVS_LinkCall(GetPlaneHeightSubsampling)(plane))
int BitsPerPixel() const AVS_BakedCode(return AVS_LinkCall(BitsPerPixel)())
int BytesPerChannelSample() const AVS_BakedCode(return AVS_LinkCall(BytesPerChannelSample)())
void SetFPS(unsigned numerator, unsigned denominator) AVS_BakedCode(AVS_LinkCall(SetFPS)(numerator, denominator))
void MulDivFPS(unsigned multiplier, unsigned divisor) AVS_BakedCode(AVS_LinkCall(MulDivFPS)(multiplier, divisor))
bool IsSameColorspace(const VideoInfo& vi) const AVS_BakedCode(return AVS_LinkCall(IsSameColorspace)(vi))
int NumComponents() const AVS_BakedCode(return AVS_LinkCallOptDefault(NumComponents, (((AVS_LinkCall(IsYUV)()) && !(AVS_LinkCall(IsY8)())) ? 3 : AVS_LinkCall(BytesFromPixels)(1)) ) )
int ComponentSize() const AVS_BakedCode(return AVS_LinkCallOptDefault(ComponentSize, 1))
int BitsPerComponent() const AVS_BakedCode(return AVS_LinkCallOptDefault(BitsPerComponent, 8))
bool Is444() const AVS_BakedCode(return AVS_LinkCallOpt(Is444, IsYV24) )
bool Is422() const AVS_BakedCode(return AVS_LinkCallOpt(Is422, IsYV16) )
bool Is420() const AVS_BakedCode( return AVS_LinkCallOpt(Is420, IsYV12) )
bool IsY() const AVS_BakedCode( return AVS_LinkCallOpt(IsY, IsY8) )
bool IsRGB48() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsRGB48, false) )
bool IsRGB64() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsRGB64, false) )
bool IsYUVA() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsYUVA, false) )
bool IsPlanarRGB() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsPlanarRGB, false) )
bool IsPlanarRGBA() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsPlanarRGBA, false) )
};
class VideoFrameBuffer {
BYTE* data;
int data_size;
volatile long sequence_number;
friend class VideoFrame;
friend class Cache;
friend class ScriptEnvironment;
volatile long refcount;
protected:
VideoFrameBuffer(BYTE *data, bool writable) : data(data), data_size(0), sequence_number(0), refcount(writable ? 1 : 9000) {}
~VideoFrameBuffer() {}
public:
const BYTE* GetReadPtr() const AVS_BakedCode( return AVS_LinkCall(VFBGetReadPtr)() )
BYTE* GetWritePtr() AVS_BakedCode( return AVS_LinkCall(VFBGetWritePtr)() )
int GetDataSize() const AVS_BakedCode( return AVS_LinkCall(GetDataSize)() )
int GetSequenceNumber() const AVS_BakedCode( return AVS_LinkCall(GetSequenceNumber)() )
int GetRefcount() const AVS_BakedCode( return AVS_LinkCall(GetRefcount)() )
private:
VideoFrameBuffer& operator=(const VideoFrameBuffer&);
};
class VideoFrame {
public:
volatile long refcount;
VideoFrameBuffer* vfb;
const size_t offset;
const int pitch, row_size, height;
const size_t offsetU, offsetV; const int pitchUV, row_sizeUV, heightUV;
const size_t offsetA;
const int pitchA, row_sizeA;
friend class PVideoFrame;
void AddRef();
void Release();
friend class ScriptEnvironment;
friend class Cache;
VideoFrame(BYTE *_vfb, bool writable, size_t _offset, int _pitch, int _row_size, int _height,
size_t _offsetU, size_t _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV)
: refcount(0), vfb(new VideoFrameBuffer(_vfb, writable)), offset(_offset), pitch(_pitch), row_size(_row_size),
height(_height), offsetU(_offsetU), offsetV(_offsetV), pitchUV(_pitchUV), row_sizeUV(_row_sizeUV), heightUV(_heightUV),
offsetA(0), pitchA(0), row_sizeA(0) {
}
public:
int GetPitch(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetPitch)(plane) )
int GetRowSize(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetRowSize)(plane) )
int GetHeight(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetHeight)(plane) )
VideoFrameBuffer* GetFrameBuffer() const AVS_BakedCode( return AVS_LinkCall(GetFrameBuffer)() )
size_t GetOffset(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetOffset)(plane) )
VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const;
VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV) const;
VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV, int rel_offsetA) const;
const BYTE* GetReadPtr(int plane=0) const AVS_BakedCode( return AVS_LinkCall(VFGetReadPtr)(plane) )
bool IsWritable() const AVS_BakedCode( return AVS_LinkCall(IsWritable)() )
BYTE* GetWritePtr(int plane=0) const AVS_BakedCode( return AVS_LinkCall(VFGetWritePtr)(plane) )
~VideoFrame() AVS_BakedCode( AVS_LinkCall(VideoFrame_DESTRUCTOR)() )
#ifdef BUILDING_AVSCORE
public:
void DESTRUCTOR();
#endif
private:
VideoFrame& operator=(const VideoFrame&);
};
enum CachePolicyHint {
CACHE_NOTHING=10, CACHE_WINDOW=11, CACHE_GENERIC=12, CACHE_FORCE_GENERIC=13,
CACHE_GET_POLICY=30, CACHE_GET_WINDOW=31, CACHE_GET_RANGE=32,
CACHE_AUDIO=50, CACHE_AUDIO_NOTHING=51, CACHE_AUDIO_NONE=52, CACHE_AUDIO_AUTO=53,
CACHE_GET_AUDIO_POLICY=70, CACHE_GET_AUDIO_SIZE=71,
CACHE_PREFETCH_FRAME=100, CACHE_PREFETCH_GO=101,
CACHE_PREFETCH_AUDIO_BEGIN=120, CACHE_PREFETCH_AUDIO_STARTLO=121, CACHE_PREFETCH_AUDIO_STARTHI=122, CACHE_PREFETCH_AUDIO_COUNT=123, CACHE_PREFETCH_AUDIO_COMMIT=124, CACHE_PREFETCH_AUDIO_GO=125,
CACHE_GETCHILD_CACHE_MODE=200, CACHE_GETCHILD_CACHE_SIZE=201, CACHE_GETCHILD_AUDIO_MODE=202, CACHE_GETCHILD_AUDIO_SIZE=203,
CACHE_GETCHILD_COST=220, CACHE_COST_ZERO=221, CACHE_COST_UNIT=222, CACHE_COST_LOW=223, CACHE_COST_MED=224, CACHE_COST_HI=225,
CACHE_GETCHILD_THREAD_MODE=240, CACHE_THREAD_UNSAFE=241, CACHE_THREAD_CLASS=242, CACHE_THREAD_SAFE=243, CACHE_THREAD_OWN=244,
CACHE_GETCHILD_ACCESS_COST=260, CACHE_ACCESS_RAND=261, CACHE_ACCESS_SEQ0=262, CACHE_ACCESS_SEQ1=263,
CACHE_AVSPLUS_CONSTANTS = 500,
CACHE_DONT_CACHE_ME, CACHE_SET_MIN_CAPACITY,
CACHE_SET_MAX_CAPACITY,
CACHE_GET_MIN_CAPACITY,
CACHE_GET_MAX_CAPACITY,
CACHE_GET_SIZE,
CACHE_GET_REQUESTED_CAP,
CACHE_GET_CAPACITY,
CACHE_GET_MTMODE,
CACHE_IS_CACHE_REQ,
CACHE_IS_CACHE_ANS,
CACHE_IS_MTGUARD_REQ,
CACHE_IS_MTGUARD_ANS,
CACHE_USER_CONSTANTS = 1000
};
class IClip {
friend class PClip;
friend class AVSValue;
volatile long refcnt;
void AddRef();
void Release();
public:
IClip() : refcnt(0) {}
virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; }
virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0;
virtual bool __stdcall GetParity(int n) = 0; virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0;
virtual int __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; virtual const VideoInfo& __stdcall GetVideoInfo() = 0;
virtual AVSC_CC ~IClip() {}
};
class PClip {
IClip* p;
IClip* GetPointerWithAddRef() const;
friend class AVSValue;
friend class VideoFrame;
void Init(IClip* x);
void Set(IClip* x);
public:
PClip() AVS_BakedCode( AVS_LinkCall(PClip_CONSTRUCTOR0)() )
PClip(const PClip& x) AVS_BakedCode( AVS_LinkCall(PClip_CONSTRUCTOR1)(x) )
PClip(IClip* x) AVS_BakedCode( AVS_LinkCall(PClip_CONSTRUCTOR2)(x) )
void operator=(IClip* x) AVS_BakedCode( AVS_LinkCall(PClip_OPERATOR_ASSIGN0)(x) )
void operator=(const PClip& x) AVS_BakedCode( AVS_LinkCall(PClip_OPERATOR_ASSIGN1)(x) )
IClip* operator->() const { return p; }
operator void*() const { return p; }
bool operator!() const { return !p; }
~PClip() AVS_BakedCode( AVS_LinkCall(PClip_DESTRUCTOR)() )
#ifdef BUILDING_AVSCORE
public:
void CONSTRUCTOR0();
void CONSTRUCTOR1(const PClip& x);
void CONSTRUCTOR2(IClip* x);
void OPERATOR_ASSIGN0(IClip* x);
void OPERATOR_ASSIGN1(const PClip& x);
void DESTRUCTOR();
#endif
};
class PVideoFrame {
VideoFrame* p;
void Init(VideoFrame* x);
void Set(VideoFrame* x);
public:
PVideoFrame() AVS_BakedCode( AVS_LinkCall(PVideoFrame_CONSTRUCTOR0)() )
PVideoFrame(const PVideoFrame& x) AVS_BakedCode( AVS_LinkCall(PVideoFrame_CONSTRUCTOR1)(x) )
PVideoFrame(VideoFrame* x) AVS_BakedCode( AVS_LinkCall(PVideoFrame_CONSTRUCTOR2)(x) )
void operator=(VideoFrame* x) AVS_BakedCode( AVS_LinkCall(PVideoFrame_OPERATOR_ASSIGN0)(x) )
void operator=(const PVideoFrame& x) AVS_BakedCode( AVS_LinkCall(PVideoFrame_OPERATOR_ASSIGN1)(x) )
VideoFrame* operator->() const { return p; }
operator void*() const { return p; }
bool operator!() const { return !p; }
~PVideoFrame() AVS_BakedCode( AVS_LinkCall(PVideoFrame_DESTRUCTOR)() )
#ifdef BUILDING_AVSCORE
public:
void CONSTRUCTOR0();
void CONSTRUCTOR1(const PVideoFrame& x);
void CONSTRUCTOR2(VideoFrame* x);
void OPERATOR_ASSIGN0(VideoFrame* x);
void OPERATOR_ASSIGN1(const PVideoFrame& x);
void DESTRUCTOR();
#endif
};
class AVSValue {
public:
AVSValue() AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR0)() )
AVSValue(IClip* c) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR1)(c) )
AVSValue(const PClip& c) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR2)(c) )
AVSValue(bool b) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR3)(b) )
AVSValue(int i) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR4)(i) )
AVSValue(float f) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR5)(f) )
AVSValue(double f) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR6)(f) )
AVSValue(const char* s) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR7)(s) )
AVSValue(const AVSValue* a, int size) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR8)(a, size) )
AVSValue(const AVSValue& a, int size) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR8)(&a, size) )
AVSValue(const AVSValue& v) AVS_BakedCode( AVS_LinkCall(AVSValue_CONSTRUCTOR9)(v) )
~AVSValue() AVS_BakedCode( AVS_LinkCall(AVSValue_DESTRUCTOR)() )
AVSValue& operator=(const AVSValue& v) AVS_BakedCode( return AVS_LinkCallV(AVSValue_OPERATOR_ASSIGN)(v) )
bool Defined() const AVS_BakedCode( return AVS_LinkCall(Defined)() )
bool IsClip() const AVS_BakedCode( return AVS_LinkCall(IsClip)() )
bool IsBool() const AVS_BakedCode( return AVS_LinkCall(IsBool)() )
bool IsInt() const AVS_BakedCode( return AVS_LinkCall(IsInt)() )
bool IsFloat() const AVS_BakedCode( return AVS_LinkCall(IsFloat)() )
bool IsString() const AVS_BakedCode( return AVS_LinkCall(IsString)() )
bool IsArray() const AVS_BakedCode( return AVS_LinkCall(IsArray)() )
PClip AsClip() const AVS_BakedCode( return AVS_LinkCall(AsClip)() )
bool AsBool() const AVS_BakedCode( return AVS_LinkCall(AsBool1)() )
int AsInt() const AVS_BakedCode( return AVS_LinkCall(AsInt1)() )
const char* AsString() const AVS_BakedCode( return AVS_LinkCall(AsString1)() )
double AsFloat() const AVS_BakedCode( return AVS_LinkCall(AsFloat1)() )
float AsFloatf() const AVS_BakedCode( return float( AVS_LinkCall(AsFloat1)() ) )
bool AsBool(bool def) const AVS_BakedCode( return AVS_LinkCall(AsBool2)(def) )
int AsInt(int def) const AVS_BakedCode( return AVS_LinkCall(AsInt2)(def) )
double AsDblDef(double def) const AVS_BakedCode( return AVS_LinkCall(AsDblDef)(def) ) double AsFloat(float def) const AVS_BakedCode( return AVS_LinkCall(AsFloat2)(def) )
float AsFloatf(float def) const AVS_BakedCode( return float( AVS_LinkCall(AsFloat2)(def) ) )
const char* AsString(const char* def) const AVS_BakedCode( return AVS_LinkCall(AsString2)(def) )
int ArraySize() const AVS_BakedCode( return AVS_LinkCall(ArraySize)() )
const AVSValue& operator[](int index) const AVS_BakedCode( return AVS_LinkCallV(AVSValue_OPERATOR_INDEX)(index) )
private:
short type; short array_size;
union {
IClip* clip;
bool boolean;
int integer;
float floating_pt;
const char* string;
const AVSValue* array;
#ifdef X86_64
__int64 longlong; double double_pt; #endif
};
void Assign(const AVSValue* src, bool init);
#ifdef BUILDING_AVSCORE
public:
void CONSTRUCTOR0();
void CONSTRUCTOR1(IClip* c);
void CONSTRUCTOR2(const PClip& c);
void CONSTRUCTOR3(bool b);
void CONSTRUCTOR4(int i);
void CONSTRUCTOR5(float f);
void CONSTRUCTOR6(double f);
void CONSTRUCTOR7(const char* s);
void CONSTRUCTOR8(const AVSValue* a, int size);
void CONSTRUCTOR9(const AVSValue& v);
void DESTRUCTOR();
AVSValue& OPERATOR_ASSIGN(const AVSValue& v);
const AVSValue& OPERATOR_INDEX(int index) const;
bool AsBool1() const;
int AsInt1() const;
const char* AsString1() const;
double AsFloat1() const;
bool AsBool2(bool def) const;
int AsInt2(int def) const;
double AsFloat2(float def) const;
const char* AsString2(const char* def) const;
#ifdef NEW_AVSVALUE
void MarkArrayAsC();
void CONSTRUCTOR10(const AVSValue& v, bool c_arrays);
AVSValue(const AVSValue& v, bool c_arrays);
void Assign2(const AVSValue* src, bool init, bool c_arrays);
#endif
#endif
};
#undef CALL_MEMBER_FN
#undef AVS_LinkCallOptDefault
#undef AVS_LinkCallOpt
#undef AVS_LinkCallV
#undef AVS_LinkCall
#undef AVS_BakedCode
class GenericVideoFilter : public IClip {
protected:
PClip child;
VideoInfo vi;
public:
GenericVideoFilter(PClip _child) : child(_child) { vi = child->GetVideoInfo(); }
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { return child->GetFrame(n, env); }
void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); }
const VideoInfo& __stdcall GetVideoInfo() { return vi; }
bool __stdcall GetParity(int n) { return child->GetParity(n); }
int __stdcall SetCacheHints(int cachehints,int frame_range) { return 0; } ; };
#include <avs/cpuid.h>
class IScriptEnvironment {
public:
virtual AVSC_CC ~IScriptEnvironment() {}
virtual int __stdcall GetCPUFlags() = 0;
virtual char* __stdcall SaveString(const char* s, int length = -1) = 0;
virtual char* __stdcall Sprintf(const char* fmt, ...) = 0;
virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0;
__declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0;
class NotFound {};
typedef AVSValue (__cdecl *ApplyFunc)(AVSValue args, void* user_data, IScriptEnvironment* env);
virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data) = 0;
virtual bool __stdcall FunctionExists(const char* name) = 0;
virtual AVSValue __stdcall Invoke(const char* name, const AVSValue args, const char* const* arg_names=0) = 0;
virtual AVSValue __stdcall GetVar(const char* name) = 0;
virtual bool __stdcall SetVar(const char* name, const AVSValue& val) = 0;
virtual bool __stdcall SetGlobalVar(const char* name, const AVSValue& val) = 0;
virtual void __stdcall PushContext(int level=0) = 0;
virtual void __stdcall PopContext() = 0;
virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0;
virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0;
virtual void __stdcall BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) = 0;
typedef void (__cdecl *ShutdownFunc)(void* user_data, IScriptEnvironment* env);
virtual void __stdcall AtExit(ShutdownFunc function, void* user_data) = 0;
virtual void __stdcall CheckVersion(int version = AVISYNTH_INTERFACE_VERSION) = 0;
virtual PVideoFrame __stdcall Subframe(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height) = 0;
virtual int __stdcall SetMemoryMax(int mem) = 0;
virtual int __stdcall SetWorkingDir(const char * newdir) = 0;
virtual void* __stdcall ManageCache(int key, void* data) = 0;
enum PlanarChromaAlignmentMode {
PlanarChromaAlignmentOff,
PlanarChromaAlignmentOn,
PlanarChromaAlignmentTest };
virtual bool __stdcall PlanarChromaAlignment(PlanarChromaAlignmentMode key) = 0;
virtual PVideoFrame __stdcall SubframePlanar(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size,
int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV) = 0;
virtual void __stdcall DeleteScriptEnvironment() = 0;
virtual void __stdcall ApplyMessage(PVideoFrame* frame, const VideoInfo& vi, const char* message, int size,
int textcolor, int halocolor, int bgcolor) = 0;
virtual const AVS_Linkage* const __stdcall GetAVSLinkage() = 0;
virtual AVSValue __stdcall GetVarDef(const char* name, const AVSValue& def = AVSValue()) = 0;
};
enum MtMode
{
MT_INVALID = 0,
MT_NICE_FILTER = 1,
MT_MULTI_INSTANCE = 2,
MT_SERIALIZED = 3,
MT_SPECIAL_MT = 4,
MT_MODE_COUNT = 5
};
class IJobCompletion
{
public:
virtual __stdcall ~IJobCompletion() {}
virtual void __stdcall Wait() = 0;
virtual AVSValue __stdcall Get(size_t i) = 0;
virtual size_t __stdcall Size() const = 0;
virtual size_t __stdcall Capacity() const = 0;
virtual void __stdcall Reset() = 0;
virtual void __stdcall Destroy() = 0;
};
class IScriptEnvironment2;
class Prefetcher;
typedef AVSValue (*ThreadWorkerFuncPtr)(IScriptEnvironment2* env, void* data);
enum AvsEnvProperty
{
AEP_PHYSICAL_CPUS = 1,
AEP_LOGICAL_CPUS = 2,
AEP_THREADPOOL_THREADS = 3,
AEP_FILTERCHAIN_THREADS = 4,
AEP_THREAD_ID = 5,
AEP_VERSION = 6
};
enum AvsAllocType
{
AVS_NORMAL_ALLOC = 1,
AVS_POOLED_ALLOC = 2
};
class AVSFunction;
class IScriptEnvironment2 : public IScriptEnvironment{
public:
virtual ~IScriptEnvironment2() {}
virtual size_t __stdcall GetProperty(AvsEnvProperty prop) = 0;
virtual bool __stdcall GetVar(const char* name, AVSValue *val) const = 0;
virtual bool __stdcall GetVar(const char* name, bool def) const = 0;
virtual int __stdcall GetVar(const char* name, int def) const = 0;
virtual double __stdcall GetVar(const char* name, double def) const = 0;
virtual const char* __stdcall GetVar(const char* name, const char* def) const = 0;
virtual bool __stdcall LoadPlugin(const char* filePath, bool throwOnError, AVSValue *result) = 0;
virtual void __stdcall AddAutoloadDir(const char* dirPath, bool toFront) = 0;
virtual void __stdcall ClearAutoloadDirs() = 0;
virtual void __stdcall AutoloadPlugins() = 0;
virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data, const char *exportVar) = 0;
virtual bool __stdcall InternalFunctionExists(const char* name) = 0;
virtual void __stdcall SetFilterMTMode(const char* filter, MtMode mode, bool force) = 0; virtual IJobCompletion* __stdcall NewCompletion(size_t capacity) = 0;
virtual void __stdcall ParallelJob(ThreadWorkerFuncPtr jobFunc, void* jobData, IJobCompletion* completion) = 0;
virtual bool __stdcall Invoke(AVSValue *result, const char* name, const AVSValue& args, const char* const* arg_names=0) = 0;
virtual void* __stdcall Allocate(size_t nBytes, size_t alignment, AvsAllocType type) = 0;
virtual void __stdcall Free(void* ptr) = 0;
using IScriptEnvironment::Invoke;
using IScriptEnvironment::AddFunction;
using IScriptEnvironment::GetVar;
virtual PVideoFrame __stdcall SubframePlanarA(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size,
int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV, int rel_offsetA) = 0;
};
AVSC_API(IScriptEnvironment*, CreateScriptEnvironment)(int version = AVISYNTH_INTERFACE_VERSION);
#define VARNAME_AllowFloatAudio "OPT_AllowFloatAudio"
#define VARNAME_VDubPlanarHack "OPT_VDubPlanarHack"
#define VARNAME_AVIPadScanlines "OPT_AVIPadScanlines"
#define VARNAME_UseWaveExtensible "OPT_UseWaveExtensible"
#define VARNAME_dwChannelMask "OPT_dwChannelMask"
#define VARNAME_Enable_V210 "OPT_Enable_V210"
#define VARNAME_Enable_Y3_10_10 "OPT_Enable_Y3_10_10"
#define VARNAME_Enable_Y3_10_16 "OPT_Enable_Y3_10_16"
#define VARNAME_Enable_b64a "OPT_Enable_b64a"
#define VARNAME_Enable_PlanarToPackedRGB "OPT_Enable_PlanarToPackedRGB"
#include <avs/capi.h>
AVSC_API(IScriptEnvironment2*, CreateScriptEnvironment2)(int version = AVISYNTH_INTERFACE_VERSION);
#pragma pack(pop)
#endif