source pkgsNeeded.tcl

ui_init "t_mode.tcl"
SetFileTypes

PH "Image mode commands and constants" 

PN "info tclversion: " ; P [info tclversion]

PS

PN "GetNumThreads  : " ; P [poImageMode GetNumThreads]
PP "SetNumThreads 3 "  ; poImageMode SetNumThreads 3
PN "GetNumThreads  : " ; P [poImageMode GetNumThreads]

PS

P "GetColorCorrect: " ; poImageMode GetColorCorrect g rx ry gx gy bx by wx wy 
poImgUtil PrintColorCorrection $g $rx $ry $gx $gy $bx $by $wx $wy
PP "SetColorCorrect 1.0 0.5 0.5" ; poImageMode SetColorCorrect 1.0 0.5 0.5
P "GetColorCorrect: " ; poImageMode GetColorCorrect g rx ry gx gy bx by wx wy 
poImgUtil PrintColorCorrection $g $rx $ry $gx $gy $bx $by $wx $wy

PS

P  "GetFormat: " ; poImageMode GetFormat chns ; poImgUtil PrintChans $chns Format
PP "poImgUtil SetFormatRGB FLOAT UBYTE OFF" ; poImgUtil SetFormatRGB $FLOAT $UBYTE $OFF
P  "GetFormat: " ; poImageMode GetFormat chns ; poImgUtil PrintChans $chns Format

PS

P "GetCompression: " ; poImageMode GetCompression chns 
poImgUtil PrintChans $chns Compression
PP "poImgUtil SetCompressionRGB RLE RLE OFF" ; poImgUtil SetCompressionRGB $RLE $RLE $OFF
P "GetCompression: " ; poImageMode GetCompression chns 
poImgUtil PrintChans $chns Compression

PS

P  "GetDrawMask: " ; poImageMode GetDrawMask chns ; poImgUtil PrintChans $chns Drawmask
PP "poImgUtil SetDrawMaskRGBA ON ON OFF ON" ; poImgUtil SetDrawMaskRGBA $ON $ON $OFF $ON
P  "GetDrawMask: " ; poImageMode GetDrawMask chns ; poImgUtil PrintChans $chns Drawmask

PS

P  "GetDrawColor: " ; poImageMode GetDrawColor chns ; poImgUtil PrintChans $chns Drawcolor
PP "poImgUtil SetDrawColorRGBA 1.0 2.0 -2.0 0.5" ; poImgUtil SetDrawColorRGBA 1.0 2.0 -2.0 0.5
P  "GetDrawColor: " ; poImageMode GetDrawColor chns ; poImgUtil PrintChans $chns Drawcolor

PS

P  "GetDrawMode: " ; poImageMode GetDrawMode chns ; poImgUtil PrintChans $chns Drawmode
PP "poImgUtil SetDrawModeRGBA REPLACE ADD SUB XOR" ; poImgUtil SetDrawModeRGBA $REPLACE $ADD $SUB $XOR
P  "GetDrawMode: " ; poImageMode GetDrawMode chns ; poImgUtil PrintChans $chns Drawmode

PS

set fname "testIn/keksi$fInfo(suf)"
P "Getting header from poImage file: $fname"
P ""

P "GetFileInfo: " ; poImageMode GetFileInfo $fname w h a g rx ry gx gy bx by wx wy
poImgUtil PrintImgSize $w $h $a
poImgUtil PrintColorCorrection $g $rx $ry $gx $gy $bx $by $wx $wy
P ""

P "GetFileFormat: " ; poImageMode GetFileFormat $fname fmt
poImgUtil PrintImgFmt $fmt
P ""

PS
P "End of test"

ui_show

if { [lindex $argv 0] eq "auto" } {
    ui_exit
    exit 0
}
