TIFFRasters

Objective-C

@interface TIFFRasters : NSObject

Swift

class TIFFRasters : NSObject

Raster image values

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithWidth:(int)width
                        andHeight:(int)height
               andSamplesPerPixel:(int)samplesPerPixel
                 andBitsPerSample:(NSArray<NSNumber *> *)bitsPerSample
                  andSampleValues:(NSMutableArray<NSMutableArray *> *)sampleValues;

    Swift

    init!(width: Int32, andHeight height: Int32, andSamplesPerPixel samplesPerPixel: Int32, andBitsPerSample bitsPerSample: [NSNumber]!, andSampleValues sampleValues: NSMutableArray!)

    Parameters

    width

    width of pixels

    height

    height of pixels

    samplesPerPixel

    samples per pixel

    bitsPerSample

    bits per sample

    sampleValues

    empty sample values double array

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithWidth:(int)width
                        andHeight:(int)height
               andSamplesPerPixel:(int)samplesPerPixel
                 andBitsPerSample:(NSArray<NSNumber *> *)bitsPerSample
              andInterleaveValues:(NSMutableArray *)interleaveValues;

    Swift

    init!(width: Int32, andHeight height: Int32, andSamplesPerPixel samplesPerPixel: Int32, andBitsPerSample bitsPerSample: [NSNumber]!, andInterleaveValues interleaveValues: NSMutableArray!)

    Parameters

    width

    width of pixels

    height

    height of pixels

    samplesPerPixel

    samples per pixel

    bitsPerSample

    bits per sample

    interleaveValues

    empty interleaved values array

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithWidth:(int)width
                        andHeight:(int)height
               andSamplesPerPixel:(int)samplesPerPixel
                 andBitsPerSample:(NSArray<NSNumber *> *)bitsPerSample
                  andSampleValues:(NSMutableArray<NSMutableArray *> *)sampleValues
              andInterleaveValues:(NSMutableArray *)interleaveValues;

    Swift

    init!(width: Int32, andHeight height: Int32, andSamplesPerPixel samplesPerPixel: Int32, andBitsPerSample bitsPerSample: [NSNumber]!, andSampleValues sampleValues: NSMutableArray!, andInterleaveValues interleaveValues: NSMutableArray!)

    Parameters

    width

    width of pixels

    height

    height of pixels

    samplesPerPixel

    samples per pixel

    bitsPerSample

    bits per sample

    sampleValues

    empty sample values double array

    interleaveValues

    empty interleaved values array

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithWidth:(int)width
                        andHeight:(int)height
               andSamplesPerPixel:(int)samplesPerPixel
                 andBitsPerSample:(NSArray<NSNumber *> *)bitsPerSample;

    Swift

    init!(width: Int32, andHeight height: Int32, andSamplesPerPixel samplesPerPixel: Int32, andBitsPerSample bitsPerSample: [NSNumber]!)

    Parameters

    width

    width of pixels

    height

    height of pixels

    samplesPerPixel

    samples per pixel

    bitsPerSample

    bits per sample

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithWidth:(int)width
                        andHeight:(int)height
               andSamplesPerPixel:(int)samplesPerPixel
           andSingleBitsPerSample:(int)bitsPerSample;

    Swift

    init!(width: Int32, andHeight height: Int32, andSamplesPerPixel samplesPerPixel: Int32, andSingleBitsPerSample bitsPerSample: Int32)

    Parameters

    width

    width of pixels

    height

    height of pixels

    samplesPerPixel

    samples per pixel

    bitsPerSample

    bits per sample for all samples of a pixel

  • True if the results are stored by samples

    Declaration

    Objective-C

    - (BOOL)hasSampleValues;

    Swift

    func hasSampleValues() -> Bool

    Return Value

    true if results exist

  • True if the results are stored interleaved

    Declaration

    Objective-C

    - (BOOL)hasInterleaveValues;

    Swift

    func hasInterleaveValues() -> Bool

    Return Value

    true if results exist

  • Add a value to the sample results

    Declaration

    Objective-C

    - (void)addSampleValue:(NSObject *)value
                   toIndex:(int)sampleIndex
             andCoordinate:(int)coordinate;

    Swift

    func addSampleValue(_ value: NSObject!, to sampleIndex: Int32, andCoordinate coordinate: Int32)

    Parameters

    sampleIndex

    sample index

    coordinate

    coordinate location

    value

    value

  • Add a value to the interleaved results

    Declaration

    Objective-C

    - (void)addInterleaveValue:(NSObject *)value toCoordinate:(int)coordinate;

    Swift

    func addInterleaveValue(_ value: NSObject!, toCoordinate coordinate: Int32)

    Parameters

    coordinate

    coordinate location

    value

    value

  • Get the width of pixels

    Declaration

    Objective-C

    - (int)width;

    Swift

    func width() -> Int32

    Return Value

    width

  • Get the height of pixels

    Declaration

    Objective-C

    - (int)height;

    Swift

    func height() -> Int32

    Return Value

    height

  • Return the number of pixels

    Declaration

    Objective-C

    - (int)numPixels;

    Swift

    func numPixels() -> Int32

    Return Value

    number of pixels

  • Get the number of samples per pixel

    Declaration

    Objective-C

    - (int)samplesPerPixel;

    Swift

    func samplesPerPixel() -> Int32

    Return Value

    samples per pixel

  • Get the bits per sample

    Declaration

    Objective-C

    - (NSArray<NSNumber *> *)bitsPerSample;

    Swift

    func bitsPerSample() -> [NSNumber]!

    Return Value

    bits per sample

  • Get the results stored by samples

    Declaration

    Objective-C

    - (NSArray<NSArray *> *)sampleValues;

    Swift

    func sampleValues() -> [[Any]]!

    Return Value

    sample values

  • Set the results stored by samples

    Declaration

    Objective-C

    - (void)setSampleValuesAndValidate:
        (NSMutableArray<NSMutableArray *> *)sampleValues;

    Swift

    func setSampleValuesAndValidate(_ sampleValues: NSMutableArray!)

    Parameters

    sampleValues

    sample values

  • Get the results stored as interleaved pixel samples

    Declaration

    Objective-C

    - (NSArray *)interleaveValues;

    Swift

    func interleaveValues() -> [Any]!

    Return Value

    interleaved values

  • Set the results stored as interleaved pixel samples

    Declaration

    Objective-C

    - (void)setInterleaveValuesAndValidate:(NSMutableArray *)interleaveValues;

    Swift

    func setInterleaveValuesAndValidate(_ interleaveValues: NSMutableArray!)

    Parameters

    interleaveValues

    interleaved values

  • Get the pixel sample values

    Declaration

    Objective-C

    - (NSArray<NSNumber *> *)pixelAtX:(int)x andY:(int)y;

    Swift

    func pixelAt(x: Int32, andY y: Int32) -> [NSNumber]!

    Parameters

    x

    x coordinate (>= 0 && < width)

    y

    y coordinate (>= 0 && < height)

    Return Value

    pixel sample values

  • Set the pixel sample values

    Declaration

    Objective-C

    - (void)setPixelAtX:(int)x andY:(int)y withValues:(NSArray<NSNumber *> *)values;

    Swift

    func setPixelAtX(_ x: Int32, andY y: Int32, withValues values: [NSNumber]!)

    Parameters

    x

    x coordinate (>= 0 && < width)

    y

    y coordinate (>= 0 && < height)

    values

    pixel values

  • Get a pixel sample value

    Declaration

    Objective-C

    - (NSNumber *)pixelSampleAtSample:(int)sample andX:(int)x andY:(int)y;

    Swift

    func pixelSample(atSample sample: Int32, andX x: Int32, andY y: Int32) -> NSNumber!

    Parameters

    sample

    sample index (>= 0 && < samplesPerPixel)

    x

    x coordinate (>= 0 && < width)

    y

    y coordinate (>= 0 && < height)

    Return Value

    pixel sample

  • Set a pixel vample value

    Declaration

    Objective-C

    - (void)setPixelSampleAtSample:(int)sample
                              andX:(int)x
                              andY:(int)y
                         withValue:(NSNumber *)value;

    Swift

    func setPixelSampleAtSample(_ sample: Int32, andX x: Int32, andY y: Int32, withValue value: NSNumber!)

    Parameters

    sample

    sample index (>= 0 && < samplesPerPixel)

    x

    x coordinate (>= 0 && < width)

    y

    y coordinate (>= 0 && < height)

    value

    pixel value

  • Get the first pixel sample value, useful for single sample pixels (grayscale)

    Declaration

    Objective-C

    - (NSNumber *)firstPixelSampleAtX:(int)x andY:(int)y;

    Swift

    func firstPixelSampleAt(x: Int32, andY y: Int32) -> NSNumber!

    Parameters

    x

    x coordinate (>= 0 && < width)

    y

    y coordinate (>= 0 && < height)

    Return Value

    first pixel sample

  • Set the first pixel sample value, useful for single sample pixels (grayscale)

    Declaration

    Objective-C

    - (void)setFirstPixelSampleAtX:(int)x andY:(int)y withValue:(NSNumber *)value;

    Swift

    func setFirstPixelSampleAtX(_ x: Int32, andY y: Int32, withValue value: NSNumber!)

    Parameters

    x

    x coordinate (>= 0 && < width)

    y

    y coordinate (>= 0 && < height)

    value

    pixel value

  • Get the sample index location

    Declaration

    Objective-C

    - (int)sampleIndexAtX:(int)x andY:(int)y;

    Swift

    func sampleIndexAt(x: Int32, andY y: Int32) -> Int32

    Parameters

    x

    x coordinate

    y

    y coordinate

    Return Value

    sample index

  • Get the interleave index location

    Declaration

    Objective-C

    - (int)interleaveIndexAtX:(int)x andY:(int)y;

    Swift

    func interleaveIndexAt(x: Int32, andY y: Int32) -> Int32

    Parameters

    x

    x coordinate

    y

    y coordinate

    Return Value

    interleave index

  • Size in bytes of the image

    Declaration

    Objective-C

    - (int)size;

    Swift

    func size() -> Int32

    Return Value

    bytes

  • Size in bytes of a pixel

    Declaration

    Objective-C

    - (int)sizePixel;

    Swift

    func sizePixel() -> Int32

    Return Value

    bytes

  • Size in bytes of a sample

    Declaration

    Objective-C

    - (int)sizeSample:(int)sample;

    Swift

    func sizeSample(_ sample: Int32) -> Int32

    Parameters

    sample

    sample index

    Return Value

    bytes

  • Calculate the rows per strip to write

    Declaration

    Objective-C

    - (int)calculateRowsPerStripWithPlanarConfiguration:(int)planarConfiguration;

    Swift

    func calculateRowsPerStrip(withPlanarConfiguration planarConfiguration: Int32) -> Int32

    Parameters

    planarConfiguration

    chunky or planar

    Return Value

    rows per strip

  • Calculate the rows per strip to write

    Declaration

    Objective-C

    - (int)calculateRowsPerStripWithPlanarConfiguration:(int)planarConfiguration
                                    andMaxBytesPerStrip:(int)maxBytesPerStrip;

    Swift

    func calculateRowsPerStrip(withPlanarConfiguration planarConfiguration: Int32, andMaxBytesPerStrip maxBytesPerStrip: Int32) -> Int32

    Parameters

    planarConfiguration

    chunky or planar

    maxBytesPerStrip

    attempted max bytes per strip

    Return Value

    rows per strip

  • Create an empty sample values array

    Declaration

    Objective-C

    + (NSMutableArray<NSMutableArray *> *)
        createEmptySampleValuesWithSamplesPerPixel:(int)samplesPerPixel
                                          andWidth:(int)width
                                         andHeight:(int)height;

    Swift

    class func createEmptySampleValues(withSamplesPerPixel samplesPerPixel: Int32, andWidth width: Int32, andHeight height: Int32) -> NSMutableArray!

    Parameters

    samplesPerPixel

    samples per pixel

    width

    width of pixels

    height

    height of pixels

  • Create an empty sample values array

    Declaration

    Objective-C

    + (NSMutableArray<NSMutableArray *> *)
        createEmptySampleValuesWithSamplesPerPixel:(int)samplesPerPixel
                                         andPixels:(int)pixels;

    Swift

    class func createEmptySampleValues(withSamplesPerPixel samplesPerPixel: Int32, andPixels pixels: Int32) -> NSMutableArray!

    Parameters

    samplesPerPixel

    samples per pixel

    pixels

    number of pixels

  • Create an empty interleave values array

    Declaration

    Objective-C

    + (NSMutableArray *)createEmptyInterleaveValuesWithSamplesPerPixel:
                            (int)samplesPerPixel
                                                              andWidth:(int)width
                                                             andHeight:(int)height;

    Swift

    class func createEmptyInterleaveValues(withSamplesPerPixel samplesPerPixel: Int32, andWidth width: Int32, andHeight height: Int32) -> NSMutableArray!

    Parameters

    samplesPerPixel

    samples per pixel

    width

    width of pixels

    height

    height of pixels

  • Create an empty interleave values array

    Declaration

    Objective-C

    + (NSMutableArray *)createEmptyInterleaveValuesWithSamplesPerPixel:
                            (int)samplesPerPixel
                                                             andPixels:(int)pixels;

    Swift

    class func createEmptyInterleaveValues(withSamplesPerPixel samplesPerPixel: Int32, andPixels pixels: Int32) -> NSMutableArray!

    Parameters

    samplesPerPixel

    samples per pixel

    pixels

    number of pixels

  • Make a bits per sample array where each samples of a pixel has the same value

    Declaration

    Objective-C

    + (NSArray<NSNumber *> *)
        makeBitsPerSampleArrayWithSamplesPerPixel:(int)samplesPerPixel
                                 andBitsPerSample:(int)bitsPerSample;

    Swift

    class func makeBitsPerSampleArray(withSamplesPerPixel samplesPerPixel: Int32, andBitsPerSample bitsPerSample: Int32) -> [NSNumber]!

    Parameters

    samplesPerPixel

    samples per pixel

    bitsPerSample

    bits per sample for all samples of a pixel

    Return Value

    bits per sample array