Show / Hide Table of Contents

Class TiffCodec

Base class for all codecs within the library.

Inheritance
System.Object
TiffCodec
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: BitMiracle.LibTiff.Classic
Assembly: BitMiracle.LibTiff.NET.dll
Syntax
public class TiffCodec
Remarks

A codec is a class that implements decoding, encoding, or decoding and encoding of a compression algorithm.

The library provides a collection of builtin codecs. More codecs may be registered through calls to the library and/or the builtin implementations may be overridden.

Constructors

| Improve this Doc View Source

TiffCodec(Tiff, Compression, String)

Initializes a new instance of the TiffCodec class.

Declaration
public TiffCodec(Tiff tif, Compression scheme, string name)
Parameters
Type Name Description
Tiff tif

An instance of Tiff class.

Compression scheme

The compression scheme for the codec.

System.String name

The name of the codec.

Fields

| Improve this Doc View Source

m_name

Codec name.

Declaration
protected string m_name
Field Value
Type Description
System.String
| Improve this Doc View Source

m_scheme

Compression scheme this codec impelements.

Declaration
protected Compression m_scheme
Field Value
Type Description
Compression
| Improve this Doc View Source

m_tif

An instance of Tiff.

Declaration
protected Tiff m_tif
Field Value
Type Description
Tiff

Properties

| Improve this Doc View Source

CanDecode

Gets a value indicating whether this codec can decode data.

Declaration
public virtual bool CanDecode { get; }
Property Value
Type Description
System.Boolean

true if this codec can decode data; otherwise, false.

| Improve this Doc View Source

CanEncode

Gets a value indicating whether this codec can encode data.

Declaration
public virtual bool CanEncode { get; }
Property Value
Type Description
System.Boolean

true if this codec can encode data; otherwise, false.

Methods

| Improve this Doc View Source

Cleanup()

Cleanups the state of the codec.

Declaration
public virtual void Cleanup()
Remarks

Cleanup is called when codec is no longer needed (won't be used) and can be used for example to restore tag methods that were substituted.

| Improve this Doc View Source

Close()

Flushes any internal data buffers and terminates current operation.

Declaration
public virtual void Close()
| Improve this Doc View Source

DecodeRow(Byte[], Int32, Int32, Int16)

Decodes one row of image data.

Declaration
public virtual bool DecodeRow(byte[] buffer, int offset, int count, short plane)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to place decoded image data to.

System.Int32 offset

The zero-based byte offset in buffer at which to begin storing decoded bytes.

System.Int32 count

The number of decoded bytes that should be placed to buffer.

System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if image data was decoded successfully; otherwise, false.

| Improve this Doc View Source

DecodeStrip(Byte[], Int32, Int32, Int16)

Decodes one strip of image data.

Declaration
public virtual bool DecodeStrip(byte[] buffer, int offset, int count, short plane)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to place decoded image data to.

System.Int32 offset

The zero-based byte offset in buffer at which to begin storing decoded bytes.

System.Int32 count

The number of decoded bytes that should be placed to buffer.

System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if image data was decoded successfully; otherwise, false.

| Improve this Doc View Source

DecodeTile(Byte[], Int32, Int32, Int16)

Decodes one tile of image data.

Declaration
public virtual bool DecodeTile(byte[] buffer, int offset, int count, short plane)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to place decoded image data to.

System.Int32 offset

The zero-based byte offset in buffer at which to begin storing decoded bytes.

System.Int32 count

The number of decoded bytes that should be placed to buffer.

System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if image data was decoded successfully; otherwise, false.

| Improve this Doc View Source

DefStripSize(Int32)

Calculates and/or constrains a strip size.

Declaration
public virtual int DefStripSize(int size)
Parameters
Type Name Description
System.Int32 size

The proposed strip size (may be zero or negative).

Returns
Type Description
System.Int32

A strip size to use.

| Improve this Doc View Source

DefTileSize(ref Int32, ref Int32)

Calculate and/or constrains a tile size

Declaration
public virtual void DefTileSize(ref int width, ref int height)
Parameters
Type Name Description
System.Int32 width

The proposed tile width upon the call / tile width to use after the call.

System.Int32 height

The proposed tile height upon the call / tile height to use after the call.

| Improve this Doc View Source

EncodeRow(Byte[], Int32, Int32, Int16)

Encodes one row of image data.

Declaration
public virtual bool EncodeRow(byte[] buffer, int offset, int count, short plane)
Parameters
Type Name Description
System.Byte[] buffer

The buffer with image data to be encoded.

System.Int32 offset

The zero-based byte offset in buffer at which to begin read image data.

System.Int32 count

The maximum number of encoded bytes that can be placed to buffer.

System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if image data was encoded successfully; otherwise, false.

| Improve this Doc View Source

EncodeStrip(Byte[], Int32, Int32, Int16)

Encodes one strip of image data.

Declaration
public virtual bool EncodeStrip(byte[] buffer, int offset, int count, short plane)
Parameters
Type Name Description
System.Byte[] buffer

The buffer with image data to be encoded.

System.Int32 offset

The zero-based byte offset in buffer at which to begin read image data.

System.Int32 count

The maximum number of encoded bytes that can be placed to buffer.

System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if image data was encoded successfully; otherwise, false.

| Improve this Doc View Source

EncodeTile(Byte[], Int32, Int32, Int16)

Encodes one tile of image data.

Declaration
public virtual bool EncodeTile(byte[] buffer, int offset, int count, short plane)
Parameters
Type Name Description
System.Byte[] buffer

The buffer with image data to be encoded.

System.Int32 offset

The zero-based byte offset in buffer at which to begin read image data.

System.Int32 count

The maximum number of encoded bytes that can be placed to buffer.

System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if image data was encoded successfully; otherwise, false.

| Improve this Doc View Source

Init()

Initializes this instance.

Declaration
public virtual bool Init()
Returns
Type Description
System.Boolean

true if initialized successfully

| Improve this Doc View Source

PostEncode()

Performs any actions after encoding required by the codec.

Declaration
public virtual bool PostEncode()
Returns
Type Description
System.Boolean

true if all post-encode actions succeeded; otherwise, false

Remarks

PostEncode is called after encoding and can be used to release any external resources needed during encoding.

| Improve this Doc View Source

PreDecode(Int16)

Prepares the decoder part of the codec for a decoding.

Declaration
public virtual bool PreDecode(short plane)
Parameters
Type Name Description
System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if this codec successfully prepared its decoder part and ready to decode data; otherwise, false.

Remarks

PreDecode is called after SetupDecode() and before decoding.

| Improve this Doc View Source

PreEncode(Int16)

Prepares the encoder part of the codec for a encoding.

Declaration
public virtual bool PreEncode(short plane)
Parameters
Type Name Description
System.Int16 plane

The zero-based sample plane index.

Returns
Type Description
System.Boolean

true if this codec successfully prepared its encoder part and ready to encode data; otherwise, false.

Remarks

PreEncode is called after SetupEncode() and before encoding.

| Improve this Doc View Source

Seek(Int32)

Seeks the specified row in the strip being processed.

Declaration
public virtual bool Seek(int row)
Parameters
Type Name Description
System.Int32 row

The row to seek.

Returns
Type Description
System.Boolean

true if specified row was successfully found; otherwise, false

| Improve this Doc View Source

SetupDecode()

Setups the decoder part of the codec.

Declaration
public virtual bool SetupDecode()
Returns
Type Description
System.Boolean

true if this codec successfully setup its decoder part and can decode data; otherwise, false.

Remarks

SetupDecode is called once before PreDecode(Int16).

| Improve this Doc View Source

SetupEncode()

Setups the encoder part of the codec.

Declaration
public virtual bool SetupEncode()
Returns
Type Description
System.Boolean

true if this codec successfully setup its encoder part and can encode data; otherwise, false.

Remarks

SetupEncode is called once before PreEncode(Int16).

  • Improve this Doc
  • View Source
Back to top Generated by DocFX