Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Lens Filter V 3.0
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Delos




PostPosted: Wed Apr 21, 2004 7:13 pm   Post subject: Lens Filter V 3.0

Yes! It is here! Version 3.0!

What is new? Well, I've finally gotten around to adding colour highlighters...the b&w is upgraded, and I've introduced a really cool interface.

When I say cool, I mean in a geeky sort of way. It closely resembles Turing GUI, but in fact is just pseudo-GUI that I made myself. Why, you ask? Well, let me put it this way:
file size + GUI = 1.03 MB
file size - GUI, w/ my "GUI" = ~750 kB

Also, you may now chose the name of your output file. Or just leave it blank for the default name.

Read instructions carefully.

If you would not mind, if any errors/bugs/grammatical/speeling errors are found, please post here.
Also if you find a way to crash the "GUI".

Thanx.


If other formats other than .zip are needed, pm me.



V3.zip
 Description:

Download
 Filename:  V3.zip
 Filesize:  277.32 KB
 Downloaded:  341 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
gamer




PostPosted: Wed Apr 21, 2004 7:39 pm   Post subject: (No subject)

yo man....those colour filtering effects ar great, how did u even do that?
jawaharyousuf




PostPosted: Thu Apr 22, 2004 7:29 pm   Post subject: Great job!

Wonderful Delos! I really liked the Colour Highlighters. They nicely pick out the colours that you want. I'm looking forward to when you introduce more colour highlighters.

few bugs though, not major at all:-

1. Z key doesn't work in the text field.
2. blue color was turned to white in greyscale, which i think shouldn't happen. I didn't check with a variety of colours though.
3.only filenames that fit in the text field are being allowed, after which they go beyond the text field to some extent.
4. some character are restricted lesser than other characters.
e.g. 20 g's but only 15 s's.(not accurate numbers,i didn't count them).I guess you add each character next to each other instead of whole text atonce(which makes sense) and may be that's why.
5. the scroll bar jumped an extra step down after Yellow in the selection menu. may be you meant to add something else there and forgot.
6. I changed the extension of a txt file to jpg and ran the program. it crashed. I'm adding this repair to my B/W(did i already?)

I'll post more if i find anymore,although i doubt i will.

Suggestions:-
1. Get a cursor to blink in the text field. That'd be really cool.
2. add a key to exit when ever you want, besides the normal closing method.

Overall, I like it! and here are some bits.

and oh yeah.. grammatical error.

Ist line of the intro of program, should be "the" instead of "then"

Harry Borter to you.
Delos




PostPosted: Fri Apr 23, 2004 3:22 pm   Post subject: (No subject)

Thank you ydj for those spots. Fixed them. The 'z' problem was with my keyrepressors...the txt -> jpg is just insane, might fix that later. The yellow thing was an odd one...fixed though.
Yes, and the new V is up.
jawaharyousuf




PostPosted: Fri Apr 23, 2004 4:02 pm   Post subject: (No subject)

Nice to know how quickly we can fix stuff.

But i found two new things:-
1. 2nd page(output page)- should be "an" instead of "and"
2. ran an exe file that was in the directory instead of jpg/bmp file and it crashed.
the_short1




PostPosted: Fri Apr 23, 2004 4:35 pm   Post subject: (No subject)

good job on the progie.... it seems like u put some good effort into this..,..

lots of progies arouind so far to switch colors... convert to bw... convert out of bw.... filters.... mangna readers.,..... whats next... and irfanview style progrie that can use the scanner and printer????? ***NOTE!!!! THAT IS A WICKED IDEA!!!! make a irfanview style program that can use printer and scanner... ** if that is posible..... errr.....

anyways.,... here... have some bits...
Cervantes




PostPosted: Wed Jul 06, 2005 5:37 pm   Post subject: (No subject)

Nice update, Delos.
It would be nice if you could type the full path into your text field, because otherwise it means moving the .exe program around. Also, it would be nice if you could input spaces.
I'd really like to see some of the ideas behind this. There are easy ways to do these things, but I think you went beyond that. Here's what I'm thinking, for the basic way:

code:

%Lets say we want a blue-green render, with a tinge of red
for i : 0 .. 255
    RGB.SetColour (i, 0.2, i / 255, i / 255)
end for

Pic.Draw (pic, 1, 1, picCopy)

for x : 1 .. Pic.Width (pic)
    for y : 1 .. Pic.Height (pic)
        Draw.Dot (x, y, whatdotcolour (x, y))
    end for
end for

To get different render colours, the palette would have to be changed accordingly. It would be very neat if you could have sliders to select the RGB colour that you want to render to, rather than selecting a from few preset render colours. Actually, I'll try that out now.

I'm interested in how to render an image with more than just a shade of a colour. If you use my method (above), you'd need a complicated colour palette.

Edit:
Here's what I came up with about the sliders. Use the mouse and the scrollers to select the colour you want to render the picture in shades of. Then hit any key. Then follow the instructions.
Turing:

var winRenderColourSelect := Window.Open ("position:centre;centre,graphics:500;150,nobuttonbar,offscreenonly")

var slider : array 1 .. 3 of real := init (0.5, 0.5, 0.5)
const sliderWidth := 4
const sliderHeight := 12

var mx, my, btn : int

loop
    Mouse.Where (mx, my, btn)

    %-=checking for moving of the sliders=-
    if btn = 1 & mx >= 20 and mx <= maxx - 20 then
        for i : 1 .. upper (slider)
            if my >= round (20 * i + 4 - sliderHeight / 2) & my <= round (20 * i + 4 + sliderHeight / 2) then
                slider (i) := (mx - 20) / (maxx - 40)
            end if
        end for
    end if

    %-=Drawing=-
    cls

    %drawing the sliders
    Draw.FillBox (20, 20, maxx - 20, 28, brightred)
    Draw.FillBox (20, 40, maxx - 20, 48, brightgreen)
    Draw.FillBox (20, 60, maxx - 20, 68, brightblue)
    for i : 1 .. upper (slider)
        Draw.FillBox (round (20 + (maxx - 40) * slider (i) - sliderWidth / 2), round (i * 20 + 4 - sliderHeight / 2),
            round (20 + (maxx - 40) * slider (i) + sliderWidth / 2), round (i * 20 + 4 + sliderHeight / 2),
            black)
    end for

    %drawing the selected colour
    RGB.SetColour (240, slider (1), slider (2), slider (3))
    Draw.FillBox (20, 80, maxx - 20, 140, 240)

    View.Update
    delay (5)

    exit when hasch ()
end loop
Window.Close (winRenderColourSelect)

var winPic := Window.Open ("position:centre;centre,graphics:510;100,nobuttonbar")
var picPath : string
put "Enter the path to the picture you would like to render.\nMake sure to get it right, I didn't do any error proofing here!"
get picPath
var pic := Pic.FileNew (picPath)
Window.Set (winPic, "graphics:" + intstr (Pic.Width (pic)) + ";" + intstr (Pic.Height (pic)))

%Set up the colour palette
for i : 0 .. 255
    RGB.SetColour (i, i / 255 * slider (1), i / 255 * slider (2), i / 255 * slider (3))
end for

Pic.Draw (pic, 1, 1, picCopy)

for x : 1 .. Pic.Width (pic)
    for y : 1 .. Pic.Height (pic)
        Draw.Dot (x, y, whatdotcolour (x, y))
    end for
    View.Set ("title:Rendering...  " + intstr (round (x / Pic.Width (pic) * 100)) + "%")  %I like this idea, Delos. :)
end for

Pic.Save (Pic.New (1, 1, maxx, maxy), "outPic.jpg")


Great job Delos. Have 100 bits. 8)
jamonathin




PostPosted: Wed Jul 06, 2005 6:36 pm   Post subject: (No subject)

Wow, very nice program Delos. I'd give you bits as well, but your a mod, and that'd be throwing them away, but lets pretend I did.

+ Surprised Bits!

Nice program as well Cervantes. That could be useful for a 'paint' program or whatever. . . although i am quite sick of them. But that pallet gives me an idea . . . hmmm . . .
the_short1




PostPosted: Wed Jul 06, 2005 6:46 pm   Post subject: (No subject)

.. its very easy to create your own pallette.. or simply addd a lot more colours... look up RGB.Add in turing reference..
Cervantes




PostPosted: Wed Jul 06, 2005 7:20 pm   Post subject: (No subject)

Yes short1, but what is the algorithm to create a palette with only a certain range of colours and a certain range of shades? Ranging the shades is easy, but the colours... Ugh?
jamonathin




PostPosted: Wed Jul 06, 2005 7:36 pm   Post subject: (No subject)

Im trying to make a color pallet, where if you clicked on the shade of the color, that would be the new color you candraw with/whatever. but it seems as if I can donly do so many RGB.AddCOlors before it gets screwy.

Below is my code for it, but then if yo uremove the %'s, it gets all screwy and it doesn't matter which c(?,?,?) it is assigned to.
code:
setscreen ("graphics:400;400,nobuttonbar,position:center;center")
var col, a, b, c, d : array 1 .. 20, 1 .. 20, 1 .. 20 of int
for re : 1 .. 20
    col (re, 1, 1) := RGB.AddColor (re / 20, 0, 0)
    a (re, 1, 1) := 0
    b (re, 1, 1) := maxy - (re * 5)
    c (re, 1, 1) := 5
    d (re, 1, 1) := maxy + 5 - (re * 5)
    drawfillbox (a (re, 1, 1), b (re, 1, 1), c (re, 1, 1), d (re, 1, 1), col (re, 1, 1))
    for gr : 1 .. 20
        col (re, gr, 1) := RGB.AddColor (re / 20, gr / 20, 0)
        a (re, gr, 1) := gr * 5
        b (re, gr, 1) := maxy - (re * 5)
        c (re, gr, 1) := gr * 5 + 5
        d (re, gr, 1) := maxy + 5 - (re * 5)
        drawfillbox (a (re, gr, 1), b (re, gr, 1), c (re, gr, 1), d (re, gr, 1), col (re, gr, 1))
        for bl : 1 .. 20
            %col (re, gr, bl) := RGB.AddColor (re / 20, gr / 20, bl / 20)
            %drawfillbox (bl * 5 + 100, maxy - (re * 5), bl * 5 + 105, maxy + 5 - (re * 5), col (re, gr, bl))
        end for
    end for
end for

[Gandalf]




PostPosted: Wed Jul 06, 2005 8:06 pm   Post subject: (No subject)

Very, very nice. Only one thing I would change. Well, alongside Cervantes' idea. Try making it so that you can add colour highlighting and filters at the same time.

delos.skill++
Delos




PostPosted: Thu Jul 07, 2005 10:07 am   Post subject: (No subject)

[Gandalf] wrote:
Very, very nice. Only one thing I would change. Well, alongside Cervantes' idea. Try making it so that you can add colour highlighting and filters at the same time.

delos.skill++

You could always run the outputted file through again! Laughing
No seriously, that's how you'd do it. In my earlier versions I did have a 'patchwork' option that rendered different areas of the pic with different filters. It wasn't all that great though.
I'm not really sure if I ever will update this proggie. By the time it got to V3, it was more an exercise in creating custom GUI for me than anything else, since only the Highlights were added to the engine.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: