Platforms to show: All Mac Windows Linux Cross-Platform

/Tiff/Tiff Speed Test
Feedback.

Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Tiff/Tiff Speed Test
This example is the version from Thu, 11th Feb 2009.
Notes: Last modified: Thu, 11th Feb 2009
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = &Beenden
Const kEditClear =
End Class

Class Window1
Inherits Window
// Event implementations
Sub Open()
dim f as FolderItem = SpecialFolder.Desktop.Child("EX119-020.tif")

if f=nil or f.Exists=false then
MsgBox "please change the path to point to another black/white tiff file!"
quit
end if

dim i,t1,t2,t3,t4,t5,t6 as integer
dim b as Boolean
dim t as MyTiff

// RGB
t=nil
t=new MyTiff

if t.Open(f) then

t3=Ticks
for i=1 to 10
b=t.ReadRGB
next
t3=ticks-t3

if not b then
MsgBox "ReadRGB failed!"
end if

else
Title="open failed"
end if

// PreviewRGB with factor 2
t=nil
t=new MyTiff

if t.Open(f) then

t4=Ticks
for i=1 to 10
b=t.ReadPreviewRGB(2)
next
t4=ticks-t4

if not b then
MsgBox "ReadPreviewRGB failed!"
else
title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
Backdrop=t.Pict
end if

else
Title="open failed"
end if

// PreviewRGB with factor 4
t=nil
t=new MyTiff

if t.Open(f) then

t5=Ticks
for i=1 to 10
b=t.ReadPreviewRGB(4)
next
t5=ticks-t5

if not b then
MsgBox "ReadPreviewRGB failed!"
else
title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
Backdrop=t.Pict
end if

else
Title="open failed"
end if

// PreviewRGB with factor 10
t=nil
t=new MyTiff

if t.Open(f) then

t6=Ticks
for i=1 to 10
b=t.ReadPreviewRGB(10)
next
t6=ticks-t6

if not b then
MsgBox "ReadPreviewRGB failed!"
else
title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
Backdrop=t.Pict
end if

else
Title="open failed"
end if

// BW
t=nil
t=new MyTiff

if t.Open(f) then

t1=Ticks
for i=1 to 10
b=t.ReadBW
next
t1=ticks-t1

if not b then
MsgBox "ReadBW failed!"
end if

else
Title="open failed"
end if

// PreviewBW
t=nil
t=new MyTiff

if t.Open(f) then

t2=Ticks
for i=1 to 10
b=t.ReadPreviewBW
next
t2=ticks-t2


if not b then
MsgBox "ReadPreviewBW failed!"
end if

if t.Pict=nil then
Title="nil!"
else
'title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
'Backdrop=t.Pict
end if

else
Title="open failed"
end if

MsgBox str(t1)+" ticks for ReadBW"+_
EndOfLine+stR(t2)+" ticks for ReadPreviewBW"+_
EndOfLine+stR(t3)+" ticks for ReadRGB"+_
EndOfLine+stR(t4)+" ticks for ReadPreviewRGB(2)"+_
EndOfLine+stR(t5)+" ticks for ReadPreviewRGB(4)"+_
EndOfLine+stR(t6)+" ticks for ReadPreviewRGB(10)"


End Sub
End Class

Class MyTiff
Inherits TiffPictureMBS
// Event implementations
Sub Error(libModule as string, message as string)
MsgBox Message

End Sub
Sub Warning(libModule as string, message as string)
'MsgBox Message

End Sub
End Class


See also:




Links
MBS Filemaker Plugins - Pfarrgemeinde Ministranten Nickenich