mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-11 19:28:40 +00:00
34 lines
739 B
C++
Executable File
34 lines
739 B
C++
Executable File
/**
|
|
* Jingga
|
|
*
|
|
* @package Test
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
#include <stdio.h>
|
|
|
|
#include "../../Image/ImageUtils.h"
|
|
#include "../../Utils/TestUtils.h"
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
printf("ImageUtils:\n\n");
|
|
|
|
printf("lightnessFromRgb:\n");
|
|
|
|
float white = Image::ImageUtils::lightnessFromRgb(255, 255, 255);
|
|
ASSERT_EQUALS(white, 1.0, "%f", "%f");
|
|
|
|
float black = Image::ImageUtils::lightnessFromRgb(0, 0, 0);
|
|
ASSERT_EQUALS(black, 0.0, "%f", "%f");
|
|
|
|
float other = Image::ImageUtils::lightnessFromRgb(125, 125, 125);
|
|
ASSERT_EQUALS_WITH_DELTA(other, 0.524, 0.01, "%f", "%f");
|
|
|
|
printf("\n\n");
|
|
|
|
return 0;
|
|
}
|