Skip to content
Snippets Groups Projects
Commit 173c5dd9 authored by Ivan Kondov's avatar Ivan Kondov
Browse files

added inputs for exercise 3

parent d1d4b88e
No related branches found
No related tags found
No related merge requests found
Showing
with 420 additions and 0 deletions
{
"name": "Image tiling",
"fws": [
{
"fw_id": 1,
"name": "Render an image from a character",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["character"],
"outputs": ["image"],
"command_spec": {
"command": [
"convert", "-size", "800x800",
"-background", "white",
"-pointsize", "800",
"-fill", "blue",
"-gravity", "Center",
"-trim"
],
"character": {
"binding": {
"prefix": "caption",
"separator": ":"
},
"source": {
"type": "data",
"value": "A"
}
},
"image": {
"target": {
"type": "path",
"value": "/tmp/letter.png"
}
}
}
}
]
}
},
{
"fw_id": 2,
"name": "Tile the image into four tiles",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["image", "tiled image"],
"command_spec": {
"command": [
"convert",
"-crop", "2x2@"
],
"image": {
"source": "image"
},
"tiled image": {
"source": {
"type": "data",
"value": "/tmp/tile.png"
}
}
}
}
]
}
},
{
"fw_id": 3,
"name": "Rotate one tile 90 degrees clockwise",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["rotation angle", "piece 2"],
"outputs": ["top left"],
"command_spec": {
"command": ["convert", "-rotate"],
"rotation angle": {
"source": {
"type": "data",
"value": 90
}
},
"top left": {
"target": {
"type": "path",
"value": "/tmp/piece-2.png"
}
},
"piece 2": {
"source": "piece 2"
}
}
}
],
"piece 2": {
"type": "path",
"value": "/tmp/tile-0.png"
}
}
},
{
"fw_id": 4,
"name": "Flip another tile vertically",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["piece 1"],
"outputs": ["bottom right"],
"command_spec": {
"command": ["convert", "-flip"],
"bottom right": {
"target": {
"type": "path",
"value": "/tmp/piece-1.png"
}
},
"piece 1": {
"source": "piece 1"
}
}
}
],
"piece 1": {
"type": "path",
"value": "/tmp/tile-3.png"
}
}
}
],
"links": {
"1": [2],
"2": [3, 4]
},
"metadata": {}
}
exercises/inputs/3_files_and_commands/A/letter.png

8.9 KiB

exercises/inputs/3_files_and_commands/A/piece-1.png

2.19 KiB | W: | H:

exercises/inputs/3_files_and_commands/A/piece-1.png

2.74 KiB | W: | H:

exercises/inputs/3_files_and_commands/A/piece-1.png
exercises/inputs/3_files_and_commands/A/piece-1.png
exercises/inputs/3_files_and_commands/A/piece-1.png
exercises/inputs/3_files_and_commands/A/piece-1.png
  • 2-up
  • Swipe
  • Onion skin
exercises/inputs/3_files_and_commands/A/piece-2.png

1.74 KiB | W: | H:

exercises/inputs/3_files_and_commands/A/piece-2.png

2.63 KiB | W: | H:

exercises/inputs/3_files_and_commands/A/piece-2.png
exercises/inputs/3_files_and_commands/A/piece-2.png
exercises/inputs/3_files_and_commands/A/piece-2.png
exercises/inputs/3_files_and_commands/A/piece-2.png
  • 2-up
  • Swipe
  • Onion skin
exercises/inputs/3_files_and_commands/A/tile-0.png

2.99 KiB

exercises/inputs/3_files_and_commands/A/tile-1.png

3.03 KiB

exercises/inputs/3_files_and_commands/A/tile-2.png

3.09 KiB

exercises/inputs/3_files_and_commands/A/tile-3.png

2.74 KiB

{
"name": "Image tiling",
"fws": [
{
"fw_id": 1,
"name": "Render an image from a character",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["character"],
"outputs": ["image"],
"command_spec": {
"command": [
"convert", "-size", "800x800",
"-background", "white",
"-pointsize", "800",
"-fill", "blue",
"-gravity", "Center",
"-trim"
],
"character": {
"binding": {
"prefix": "caption",
"separator": ":"
},
"source": {
"type": "data",
"value": "C"
}
},
"image": {
"target": {
"type": "path",
"value": "/tmp/letter.png"
}
}
}
}
]
}
},
{
"fw_id": 2,
"name": "Tile the image into four tiles",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["image", "tiled image"],
"command_spec": {
"command": [
"convert",
"-crop", "2x2@"
],
"image": {
"source": "image"
},
"tiled image": {
"source": {
"type": "data",
"value": "/tmp/tile.png"
}
}
}
}
]
}
},
{
"fw_id": 3,
"name": "Rotate one tile 90 degrees clockwise",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["rotation angle", "piece 2"],
"outputs": ["top left"],
"command_spec": {
"command": ["convert", "-rotate"],
"rotation angle": {
"source": {
"type": "data",
"value": 90
}
},
"top left": {
"target": {
"type": "path",
"value": "/tmp/piece-2.png"
}
},
"piece 2": {
"source": "piece 2"
}
}
}
],
"piece 2": {
"type": "path",
"value": "/tmp/tile-0.png"
}
}
},
{
"fw_id": 4,
"name": "Flip another tile vertically",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["piece 1"],
"outputs": ["bottom right"],
"command_spec": {
"command": ["convert", "-flip"],
"bottom right": {
"target": {
"type": "path",
"value": "/tmp/piece-1.png"
}
},
"piece 1": {
"source": "piece 1"
}
}
}
],
"piece 1": {
"type": "path",
"value": "/tmp/tile-3.png"
}
}
}
],
"links": {
"1": [2],
"2": [3, 4]
},
"metadata": {}
}
exercises/inputs/3_files_and_commands/C/letter.png

9.76 KiB

exercises/inputs/3_files_and_commands/C/piece-1.png

3.17 KiB

exercises/inputs/3_files_and_commands/C/piece-2.png

3.5 KiB

exercises/inputs/3_files_and_commands/C/tile-0.png

3.58 KiB

exercises/inputs/3_files_and_commands/C/tile-1.png

2.95 KiB

exercises/inputs/3_files_and_commands/C/tile-2.png

3.85 KiB

exercises/inputs/3_files_and_commands/C/tile-3.png

3.16 KiB

{
"name": "Image tiling",
"fws": [
{
"fw_id": 1,
"name": "Render an image from a character",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["character"],
"outputs": ["image"],
"command_spec": {
"command": [
"convert", "-size", "800x800",
"-background", "white",
"-pointsize", "800",
"-fill", "blue",
"-gravity", "Center",
"-trim"
],
"character": {
"binding": {
"prefix": "caption",
"separator": ":"
},
"source": {
"type": "data",
"value": "D"
}
},
"image": {
"target": {
"type": "path",
"value": "/tmp/letter.png"
}
}
}
}
]
}
},
{
"fw_id": 2,
"name": "Tile the image into four tiles",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["image", "tiled image"],
"command_spec": {
"command": [
"convert",
"-crop", "2x2@"
],
"image": {
"source": "image"
},
"tiled image": {
"source": {
"type": "data",
"value": "/tmp/tile.png"
}
}
}
}
]
}
},
{
"fw_id": 3,
"name": "Rotate one tile 90 degrees clockwise",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["rotation angle", "piece 2"],
"outputs": ["top left"],
"command_spec": {
"command": ["convert", "-rotate"],
"rotation angle": {
"source": {
"type": "data",
"value": 90
}
},
"top left": {
"target": {
"type": "path",
"value": "/tmp/piece-2.png"
}
},
"piece 2": {
"source": "piece 2"
}
}
}
],
"piece 2": {
"type": "path",
"value": "/tmp/tile-0.png"
}
}
},
{
"fw_id": 4,
"name": "Flip another tile vertically",
"spec": {
"_tasks": [
{
"_fw_name": "CommandLineTask",
"inputs": ["piece 1"],
"outputs": ["bottom right"],
"command_spec": {
"command": ["convert", "-flip"],
"bottom right": {
"target": {
"type": "path",
"value": "/tmp/piece-1.png"
}
},
"piece 1": {
"source": "piece 1"
}
}
}
],
"piece 1": {
"type": "path",
"value": "/tmp/tile-3.png"
}
}
}
],
"links": {
"1": [2],
"2": [3, 4]
},
"metadata": {}
}
exercises/inputs/3_files_and_commands/D/letter.png

6.67 KiB

exercises/inputs/3_files_and_commands/D/piece-1.png

3.36 KiB

exercises/inputs/3_files_and_commands/D/piece-2.png

922 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment