Our priority was to introduce as little changes into LibTiff's API as possible. But, as you can imagine, some changes had to be made because of differences between C and C# languages and underlying class libraries.
Also, we were unable to resist the temptation to rename some methods and types.
LibTiff prefers unsigned integer types for parameters and return values. LibTiff.Net, by contrast, prefers signed integer types for parameters and return values. You can pass unsigned values or convert return values to unsigned types if you wish, but keep in mind, that it will affect performance (not seriously, though).
General notes
TIFF struct changed it's name to Tiff and became full-featured class.
In LibTiff most functions were accepting pointer to a TIFF struct as first parameter. LibTiff.NET does not need it because these functions are now methods of Tiff class.
TIFFCodec struct changed it's name to TiffCodec and became full-featured class with virtual methods suitable for overloading.
TIFFTagMethods struct changed it's name to TiffTagMethods and became full-featured class with virtual methods suitable for overloading.
TIFFRegisterCODEC function changed it's name and signature. It is now known as RegisterCodec(TiffCodec) and gets an instance of class derived from TiffCodec.
Custom error handling strategy changed. Now you should provide implementation of a class derived from TiffErrorHandler and pass it as parameter to SetErrorHandler(TiffErrorHandler) method.
Custom file/stream handling strategy changed. Now you should provide implementation of a class derived from TiffStream and pass it as parameter to ClientOpen(String, String, Object, TiffStream) method.
Renamings of functions
Libtiff name | LibTiff.Net name / notes |
---|---|
TIFFGetA | GetA(Int32) |
TIFFGetB | GetB(Int32) |
TIFFGetG | GetG(Int32) |
TIFFGetR | GetR(Int32) |
TIFF.tif_cleanup | Cleanup() |
TIFF.tif_close | Close() |
TIFF.tif_decoderow | DecodeRow(Byte[], Int32, Int32, Int16) |
TIFF.tif_decodestrip | DecodeStrip(Byte[], Int32, Int32, Int16) |
TIFF.tif_decodetile | DecodeTile(Byte[], Int32, Int32, Int16) |
TIFF.tif_defstripsize | DefStripSize(Int32) |
TIFF.tif_deftilesize | DefTileSize(ref Int32, ref Int32) |
TIFF.tif_encoderow | EncodeRow |
TIFF.tif_encodestrip | EncodeStrip |
TIFF.tif_encodetile | EncodeTile |
TIFF.tif_postencode | PostEncode() |
TIFF.tif_predecode | PreDecode(Int16) |
TIFF.tif_preencode | PreEncode(Int16) |
TIFF.tif_seek | Seek(Int32) |
TIFF.tif_setupdecode | SetupDecode() |
TIFF.tif_setupencode | SetupEncode() |
TIFFTagMethods.printdir | PrintDirectory(Stream, TiffPrintFlags) |
TIFFTagMethods.vgetfield | GetField |
TIFFTagMethods.vsetfield | SetField |
_TIFFmemcmp | Compare(Int16[], Int16[], Int32) (for some types, write us if you need another overload.) |
_TIFFmemcpy | no longer exists |
_TIFFmemset | no longer exists |
_TIFFrealloc | Realloc(Byte[], Int32) (for some types, write us if you need another overload.) |
TIFFAccessTagMethods | GetTagMethods() (Also added SetTagMethods(TiffTagMethods) in order to retain original abilities TIFFAccessTagMethods) |
TIFFCheckTile | CheckTile(Int32, Int32, Int32, Int16) |
TIFFCheckpointDirectory | CheckpointDirectory() |
TIFFCleanup | no longer exists |
TIFFClientOpen | ClientOpen |
TIFFClientdata | Clientdata() |
TIFFClose | Close() |
TIFFComputeStrip | ComputeStrip |
TIFFComputeTile | ComputeTile |
TIFFCreateDirectory | CreateDirectory() |
TIFFCurrentDirOffset | CurrentDirOffset() |
TIFFCurrentDirectory | CurrentDirectory() |
TIFFCurrentRow | CurrentRow() |
TIFFCurrentStrip | CurrentStrip() |
TIFFCurrentTile | CurrentTile() |
TIFFDataWidth | DataWidth |
TIFFDefaultStripSize | DefaultStripSize(Int32) |
TIFFDefaultTileSize | DefaultTileSize(ref Int32, ref Int32) |
TIFFError | Error(String, String, Object[]) (also added overloaded method Error(Tiff, String, String, Object[]) that accepts Tiff class instance as first parameter. Please use that overloaded method) |
TIFFErrorExt | ErrorExt(Object, String, String, Object[]) (also added overloaded method ErrorExt(Tiff, Object, String, String, Object[]) that accepts Tiff class instance as first parameter. Please use that overloaded method) |
TIFFExtendProc | Tiff.TiffExtendProc |
TIFFFdOpen | no longer exists (please use Open(String, String)) |
TIFFFieldWithName | FieldWithName(String) |
TIFFFieldWithTag | FieldWithTag |
TIFFFileName | FileName() |
TIFFFileno | no longer exists |
TIFFFindCODEC | FindCodec(Compression) |
TIFFFindFieldInfo | FindFieldInfo(TiffTag, TiffType) |
TIFFFindFieldInfoByName | FindFieldInfoByName(String, TiffType) |
TIFFFlush | Flush() |
TIFFFlushData | FlushData() |
TIFFFreeDirectory | FreeDirectory() |
TIFFGetBitRevTable | GetBitRevTable(Boolean) |
TIFFGetClientInfo | GetClientInfo(String) |
TIFFGetCloseProc | no longer exists (please use GetStream()) |
TIFFGetConfiguredCODECs | GetConfiguredCodecs() |
TIFFGetField | GetField(TiffTag) |
TIFFGetFieldDefaulted | GetFieldDefaulted(TiffTag) |
TIFFGetMapFileProc | no longer exists (please use GetStream()) |
TIFFGetMode | GetMode() |
TIFFGetReadProc | no longer exists (please use GetStream()) |
TIFFGetSeekProc | no longer exists (please use GetStream()) |
TIFFGetSizeProc | no longer exists (please use GetStream()) |
TIFFGetTagListCount | GetTagListCount() |
TIFFGetTagListEntry | GetTagListEntry(Int32) |
TIFFGetUnmapFileProc | no longer exists (please use GetStream()) |
TIFFGetVersion | GetVersion() |
TIFFGetWriteProc | no longer exists (please use GetStream()) |
TIFFIsBigEndian | IsBigEndian() |
TIFFIsByteSwapped | IsByteSwapped() |
TIFFIsCODECConfigured | IsCodecConfigured |
TIFFIsMSB2LSB | IsMSB2LSB() |
TIFFIsTiled | IsTiled() |
TIFFIsUpSampled | IsUpSampled() |
TIFFLastDirectory | LastDirectory() |
TIFFMergeFieldInfo | MergeFieldInfo |
TIFFNumberOfDirectories | NumberOfDirectories() |
TIFFNumberOfStrips | NumberOfStrips() |
TIFFNumberOfTiles | NumberOfTiles() |
TIFFOpen | Open(String, String) |
TIFFOpenW | no longer exists (please use Open(String, String)) |
TIFFPrintDirectory | PrintDirectory(Stream) |
TIFFRGBAImageOK | RGBAImageOK(out String) |
TIFFRasterScanlineSize | RasterScanlineSize() |
TIFFRawStripSize | RawStripSize(Int32) |
TIFFReadBufferSetup | ReadBufferSetup(Byte[], Int32) |
TIFFReadCustomDirectory | ReadCustomDirectory(Int64, TiffFieldInfo[], Int32) |
TIFFReadDirectory | ReadDirectory() |
TIFFReadEXIFDirectory | ReadEXIFDirectory(Int64) |
TIFFReadEncodedStrip | ReadEncodedStrip(Int32, Byte[], Int32, Int32) |
TIFFReadEncodedTile | ReadEncodedTile(Int32, Byte[], Int32, Int32) |
TIFFReadRGBAImage | ReadRGBAImage |
TIFFReadRGBAImageOriented | ReadRGBAImageOriented |
TIFFReadRGBAStrip | ReadRGBAStrip |
TIFFReadRGBATile | ReadRGBATile |
TIFFReadRawStrip | ReadRawStrip |
TIFFReadRawTile | ReadRawTile(Int32, Byte[], Int32, Int32) |
TIFFReadScanline | ReadScanline |
TIFFReadTile | ReadTile(Byte[], Int32, Int32, Int32, Int32, Int16) |
TIFFReassignTagToIgnore | no longer exists |
TIFFRegisterCODEC | RegisterCodec(TiffCodec) |
TIFFReverseBits | ReverseBits(Byte[], Int32) |
TIFFRewriteDirectory | RewriteDirectory() |
TIFFScanlineSize | ScanlineSize() |
TIFFSetClientInfo | SetClientInfo(Object, String) |
TIFFSetClientdata | SetClientdata(Object) |
TIFFSetDirectory | SetDirectory(Int16) |
TIFFSetErrorHandler | no longer exists (use SetErrorHandler(TiffErrorHandler) with instance of class derived from TiffErrorHandler) |
TIFFSetErrorHandlerExt | no longer exists (use SetErrorHandler(TiffErrorHandler) with instance of class derived from TiffErrorHandler) |
TIFFSetField | SetField(TiffTag, Object[]) |
TIFFSetFileName | SetFileName(String) |
TIFFSetFileno | no longer exists |
TIFFSetMode | SetMode(Int32) |
TIFFSetSubDirectory | SetSubDirectory(Int64) |
TIFFSetTagExtender | SetTagExtender(Tiff.TiffExtendProc) |
TIFFSetWarningHandler | no longer exists (use SetErrorHandler(TiffErrorHandler) with instance of class derived from TiffErrorHandler) |
TIFFSetWarningHandlerExt | no longer exists (use SetErrorHandler(TiffErrorHandler) with instance of class derived from TiffErrorHandler) |
TIFFSetWriteOffset | SetWriteOffset(Int64) |
TIFFSetupStrips | SetupStrips() |
TIFFStripSize | StripSize() |
TIFFSwabArrayOfDouble | SwabArrayOfDouble(Double[], Int32) |
TIFFSwabArrayOfLong | SwabArrayOfLong(Int32[], Int32) |
TIFFSwabArrayOfShort | SwabArrayOfShort(Int16[], Int32) |
TIFFSwabArrayOfTriples | SwabArrayOfTriples |
TIFFSwabDouble | SwabDouble(ref Double) |
TIFFSwabLong | SwabLong(ref Int32) |
TIFFSwabShort | SwabShort(ref Int16) |
TIFFTileRowSize | TileRowSize() |
TIFFTileSize | TileSize() |
TIFFUnRegisterCODEC | UnRegisterCodec(TiffCodec) |
TIFFUnlinkDirectory | UnlinkDirectory(Int16) |
TIFFVGetField | no longer exists (please use GetField(TiffTag)) |
TIFFVGetFieldDefaulted | no longer exists (please use GetFieldDefaulted(TiffTag)) |
TIFFVSetField | no longer exists (please use SetField(TiffTag, Object[])) |
TIFFVStripSize | VStripSize(Int32) |
TIFFVTileSize | VTileSize(Int32) |
TIFFWarning | Warning(String, String, Object[]) (also added overloaded method Warning(Tiff, String, String, Object[]) that accepts Tiff class instance as first parameter. Please use that overloaded method) |
TIFFWarningExt | WarningExt(Object, String, String, Object[]) (also added overloaded method WarningExt(Tiff, Object, String, String, Object[]) that accepts Tiff class instance as first parameter. Please use that overloaded method) |
TIFFWriteBufferSetup | WriteBufferSetup(Byte[], Int32) |
TIFFWriteCheck | WriteCheck(Boolean, String) |
TIFFWriteDirectory | WriteDirectory() |
TIFFWriteEncodedStrip | WriteEncodedStrip |
TIFFWriteEncodedTile | WriteEncodedTile |
TIFFWriteRawStrip | WriteRawStrip |
TIFFWriteRawTile | WriteRawTile |
TIFFWriteScanline | WriteScanline |
TIFFWriteTile | WriteTile |
Renamings of constants and types
Libtiff name | LibTiff.Net name / notes |
---|---|
CLEANFAXDATA_* | CleanFaxData.* |
COLORRESPONSEUNIT_* | ColorResponseUnit.CRU* |
COMPRESSION_* | Compression.* |
EXIFTAG_* | TiffTag.EXIF_* |
EXTRASAMPLE_* | ExtraSample.* |
FAXMODE_* | FaxMode.* |
FILETYPE_* | FileType.* |
FILLORDER_* | FillOrder.* |
GRAYRESPONSEUNIT_* | GrayResponseUnit.GRU* |
GROUP3OPT_* | Group3Opt.* (note, that GROUP3OPT_2DENCODING renamed to ENCODING2D) |
INKSET_* | InkSet.* |
JPEGCOLORMODE_* | JpegColorMode.* |
JPEGPROC_* | JpegProc.* |
JPEGTABLESMODE_* | JpegTablesMode.* |
OFILETYPE_* | OFileType.* |
ORIENTATION_* | Orientation.* |
PHOTOMETRIC_* | Photometric.* |
PLANARCONFIG_* | PlanarConfig.* |
PREDICTOR_* | Predictor.* |
RESUNIT_* | ResUnit.* |
SAMPLEFORMAT_* | SampleFormat.* |
THRESHHOLD_* | Threshold.* |
TIFFPRINT_* | TiffPrintFlags.* |
TIFFTAG_* | TiffTag.* |
YCBCRPOSITION_* | YCbCrPosition.* |
TIFFDataType.TIFF_* | TiffType.* |
TIFFFieldInfo | TiffFieldInfo |
TIFFRGBAImage | TiffRgbaImage |