This shows you the differences between two versions of the page.
image_adapter_examples [2023/11/16 13:09] montse |
image_adapter_examples [2023/12/18 13:43] (current) montse |
||
---|---|---|---|
Line 15: | Line 15: | ||
===== Predefined functions (PF) ===== | ===== Predefined functions (PF) ===== | ||
- | * **compareWithAnother addHeaderText**: compares the image of the adapter with another image. It has two input and one output parameter:\\ | + | * **compareWithAnother**: compares the image of the adapter with another image. It has two input and one output parameter:\\ |
* **ImageToCompare**: path of the image to compare. This is mandatory. | * **ImageToCompare**: path of the image to compare. This is mandatory. | ||
* **ResultPath**: path to the folder to leave the result. This is optional. If empty, the resulting image Will be in the TCD path. The new image will be an image with red rectangles marking the difference between images. | * **ResultPath**: path to the folder to leave the result. This is optional. If empty, the resulting image Will be in the TCD path. The new image will be an image with red rectangles marking the difference between images. | ||
Line 25: | Line 25: | ||
* **ImageToTransform**: path of the image to transform. This is optional. If the user does not enter a path, TAST uses the path of the image adapter. | * **ImageToTransform**: path of the image to transform. This is optional. If the user does not enter a path, TAST uses the path of the image adapter. | ||
* **Scale**: is mandatory, if the number is positive, it enlarges the image. If it is a negative number, it reduces the image. | * **Scale**: is mandatory, if the number is positive, it enlarges the image. If it is a negative number, it reduces the image. | ||
- | * **ResultPath**: path to the folder where to leave the result. This is optional. If empty, the resulting image will be in the TCD path.\\ \\ Let´s look at some examples:\\ \\ **First example: enlarging an image.**\\ \\ We have chosen an image, in this case, the image of a cat:\\ \\ {{ :redimensionar_0en.png?direct&300 |}}\\ \\ IMPORTANT: This function also allows us to resize another image. If we fill in this value (frame below in red), it will resize the image we set, not the one the adapter has in its configuration.\\ \\ In our example we are going to enlarge the image of the cat. We add the value **10**.\\ \\ {{ :redimensionar_otra_imagenen.png?direct&300 |}}\\ \\ We run the test case.\\ \\ {{ :es:redimensionar_1.png?direct&300 |}}\\ \\ The result tells us that it went well:\\ \\ {{ :es:redimensionar_3.png?direct&300 |}}\\ \\ And we get as a result the enlarged image of the cat. If we go to properties, we see that the size of the image is ten times bigger.\\ \\ {{ :es:redimensionar_4.png?direct&200 |}}\\ \\ Since the size of the initial image, with which we started from, was of:\\ \\ {{ :es:redimensionar_5.png?direct&200 |}}\\ \\ **Second example: reducing an image**.\\ \\ We start from the same initial image and to reduce it we ass the value **-10**:\\ \\ {{ :es:redimensionar_7.png?direct&300 |}}\\ \\ The result is a very small image of the cat. If we go to properties, we see that the size of the image is ten times smaller.\\ \\ {{ :es:redimensionar_6.png?direct&200 |}}\\ \\ IMPORTANT: If we now want to compare the enlarged image and the reduce image, we must set in the adapter configuration the large image so that it compares it with the small image, in this way we shorten the time it takes to generate the resulting image. Because the result is a third image that is generated from the second image (not the one from the adapter). Therefore, if the second image is very large, it will take the adapter a long time to copy it.\\ \\ | + | * **ResultPath**: path to the folder where to leave the result. This is optional. If empty, the resulting image will be in the TCD path.\\ \\ Let´s look at some examples:\\ \\ **First example: enlarging an image.**\\ \\ We have chosen an image, in this case, the image of a cat:\\ \\ {{ :redimensionar_0en.png?direct&300 |}}\\ \\ IMPORTANT: This function also allows us to resize another image. If we fill in this value (frame below in red), it will resize the image we set, not the one the adapter has in its configuration.\\ \\ In our example we are going to enlarge the image of the cat. We add the value **10**.\\ \\ {{ :redimensionar_otra_imagenen.png?direct&300 |}}\\ \\ We run the test case.\\ \\ {{ :es:redimensionar_1.png?direct&300 |}}\\ \\ The result tells us that it went well:\\ \\ {{ :es:redimensionar_3.png?direct&300 |}}\\ \\ And we get as a result the enlarged image of the cat. If we go to properties, we see that the size of the image is ten times bigger.\\ \\ {{ :es:redimensionar_4.png?direct&200 |}}\\ \\ Since the size of the initial image, with which we started from, was of:\\ \\ {{ :es:redimensionar_5.png?direct&200 |}}\\ \\ **Second example: reducing an image**.\\ \\ We start from the same initial image and to reduce it we ass the value **-10**:\\ \\ {{ :redimensionar_7en.png?direct&300 |}}\\ \\ The result is a very small image of the cat. If we go to properties, we see that the size of the image is ten times smaller.\\ \\ {{ :es:redimensionar_6.png?direct&200 |}}\\ \\ IMPORTANT: If we now want to compare the enlarged image and the reduce image, we must set in the adapter configuration the large image so that it compares it with the small image, in this way we shorten the time it takes to generate the resulting image. Because the result is a third image that is generated from the second image (not the one from the adapter). Therefore, if the second image is very large, it will take the adapter a long time to copy it.\\ \\ |
Line 32: | Line 32: | ||
* **transformBlackAndWhite**: allows you to transform a colour image into a black and white image. It has two input parameters: | * **transformBlackAndWhite**: allows you to transform a colour image into a black and white image. It has two input parameters: | ||
* **ImageToTranform**: path of the image to transform. This is optional. If the user does not enter a path, TAST uses the path of the image adapter. | * **ImageToTranform**: path of the image to transform. This is optional. If the user does not enter a path, TAST uses the path of the image adapter. | ||
- | * **ResultPath**: path to the folder where to leave the result. This is optional. If empty, the resulting image will be in the TCD path.\\ \\ Here is an example:\\ \\ {{ :es:blancoynegro_1.png?direct&300 |}}\\ \\ We have chosen an image, in this case, the image of an elephant. This is the image we put on the adapter.\\ \\ {{ :es:blancoynegro_4.png?direct&300 |}}\\ \\{{ :es:blancoynegro_3.png?direct&300 |}}\\ \\ We do not fill in any of the parameters. So what it will do is transform the colour elephant image into a black and white elephant image.\\ \\ {{ :es:blancoynegro_2.png?direct&300 |}}\\ \\ {{ :es:blancoynegro_5.png?direct&300 |}}\\ \\ Run the test case\\ \\ {{ :es:blancoynegro_4.1.png?direct&300 |}}\\ \\ The result is the elephant transformed into black and white:\\ \\ {{ :es:blancoynegro_4.2.png?direct&300 |}}\\ \\ {{ :es:blancoynegro_6.png?direct&300 |}}\\ \\ | + | * **ResultPath**: path to the folder where to leave the result. This is optional. If empty, the resulting image will be in the TCD path.\\ \\ Here is an example:\\ \\ {{ :blancoynegro_1en.png?direct&300 |}}\\ \\ We have chosen an image, in this case, the image of an elephant. This is the image we put on the adapter.\\ \\ {{ :es:blancoynegro_4.png?direct&300 |}}\\ \\ {{ :blancoynegro_3en.png?direct&300 |}}\\ \\ We do not fill in any of the parameters. So what it will do is transform the colour elephant image into a black and white elephant image.\\ \\ {{ :blancoynegro_2en.png?direct&300 |}}\\ \\ {{ :es:blancoynegro_5.png?direct&300 |}}\\ \\ Run the test case\\ \\ {{ :es:blancoynegro_4.1.png?direct&300 |}}\\ \\ The result is the elephant transformed into black and white:\\ \\ {{ :es:blancoynegro_4.2.png?direct&300 |}}\\ \\ {{ :es:blancoynegro_6.png?direct&300 |}}\\ \\ |