Platforms to show: All Mac Windows Linux Cross-Platform
Back to TiffPictureMBS class.
TiffPictureMBS.RawStripSize(strip as UInt32) as UInt64
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.ReadBW as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
Some examples using this method:
TiffPictureMBS.ReadBW(left as Integer, top as Integer, width as Integer, height as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
TiffPictureMBS.ReadEncodedStrip(strip as UInt32, byref data as Memoryblock) as UInt32
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the specified strip of data and place up to size bytes of decompressed information in the (user supplied) data buffer.
The value of strip is a "raw strip number". That is, the caller must take into account whether or not the data are organized in separate planes (PlanarConfiguration=2). To read a full strip of data the data buffer should typically be at least as large as the number returned by StripSize.
The library attempts to hide bit- and byte-ordering differences between the image and the native machine by converting data to the native machine order. Bit reversal is done if the FillOrder tag is opposite to the native machine bit order. 16- and 32-bit samples are automatically byte-swapped if the file was written with a byte order opposite to the native machine byte order,
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedStrip returns -1 if an error was encountered.
TiffPictureMBS.ReadEncodedTile(tile as UInt32, byref data as Memoryblock) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the specified tile of data and place up to size bytes of decompressed information in the (user supplied) data buffer.
The value of tile is a "raw tile number". That is, the caller must take into account whether or not the data are organized in separate planes (PlanarConfiguration=2). ComputeTile automatically does this when converting an (x,y,z,sample) coordinate quadruple to a tile number. To read a full tile of data the data buffer should be at least as large as the value returned by TileSize.
The library attempts to hide bit- and byte-ordering differences between the image and the native machine by converting data to the native machine order. Bit reversal is done if the FillOrder tag is opposite to the native machine bit order. 16- and 32-bit samples are automatically byte-swapped if the file was written with a byte order opposite to the native machine byte order,
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedTile returns −1 if an error was encountered.
TiffPictureMBS.ReadPreviewBW as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is faster than ReadBW, because it reads only every 8th line and every 8th pixel in each row. So the picture you get is much smaller, but may be enough for a preview.
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
Some examples using this method:
TiffPictureMBS.ReadPreviewBW(left as Integer, top as Integer, width as Integer, height as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is faster than ReadBW, because it reads only every 8th line and every 8th pixel in each row. So the picture you get is much smaller, but may be enough for a preview.
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
TiffPictureMBS.ReadPreviewRGB(ReduceFactor as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is faster than ReadRGB, because it reads only every ReduceFactorth line and every ReduceFactorth pixel in each row. So the picture you get is much smaller, but may be enough for a preview.
Returns true on success.
ReadRGB does converting on the picture data if needed so you can read CMYK, RGB, BW and other image data using this function.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
Some examples using this method:
TiffPictureMBS.ReadRawStrip(strip as UInt32, byref data as Memoryblock) as UInt32
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the contents of the specified strip into the (user supplied) data buffer. Note that the value of strip is a "raw strip number". That is, the caller must take into account whether or not the data is organized in separate planes (PlanarConfiguration=2). To read a full strip of data the data buffer should typically be at least as large as the number returned by StripSize.
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedStrip returns -1 if an error was encountered.
TiffPictureMBS.ReadRawTile(tile as UInt32, byref data as Memoryblock) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the contents of the specified tile into the (user supplied) data buffer. Note that the value of tile is a "raw tile number". That is, the caller must take into account whether or not the data is organized in separate planes (PlanarConfiguration=2). ComputeTile automatically does this when converting an (x,y,z,sample) coordinate quadruple to a tile number. To read a full tile of data the data buffer should typically be at least as large as the value returned by TileSize.
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedTile returns −1 if an error was encountered.
TiffPictureMBS.ReadRGB as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
ReadRGB does converting on the picture data if needed so you can read CMYK, RGB, BW and other image data using this function.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
See also:
Some examples using this method:
- /Images/JPEG/Quickly generate previews for JPEG and Tiff
- /Images/LargePicture/Tiff Load and Save
- /Images/LCMS2/Convert image to sRGB JPEG
- /Images/Tiff/BigTiff Test
- /Images/Tiff/Quickly generate previews for JPEG and Tiff
- /Images/Tiff/TIFF Picture Info
- /Images/Tiff/Tiff Speed Test
- /MacCI/CoreImage/Quickly generate previews for JPEG and Tiff
TiffPictureMBS.ReadRGB(byref ErrorMessage as string, Dest as MemoryBlock = nil) as memoryblock
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The Scanline() array gives you the raw uncompressed data. But this method decodes the data into a RGBA image.
The Memoryblock has the size of 4*width*height. Each pixel has one byte for red, one byte for green, one byte for blue and one byte for alpha. If no alpha is in the file, all pixels have the same alpha of 255.
If the decompression fails the function returns nil. (e.g. out of memory).
If the decoding fails, you also get an error message.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
If dest is not nil and big enough, the plugin will use it and return it on success. This can avoid additional memory allocations which can cost CPU time (especially to clear the bytes).
See also:
TiffPictureMBS.ReadRGBMemoryBegin(byref ErrorMessage as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Like ReadRGB, but with ReadRGBMemoryBegin, ReadRGBMemoryEnd and ReadRGBMemoryStep you can read the RGBA data in portions.
The Memoryblock returned by ReadRGBMemoryStep has the size of 4*width*height. Each pixel has one byte for red, one byte for green, one byte for blue and one byte for alpha. If no alpha is in the file, all pixels have the same alpha of 255.
If the decompression fails the function returns false. (e.g. out of memory).
If the decoding fails, you also get an error message.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
TiffPictureMBS.ReadRGBMemoryEnd
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.ReadRGBMemoryStep(x as Integer, y as Integer, width as Integer, height as Integer, Dest as MemoryBlock = nil) as memoryblock
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
As you see in the example, you can use this method to easily read huge TIFF files into a PictureMBS object.
If the decompression fails the function returns nil. (e.g. out of memory).
Please make sure that the range in x and y, width and height is right.
If dest is not nil and big enough, the plugin will use it and return it on success. This can avoid additional memory allocations which can cost CPU time (especially to clear the bytes).
TiffPictureMBS.ReadWithLUT(ColorLookupTable() as color) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Works with 8, 16 amd 32 bits per sample. And with 1 or 3 samples per pixels (Gray or RGB). The lookup table has 256 entries for 8 bit and 65536 entries for 16/32 bit.
This method uses the YieldTicks property and may yield time to other threads.
See also:
Some examples using this method:
TiffPictureMBS.ReadWithLUT(ColorLookupTable() as color, left as Integer, top as Integer, width as Integer, height as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Works with 8, 16 amd 32 bits per sample. And with 1 or 3 samples per pixels (Gray or RGB). The lookup table has 256 entries for 8 bit and 65536 entries for 16/32 bit.
This method uses the YieldTicks property and may yield time to other threads.
See also:
TiffPictureMBS.RewriteDirectory as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 8.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
As the data is added to the file and just the reference to the old data is deleted, the filesize will grow.
Calls TIFFReWriteDirectory internally. Same as SaveImage.
Some examples using this method:
The items on this page are in the following plugins: MBS Images Plugin.