summaryrefslogtreecommitdiffstats
path: root/debian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-09-11 14:38:47 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-09-11 14:38:47 +0900
commit884c8093d63402a1ad0b502244b791e3c6782be3 (patch)
treea600d4ab0d431a2bdfe4c15b70df43c14fbd8dd0 /debian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS
parent14e1aa2006796f147f3f4811fb908a6b01e79253 (diff)
downloadextra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.tar.gz
extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.zip
Added debian extra dependency packages.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS')
-rwxr-xr-xdebian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS71
1 files changed, 71 insertions, 0 deletions
diff --git a/debian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS b/debian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS
new file mode 100755
index 00000000..5530c1a6
--- /dev/null
+++ b/debian/lcms/lcms-1.19.dfsg2/Delphi/Samples/TEST.PAS
@@ -0,0 +1,71 @@
+
+
+
+PROGRAM LcmsTest;
+USES lcmsdll, Windows;
+
+TYPE
+ ScanLineType = Array[0..255] OF PACKED RECORD
+ b, g, r: Byte;
+ END;
+
+VAR
+ hInProfile, hOutProfile: cmsHPROFILE;
+ hTransform: cmsHTRANSFORM;
+
+ ScanLine, ScanLineTranslated: ScanLineType;
+ r, g, b: Integer;
+
+
+BEGIN
+
+
+ hInProfile := cmsOpenProfileFromFile('HPSJTW.ICM', 'r');
+ hOutProfile := cmsOpenProfileFromFile('sRGB Color Space Profile.ICM', 'r');
+
+
+ WriteLn('Input profile : ', cmsTakeProductName(hInProfile));
+ WriteLn('Output profile : ', cmsTakeProductName(hOutProfile));
+
+
+ hTransform := cmsCreateTransform(hInProfile,
+ TYPE_BGR_8,
+ hOutProfile,
+ TYPE_BGR_8,
+ INTENT_PERCEPTUAL, 0);
+
+ WriteLn('As speed test, I will transform all spectrum...');
+ WriteLn('This implies an image of 255x255x255x3 = 47 MB!!!');
+ WriteLn('Each number represents a chunk 255x255x3 = 190.5 Kb! processed');
+
+ FOR r := 0 TO 255 DO
+ BEGIN
+ FOR g := 0 TO 255 DO
+ BEGIN
+ FOR b := 0 TO 255 DO
+ BEGIN
+
+ ScanLine[b].r := r;
+ ScanLine[b].g := g;
+ ScanLine[b].b := b;
+ END;
+
+ cmsDoTransform(hTransform,
+ @ScanLine,
+ @ScanLineTranslated,
+ 255)
+
+ END;
+
+ Write(r:4, #$0d)
+ END;
+ WriteLn; WriteLn('Done!!!');
+
+
+
+ cmsDeleteTransform(hTransform);
+ cmsCloseProfile(hInProfile);
+ cmsCloseProfile(hOutProfile);
+
+END.
+