summaryrefslogtreecommitdiff
path: root/python-perlin-noise.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-31 03:32:58 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-31 03:32:58 +0000
commit0441b0544b61ee1af157c0a4ddb2be7efa35ce6c (patch)
treed8f021031e1688a76aa883582cbfe50315e48d59 /python-perlin-noise.spec
parent499142595b747dd8ec808564ba47114a1cb4e3ed (diff)
automatic import of python-perlin-noise
Diffstat (limited to 'python-perlin-noise.spec')
-rw-r--r--python-perlin-noise.spec273
1 files changed, 273 insertions, 0 deletions
diff --git a/python-perlin-noise.spec b/python-perlin-noise.spec
new file mode 100644
index 0000000..a423bd4
--- /dev/null
+++ b/python-perlin-noise.spec
@@ -0,0 +1,273 @@
+%global _empty_manifest_terminate_build 0
+Name: python-perlin-noise
+Version: 1.12
+Release: 1
+Summary: Python implementation for Perlin Noise with unlimited coordinates space
+License: MIT License
+URL: https://pypi.org/project/perlin-noise/
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/02/82/4762c741b3edee5cda7207d45592c959760797860f1e8e69b143cf1805bc/perlin_noise-1.12.tar.gz
+BuildArch: noarch
+
+
+%description
+Smooth random noise generator
+read more https://en.wikipedia.org/wiki/Perlin_noise
+
+source code: https://github.com/salaxieb/perlin_noise
+
+
+noise = PerlinNoise(octaves=3.5, seed=777)
+ &nbsp;&nbsp;&nbsp;&nbsp;octaves : number of sub rectangles in each [0, 1] range
+ &nbsp;&nbsp;&nbsp;&nbsp;seed : specific seed with which you want to initialize random generator
+
+
+```python
+from perlin_noise import PerlinNoise
+
+
+noise = PerlinNoise()
+# accepts as argument float and/or list[float]
+noise(0.5) == noise([0.5])
+--> True
+# noise not limited in space dimension and seamless in any space size
+noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0])
+--> True
+```
+
+Usage examples:
+```python
+import matplotlib.pyplot as plt
+from perlin_noise import PerlinNoise
+
+noise = PerlinNoise(octaves=10, seed=1)
+xpix, ypix = 100, 100
+pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)]
+
+plt.imshow(pic, cmap='gray')
+plt.show()
+```
+![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png)
+
+```python
+import matplotlib.pyplot as plt
+from perlin_noise import PerlinNoise
+
+noise1 = PerlinNoise(octaves=3)
+noise2 = PerlinNoise(octaves=6)
+noise3 = PerlinNoise(octaves=12)
+noise4 = PerlinNoise(octaves=24)
+
+xpix, ypix = 100, 100
+pic = []
+for i in range(xpix):
+ row = []
+ for j in range(ypix):
+ noise_val = noise1([i/xpix, j/ypix])
+ noise_val += 0.5 * noise2([i/xpix, j/ypix])
+ noise_val += 0.25 * noise3([i/xpix, j/ypix])
+ noise_val += 0.125 * noise4([i/xpix, j/ypix])
+
+ row.append(noise_val)
+ pic.append(row)
+
+plt.imshow(pic, cmap='gray')
+plt.show()
+```
+
+![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png)
+
+
+
+
+%package -n python3-perlin-noise
+Summary: Python implementation for Perlin Noise with unlimited coordinates space
+Provides: python-perlin-noise
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-perlin-noise
+Smooth random noise generator
+read more https://en.wikipedia.org/wiki/Perlin_noise
+
+source code: https://github.com/salaxieb/perlin_noise
+
+
+noise = PerlinNoise(octaves=3.5, seed=777)
+ &nbsp;&nbsp;&nbsp;&nbsp;octaves : number of sub rectangles in each [0, 1] range
+ &nbsp;&nbsp;&nbsp;&nbsp;seed : specific seed with which you want to initialize random generator
+
+
+```python
+from perlin_noise import PerlinNoise
+
+
+noise = PerlinNoise()
+# accepts as argument float and/or list[float]
+noise(0.5) == noise([0.5])
+--> True
+# noise not limited in space dimension and seamless in any space size
+noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0])
+--> True
+```
+
+Usage examples:
+```python
+import matplotlib.pyplot as plt
+from perlin_noise import PerlinNoise
+
+noise = PerlinNoise(octaves=10, seed=1)
+xpix, ypix = 100, 100
+pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)]
+
+plt.imshow(pic, cmap='gray')
+plt.show()
+```
+![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png)
+
+```python
+import matplotlib.pyplot as plt
+from perlin_noise import PerlinNoise
+
+noise1 = PerlinNoise(octaves=3)
+noise2 = PerlinNoise(octaves=6)
+noise3 = PerlinNoise(octaves=12)
+noise4 = PerlinNoise(octaves=24)
+
+xpix, ypix = 100, 100
+pic = []
+for i in range(xpix):
+ row = []
+ for j in range(ypix):
+ noise_val = noise1([i/xpix, j/ypix])
+ noise_val += 0.5 * noise2([i/xpix, j/ypix])
+ noise_val += 0.25 * noise3([i/xpix, j/ypix])
+ noise_val += 0.125 * noise4([i/xpix, j/ypix])
+
+ row.append(noise_val)
+ pic.append(row)
+
+plt.imshow(pic, cmap='gray')
+plt.show()
+```
+
+![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png)
+
+
+
+
+%package help
+Summary: Development documents and examples for perlin-noise
+Provides: python3-perlin-noise-doc
+%description help
+Smooth random noise generator
+read more https://en.wikipedia.org/wiki/Perlin_noise
+
+source code: https://github.com/salaxieb/perlin_noise
+
+
+noise = PerlinNoise(octaves=3.5, seed=777)
+ &nbsp;&nbsp;&nbsp;&nbsp;octaves : number of sub rectangles in each [0, 1] range
+ &nbsp;&nbsp;&nbsp;&nbsp;seed : specific seed with which you want to initialize random generator
+
+
+```python
+from perlin_noise import PerlinNoise
+
+
+noise = PerlinNoise()
+# accepts as argument float and/or list[float]
+noise(0.5) == noise([0.5])
+--> True
+# noise not limited in space dimension and seamless in any space size
+noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0])
+--> True
+```
+
+Usage examples:
+```python
+import matplotlib.pyplot as plt
+from perlin_noise import PerlinNoise
+
+noise = PerlinNoise(octaves=10, seed=1)
+xpix, ypix = 100, 100
+pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)]
+
+plt.imshow(pic, cmap='gray')
+plt.show()
+```
+![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png)
+
+```python
+import matplotlib.pyplot as plt
+from perlin_noise import PerlinNoise
+
+noise1 = PerlinNoise(octaves=3)
+noise2 = PerlinNoise(octaves=6)
+noise3 = PerlinNoise(octaves=12)
+noise4 = PerlinNoise(octaves=24)
+
+xpix, ypix = 100, 100
+pic = []
+for i in range(xpix):
+ row = []
+ for j in range(ypix):
+ noise_val = noise1([i/xpix, j/ypix])
+ noise_val += 0.5 * noise2([i/xpix, j/ypix])
+ noise_val += 0.25 * noise3([i/xpix, j/ypix])
+ noise_val += 0.125 * noise4([i/xpix, j/ypix])
+
+ row.append(noise_val)
+ pic.append(row)
+
+plt.imshow(pic, cmap='gray')
+plt.show()
+```
+
+![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png)
+
+
+
+
+%prep
+%autosetup -n perlin-noise-1.12
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-perlin-noise -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 1.12-1
+- Package Spec generated