划清界限 [英] drawing a line

查看:53
本文介绍了划清界限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是一名艺术家,我正在寻找一种画出一条曲折线的方法

随机图像,纵横交错多次,随机数字为



为了让你知道我想做什么,这里'是gif的链接:
http://www.chaosmos .net / chaosmoseng / chaosmos7.htm

(它基于一个简单的算法:
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm


有没有这样做的方法还是我在错误的树上咆哮?


作为旁注,我对C语言一无所知,我只有

有关shell脚本和php的一些知识。

FWIW我是FreeBSD用户,所以没有操作系统问题。

感谢您的回答


marko

Hi everyone,
I''m an artist and I''m looking for a way to draw a line that will zig-zag
its way thru an image randomly, crisscrossing itself many times, based
on random numbers.

To give you an idea of what I''d like to do, here''s a link to a gif :
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm
(it is based on a simple algorithm :
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm)

Is there a way to do that or am I barking up the wrong tree?

As a side note, I don''t know anything about C language, I do only have
some knowledge of shell scripting and php.
FWIW I''m a FreeBSD user, so there is no OS issue.
Thanks for your answers

marko

推荐答案

marko写道:
marko wrote:

我是一名艺术家,我正在寻找一种画出一条曲线的方法,这条曲线将随机地通过一幅图像逐渐形成zig-zag

,基于

随机数。


为了让你知道我想做什么,这里有一个gif的链接:
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm

(它基于一个简单的算法:
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm


有没有办法做到这一点,还是我咆哮错误的树?
I''m an artist and I''m looking for a way to draw a line that will zig-zag
its way thru an image randomly, crisscrossing itself many times, based
on random numbers.

To give you an idea of what I''d like to do, here''s a link to a gif :
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm
(it is based on a simple algorithm :
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm)

Is there a way to do that or am I barking up the wrong tree?



它当然是可编程的,但标准C,这个
讨论,

不不提供任何图形基元。所以你需要选择一种某种类型的图形包,这对于这个问题来说是偏离主题的。尝试

寻找

的图形,他们可以提供更多的帮助。

well it''s certainly programmable, But standard C, which this ng
discusses,
doesn''t provide any graphics primitives. So you would need to pick a
graphics package of some sort, and that''s off-topic to this ng. Try
looking
for a graphics ng they may be able to give more help.


作为旁注,我对C语言一无所知,我只有一些关于shell脚本和php的知识。
As a side note, I don''t know anything about C language, I do only have
some knowledge of shell scripting and php.



C可能不是你最好的选择。 Python可能吗?可能是一个类似的

学习曲线,但在标准库中有很多好东西。

C may not be your best option then. Python maybe? Probably a similar
learning curve, but lots of goodies in the standard library.


FWIW我是FreeBSD用户,所以有没有OS问题。
FWIW I''m a FreeBSD user, so there is no OS issue.



为什么没有操作系统问题?你已经淘汰了MS GDI。

-

Nick Keighley

why no OS issue? You''ve eliminated MSs GDI for instance.
--
Nick Keighley


Nick基斯利说:
Nick Keighley said:

marko写道:
marko wrote:

>我是一名艺术家而我''我正在寻找一种方法来绘制一条线,这条线会随机地通过图像形成锯齿形,多次纵横交错,基于随机数字。

给你想知道我想做什么,这里有一个gif的链接:
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm
(它基于一个简单的算法:
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm
<有没有办法做到这一点,还是我咆哮错误的树?
>I''m an artist and I''m looking for a way to draw a line that will zig-zag
its way thru an image randomly, crisscrossing itself many times, based
on random numbers.

To give you an idea of what I''d like to do, here''s a link to a gif :
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm
(it is based on a simple algorithm :
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm)

Is there a way to do that or am I barking up the wrong tree?



它当然是可编程的,但是标准的C,这个讨论,b
$ b不提供任何图形基元。所以你需要选择一种某种类型的图形包,这对于这个问题来说是偏离主题的。尝试

寻找

的图形,他们可以提供更多的帮助。


well it''s certainly programmable, But standard C, which this ng
discusses,
doesn''t provide any graphics primitives. So you would need to pick a
graphics package of some sort, and that''s off-topic to this ng. Try
looking
for a graphics ng they may be able to give more help.



嗯,这不一定是真的。他可以在

标准C中写下所有必要的代码。我已经完成了,所以我不明白为什么他不能,如果他已经准备好

花足够的时间学习。我应该补充一点,我实际上并没有实现他的精确要求,但我/我已经/编写的代码可以将b / b
加载到内存中,执行各种操作图形操作

就可以了,把它写回一个文件,这可能就是他需要的所有东西 - 他可以用像Image-Magick这样的东西来做任何事情必要文件

转换。好吧,所以我依靠有足够的内存来加载图像,

我会授予你这个,但是我的代码在Windows和Linux上非常开心,

和毫无疑问,它也适用于迷你版,b $ b b大型机或Mac版 - 或者实际上任何有足够内存的b / b
。 />

嗯,好吧,一个警告 - 我不是百分百肯定它会应对具有巨大

CHAR_BIT值的系统,至少不会没有返回密切关注它

来检查。所以它可能不适用于一些古老的大型机或一些现代的b / b $ b $ DSP。但是,考虑到这一点,它可能会被视为

comp.lang.c-conforming,可以这么说。


< snip>

-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

Well, that''s not necessarily true. He could write all the necessary code in
standard C. I''ve done it, so I don''t see why he can''t, if he''s prepared to
spend enough time learning. I should add that I haven''t actually
implemented his precise requirements, but I /have/ written code that can
load a bitmap file into into memory, perform various graphical operations
on it, and write it back out to a file, and that would probably be all he
needs - he can use something like Image-Magick to do any necessary file
conversions. Okay, so I rely on having sufficient memory to load the image,
I''ll grant you that, but my code works quite happily on Windows and Linux,
and I have no doubts whatsoever that it would also work on a mini, a
mainframe, or a Mac - or indeed anything that has sufficient memory
available to it.

Um, okay, a caveat - I''m not 100% sure it would cope on systems with huge
CHAR_BIT values, at least not without going back and looking closely at it
to check. So it might not work on some ancient mainframes or some modern
DSPs. But, given that caveat, it would probably be considered
comp.lang.c-conforming, so to speak.

<snip>
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


Richard Heathfield写道:
Richard Heathfield wrote:

Nick Keighley说:
Nick Keighley said:

> marko写道:
>marko wrote:

> ;>我是一个艺术家,我正在寻找一种方法来绘制一条线,这条线将随机地通过图像锯齿形,多次纵横交错,基于
随机数字。

为了让你知道我想做什么,这里有一个gif的链接:
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm
(它基于一个简单的算法:
http://www.chaosmos.net /chaosmoseng/chaosmos6.htm

有没有办法做到这一点,还是我咆哮错误的树?
>>I''m an artist and I''m looking for a way to draw a line that will zig-zag
its way thru an image randomly, crisscrossing itself many times, based
on random numbers.

To give you an idea of what I''d like to do, here''s a link to a gif :
http://www.chaosmos.net/chaosmoseng/chaosmos7.htm
(it is based on a simple algorithm :
http://www.chaosmos.net/chaosmoseng/chaosmos6.htm)

Is there a way to do that or am I barking up the wrong tree?


它当然是可编程的,但是标准C,这个讨论,
并没有提供任何图形基元。所以你需要选择某种类型的图形包,这对于这个问题是不合适的。尝试
寻找图形,他们可以提供更多帮助。

well it''s certainly programmable, But standard C, which this ng
discusses,
doesn''t provide any graphics primitives. So you would need to pick a
graphics package of some sort, and that''s off-topic to this ng. Try
looking
for a graphics ng they may be able to give more help.



嗯,这不一定是真的。他可以在

标准C中写下所有必要的代码。我已经完成了,所以我不明白为什么他不能,如果他已经准备好

花足够的时间学习。我应该补充一点,我实际上并没有实现他的精确要求,但我/我已经/编写的代码可以将b / b
加载到内存中,执行各种操作图形操作

就可以了,把它写回一个文件,这可能就是他所有的b $ b


Well, that''s not necessarily true. He could write all the necessary code in
standard C. I''ve done it, so I don''t see why he can''t, if he''s prepared to
spend enough time learning. I should add that I haven''t actually
implemented his precise requirements, but I /have/ written code that can
load a bitmap file into into memory, perform various graphical operations
on it, and write it back out to a file, and that would probably be all he



当然他可能只是想要完成工作,其中

使用一两个库的情况可能有所帮助。特别是如果您想要做一些事情,比如绘制抗锯齿线和

,我们不想学习算法。

(快速破解的方法是写出一个原始位图

并使用一个能够导入它的图形程序,但是

很快就会变得很烦人)

Of course he may just want to get the job done, in which
case using a library or two might help. Especially if
you want to do things like draw anti-aliased lines and
don''t want to have to learn the algorithms.
(The quick hack approach is to write out a raw bitmap
and use a graphics program capable of importing it, but
that quickly gets tiresome)


>

嗯,好吧,一个警告 - 我不是百分百肯定它会应对巨大的系统

CHAR_BIT值,至少不会没有返回并密切关注它

来检查。所以它可能不适用于一些古老的大型机或一些现代的b / b $ b $ DSP。但是,考虑到这一点,它可能会被视为

comp.lang.c-conforming,可以这么说。
>
Um, okay, a caveat - I''m not 100% sure it would cope on systems with huge
CHAR_BIT values, at least not without going back and looking closely at it
to check. So it might not work on some ancient mainframes or some modern
DSPs. But, given that caveat, it would probably be considered
comp.lang.c-conforming, so to speak.



你''重新讨论阅读二进制文件格式并调整

,因为你的实现有一个奇怪的选择

的CHAR_BIT(一个不等于8 ......)。这是通过屏蔽

和位移来完成的吗?


-

imalone

You''re talking about reading binary file formats and adjusting
for the fact that your implementation has a bizarre choice
of CHAR_BIT (one not equal to 8...). Is this done by masking
and bit shifts?

--
imalone


这篇关于划清界限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆