Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Logo > Re: [LogoForum]...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 1570 of 1588
Post > Topic >>

Re: [LogoForum] Re: Perspective mode, tests for compliance, standards et al

by "John St. Clair" <john.stclair@[EMAIL PROTECTED] > Feb 23, 2008 at 11:53 PM

The message below is being cross-posted from the LogoForum.  Please 
reply here at comp.lang.logo and it will be cross-posted back to the 
LogoForum.  The original author of this message is 
bgorman@[EMAIL PROTECTED]
 do a bit of image manipulation, so I checked by running my program in 
both MSWLogo and FMSLogo, and it works identically in both.

I do not use FD to move about, but FOR loops that control movement using 
setxy.

Here's a sample, works with any .bmp file:

First load the pix and set variable "pixsize:
to getpix :filename
;Get the picture
;cs home
bitload :filename
; Get it's size
make "pixsize bitloadsize :filename
end

This is the main routine that loops through the image:
to pix :Type
; get size from :Pixsize
ht pu
make "xsiz first :pixsize
make "ysiz second :pixsize
make "newpxl []
for [x 0 :xsiz-1 1]~
    [for [y :ysiz-1 0 -1]~
        [DoPixel]]
end

to DoPixel
; inherit x & y
setxy :x :y
make "pxl pixel
; Transform
make "red first :pxl
make "grn second :pxl
make "blu third :pxl
;
; Transform the image
change :Type
make "newpxl (list :red :grn :blu)
setpixel :newpxl
end

Here's a sample Transformation - Reverse, which done twice restores the 
original.
to change :type
if :type = "reverse [~
    make "red 255 - :red
    make "grn 255 - :grn
    make "blu 255 - :blu
    stop]
end

Utilities
to second :list
;output 2nd element
    output first butfirst :list
end

to third :thing
    output first butfirst butfirst :thing
end

Enjoy,
Bob
-- 
A ship in a harbor is safe. But that is not what ships were built for... 
J.A. Shedd
http://www.KnCell.org

http://blog.KnCell.org


__._,_.___
LogoForum messages are archived at: 
http://groups.yahoo.com/group/LogoForum



> The message below is being cross-posted from the LogoForum.  Please 
> reply here at comp.lang.logo and it will be cross-posted back to the 
> LogoForum.  The original author of this message is 
> dale-reed@[EMAIL PROTECTED]
> 
> 
> This discussion reminds me of the old saw that when you acquire a brand 
> new hammer everything looks like a nail.
> 
> Do any of you have any evidence that programming with Logo will improve 
> your thinking about any thing else?
> 
> Dale
> 
> PS Back to "standards"
> Try this code in MSWLogo and FMSLogo and tell me if you get the same 
> answers.  On my computer, but apparently not others, MSWLogo determines 
> the color of the pixels *under* the pen but FMSLogo determines the color

> *of* the pen.
> 
> to aa
> cs pu
> fd 100
> rt 90 fd 100
> setpc [255 0 0]
> setpensize[3 3]
> pd bk 200
> pu home
> setpc [0 0 0]
> setpensize[1 1]
> pd fd 95
> repeat 10[show pixel fd 1]
> end
> 
> ---
> $ dale-reed@[EMAIL PROTECTED]
 Seattle, Washington $ 
> 
> __._,_.___
> LogoForum messages are archived at: 
> http://groups.yahoo.com/group/LogoForum




 4 Posts in Topic:
Re: [LogoForum] Re: Perspective mode, tests for compliance, stan
"John St. Clair"  2008-02-23 23:44:57 
Re: [LogoForum] Re: Perspective mode, tests for compliance, stan
"John St. Clair"  2008-02-23 23:51:47 
Re: [LogoForum] Re: Perspective mode, tests for compliance, stan
"John St. Clair"  2008-02-23 23:58:09 
Re: [LogoForum] Re: Perspective mode, tests for compliance, stan
"John St. Clair"  2008-02-23 23:53:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 3:11:01 CDT 2008.