View Single Post
Old 20th November 2013, 21:34   #37  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Argument is clip only, source clip Planar, Colorbars().ConvertToYV12().Invert(),
dont forget to copy dll to plugins, else will use built-in Invert().
Remove dll afterwards.

Below tells avisynth about the plugin name and args.
Code:
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env)
{
 env->AddFunction("Invert", "c", Create_Invert, 0);
 return "Invert plugin";
}
This is (TwoFiveInvert) sample from SDK. http://avisynth.nl/index.php/Filter_SDK
also in Avisynth 2.6 + SDK compressed helpfile as previously posted (MediaFire in sig).
EDIT: Not TwoFiveInvert, but very similar.

EDIT: This is the bit that does invert (on Y)
Code:
dstpY[x] = srcpY[x] ^ 0xFF;
the '^' is XOR, XOR with $FF makes eg 0->FF and FF->0. (Copying from source, XOR, to Dest)

To call another built-in or external function (you need to know it exists) see Invoke. http://avisynth.nl/index.php/Cplusplus_API
(Most filters do the hard work themselves and do not call built-in/external filters)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 20th November 2013 at 21:55.
StainlessS is offline   Reply With Quote