Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
13th March 2006, 12:21 | #1 | Link |
Registered User
Join Date: Feb 2002
Location: Germany
Posts: 540
|
New filters: PixelInfo / PsetRGB
Hello everyone,
here are two little filers: Pixelinfo_0.1.zip PixelInfo() is a GUI-based filter. It lets you pick a pixel and gives you color-information. It works only with YUY2 and RGB32. PSetRGB(x,y,r,g,b) Draws a pixel on the given position with the given color. (RGB32 only) How should i implement a YUY2 or even YV12 version of the Pset-filter? Any ideas or wishes? I will upload the source as well in a couple of days. Have to clean up first. hanfrunz |
13th March 2006, 21:23 | #3 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
how to use it?
I'd like to try this out, but I don't know how! I made a simple test avs,
Code:
colorbars(720,480) pixelinfo() Update: the script must be playing. Improvements would be: passing the start position as arguments, passing the colorvalue to the script, and drawing a cursor to know where you're at. It does save a lot of time compared to pasting the frame into a paint program, if it would accept coordinates, otherwise it takes too long to set them. Last edited by jmac698; 13th March 2006 at 22:05. |
13th March 2006, 22:43 | #4 | Link | |
Registered User
Join Date: Feb 2002
Location: Germany
Posts: 540
|
Quote:
@AVIL: okay i try to implement these methods, and also a mode where you have to set four values "y1, U, y2 and V". YV12 is more tricky... hanfrunz |
|
14th March 2006, 16:56 | #6 | Link | |
Registered User
Join Date: Feb 2002
Location: Germany
Posts: 540
|
Quote:
|
|
15th March 2006, 00:56 | #7 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
sweet! i'm going to implement a mandelbrot generator when i get time now maybe frames = iterations would be an interesting way to do it?
[edit] would it be possible to have a non-gui pixelinfo that returns pixel info for an x,y coord like pixelinfo does? it'd be the basis of script-based pixel manipulation if you could also check pixel values without having to select them. that way you could make a primitive temporal smoother by checking if the pixel has changed by a threshold, and if not, keep the current pixel. might be good for proof-of-concept filters, but it'd probably be dog slow for anything else [edit 2] oops, just realised i'd need width*height calls of pset... i'm not up for that just yet
__________________
sucking the life out of your videos since 2004 Last edited by Mug Funky; 15th March 2006 at 01:08. |
15th March 2006, 11:40 | #8 | Link | |
Registered User
Join Date: Feb 2002
Location: Germany
Posts: 540
|
Quote:
Code:
r=pget(x,y,"r") g=pget(x,y,"g") b=pget(x,y,"b") |
|
20th March 2006, 11:23 | #10 | Link | |
Registered User
Join Date: Feb 2002
Location: Germany
Posts: 540
|
Quote:
hanfrunz |
|
21st March 2006, 04:33 | #13 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
set var
Did you try this?
Code:
static AVSValue __cdecl GetSystemEnv(AVSValue args, void* /* userDataP */, IScriptEnvironment* envP) { const char* varName = args[0].AsString(); const char* val = getenv(varName); return (val == NULL) ? AVSValue() : AVSValue(envP->SaveString(val, strlen(val))); } |
22nd March 2006, 09:40 | #14 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Not sure I quite understand what you want to do here. Put you source up and I will have a look.
Hints:- Constructor code runs exactly once as the script compiles. GetFrame code runs once per frame being generated. The cache can stop GetFrame being run a second time for the same frame number. |
23rd March 2006, 08:52 | #16 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
To write a conditional filter plugin look at src\filters\conditional\conditional_functions.cpp for examples.
To set a variable Code:
int n = 42; env->SetVar("name", (AVSalue)n); Code:
AVSValue v = env->GetVar("name"); int n = v.AsInt(); Last edited by IanB; 23rd March 2006 at 08:55. |
23rd March 2006, 12:25 | #17 | Link | |
Registered User
Join Date: Feb 2002
Location: Germany
Posts: 540
|
Quote:
Code:
xxxsource(whatever) x=0 filterA filterB |
|
23rd March 2006, 16:02 | #18 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Hi Hanfrunz,
I notice the colours in your avatar do not scale past 204 colour (except for the colour white which scales up to all three 255) levels: - I took the liberty of making another version that scales up to all three 255 levels: - Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 23rd March 2006 at 19:04. |
24th March 2006, 00:37 | #20 | Link | |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Quote:
Code:
x=0 # constructor time ... World->GetFrame(n) filterB->GetFrame(n) GetVar(x) # returns 0 filterA->GetFrame(n) xxxsource->GetFrame(n) make a video frame return SetVar(x, 42) return GetVar(x) # returns 42 return return Perhaps if you explain exactly what you want to happen I can say exactly how to do it. At the moment I am second guessing what you want and offering generic answers which may have hidden gotcha's for your case |
|
|
|