kopia lustrzana https://github.com/villares/sketch-a-day
20 java sort
rodzic
2e1a2b2799
commit
5b01480fcf
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 122 KiB |
|
@ -0,0 +1,32 @@
|
||||||
|
PImage img;
|
||||||
|
PImage imgTemp;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
size(100, 100);
|
||||||
|
img = loadImage("a.jpg");
|
||||||
|
imgTemp = img.get();
|
||||||
|
surface.setSize(img.width * 2, img.height);
|
||||||
|
}
|
||||||
|
void draw() {
|
||||||
|
if (i < imgTemp.pixels.length) {
|
||||||
|
float record = -1;
|
||||||
|
int selectedPixel = i;
|
||||||
|
for (int j = i; j < imgTemp.pixels.length; j++) {
|
||||||
|
color pix = imgTemp.pixels[j];
|
||||||
|
float b = hue(pix);
|
||||||
|
if (b > record) {
|
||||||
|
selectedPixel = j;
|
||||||
|
record = b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
color cor = imgTemp.pixels[i];
|
||||||
|
imgTemp.pixels[i] = imgTemp.pixels[selectedPixel];
|
||||||
|
imgTemp.pixels[selectedPixel] = cor;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
imgTemp.updatePixels();
|
||||||
|
image(img, 0, 0);
|
||||||
|
image(imgTemp, img.width, 0);
|
||||||
|
}
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 1.2 MiB |
60
README.md
60
README.md
|
@ -25,6 +25,66 @@ Here are listed some of the tools I have been using:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_28e](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_28e) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_28d](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_28d) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_27a](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_27a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_26a](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_26a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_25e](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_25e) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_24e](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_24e) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_23c](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_23c) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_22c](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_22c) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_21c_simple_while](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_21c_simple_while) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_03_19a_sorting](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_19a_sorting) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
[sketch_2021_03_18a_sorting](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_18a_sorting) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
[sketch_2021_03_18a_sorting](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_03_18a_sorting) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
Ładowanie…
Reference in New Issue