![]() |
| |||||||
| Software Photoshop, Paintshop Pro, Painter, etc., and all their various plugins. Of course, you can also discuss all other programs, as well. |
| | Thread Tools |
|
#31
| ||||
| ||||
| Ro, thank you. i'd say more in response, but at the moment it's quite late and i wanted to post this for you all. all i can say is that it works. it's sloppy, amatuer, etc, but it does work! Code: %ffp
OnFilterstart:{
setDialogPos( true, 50, 50, 550, 200 ); // repositions and resizes dialog window
setDialogColor (RGB(225,56,56));
//setDialogPos( false, -1, -1, 320, 240 ); // centers dialog according to host client area
return true;
}
//OnFilterstart:{
// setCtlPos(CTL_OK, 420,280, -1, -1);
// setCtlPos(CTL_CANCEL, 460,280, -1, -1);
// setCtlPos(CTL_PREVIEW, 5, 5,175,150);
// setCtlPos(CTL_ZOOM, 200,285, 50, 10);
// setCtlPos(CTL_PROGRESS, 5,285,185, 10);
// return false;
// }
ctl(0):"0",size=(*,6),pos=(265,8),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(1):"8",size=(*,6),pos=(265,16),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(2):"16",size=(*,6),pos=(265,24),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(3):"24",size=(*,6),pos=(265,32),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(4):"32",size=(*,6),pos=(265,40),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(5):"40",size=(*,6),pos=(265,48),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(6):"48",size=(*,6),pos=(265,56),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(7):"56",size=(*,6),pos=(265,64),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(8):"64",size=(*,6),pos=(265,72),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(9):"72",size=(*,6),pos=(265,80),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(10):"80",size=(*,6),pos=(265,88),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(11):"88",size=(*,6),pos=(265,96),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(12):"96",size=(*,6),pos=(265,104),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(13):"104",size=(*,6),pos=(265,112),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(14):"112",size=(*,6),pos=(265,120),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(15):"120",size=(*,6),pos=(265,128),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(16):"128",size=(*,6),pos=(410,8),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(17):"136",size=(*,6),pos=(410,16),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(18):"144",size=(*,6),pos=(410,24),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(19):"152",size=(*,6),pos=(410,32),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(20):"160",size=(*,6),pos=(410,40),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(21):"168",size=(*,6),pos=(410,48),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(22):"176",size=(*,6),pos=(410,56),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(23):"184",size=(*,6),pos=(410,64),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(24):"192",size=(*,6),pos=(410,72),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(25):"200",size=(*,6),pos=(410,80),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(26):"208",size=(*,6),pos=(410,88),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(27):"216",size=(*,6),pos=(410,96),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(28):"224",size=(*,6),pos=(410,104),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(29):"232",size=(*,6),pos=(410,112),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(30):"240",size=(*,6),pos=(410,120),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(31):"248",size=(*,6),pos=(410,128),range=(-1000,1000),val=0,color=gray,fontcolor=white,track
ctl(72): PUSHBUTTON, "Reset all to 0",size=(47,14),pos=(484,160),val=0
ForEveryTile:{
int x,y,r,g,b,avg,final,number;
float workingfloat,weight1,weight2;
for (y=y_start; y<y_end; y++){
//if(updateProgress(y,y_end)) abort();
for (x=x_start; x<x_end; x++){
r=src(x,y,0);
g=src(x,y,1);
b=src(x,y,2);
avg=(r+g+b)/3;
//avg=r*0.30 + g*0.59 + b*0.11;
workingfloat=(float)avg/8.50;
// +0.5 for rounding
number=floor(workingfloat+0.5);
// again, +0.5 for rounding
weight1=(workingfloat+0.5)-number;
weight2=1.0 - weight1;
// checking along the way
//final=number*51;
//final=weight1*255;
//final=weight2*255;
// final weighted value
final=avg + ctl(number)*weight2 + ctl(number+1)*weight1;
// write the values back
pset(x,y,0,final);
pset(x,y,1,final);
pset(x,y,2,final);
{
if (ctl(72)) setCtlVal(0, 0),setCtlVal(1, 0),setCtlVal(2, 0),
setCtlVal(3, 0),setCtlVal(4, 0),setCtlVal(5, 0),setCtlVal(6, 0),
setCtlVal(7, 0),setCtlVal(8, 0),setCtlVal(9, 0),setCtlVal(10, 0),
setCtlVal(11, 0),setCtlVal(12, 0),setCtlVal(13, 0),setCtlVal(14, 0),
setCtlVal(15, 0),setCtlVal(16, 0),setCtlVal(17, 0),setCtlVal(18, 0),
setCtlVal(19, 0),setCtlVal(20, 0),setCtlVal(21, 0),setCtlVal(22, 0),
setCtlVal(23, 0),setCtlVal(24, 0),setCtlVal(25, 0),setCtlVal(26, 0),
setCtlVal(27, 0),setCtlVal(28, 0),setCtlVal(29, 0),setCtlVal(30, 0),
setCtlVal(31, 0),setCtlVal(72,0);
return false; }
}} // x y
return true;
} // for every pixel
craig |
|
#32
| ||||
| ||||
| Filter Meister uses structures. It took me awhile to wrap my head around these. ForEveryTile and ForEveryPixel are structures. I think of structures as sub-routines that are run in a particular order or when certain things happen. For pushbuttons, you should use the OnCtl(n) structure. When ever you push a button or whatever, this structure will be run. Within the structure, check to see which button or control was messed with. Then do junk based on that. Code: OnCtl(n):{
if (n==72){ // reset button was pushed
int i;
for(i=0;i<72;i++){setCtlVal(i, 0);} // loop and reset
}// end reset all to 0
return false;
}// end on control
|
|
#33
| ||||
| ||||
| stroker, thanks. we used to call what you're calling 'structures', 'functions'. but yes, they are sort of sub-routines or algorythms(sp?). i used what i used there because that's the example i found in the docs and code stuff. it just said 'if (ctl(72) { '. and then followed it with a 'for' or another 'if' (i forget). i didnt know how to do the 'for', so i just did it up in longhand. but yours looks pretty simple. i did see the 'onctl' mentioned, but it wasnt mentioned with pushbuttons, so i just went with the code example. now, on to the 'for'. you put: "for(i=0;i<72;i++){setCtlVal(i, 0);} // loop and reset" . i understand that it's a loop. that's fine. what i dont understand is the syntax of it. you declared 'i'. ok. and in the 'for' statement you did 'i=0;' . ok, i get that. and i understand the last part, but i dont get the 'i<72;i++)', particularly with it being in conjunction with the i=0. if the whole is a loop, wouldnt the i be reset to 0 each time around in the loop? i get the i is going to not hit 72 (< = less than) and i get that i++ = increment i by 1 each time aruond. but the way i read that code it looks like the 'for' loops i=0 and i<72 and increment i by 1, all on every loop. and if i = 0 each time, then i is never going to reach 31 (the highest n in my ctl's). but that's just the way i understand it based on older codes and what they did. and i can certainly understand that that may not be the case here. anyways, i can try it and see. but i need to understand how these things work with each other, the syntax and so on. also, dont the braces { } more or less set a piece of code apart, sort of like the old if-then. if the 'if' tests true you'd jump to a new line. if it was false, you'd simply bypass the rest of the code in the braces. i assume that's still true here (only without the 'then' now). and what stops the 'for' from looping further, the <72 ? i seem to recall back in the old 8 bit, BASIC days that a 'for' was followed by something the same way the if was always followed by a 'then', but i forget what it was. 'while'? so, what breaks it now? how does the loop know when it's finished? craig |
|
#34
| ||||
| ||||
| Quote:
The correct term is "handler", which gives a good idea of what it is. This is not ordinary linear (start here - end there) programming, this is more "object orientated". Which means that each handler gets called in response to something happening. The easiest handler to understand is OnCtrl(n), this gets invoked whenever you fiddle with a control - other than that it doesn't run. Unfortunately, unless I missed something, FM does not have any provision for sub-routines or functions. Quote:
a) Start from zero; Quote:
Code: for(i=0;i<72;i++){setCtlVal(i, 0);}
Code: for(i=0;i<72;i++) setCtlVal(i, 0); Quote:
Hope that cleared it up. Any questions, just fire away! Rô |
|
#35
| ||||
| ||||
| Ro, thanks. ok, grouped parameters. i can live with that. thus, it is the <72 that defines the end of the loop. and the ';' is simply demarking the end of a given parameter, but like you said, it's not linear. ok. so, the handler simply understands all this and handles things accordingly. would it matter the order then of the various parameters? is there a specified syntax to that? if it's not linear, i would think it wouldnt matter, but then again, if the handler is set up to look for certain things first, then it would. so are 'if's the same way as the 'for's? craig |
|
#36
| ||||
| ||||
| Quote:
Quote:
After the "If" code is all finished you can optionally add an "Else" section. *something that returns a true/false value Rô |
|
#37
| ||||
| ||||
| There are shortcuts to the basic math functions. i=i+1 is the same as i++ This is why you usually see i++ in the for loops. i=i+j is the same as i+=j for( initial state ; conditional ; incremental ) { // statements } Like Ro said. In the conditional, using < or <= may make a difference. I haven't completely figured this out. Sometimes a loop will go one beyond and sometimes it will behave just fine. Even in BASIC, I've had to break for/next loops early because of One Beyond Syndrome. I think FM does support do/while and while/wend loops. I avoid them because it's easy for me to plant a logic bomb when I use them. I can handle logic bombs, but these ones throw me for a... loop. ~snicker~ Indenting - ugh! I was never one for proper indenting because I have the hardest time reading code with indents. Once in a great while I might indent properly if my nested conditionals get uber hairy. I'm trying to be better about it. Honestly. Crud. I lost my train of thought. |
|
#38
| ||||
| ||||
| thanks stroker. still studying, but all that does help. also, anyone know if FM is still being developed? would love to see a greater zoom and an increase in ctl numbers (docs say it's currently limited to 60). craig |
|
#39
| ||||
| ||||
| FM is still being developed. Alex and Harald, I believe. - zooming in - user defined functions - dll linking - Perlin Noise function And some other things I can't remember right now. I think the limit on controls is more than 60. Like 0 to 255. |
|
#40
| ||||
| ||||
| Quote:
Rô |
|
#41
| ||||
| ||||
| thanks guys. good to know it's still being worked on. that 'what's new' page is actually what's in the version i'm using. the setZoom does work. tried it out, but functionally, it doesnt really seem get anything more than what i was getting before before using setZoom. they said '200% larger preview' on the what's new, but i dont really see it, unless it means that what exists now is 200% over what was possible in the earlier versions, which i never had. but it's not a 200% of original image. what i'd love to see is 200% of the original image. then again, i may have implemented it wrong or be looking at it incorrectly. i tried it like they said, but wasnt quite sure where to put the -888. Code: setZoom(ctl(40)); ctl(40): "Preview Zoom",Range=(-888,16),pos=(305,330) but again, i'm probably just implementing it incorrectly or thinking about it incorrectly. craig |
|
#42
| ||||
| ||||
| guys, a question here about FM. does it have the capability to do a color pick from the preview window and if so, could you steer me in that direction? you know, like the eye dropper tool, pick a color and tell you its values or assign it to something. craig |
|
#43
| ||||
| ||||
|
#45
| |||
| |||
| well DAMN. I've got to day this... As a very new member of RTP and a technology-minded, vb script reading digital arts freak... you guys completely amaze me in how much you're willing to share on this forum. Quality... love it. My ears are smoking btw. Rob |
|
#46
| ||||
| ||||
| ParkerF1, nice to see you around here. Have you already delved into FilterMeister? "technology-minded, vb script reading digital arts freak" - seems like you're in the right place. Folks of FM world. This thread is getting too long to be really useful to anybody trying to get the information out easily. Over the weekend I'll be chopping this thread into smaller chunks, something like: FM Basic information;If the interest continues maybe we'll get ourselves our own little sub-forum - and tomorrow the world |
|
#47
| ||||
| ||||
| Hi Rô. Are you trying to make FM easy? Maybe an FM Art Chunk? I think this would be popular. And it’s an area we haven’t really touched on yet. Maybe ParkerF1 can contribute. If this has to be split then I can think of no-one more capable than yourself. I am sure you will do it correctly. But really this question can only be answered by Stroker. Without Stroker’s fantastic contributions this thread would not have become such a wonderful resource of FM info. And they thought FM was just for geeks. Ken. |
|
#48
| ||||
| ||||
| Whatever byRo or whomever wants to do, I'm cool. If someone sets something up, I'm sure I'll contribute content. Ever since my last stretch with Tech-Slop, I haven't been much of a mood to do big organization type stuff (which is why I wanted a wiki, much looser for my sloppy ways). |
|
#49
| |||
| |||
| Nope, u guys just turned me on to it I haven't had time to dive into it just yet. The 1 yr old at home sucks every ounce of time out of my evenings! I don't think I would even bother if it hadn't been for what you've already done here... I honestly am blown away by the generosity here. this forum is second to none. |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Important security info | chrishoggy | Salon | 11 | 02-16-2007 02:31 PM |
| scratch info in info palette | seanarmenta | Photoshop Help | 5 | 08-11-2006 08:32 PM |
| Using info from green channel, any help? | RobArnold | Image Help | 8 | 12-07-2005 06:04 AM |
| File > File Info - Does Elements have this menu command? | DannyRaphael | Photoshop Elements Help | 5 | 07-26-2004 07:18 PM |
| Mend Tool - Patron Info button error. | jimlay | Hidden Power Support | 6 | 02-29-2004 12:49 PM |