Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-01-27 01:33:16 +0300
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-01-27 01:33:16 +0300
commitcea18ffdf7a5c27b8954e98dd4e5e31c755dda19 (patch)
tree0ec9ddff0e72d6f9a50be00ab29b5b52bfdc9de2 /include
parent5fe2d7d632353a0a18e6db305523bbae7c0cc6a3 (diff)
removed unneeded files
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1567 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'include')
-rw-r--r--include/avisynth/avisynth1.h406
-rw-r--r--include/avisynth/avisynth25.h670
-rw-r--r--include/aviutl/filter.h476
3 files changed, 0 insertions, 1552 deletions
diff --git a/include/avisynth/avisynth1.h b/include/avisynth/avisynth1.h
deleted file mode 100644
index ce0089f1f..000000000
--- a/include/avisynth/avisynth1.h
+++ /dev/null
@@ -1,406 +0,0 @@
-// Avisynth v1.0 beta. Copyright 2000 Ben Rudiak-Gould.
-// http://www.math.berkeley.edu/~benrg/avisynth.html
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
-// http://www.gnu.org/copyleft/gpl.html .
-
-
-#pragma once
-
-#ifdef _MSC_VER
- #include <crtdbg.h>
-#else
- #define _ASSERTE(x) assert(x)
- #include <assert.h>
-#endif
-
-
-enum { AVISYNTH_INTERFACE_VERSION = 1 };
-
-
-// I had problems with Premiere wanting 1-byte alignment for its structures,
-// so I now set the Avisynth struct alignment explicitly here.
-#pragma pack(push,8)
-
-
-// The VideoInfo struct holds global information about a clip (i.e.
-// information that does not depend on the frame number). The GetVideoInfo
-// method in IClip returns this struct.
-
-struct VideoInfo {
- int width, height; // width=0 means no video
- unsigned fps_numerator, fps_denominator;
- int num_frames;
- enum { UNKNOWN=0, BGR24=0x13, BGR32=0x14, YUY2=0x22 };
- unsigned char pixel_type;
- bool field_based;
-
- int audio_samples_per_second; // 0 means no audio
- int num_audio_samples;
- bool stereo, sixteen_bit;
-
- // useful functions of the above
- bool HasVideo() const { return !!width; }
- bool HasAudio() const { return !!audio_samples_per_second; }
- bool IsRGB() const { return !!(pixel_type&0x10); }
- bool IsRGB24() const { return pixel_type == BGR24; }
- bool IsRGB32() const { return pixel_type == BGR32; }
- bool IsYUV() const { return !!(pixel_type&0x20); }
- bool IsYUY2() const { return pixel_type == YUY2; }
- int BytesFromPixels(int pixels) const { return pixels * (pixel_type&7); }
- int RowSize() const { return BytesFromPixels(width); }
- int BitsPerPixel() const { return (pixel_type&7) * 8; }
- int BMPSize() const { return height * ((RowSize()+3) & -4); }
- int AudioSamplesFromFrames(int frames) const { return int(__int64(frames) * audio_samples_per_second * fps_denominator / fps_numerator); }
- int FramesFromAudioSamples(int samples) const { return int(__int64(samples) * fps_numerator / fps_denominator / audio_samples_per_second); }
- int AudioSamplesFromBytes(int bytes) const { return bytes >> (stereo + sixteen_bit); }
- int BytesFromAudioSamples(int samples) const { return samples << (stereo + sixteen_bit); }
- int BytesPerAudioSample() const { return BytesFromAudioSamples(1); }
-
- // useful mutator
- void SetFPS(unsigned numerator, unsigned denominator) {
- unsigned x=numerator, y=denominator;
- while (y) { // find gcd
- unsigned t = x%y; x = y; y = t;
- }
- fps_numerator = numerator/x;
- fps_denominator = denominator/x;
- }
-};
-
-
-// VideoFrameBuffer holds information about a memory block which is used
-// for video data. For efficiency, instances of this class are not deleted
-// when the refcount reaches zero; instead they're stored in a linked list
-// to be reused. The instances are deleted when the corresponding AVS
-// file is closed.
-
-class VideoFrameBuffer {
- unsigned char* const data;
- const int data_size;
- // sequence_number is incremented every time the buffer is changed, so
- // that stale views can tell they're no longer valid.
- long sequence_number;
-
- friend class VideoFrame;
- friend class Cache;
- long refcount;
-
-public:
- VideoFrameBuffer(int size);
- VideoFrameBuffer();
- ~VideoFrameBuffer();
-
- const unsigned char* GetReadPtr() const { return data; }
- unsigned char* GetWritePtr() { ++sequence_number; return data; }
- int GetDataSize() { return data_size; }
- int GetSequenceNumber() { return sequence_number; }
- int GetRefcount() { return refcount; }
-};
-
-
-class IClip;
-class PClip;
-class PVideoFrame;
-class IScriptEnvironment;
-class AVSValue;
-
-
-// VideoFrame holds a "window" into a VideoFrameBuffer. Operator new
-// is overloaded to recycle class instances.
-
-class VideoFrame {
- int refcount;
- VideoFrameBuffer* const vfb;
- const int offset, pitch, row_size, height;
-
- friend class PVideoFrame;
- void AddRef() { ++refcount; }
- void Release() { if (refcount==1) --vfb->refcount; --refcount; }
-
- friend class ScriptEnvironment;
- friend class Cache;
-
- VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height);
-
- void* operator new(unsigned size);
-
-public:
- int GetPitch() const { return pitch; }
- int GetRowSize() const { return row_size; }
- int GetHeight() const { return height; }
-
- // generally you shouldn't use these two
- VideoFrameBuffer* GetFrameBuffer() const { return vfb; }
- int GetOffset() const { return offset; }
-
- // in plugins use env->SubFrame()
- VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const;
-
- const unsigned char* GetReadPtr() const { return vfb->GetReadPtr() + offset; }
-
- bool IsWritable() const { return (refcount == 1 && vfb->refcount == 1); }
-
- unsigned char* GetWritePtr() const {
- return IsWritable() ? (vfb->GetWritePtr() + offset) : 0;
- }
-
- ~VideoFrame() { --vfb->refcount; }
-};
-
-
-// Base class for all filters.
-class IClip {
- friend class PClip;
- friend class AVSValue;
- int refcnt;
- void AddRef() { ++refcnt; }
- void Release() { if (!--refcnt) delete this; }
-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; // return field parity if field_based, else parity of first field in frame
- virtual void __stdcall GetAudio(void* buf, int start, int count, IScriptEnvironment* env) = 0; // start and count are in samples
- virtual const VideoInfo& __stdcall GetVideoInfo() = 0;
- virtual __stdcall ~IClip() {}
-};
-
-
-// smart pointer to IClip
-class PClip {
-
- IClip* p;
-
- IClip* GetPointerWithAddRef() const { if (p) p->AddRef(); return p; }
- friend class AVSValue;
- friend class VideoFrame;
-
- void Init(IClip* x) {
- if (x) x->AddRef();
- p=x;
- }
- void Set(IClip* x) {
- if (x) x->AddRef();
- if (p) p->Release();
- p=x;
- }
-
-public:
- PClip() { p = 0; }
- PClip(const PClip& x) { Init(x.p); }
- PClip(IClip* x) { Init(x); }
- void operator=(IClip* x) { Set(x); }
- void operator=(const PClip& x) { Set(x.p); }
-
- IClip* operator->() const { return p; }
-
- // useful in conditional expressions
- operator void*() const { return p; }
- bool operator!() const { return !p; }
-
- ~PClip() { if (p) p->Release(); }
-};
-
-
-// smart pointer to VideoFrame
-class PVideoFrame {
-
- VideoFrame* p;
-
- void Init(VideoFrame* x) {
- if (x) x->AddRef();
- p=x;
- }
- void Set(VideoFrame* x) {
- if (x) x->AddRef();
- if (p) p->Release();
- p=x;
- }
-
-public:
- PVideoFrame() { p = 0; }
- PVideoFrame(const PVideoFrame& x) { Init(x.p); }
- PVideoFrame(VideoFrame* x) { Init(x); }
- void operator=(VideoFrame* x) { Set(x); }
- void operator=(const PVideoFrame& x) { Set(x.p); }
-
- VideoFrame* operator->() const { return p; }
-
- // for conditional expressions
- operator void*() const { return p; }
- bool operator!() const { return !p; }
-
- ~PVideoFrame() { if (p) p->Release(); }
-};
-
-
-class AVSValue {
-public:
-
- AVSValue() { type = 'v'; }
- AVSValue(IClip* c) { type = 'c'; clip = c; if (c) c->AddRef(); }
- AVSValue(const PClip& c) { type = 'c'; clip = c.GetPointerWithAddRef(); }
- AVSValue(bool b) { type = 'b'; boolean = b; }
- AVSValue(int i) { type = 'i'; integer = i; }
- AVSValue(float f) { type = 'f'; floating_pt = f; }
- AVSValue(double f) { type = 'f'; floating_pt = float(f); }
- AVSValue(const char* s) { type = 's'; string = s; }
- AVSValue(const AVSValue* a, int size) { type = 'a'; array = a; array_size = size; }
- AVSValue(const AVSValue& v) { Assign(&v, true); }
-
- ~AVSValue() { if (IsClip() && clip) clip->Release(); }
- AVSValue& operator=(const AVSValue& v) { Assign(&v, false); return *this; }
-
- // Note that we transparently allow 'int' to be treated as 'float'.
- // There are no int<->bool conversions, though.
-
- bool Defined() const { return type != 'v'; }
- bool IsClip() const { return type == 'c'; }
- bool IsBool() const { return type == 'b'; }
- bool IsInt() const { return type == 'i'; }
- bool IsFloat() const { return type == 'f' || type == 'i'; }
- bool IsString() const { return type == 's'; }
- bool IsArray() const { return type == 'a'; }
-
- PClip AsClip() const { _ASSERTE(IsClip()); return IsClip()?clip:0; }
- bool AsBool() const { _ASSERTE(IsBool()); return boolean; }
- int AsInt() const { _ASSERTE(IsInt()); return integer; }
- const char* AsString() const { _ASSERTE(IsString()); return IsString()?string:0; }
- double AsFloat() const { _ASSERTE(IsFloat()); return IsInt()?integer:floating_pt; }
-
- bool AsBool(bool def) const { _ASSERTE(IsBool()||!Defined()); return IsBool() ? boolean : def; }
- int AsInt(int def) const { _ASSERTE(IsInt()||!Defined()); return IsInt() ? integer : def; }
- double AsFloat(double def) const { _ASSERTE(IsFloat()||!Defined()); return IsInt() ? integer : type=='f' ? floating_pt : def; }
- const char* AsString(const char* def) const { _ASSERTE(IsString()||!Defined()); return IsString() ? string : def; }
-
- int ArraySize() const { _ASSERTE(IsArray()); return IsArray()?array_size:1; }
- const AVSValue& operator[](int index) const {
- _ASSERTE(IsArray() && index>=0 && index<array_size);
- return (IsArray() && index>=0 && index<array_size) ? array[index] : *this;
- }
-
-private:
-
- short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, or 'v'oid
- short array_size;
- union {
- IClip* clip;
- bool boolean;
- int integer;
- float floating_pt;
- const char* string;
- const AVSValue* array;
- };
-
- void Assign(const AVSValue* src, bool init) {
- if (src->IsClip() && src->clip)
- src->clip->AddRef();
- if (!init && IsClip() && clip)
- clip->Release();
- // make sure this copies the whole struct!
- ((__int32*)this)[0] = ((__int32*)src)[0];
- ((__int32*)this)[1] = ((__int32*)src)[1];
- }
-};
-
-
-// instantiable null filter
-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, int start, int count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); }
- const VideoInfo& __stdcall GetVideoInfo() { return vi; }
- bool __stdcall GetParity(int n) { return child->GetParity(n); }
-};
-
-
-class AvisynthError /* exception */ {
-public:
- const char* const msg;
- AvisynthError(const char* _msg) : msg(_msg) {}
-};
-
-
-// For GetCPUFlags. These are the same as in VirtualDub.
-enum {
- CPUF_FORCE = 0x01,
- CPUF_FPU = 0x02,
- CPUF_MMX = 0x04,
- CPUF_INTEGER_SSE = 0x08, // Athlon MMX extensions or Intel SSE
- CPUF_SSE = 0x10, // Full SSE (PIII)
- CPUF_SSE2 = 0x20, // (PIV)
- CPUF_3DNOW = 0x40,
- CPUF_3DNOW_EXT = 0x80, // Athlon 3DNow! extensions
-};
-
-
-class IScriptEnvironment {
-public:
- virtual __stdcall ~IScriptEnvironment() {}
-
- virtual /*static*/ long __stdcall GetCPUFlags() = 0;
-
- virtual char* __stdcall SaveString(const char* s, int length = -1) = 0;
- virtual char* __stdcall Sprintf(const char* fmt, ...) = 0;
- // note: val is really a va_list; I hope everyone typedefs va_list to a pointer
- virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0;
-
- __declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0;
-
- class NotFound /*exception*/ {}; // thrown by Invoke and GetVar
-
- 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** 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;
-
- // align should be 4 or 8
- virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=8) = 0;
-
- virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0;
-
- virtual /*static*/ void __stdcall BitBlt(unsigned char* dstp, int dst_pitch, const unsigned char* 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;
-};
-
-
-// avisynth.dll exports this; it's a way to use it as a library, without
-// writing an AVS script or without going through AVIFile.
-IScriptEnvironment* __stdcall CreateScriptEnvironment(int version = AVISYNTH_INTERFACE_VERSION);
-
-
-#pragma pack(pop)
-
diff --git a/include/avisynth/avisynth25.h b/include/avisynth/avisynth25.h
deleted file mode 100644
index 21de2eca4..000000000
--- a/include/avisynth/avisynth25.h
+++ /dev/null
@@ -1,670 +0,0 @@
-// Avisynth v2.5 alpha. Copyright 2002 Ben Rudiak-Gould et al.
-// http://www.avisynth.org
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
-// http://www.gnu.org/copyleft/gpl.html .
-//
-// Linking Avisynth statically or dynamically with other modules is making a
-// combined work based on Avisynth. Thus, the terms and conditions of the GNU
-// General Public License cover the whole combination.
-//
-// As a special exception, the copyright holders of Avisynth give you
-// permission to link Avisynth with independent modules that communicate with
-// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license
-// terms of these independent modules, and to copy and distribute the
-// resulting combined work under terms of your choice, provided that
-// every copy of the combined work is accompanied by a complete copy of
-// the source code of Avisynth (the version of Avisynth used to produce the
-// combined work), being distributed under the terms of the GNU General
-// Public License plus this exception. An independent module is a module
-// which is not derived from or based on Avisynth, such as 3rd-party filters,
-// import and export plugins, or graphical user interfaces.
-
-
-#pragma once
-
-enum { AVISYNTH_INTERFACE_VERSION = 2 };
-
-
-/* Define all types necessary for interfacing with avisynth.dll
- Moved from internal.h */
-
-// Win32 API macros, notably the types BYTE, DWORD, ULONG, etc.
-#include <windef.h>
-
-// COM interface macros
-#include <objbase.h>
-
-// Raster types used by VirtualDub & Avisynth
-#define in64 (__int64)(unsigned short)
-typedef unsigned long Pixel; // this will break on 64-bit machines!
-typedef unsigned long Pixel32;
-typedef unsigned char Pixel8;
-typedef long PixCoord;
-typedef long PixDim;
-typedef long PixOffset;
-
-
-/* Compiler-specific crap */
-
-// Tell MSVC to stop precompiling here
-#ifdef _MSC_VER
-// #pragma hdrstop
-#endif
-
-// Set up debugging macros for MS compilers; for others, step down to the
-// standard <assert.h> interface
-#ifdef _MSC_VER
- #include <crtdbg.h>
-#else
- #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 _ASSERTE(x) assert(x)
- #include <assert.h>
-#endif
-
-
-
-// I had problems with Premiere wanting 1-byte alignment for its structures,
-// so I now set the Avisynth struct alignment explicitly here.
-#pragma pack(push,8)
-
-#define FRAME_ALIGN 16
-// Default frame alignment is 16 bytes, to help P4, when using SSE2
-
-// The VideoInfo struct holds global information about a clip (i.e.
-// information that does not depend on the frame number). The GetVideoInfo
-// method in IClip returns this struct.
-
-// Audio Sample information
-typedef float SFLOAT;
-
-enum {SAMPLE_INT8 = 1<<0,
- SAMPLE_INT16 = 1<<1,
- SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware.
- 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,
- };
-
-struct VideoInfo {
- int width, height; // width=0 means no video
- unsigned fps_numerator, fps_denominator;
- int num_frames;
- // This is more extensible than previous versions. More properties can be added seeminglesly.
-
- // Colorspace properties.
- enum {
- CS_BGR = 1<<28,
- CS_YUV = 1<<29,
- CS_INTERLEAVED = 1<<30,
- CS_PLANAR = 1<<31
- };
-
- // Specific colorformats
- enum { CS_UNKNOWN = 0,
- CS_BGR24 = 1<<0 | CS_BGR | CS_INTERLEAVED,
- CS_BGR32 = 1<<1 | CS_BGR | CS_INTERLEAVED,
- CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED,
- CS_YV12 = 1<<3 | CS_YUV | CS_PLANAR, // y-v-u, planar
- CS_I420 = 1<<4 | CS_YUV | CS_PLANAR, // y-u-v, planar
- CS_IYUV = 1<<4 | CS_YUV | CS_PLANAR // same as above
- };
- int pixel_type; // changed to int as of 2.5
-
-
- int audio_samples_per_second; // 0 means no audio
- int sample_type; // as of 2.5
- __int64 num_audio_samples; // changed as of 2.5
- int nchannels; // as of 2.5
-
- // Imagetype properties
-
- int image_type;
-
- enum {
- IT_BFF = 1<<0,
- IT_TFF = 1<<1,
- IT_FIELDBASED = 1<<2
- };
-
- // useful functions of the above
- bool HasVideo() const { return (width!=0); }
- bool HasAudio() const { return (audio_samples_per_second!=0); }
- bool IsRGB() const { return !!(pixel_type&CS_BGR); }
- bool IsRGB24() const { return (pixel_type&CS_BGR24)==CS_BGR24; } // Clear out additional properties
- bool IsRGB32() const { return (pixel_type & CS_BGR32) == CS_BGR32 ; }
- bool IsYUV() const { return !!(pixel_type&CS_YUV ); }
- bool IsYUY2() const { return (pixel_type & CS_YUY2) == CS_YUY2; }
- bool IsYV12() const { return ((pixel_type & CS_YV12) == CS_YV12)||((pixel_type & CS_I420) == CS_I420); }
- bool IsColorSpace(int c_space) const { return ((pixel_type & c_space) == c_space); }
- bool Is(int property) const { return ((pixel_type & property)==property ); }
- bool IsPlanar() const { return !!(pixel_type & CS_PLANAR); }
- bool IsFieldBased() const { return !!(image_type & IT_FIELDBASED); }
- bool IsParityKnown() const { return ((image_type & IT_FIELDBASED)&&(image_type & (IT_BFF||IT_TFF))); }
- bool IsBFF() const { return !!(pixel_type & IT_BFF); }
- bool IsTFF() const { return !!(pixel_type & IT_TFF); }
-
- bool IsVPlaneFirst() const {return ((pixel_type & CS_YV12) == CS_YV12); } // Don't use this
- int BytesFromPixels(int pixels) const { return pixels * (BitsPerPixel()>>3); } // Will not work on planar images, but will return only luma planes
- int RowSize() const { return BytesFromPixels(width); } // Also only returns first plane on planar images
- int BMPSize() const { if (IsPlanar()) {int p = height * ((RowSize()+3) & ~3); p+=p>>1; return p; } return height * ((RowSize()+3) & ~3); }
- __int64 AudioSamplesFromFrames(__int64 frames) const { return (__int64(frames) * audio_samples_per_second * fps_denominator / fps_numerator); }
- int FramesFromAudioSamples(__int64 samples) const { return (int)(samples * (__int64)fps_numerator / (__int64)fps_denominator / (__int64)audio_samples_per_second); }
- __int64 AudioSamplesFromBytes(__int64 bytes) const { return bytes / BytesPerAudioSample(); }
- __int64 BytesFromAudioSamples(__int64 samples) const { return samples * BytesPerAudioSample(); }
- int AudioChannels() const { return nchannels; }
- int SampleType() const{ return sample_type;}
- int SamplesPerSecond() const { return audio_samples_per_second; }
- int BytesPerAudioSample() const { return nchannels*BytesPerChannelSample();}
- void SetFieldBased(bool isfieldbased) { if (isfieldbased) image_type|=IT_FIELDBASED; else image_type&=~IT_FIELDBASED; }
- void Set(int property) { image_type|=property; }
- void Clear(int property) { image_type&=~property; }
-
- int BitsPerPixel() const {
- switch (pixel_type) {
- case CS_BGR24:
- return 24;
- case CS_BGR32:
- return 32;
- case CS_YUY2:
- return 16;
- case CS_YV12:
- case CS_I420:
- return 12;
- default:
- return 0;
- }
- }
- int BytesPerChannelSample() const {
- switch (sample_type) {
- case SAMPLE_INT8:
- return sizeof(signed char);
- case SAMPLE_INT16:
- return sizeof(signed short);
- case SAMPLE_INT24:
- return 3;
- case SAMPLE_INT32:
- return sizeof(signed int);
- case SAMPLE_FLOAT:
- return sizeof(SFLOAT);
- default:
- _ASSERTE("Sample type not recognized!");
- return 0;
- }
- }
-
- // useful mutator
- void SetFPS(unsigned numerator, unsigned denominator) {
- unsigned x=numerator, y=denominator;
- while (y) { // find gcd
- unsigned t = x%y; x = y; y = t;
- }
- fps_numerator = numerator/x;
- fps_denominator = denominator/x;
- }
-};
-
-enum {
- FILTER_TYPE=1,
- FILTER_INPUT_COLORSPACE=2,
- FILTER_OUTPUT_TYPE=9,
- FILTER_NAME=4,
- FILTER_AUTHOR=5,
- FILTER_VERSION=6,
- FILTER_ARGS=7,
- FILTER_ARGS_INFO=8,
- FILTER_ARGS_DESCRIPTION=10,
- FILTER_DESCRIPTION=11,
-};
-enum { //SUBTYPES
- FILTER_TYPE_AUDIO=1,
- FILTER_TYPE_VIDEO=2,
- FILTER_OUTPUT_TYPE_SAME=3,
- FILTER_OUTPUT_TYPE_DIFFERENT=4,
-};
-
-
-
-// VideoFrameBuffer holds information about a memory block which is used
-// for video data. For efficiency, instances of this class are not deleted
-// when the refcount reaches zero; instead they're stored in a linked list
-// to be reused. The instances are deleted when the corresponding AVS
-// file is closed.
-
-class VideoFrameBuffer {
- BYTE* const data;
- const int data_size;
- // sequence_number is incremented every time the buffer is changed, so
- // that stale views can tell they're no longer valid.
- long sequence_number;
-
- friend class VideoFrame;
- friend class Cache;
- long refcount;
-
-public:
- VideoFrameBuffer(int size);
- VideoFrameBuffer();
- ~VideoFrameBuffer();
-
- const BYTE* GetReadPtr() const { return data; }
- BYTE* GetWritePtr() { ++sequence_number; return data; }
- int GetDataSize() { return data_size; }
- int GetSequenceNumber() { return sequence_number; }
- int GetRefcount() { return refcount; }
-};
-
-
-class IClip;
-class PClip;
-class PVideoFrame;
-class IScriptEnvironment;
-class AVSValue;
-
-
-// VideoFrame holds a "window" into a VideoFrameBuffer. Operator new
-// is overloaded to recycle class instances.
-
-class VideoFrame {
- int refcount;
- VideoFrameBuffer* const vfb;
- const int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
-
- friend class PVideoFrame;
- void AddRef() { ++refcount; }
- void Release() { if (refcount==1) --vfb->refcount; --refcount; }
-
- friend class ScriptEnvironment;
- friend class Cache;
-
- VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height);
- VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV);
-
- void* operator new(unsigned size);
-// TESTME: OFFSET U/V may be switched to what could be expected from AVI standard!
-public:
- int GetPitch() const { return pitch; }
- int GetPitch(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: return pitchUV;} return pitch; }
- int GetRowSize() const { return row_size; }
- int GetRowSize(int plane) const {
- switch (plane) {
- case PLANAR_U: case PLANAR_V: if (pitchUV) return row_size>>1; else return 0;
- case PLANAR_U_ALIGNED: case PLANAR_V_ALIGNED:
- if (pitchUV) {
- int r = ((row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)) )>>1; // Aligned rowsize
- if (r<=pitchUV)
- return r;
- return row_size>>1;
- } else return 0;
- case PLANAR_Y_ALIGNED:
- int r = (row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)); // Aligned rowsize
- if (r<=pitch)
- return r;
- return row_size;
- }
- return row_size; }
- int GetHeight() const { return height; }
- int GetHeight(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: if (pitchUV) return height>>1; return 0;} return height; }
-
- // generally you shouldn't use these three
- VideoFrameBuffer* GetFrameBuffer() const { return vfb; }
- int GetOffset() const { return offset; }
- int GetOffset(int plane) const { switch (plane) {case PLANAR_U: return offsetU;case PLANAR_V: return offsetV;default: return offset;}; }
-
- // in plugins use env->SubFrame()
- 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;
-
-
- const BYTE* GetReadPtr() const { return vfb->GetReadPtr() + offset; }
- const BYTE* GetReadPtr(int plane) const { return vfb->GetReadPtr() + GetOffset(plane); }
-
- bool IsWritable() const { return (refcount == 1 && vfb->refcount == 1); }
-
- BYTE* GetWritePtr() const {
- return IsWritable() ? (vfb->GetWritePtr() + offset) : 0;
- }
-
- BYTE* GetWritePtr(int plane) const {
- if (plane==PLANAR_Y)
- return IsWritable() ? vfb->GetWritePtr() + GetOffset(plane) : 0;
- return vfb->data + GetOffset(plane);
- }
-
- ~VideoFrame() { --vfb->refcount; }
-};
-
-enum {
- CACHE_NOTHING=0,
- CACHE_RANGE=1 };
-
-// Base class for all filters.
-class IClip {
- friend class PClip;
- friend class AVSValue;
- int refcnt;
- void AddRef() { ++refcnt; }
- void Release() { if (!--refcnt) delete this; }
-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; // return field parity if field_based, else parity of first field in frame
- virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples
- virtual void __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; // We do not pass cache requests upwards, only to the next filter.
- virtual const VideoInfo& __stdcall GetVideoInfo() = 0;
- virtual __stdcall ~IClip() {}
-};
-
-
-// smart pointer to IClip
-class PClip {
-
- IClip* p;
-
- IClip* GetPointerWithAddRef() const { if (p) p->AddRef(); return p; }
- friend class AVSValue;
- friend class VideoFrame;
-
- void Init(IClip* x) {
- if (x) x->AddRef();
- p=x;
- }
- void Set(IClip* x) {
- if (x) x->AddRef();
- if (p) p->Release();
- p=x;
- }
-
-public:
- PClip() { p = 0; }
- PClip(const PClip& x) { Init(x.p); }
- PClip(IClip* x) { Init(x); }
- void operator=(IClip* x) { Set(x); }
- void operator=(const PClip& x) { Set(x.p); }
-
- IClip* operator->() const { return p; }
-
- // useful in conditional expressions
- operator void*() const { return p; }
- bool operator!() const { return !p; }
-
- ~PClip() { if (p) p->Release(); }
-};
-
-
-// smart pointer to VideoFrame
-class PVideoFrame {
-
- VideoFrame* p;
-
- void Init(VideoFrame* x) {
- if (x) x->AddRef();
- p=x;
- }
- void Set(VideoFrame* x) {
- if (x) x->AddRef();
- if (p) p->Release();
- p=x;
- }
-
-public:
- PVideoFrame() { p = 0; }
- PVideoFrame(const PVideoFrame& x) { Init(x.p); }
- PVideoFrame(VideoFrame* x) { Init(x); }
- void operator=(VideoFrame* x) { Set(x); }
- void operator=(const PVideoFrame& x) { Set(x.p); }
-
- VideoFrame* operator->() const { return p; }
-
- // for conditional expressions
- operator void*() const { return p; }
- bool operator!() const { return !p; }
-
- ~PVideoFrame() { if (p) p->Release(); }
-};
-
-
-class AVSValue {
-public:
-
- AVSValue() { type = 'v'; }
- AVSValue(IClip* c) { type = 'c'; clip = c; if (c) c->AddRef(); }
- AVSValue(const PClip& c) { type = 'c'; clip = c.GetPointerWithAddRef(); }
- AVSValue(bool b) { type = 'b'; boolean = b; }
- AVSValue(int i) { type = 'i'; integer = i; }
-// AVSValue(__int64 l) { type = 'l'; longlong = l; }
- AVSValue(float f) { type = 'f'; floating_pt = f; }
- AVSValue(double f) { type = 'f'; floating_pt = float(f); }
- AVSValue(const char* s) { type = 's'; string = s; }
- AVSValue(const AVSValue* a, int size) { type = 'a'; array = a; array_size = size; }
- AVSValue(const AVSValue& v) { Assign(&v, true); }
-
- ~AVSValue() { if (IsClip() && clip) clip->Release(); }
- AVSValue& operator=(const AVSValue& v) { Assign(&v, false); return *this; }
-
- // Note that we transparently allow 'int' to be treated as 'float'.
- // There are no int<->bool conversions, though.
-
- bool Defined() const { return type != 'v'; }
- bool IsClip() const { return type == 'c'; }
- bool IsBool() const { return type == 'b'; }
- bool IsInt() const { return type == 'i'; }
-// bool IsLong() const { return (type == 'l'|| type == 'i'); }
- bool IsFloat() const { return type == 'f' || type == 'i'; }
- bool IsString() const { return type == 's'; }
- bool IsArray() const { return type == 'a'; }
-
- PClip AsClip() const { _ASSERTE(IsClip()); return IsClip()?clip:0; }
- bool AsBool() const { _ASSERTE(IsBool()); return boolean; }
- int AsInt() const { _ASSERTE(IsInt()); return integer; }
-// int AsLong() const { _ASSERTE(IsLong()); return longlong; }
- const char* AsString() const { _ASSERTE(IsString()); return IsString()?string:0; }
- double AsFloat() const { _ASSERTE(IsFloat()); return IsInt()?integer:floating_pt; }
-
- bool AsBool(bool def) const { _ASSERTE(IsBool()||!Defined()); return IsBool() ? boolean : def; }
- int AsInt(int def) const { _ASSERTE(IsInt()||!Defined()); return IsInt() ? integer : def; }
- double AsFloat(double def) const { _ASSERTE(IsFloat()||!Defined()); return IsInt() ? integer : type=='f' ? floating_pt : def; }
- const char* AsString(const char* def) const { _ASSERTE(IsString()||!Defined()); return IsString() ? string : def; }
-
- int ArraySize() const { _ASSERTE(IsArray()); return IsArray()?array_size:1; }
- const AVSValue& operator[](int index) const {
- _ASSERTE(IsArray() && index>=0 && index<array_size);
- return (IsArray() && index>=0 && index<array_size) ? array[index] : *this;
- }
-
-private:
-
- short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
- short array_size;
- union {
- IClip* clip;
- bool boolean;
- int integer;
- float floating_pt;
- const char* string;
- const AVSValue* array;
-// __int64 longlong;
- };
-
- void Assign(const AVSValue* src, bool init) {
- if (src->IsClip() && src->clip)
- src->clip->AddRef();
- if (!init && IsClip() && clip)
- clip->Release();
- // make sure this copies the whole struct!
- ((__int32*)this)[0] = ((__int32*)src)[0];
- ((__int32*)this)[1] = ((__int32*)src)[1];
- }
-};
-
-
-// instantiable null filter
-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); }
- void __stdcall SetCacheHints(int cachehints,int frame_range) { } ; // We do not pass cache requests upwards, only to the next filter.
-};
-
-
-class AvisynthError /* exception */ {
-public:
- const char* const msg;
- AvisynthError(const char* _msg) : msg(_msg) {}
-};
-
-
-// For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
-enum {
- /* slowest CPU to support extension */
- CPUF_FORCE = 0x01, // N/A
- CPUF_FPU = 0x02, // 386/486DX
- CPUF_MMX = 0x04, // P55C, K6, PII
- CPUF_INTEGER_SSE = 0x08, // PIII, Athlon
- CPUF_SSE = 0x10, // PIII, Athlon XP/MP
- CPUF_SSE2 = 0x20, // PIV, Hammer
- CPUF_3DNOW = 0x40, // K6-2
- CPUF_3DNOW_EXT = 0x80, // Athlon
- CPUF_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, which only Hammer
- // will have anyway)
-};
-#define MAX_INT 0x7fffffff
-#define MIN_INT 0x80000000
-
-
-class ConvertAudio : public GenericVideoFilter
-/**
- * Helper class to convert audio to any format
- **/
-{
-public:
- ConvertAudio(PClip _clip, int prefered_format);
- void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env);
-
- static PClip Create(PClip clip, int sample_type, int prefered_type);
- static AVSValue __cdecl Create_float(AVSValue args, void*, IScriptEnvironment*);
- static AVSValue __cdecl Create_32bit(AVSValue args, void*, IScriptEnvironment*);
- static AVSValue __cdecl Create_16bit(AVSValue args, void*, IScriptEnvironment*);
- static AVSValue __cdecl Create_8bit(AVSValue args, void*, IScriptEnvironment*);
- virtual ~ConvertAudio()
- {if (tempbuffer_size) {delete[] tempbuffer;tempbuffer_size=0;}}
-private:
-void ConvertAudio::convertToFloat(char* inbuf, float* outbuf, char sample_type, int count);
-void ConvertAudio::convertFromFloat(float* inbuf, void* outbuf, char sample_type, int count);
-
- __inline int Saturate_int8(float n);
- __inline short Saturate_int16(float n);
- __inline int Saturate_int24(float n);
- __inline int Saturate_int32(float n);
-
- char src_format;
- char dst_format;
- int src_bps;
- char *tempbuffer;
- SFLOAT *floatbuffer;
- int tempbuffer_size;
-};
-
-class AlignPlanar : public GenericVideoFilter {
-public:
- AlignPlanar(PClip _clip);
- static PClip Create(PClip clip);
- PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env);
-};
-
-class FillBorder : public GenericVideoFilter {
-public:
- FillBorder(PClip _clip);
- static PClip Create(PClip clip);
- PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env);
-};
-
-class IScriptEnvironment {
-public:
- virtual __stdcall ~IScriptEnvironment() {}
-
- virtual /*static*/ long __stdcall GetCPUFlags() = 0;
-
- virtual char* __stdcall SaveString(const char* s, int length = -1) = 0;
- virtual char* __stdcall Sprintf(const char* fmt, ...) = 0;
- // note: val is really a va_list; I hope everyone typedefs va_list to a pointer
- virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0;
-
- __declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0;
-
- class NotFound /*exception*/ {}; // thrown by Invoke and GetVar
-
- 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** 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;
-
- // align should be 4 or 8
- virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0;
-
- virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0;
-
- virtual /*static*/ 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;
-
-};
-
-
-// avisynth.dll exports this; it's a way to use it as a library, without
-// writing an AVS script or without going through AVIFile.
-IScriptEnvironment* __stdcall CreateScriptEnvironment(int version = AVISYNTH_INTERFACE_VERSION);
-
-
-#pragma pack(pop)
diff --git a/include/aviutl/filter.h b/include/aviutl/filter.h
deleted file mode 100644
index 97e28a41f..000000000
--- a/include/aviutl/filter.h
+++ /dev/null
@@ -1,476 +0,0 @@
-#pragma once
-
-typedef struct {short y, cb, cr;} PIXEL_YC;
-typedef struct {unsigned char b, g, r;} PIXEL;
-
-// フィルタPROC用構造体
-typedef struct {
- int flag; // フィルタのフラグ
- PIXEL_YC *ycp_edit; // 画像データへのポインタ
- PIXEL_YC *ycp_temp; // テンポラリ領域へのポインタ
- int w,h; // 現在の画像のサイズ
- int max_w,max_h; // 画像領域のサイズ
- int frame; // 現在のフレーム番号(番号は0から)
- int frame_n; // 総フレーム数
- int org_w,org_h; // 元の画像のサイズ
- short *audiop; // オーディオデータへのポインタ ( オーディオフィルタの時のみ )
- // オーディオ形式はPCM16bitです ( 1サンプルは mono = 2byte , stereo = 4byte )
- int audio_n; // オーディオサンプルの総数
- int audio_ch; // オーディオチャンネル数
- PIXEL *pixelp; // DIB形式のデータへのポインタ( 表示フィルタの時のみ )
- void *editp; // エディットハンドル
- int reserve[10]; // 拡張用に予約されてます
-} FILTER_PROC_INFO;
-
-#define FILTER_PROC_INFO_FLAG_FILL_OVERAREA 1
-#define FILTER_PROC_INFO_FLAG_MASK 0x0fffffff
-
-// フレームステータス構造体
-typedef struct {
- int video; // 実際の映像データ番号
- int audio; // 実際の音声データ番号
- int inter; // フレームのインターレース
- // FRAME_STATUS_INTER_NORMAL : 標準
- // FRAME_STATUS_INTER_REVERSE : 反転
- // FRAME_STATUS_INTER_ODD : 奇数
- // FRAME_STATUS_INTER_EVEN : 偶数
- // FRAME_STATUS_INTER_MIX : 二重化
- // FRAME_STATUS_INTER_AUTO : 自動
- int index24fps; // 24fpの周期
- int config; // フレームの設定環境の番号
- int vcm; // フレームの圧縮設定の番号
- int edit_flag; // 編集フラグ
- // EDIT_FRAME_EDIT_FLAG_KEYFRAME : キーフレーム
- // EDIT_FRAME_EDIT_FLAG_MARKFRAME : マークフレーム
- // EDIT_FRAME_EDIT_FLAG_DELFRAME : 優先間引きフレーム
- // EDIT_FRAME_EDIT_FLAG_NULLFRAME : コピーフレーム
- int reserve[9]; // 拡張用に予約されてます
-} FRAME_STATUS;
-
-#define FRAME_STATUS_INTER_NORMAL 0
-#define FRAME_STATUS_INTER_REVERSE 1
-#define FRAME_STATUS_INTER_ODD 2
-#define FRAME_STATUS_INTER_EVEN 3
-#define FRAME_STATUS_INTER_MIX 4
-#define FRAME_STATUS_INTER_AUTO 5
-#define EDIT_FRAME_EDIT_FLAG_KEYFRAME 1
-#define EDIT_FRAME_EDIT_FLAG_MARKFRAME 2
-#define EDIT_FRAME_EDIT_FLAG_DELFRAME 4
-#define EDIT_FRAME_EDIT_FLAG_NULLFRAME 8
-
-// ファイルインフォメーション構造体
-typedef struct {
- int flag; // ファイルのフラグ
- // FILE_INFO_FLAG_VIDEO : 映像が存在する
- // FILE_INFO_FLAG_AUDIO : 音声が存在する
- LPSTR name; // 編集ファイル名
- int w,h; // 元のサイズ
- int video_rate,video_scale; // フレームレート
- int audio_rate; // 音声サンプリングレート
- int audio_ch; // 音声チャンネル数
- int reserve[8]; // 拡張用に予約されてます
-} FILE_INFO;
-
-#define FILE_INFO_FLAG_VIDEO 1
-#define FILE_INFO_FLAG_AUDIO 2
-
-// システムインフォメーション構造体
-typedef struct {
- int flag; // システムフラグ
- // SYS_INFO_FLAG_EDIT : 編集中
- // SYS_INFO_FLAG_VFAPI : VFAPI動作時
- LPSTR info; // バージョン情報
- int filter_n; // 登録されてるフィルタの数
- int min_w,min_h; // 編集出来る最小画像サイズ
- int max_w,max_h; // 編集出来る最大画像サイズ
- int max_frame; // 編集出来る最大フレーム数
- LPSTR edit_name; // 編集ファイル名 (ファイル名が決まっていない時は何も入っていません)
- LPSTR project_name; // プロジェクトファイル名 (ファイル名が決まっていない時は何も入っていません)
- LPSTR output_name; // 出力ファイル名 (ファイル名が決まっていない時は何も入っていません)
- int reserve[8]; // 拡張用に予約されてます
-} SYS_INFO;
-
-#define SYS_INFO_FLAG_EDIT 1
-#define SYS_INFO_FLAG_VFAPI 2
-
-// 外部関数構造体
-typedef struct {
- void *(*get_ycp_ofs)( void *editp,int n,int ofs );
- // 指定したフレームのAVIファイル上でのオフセット分移動した
- // フレームの画像データのポインタを取得します
- // データはフィルタ前のものです
- // editp : エディットハンドル
- // n : フレーム番号
- // ofs : フレームからのオフセット
- // 戻り値 : 画像データへのポインタ (NULLなら失敗)
- void *(*get_ycp)( void *editp,int n );
- // 指定したフレームの画像データのポインタを取得します
- // データはフィルタ前のものです
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : 画像データへのポインタ (NULLなら失敗)
- void *(*get_pixelp)( void *editp,int n );
- // 指定したフレームのDIB形式(RGB24bit)の画像データのポインタを取得します
- // データはフィルタ前のものです
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : DIB形式データへのポインタ (NULLなら失敗)
- int (*get_audio)( void *editp,int n,void *buf );
- // 指定したフレームのオーディオデータを読み込みます
- // データはフィルタ前のものです
- // editp* : エディットハンドル
- // n : フレーム番号
- // buf : 格納するバッファ
- // 戻り値 : 読み込んだサンプル数
- BOOL (*is_editing)( void *editp );
- // 現在編集中か調べます
- // editp : エディットハンドル
- // 戻り値 : TRUEなら編集中
- BOOL (*is_saving)( void *editp );
- // 現在保存中か調べます
- // editp : エディットハンドル
- // 戻り値 : TRUEなら保存中
- int (*get_frame)( void *editp );
- // 現在の表示フレームを取得します
- // editp : エディットハンドル
- // 戻り値 : 現在のフレーム番号
- int (*get_frame_n)( void *editp );
- // 総フレーム数を取得します
- // editp : エディットハンドル
- // 戻り値 : 現在の総フレーム数
- BOOL (*get_frame_size)( void *editp,int *w,int *h );
- // フィルタ前のフレームのサイズを取得します
- // editp : エディットハンドル
- // w,h : 画像サイズの格納ポインタ
- // 戻り値 : TRUEなら成功
- int (*set_frame)( void *editp,int n );
- // 現在の表示フレームを変更します
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : 設定されたフレーム番号
- int (*set_frame_n)( void *editp,int n );
- // 総フレーム数を変更します
- // editp : エディットハンドル
- // n : フレーム数
- // 戻り値 : 設定された総フレーム数
- BOOL (*copy_frame)( void *editp,int d,int s );
- // フレームを他のフレームにコピーします
- // editp : エディットハンドル
- // d : コピー先フレーム番号
- // s : コピー元フレーム番号
- // 戻り値 : TRUEなら成功
- BOOL (*copy_video)( void *editp,int d,int s );
- // フレームの映像だけを他のフレームにコピーします
- // editp : エディットハンドル
- // d : コピー先フレーム番号
- // s : コピー元フレーム番号
- // 戻り値 : TRUEなら成功
- BOOL (*copy_audio)( void *editp,int d,int s );
- // フレームの音声だけを他のフレームにコピーします
- // editp : エディットハンドル
- // d : コピー先フレーム番号
- // s : コピー元フレーム番号
- // 戻り値 : TRUEなら成功
- BOOL (*copy_clip)( HWND hwnd,void *pixelp,int w,int h );
- // クリップボードにDIB形式(RGB24bit)の画像をコピーします
- // hwnd : ウィンドウハンドル
- // pixelp : DIB形式データへのポインタ
- // w,h : 画像サイズ
- // 戻り値 : TRUEなら成功
- BOOL (*paste_clip)( HWND hwnd,void *editp,int n );
- // クリップボードから画像を張りつけます
- // hwnd : ウィンドウハンドル
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : TRUEなら成功
- BOOL (*get_frame_status)( void *editp,int n,FRAME_STATUS *fsp );
- // フレームのステータスを取得します
- // editp : エディットハンドル
- // n : フレーム番号
- // fps : フレームステータスへのポインタ
- // 戻り値 : TRUEなら成功
- BOOL (*set_frame_status)( void *editp,int n,FRAME_STATUS *fsp );
- // フレームのステータスを変更します
- // editp : エディットハンドル
- // n : フレーム番号
- // fps : フレームステータスへのポインタ
- // 戻り値 : TRUEなら成功
- BOOL (*is_saveframe)( void *editp,int n );
- // 実際に保存されるフレームか調べます
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : TRUEなら保存されます
- BOOL (*is_keyframe)( void *editp,int n );
- // キーフレームかどうか調べます
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : TRUEならキーフレーム
- BOOL (*is_recompress)( void *editp,int n );
- // 再圧縮が必要か調べます
- // editp : エディットハンドル
- // n : フレーム番号
- // 戻り値 : TRUEなら再圧縮が必要
- BOOL (*filter_window_update)( void *fp );
- // 設定ウィンドウのトラックバーとチェックボックスを再描画します
- // fp : フィルタ構造体のポインタ
- // 戻り値 : TRUEなら成功
- BOOL (*is_filter_window_disp)( void *fp );
- // 設定ウィンドウが表示されているか調べます
- // fp : フィルタ構造体のポインタ
- // 戻り値 : TRUEなら表示されている
- BOOL (*get_file_info)( void *editp,FILE_INFO *fip );
- // 編集ファイルの情報を取得します
- // editp : エディットハンドル
- // fip : ファイルインフォメーション構造体へのポインタ
- // 戻り値 : TRUEなら成功
- LPSTR (*get_config_name)( void *editp,int n );
- // 設定環境の名前を取得します
- // editp : エディットハンドル
- // n : 設定環境の番号
- // 戻り値 : 設定環境の名前へのポインタ
- BOOL (*is_filter_active)( void *fp );
- // フィルタが有効になっているか調べます
- // fp : フィルタ構造体のポインタ
- // 戻り値 : TRUEならフィルタ有効
- BOOL (*get_pixel_filtered)( void *editp,int n,void *pixelp,int *w,int *h );
- // 指定したフレームのDIB形式(RGB24bit)の画像データを読み込みます
- // データはフィルタ後のものです
- // editp : エディットハンドル
- // n : フレーム番号
- // pixelp : DIB形式データを格納するポインタ (NULLなら画像サイズだけを返します)
- // w,h : 画像のサイズ (NULLならDIB形式データだけを返します)
- // 戻り値 : TRUEなら成功
- int (*get_audio_filtered)( void *editp,int n,void *buf );
- // 指定したフレームのオーディオデータを読み込みます
- // データはフィルタ後のものです
- // editp* : エディットハンドル
- // n : フレーム番号
- // buf : 格納するバッファ
- // 戻り値 : 読み込んだサンプル数
- BOOL (*get_select_frame)( void *editp,int *s,int *e );
- // 選択開始終了フレームを取得します
- // editp : エディットハンドル
- // s : 選択開始フレーム
- // e : 選択終了フレーム
- // 戻り値 : TRUEなら成功
- BOOL (*set_select_frame)( void *editp,int s,int e );
- // 選択開始終了フレームを設定します
- // editp : エディットハンドル
- // s : 選択開始フレーム
- // e : 選択終了フレーム
- // 戻り値 : TRUEなら成功
- BOOL (*rgb2yc)( PIXEL_YC *ycp,PIXEL *pixelp,int w );
- // PIXELからPIXEL_YCに変換します
- // ycp : PIXEL_YC構造体へのポインタ
- // pixelp : PIXEL構造体へのポインタ
- // w : 構造体の数
- // 戻り値 : TRUEなら成功
- BOOL (*yc2rgb)( PIXEL *pixelp,PIXEL_YC *ycp,int w );
- // PIXEL_YCからPIXELに変換します
- // pixelp : PIXEL構造体へのポインタ
- // ycp : PIXEL_YC構造体へのポインタ
- // w : 構造体の数
- // 戻り値 : TRUEなら成功
- BOOL (*dlg_get_load_name)( LPSTR name,LPSTR filter,LPSTR def );
- // ファイルダイアログを使って読み込むファイル名を取得します
- // name : ファイル名を格納するポインタ
- // filter : ファイルフィルタ
- // def : デフォルトのファイル名
- // 戻り値 : TRUEなら成功 FALSEならキャンセル
- BOOL (*dlg_get_save_name)( LPSTR name,LPSTR filter,LPSTR def );
- // ファイルダイアログを使って書き込むファイル名を取得します
- // name : ファイル名を格納するポインタ
- // filter : ファイルフィルタ
- // def : デフォルトのファイル名
- // 戻り値 : TRUEなら成功 FALSEならキャンセル
- int (*ini_load_int)( void *fp,LPSTR key,int n );
- // INIファイルから数値を読み込む
- // fp : フィルタ構造体のポインタ
- // key : アクセス用のキーの名前
- // n : デフォルトの数値
- // 戻り値 : 読み込んだ数値
- int (*ini_save_int)( void *fp,LPSTR key,int n );
- // INIファイルに数値を書き込む
- // fp : フィルタ構造体のポインタ
- // key : アクセス用のキーの名前
- // n : 書き込む数値
- // 戻り値 : 書き込んだ数値
- BOOL (*ini_load_str)( void *fp,LPSTR key,LPSTR str,LPSTR def );
- // INIファイルから文字列を読み込む
- // fp : フィルタ構造体のポインタ
- // key : アクセス用のキーの名前
- // str : 文字列を読み込むバッファ
- // def : デフォルトの文字列
- // 戻り値 : TRUEなら成功
- BOOL (*ini_save_str)( void *fp,LPSTR key,LPSTR str );
- // INIファイルに文字列を書き込む
- // fp : フィルタ構造体のポインタ
- // key : アクセス用のキーの名前
- // n : 書き込む文字列
- // 戻り値 : TRUEなら成功
- BOOL (*get_source_file_info)( void *editp,FILE_INFO *fip,int source_file_id );
- // 指定したファイルIDのファイルの情報を取得します
- // editp : エディットハンドル
- // fip : ファイルインフォメーション構造体へのポインタ
- // souce_file_id
- // : ファイルID
- // 戻り値 : TRUEなら成功
- BOOL (*get_source_video_number)( void *editp,int n,int *source_file_id,int *source_video_number );
- // 指定したフレームのソースのファイルIDとフレーム番号を取得します
- // editp : エディットハンドル
- // n : フレーム番号
- // souce_file_id
- // : ファイルIDを格納するポインタ
- // souce_video_number
- // : フレーム番号を格納するポインタ
- // 戻り値 : TRUEなら成功
- BOOL (*get_sys_info)( void *editp,SYS_INFO *sip );
- // システムの情報を取得します
- // editp : エディットハンドル
- // sip : システムインフォメーション構造体へのポインタ
- // 戻り値 : TRUEなら成功
- void *(*get_filterp)( int filter_id );
- // 指定のフィルタIDのフィルタ構造体へのポインタを取得します
- // filter_id
- // : フィルタID (0〜登録されてるフィルタの数-1までの値)
- // 戻り値 : フィルタ構造体へのポインタ (NULLなら失敗)
- int reserve[6];
-} EXFUNC;
-
-// フィルタ構造体
-typedef struct {
- int flag; // フィルタのフラグ
- // FILTER_FLAG_ALWAYS_ACTIVE : フィルタを常にアクティブにします
- // FILTER_FLAG_CONFIG_POPUP : 設定をポップアップメニューにします
- // FILTER_FLAG_CONFIG_CHECK : 設定をチェックボックスメニューにします
- // FILTER_FLAG_CONFIG_RADIO : 設定をラジオボタンメニューにします
- // FILTER_FLAG_EX_DATA : 拡張データを保存出来るようにします
- // FILTER_FLAG_PRIORITY_HIGHEST : フィルタのプライオリティを常に最上位にします
- // FILTER_FLAG_PRIORITY_LOWEST : フィルタのプライオリティを常に最下位にします
- // FILTER_FLAG_WINDOW_THICKFRAME : サイズ変更可能なウィンドウを作ります
- // FILTER_FLAG_WINDOW_SIZE : 設定ウィンドウのサイズを指定出来るようにします
- // FILTER_FLAG_DISP_FILTER : 表示フィルタにします
- // FILTER_FLAG_REDRAW : 再描画をplugin側で処理するようにします
- // FILTER_FLAG_EX_INFORMATION : フィルタの拡張情報を設定できるようにします
- // FILTER_FLAG_INFORMATION : FILTER_FLAG_EX_INFORMATION を使うようにして下さい
- // FILTER_FLAG_NO_CONFIG : 設定ウィンドウを表示しないようにします
- // FILTER_FLAG_AUDIO_FILTER : オーディオフィルタにします
- // FILTER_FLAG_RADIO_BUTTON : チェックボックスをラジオボタンにします
- // FILTER_FLAG_WINDOW_HSCROLL : 水平スクロールバーを持つウィンドウを作ります
- // FILTER_FLAG_WINDOW_VSCROLL : 垂直スクロールバーを持つウィンドウを作ります
- // FILTER_FLAG_IMPORT : インポートメニューを作ります
- // FILTER_FLAG_EXPORT : エクスポートメニューを作ります
- int x,y; // 設定ウインドウのサイズ (FILTER_FLAG_WINDOW_SIZEが立っている時に有効)
- TCHAR *name; // フィルタの名前
- int track_n; // トラックバーの数
- TCHAR **track_name; // トラックバーの名前郡へのポインタ(トラックバー数が0ならNULLでよい)
- int *track_default; // トラックバーの初期値郡へのポインタ(トラックバー数が0ならNULLでよい)
- int *track_s,*track_e; // トラックバーの数値の下限上限 (NULLなら全て0〜256)
- int check_n; // チェックボックスの数
- TCHAR **check_name; // チェックボックスの名前郡へのポインタ(チェックボックス数が0ならNULLでよい)
- int *check_default; // チェックボックスの初期値郡へのポインタ(チェックボックス数が0ならNULLでよい)
- BOOL (*func_proc)( void *fp,FILTER_PROC_INFO *fpip );
- // フィルタ処理関数へのポインタ (NULLなら呼ばれません)
- BOOL (*func_init)( void *fp );
- // 開始時に呼ばれる関数へのポインタ (NULLなら呼ばれません)
- BOOL (*func_exit)( void *fp );
- // 終了時に呼ばれる関数へのポインタ (NULLなら呼ばれません)
- BOOL (*func_update)( void *fp );
- // 設定が変更されたときに呼ばれる関数へのポインタ (NULLなら呼ばれません)
- BOOL (*func_WndProc)( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,void *fp );
- // 設定ウィンドウにウィンドウメッセージが来た時に呼ばれる関数へのポインタ (NULLなら呼ばれません)
- // 通常のメッセージ以外に以下の拡張メッセージが送られます
- // WM_FILTER_UPDATE : フィルタ設定や編集内容が変更された直後に送られます
- // WM_FILTER_FILE_OPEN : 編集ファイルがオープンされた直後に送られます
- // WM_FILTER_FILE_CLOSE : 編集ファイルがクローズされる直前に送られます
- // WM_FILTER_INIT : 開始直後に送られます
- // WM_FILTER_EXIT : 終了直前に送られます
- // WM_FILTER_SAVE_START : セーブが開始される直前に送られます
- // WM_FILTER_SAVE_END : セーブが終了された直後に送られます
- // WM_FILTER_IMPORT : インポートが選択された直後に送られます
- // WM_FILTER_EXPORT : エクスポートが選択された直後に送られます
- // 戻り値をTRUEにすると編集内容が更新されたとして全体が再描画されます
- int *track,*check; // システムで使いますので使用しないでください
- void *ex_data_ptr; // 拡張データ領域へのポインタ (FILTER_FLAG_EX_DATAが立っている時に有効)
- int ex_data_size; // 拡張データサイズ (FILTER_FLAG_EX_DATAが立っている時に有効)
- TCHAR *information; // フィルタ情報へのポインタ (FILTER_FLAG_EX_INFORMATIONが立っている時に有効)
- BOOL (*func_save_start)( void *fp,int s,int e,void *editp );
- // セーブが開始される直前に呼ばれる関数へのポインタ (NULLなら呼ばれません)
- BOOL (*func_save_end)( void *fp,void *editp );
- // セーブが終了した直前に呼ばれる関数へのポインタ (NULLなら呼ばれません)
- EXFUNC *exfunc; // 外部関数テーブルへのポインタ
- HWND hwnd; // ウィンドウハンドル
- HINSTANCE dll_hinst; // DLLのインスタンスハンドル
- int reserve[8]; // 拡張用に予約されてます
-} FILTER;
-#define FILTER_FLAG_ACTIVE 1
-#define FILTER_FLAG_ALWAYS_ACTIVE 4
-#define FILTER_FLAG_CONFIG_POPUP 8
-#define FILTER_FLAG_CONFIG_CHECK 16
-#define FILTER_FLAG_CONFIG_RADIO 32
-#define FILTER_FLAG_EX_DATA 1024
-#define FILTER_FLAG_PRIORITY_HIGHEST 2048
-#define FILTER_FLAG_PRIORITY_LOWEST 4096
-#define FILTER_FLAG_WINDOW_THICKFRAME 8192
-#define FILTER_FLAG_WINDOW_SIZE 16384
-#define FILTER_FLAG_DISP_FILTER 32768
-#define FILTER_FLAG_REDRAW 0x20000
-#define FILTER_FLAG_EX_INFORMATION 0x40000
-#define FILTER_FLAG_INFORMATION 0x80000
-#define FILTER_FLAG_NO_CONFIG 0x100000
-#define FILTER_FLAG_AUDIO_FILTER 0x200000
-#define FILTER_FLAG_RADIO_BUTTON 0x400000
-#define FILTER_FLAG_WINDOW_HSCROLL 0x800000
-#define FILTER_FLAG_WINDOW_VSCROLL 0x1000000
-#define FILTER_FLAG_IMPORT 0x10000000
-#define FILTER_FLAG_EXPORT 0x20000000
-#define WM_FILTER_UPDATE (WM_USER+100)
-#define WM_FILTER_FILE_OPEN (WM_USER+101)
-#define WM_FILTER_FILE_CLOSE (WM_USER+102)
-#define WM_FILTER_INIT (WM_USER+103)
-#define WM_FILTER_EXIT (WM_USER+104)
-#define WM_FILTER_SAVE_START (WM_USER+105)
-#define WM_FILTER_SAVE_END (WM_USER+106)
-#define WM_FILTER_IMPORT (WM_USER+107)
-#define WM_FILTER_EXPORT (WM_USER+108)
-
-// フィルタDLL用構造体
-typedef struct {
- int flag;
- int x,y;
- TCHAR *name;
- int track_n;
- TCHAR **track_name;
- int *track_default;
- int *track_s,*track_e;
- int check_n;
- TCHAR **check_name;
- int *check_default;
- BOOL (*func_proc)( FILTER *fp,FILTER_PROC_INFO *fpip );
- BOOL (*func_init)( FILTER *fp );
- BOOL (*func_exit)( FILTER *fp );
- BOOL (*func_update)( FILTER *fp );
- BOOL (*func_WndProc)( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,FILTER *fp );
- int *track,*check;
- void *ex_data_ptr;
- int ex_data_size;
- TCHAR *information;
- BOOL (*func_save_start)( void *fp,int s,int e,void *editp );
- BOOL (*func_save_end)( void *fp,void *editp );
- EXFUNC *exfunc;
- HWND hwnd;
- HINSTANCE dll_hinst;
- int reserve[8];
-} FILTER_DLL;
-
-#define MID_FILTER_BUTTON 12004
-
-BOOL func_proc( FILTER *fp,FILTER_PROC_INFO *fpip );
-BOOL func_init( FILTER *fp );
-BOOL func_exit( FILTER *fp );
-BOOL func_update( FILTER *fp );
-BOOL func_WndProc( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,FILTER *fp );
-BOOL func_save_start( FILTER *fp,int s,int e,void *editp );
-BOOL func_save_end( FILTER *fp,void *editp );
-
-