0030182: Visualization, Image_AlienPixMap - support reading encoded image from memory...
[occt.git] / tests / bugs / vis / bug30182
CommitLineData
88b12b7c 1puts "============"
2puts "0030182: Visualization, Image_AlienPixMap - support reading encoded image from memory buffer"
3puts "============"
4puts ""
5
6set anImg1 [locate_data_file hatch_1.png]
7set anImg2 [locate_data_file OCC1188.gif]
8set anImgTmp "$imagedir/${casename}_img.bin"
9
10set aTmpOut [open "$anImgTmp" w]
11fconfigure $aTmpOut -translation binary
12foreach aFileIter {anImg1 anImg2} {
13 set aFileName [set $aFileIter]
14 set aFileIn [open $aFileName]
15 fconfigure $aFileIn -translation binary
16 fcopy $aFileIn $aTmpOut
17 close $aFileIn
18}
19close $aTmpOut
20
21pload VISUALIZATION QAcommands
22vclear
23vinit View1
24vtop
25
26OCC30182 t $anImg1 -fileName; vfit
27vdump $imagedir/${casename}_1.png
28
29OCC30182 t $anImg1 -stream; vfit
30vdump $imagedir/${casename}_1s1.png
31
32OCC30182 t $anImg1 -memory; vfit
33vdump $imagedir/${casename}_1m1.png
34
35OCC30182 t $anImg2 -fileName; vfit
36vdump $imagedir/${casename}_2.png
37
38OCC30182 t $anImg2 -stream; vfit
39vdump $imagedir/${casename}_2s1.png
40
41OCC30182 t $anImg2 -memory; vfit
42vdump $imagedir/${casename}_2m1.png
43
44OCC30182 t $anImgTmp -stream -offset 0; vfit
45vdump $imagedir/${casename}_1s2.png
46
47OCC30182 t $anImgTmp -memory -offset 0; vfit
48vdump $imagedir/${casename}_1m2.png
49
50OCC30182 t $anImgTmp -stream -offset [file size $anImg1]; vfit
51vdump $imagedir/${casename}_2s2.png
52
53OCC30182 t $anImgTmp -memory -offset [file size $anImg1]; vfit
54vdump $imagedir/${casename}_2m2.png
55
56if { [diffimage $imagedir/${casename}_1s1.png $imagedir/${casename}_1.png] != 0 } { puts "Error 1s1" }
57if { [diffimage $imagedir/${casename}_1m1.png $imagedir/${casename}_1.png] != 0 } { puts "Error 1m1" }
58if { [diffimage $imagedir/${casename}_1s2.png $imagedir/${casename}_1.png] != 0 } { puts "Error 1s2" }
59if { [diffimage $imagedir/${casename}_1m2.png $imagedir/${casename}_1.png] != 0 } { puts "Error 1m2" }
60
61if { [diffimage $imagedir/${casename}_2s1.png $imagedir/${casename}_2.png] != 0 } { puts "Error 2s1" }
62if { [diffimage $imagedir/${casename}_2m1.png $imagedir/${casename}_2.png] != 0 } { puts "Error 2m1" }
63if { [diffimage $imagedir/${casename}_2s2.png $imagedir/${casename}_2.png] != 0 } { puts "Error 2s2" }
64if { [diffimage $imagedir/${casename}_2m2.png $imagedir/${casename}_2.png] != 0 } { puts "Error 2m2" }