Leadtools.Codecs名前空間 > RasterCodecsクラス > StartFeedLoadメソッド :StartFeedLoad(Int32、CodecsLoadByteOrder、Int32、Int32)メソッド |
結果として生じるimageビット数。有効値は以下の通りです:
値 | 意味 |
---|---|
0 | オリジナルファイルのビット数(変換しません)を保持します。 |
8への1 | 結果として生じるimageの指定されたピクセル当たりビット。 |
12 | 結果として生じるimageの12ビット/ピクセル。 |
16 | 結果として生じるimageの16ビット/ピクセル。 |
24 | 結果として生じるimageの24ビット/ピクセル。 |
32 | 結果として生じるimageの32ビット/ピクセル。 |
48 | 結果として生じるimageの48ビット/ピクセル。 |
64 | 結果として生じるimageの64ビット/ピクセル。 |
目的のカラーオーダー。設定可能な値は、以下の通りです。
値 | 意味 |
---|---|
CodecsLoadByteOrder.Rgb | メモリ内に赤・緑・青のカラーオーダー。 |
CodecsLoadByteOrder.Bgr | メモリ内にBlue、緑と赤のカラーオーダー。 |
CodecsLoadByteOrder.Gray | 12または16ビットグレースケールimage。12ビットと16ビットのグレースケールイメージは、Document/Medical画像化版でのみサポートされます。 |
CodecsLoadByteOrder.RgbOrGray | 赤い、緑、青として、または12ビットまたは16ビットのグレースケールimageとして画像をロードします。12ビットと16ビットのグレースケールイメージは、Document/Medical画像化版でサポートされます。 |
CodecsLoadByteOrder.BgrOrGray | 青、緑、赤として、または12ビットまたは16ビットのグレースケールimageとして画像をロードします。12ビットと16ビットのグレースケールイメージは、Document/Medical画像化版でサポートされます。 |
CodecsLoadByteOrder.Romm | ROMMオーダー。ROMMは、24ビットと48ビットのイメージのみをサポートします。 |
CodecsLoadByteOrder.BgrOrGrayOrRomm | 赤い、緑、青として、または12ビットまたは16ビットのグレースケールimageとして、またはROMMとして画像をロードします。12ビットと16ビットのグレースケールイメージは、ドキュメント/Medical Imaging版でのみサポートされます。ロンムは、24ビットと48ビットのカラーイメージのみをサポートします。 |
public void StartFeedLoad( int bitsPerPixel, CodecsLoadByteOrder order, int firstPage, int lastPage )
'Declaration
Public Overloads Sub StartFeedLoad( _ ByVal bitsPerPixel As Integer, _ ByVal order As CodecsLoadByteOrder, _ ByVal firstPage As Integer, _ ByVal lastPage As Integer _ )
'Usage
Dim instance As RasterCodecs Dim bitsPerPixel As Integer Dim order As CodecsLoadByteOrder Dim firstPage As Integer Dim lastPage As Integer instance.StartFeedLoad(bitsPerPixel, order, firstPage, lastPage)
public void StartFeedLoad( int bitsPerPixel, CodecsLoadByteOrder order, int firstPage, int lastPage )
- (BOOL)startFeedLoad:(NSInteger)bitsPerPixel order:(LTCodecsLoadByteOrder)order firstPage:(NSInteger)firstPage lastPage:(NSInteger)lastPage error:(NSError **)error
public FeedCallbackThunk startFeedLoad(int bitsPerPixel, CodecsLoadByteOrder order, int firstPage, int lastPage)
function Leadtools.Codecs.RasterCodecs.StartFeedLoad(Int32,CodecsLoadByteOrder,Int32,Int32)( bitsPerPixel , order , firstPage , lastPage )
public: void StartFeedLoad( int bitsPerPixel, CodecsLoadByteOrder order, int firstPage, int lastPage )
結果として生じるimageビット数。有効値は以下の通りです:
値 | 意味 |
---|---|
0 | オリジナルファイルのビット数(変換しません)を保持します。 |
8への1 | 結果として生じるimageの指定されたピクセル当たりビット。 |
12 | 結果として生じるimageの12ビット/ピクセル。 |
16 | 結果として生じるimageの16ビット/ピクセル。 |
24 | 結果として生じるimageの24ビット/ピクセル。 |
32 | 結果として生じるimageの32ビット/ピクセル。 |
48 | 結果として生じるimageの48ビット/ピクセル。 |
64 | 結果として生じるimageの64ビット/ピクセル。 |
目的のカラーオーダー。設定可能な値は、以下の通りです。
値 | 意味 |
---|---|
CodecsLoadByteOrder.Rgb | メモリ内に赤・緑・青のカラーオーダー。 |
CodecsLoadByteOrder.Bgr | メモリ内にBlue、緑と赤のカラーオーダー。 |
CodecsLoadByteOrder.Gray | 12または16ビットグレースケールimage。12ビットと16ビットのグレースケールイメージは、Document/Medical画像化版でのみサポートされます。 |
CodecsLoadByteOrder.RgbOrGray | 赤い、緑、青として、または12ビットまたは16ビットのグレースケールimageとして画像をロードします。12ビットと16ビットのグレースケールイメージは、Document/Medical画像化版でサポートされます。 |
CodecsLoadByteOrder.BgrOrGray | 青、緑、赤として、または12ビットまたは16ビットのグレースケールimageとして画像をロードします。12ビットと16ビットのグレースケールイメージは、Document/Medical画像化版でサポートされます。 |
CodecsLoadByteOrder.Romm | ROMMオーダー。ROMMは、24ビットと48ビットのイメージのみをサポートします。 |
CodecsLoadByteOrder.BgrOrGrayOrRomm | 赤い、緑、青として、または12ビットまたは16ビットのグレースケールimageとして、またはROMMとして画像をロードします。12ビットと16ビットのグレースケールイメージは、ドキュメント/Medical Imaging版でのみサポートされます。ロンムは、24ビットと48ビットのカラーイメージのみをサポートします。 |
バッファーに入れられたデータを供給するためにFeedLoadメソッドを呼び出さなければなりません、そして、ロードが完了しているとき、StopFeedLoadを呼び出さなければなりません。
受信がイメージを送ったとき、このファイル-ロードプロセスは、インターネットの上のそれらなどの、役に立ちます。それはロードまたはLoadAsyncメソッドと同じ方法を機能しますが、codeは画像データを供給します。ファイル-ロードプロセスは、以下のように機能します:
それにはそうするのに十分なデータがあるときはいつでも、ファイル-ロードプロセスはロードまたはLoadAsyncメソッドで同じにふるまいます。それは、imageをロードすることを割り当てて、開始します。入力バッファに十分なデータがあるときはいつでも、人が指定されるならば、それはLoadImageイベントハンドラを呼び出します。
それがそうするのに十分な情報を受け取ったとき、ファイル-ロードプロセスはRasterImageで情報を更新します。この情報が利用できるときはいつでも、ファイル-ロードプロセスはイベントハンドラに最初の電話をかけます。
CodecsLoadByteOrder.Grayは、12と16ビットグレースケールイメージに有効なだけです。12と16ビットグレースケールイメージのサポートは、Document/Medicalイメージングエディションのみで利用できます。
このメソッドが、StartRedirectingと結合して使われることができません。
このサンプルは、2、3ページのマルチページファイルをロードするために、フィードロードを使います
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.ImageProcessing Imports Leadtools.ImageProcessing.Color Imports Leadtools.Drawing Imports Leadtools.Svg Public Sub FeedLoadMultiExample() Dim codecs As New RasterCodecs() Dim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Eye.gif") Dim destFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "FeedLoadMulti.tif") ' Load pages 2 through 5 from the file by reading chunks from the stream codecs.StartFeedLoad(0, CodecsLoadByteOrder.BgrOrGray, 2, 5) Dim fs As FileStream = File.OpenRead(srcFileName) Try Const bufferSize As Integer = 1024 Dim buffer(bufferSize - 1) As Byte Dim read As Integer Do System.Windows.Forms.Application.DoEvents() read = fs.Read(buffer, 0, bufferSize) Console.WriteLine("Feeding {0} bytes", read) If (read > 0) Then codecs.FeedLoad(buffer, 0, read) End If Loop While read > 0 AndAlso Not codecs.IsFeedLoadDone Finally fs.Close() End Try Dim image As RasterImage = codecs.StopFeedLoad() Console.WriteLine("{0} pages loaded", image.PageCount) ' Save the image to disk codecs.Save(image, destFileName, RasterImageFormat.Tif, 1, 1, -1, 1, CodecsSavePageMode.Overwrite) image.Dispose() ' Clean up codecs.Dispose() End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; using Leadtools.ImageProcessing.Color; using Leadtools.Svg; public void FeedLoadMultiExample() { RasterCodecs codecs = new RasterCodecs(); string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Eye.gif"); string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "FeedLoadMulti.tif"); // Load pages 2 through 5 from the file by reading chunks from the stream codecs.StartFeedLoad(0, CodecsLoadByteOrder.BgrOrGray, 2, 5); using (FileStream fs = File.OpenRead(srcFileName)) { const int bufferSize = 1024; byte[] buffer = new byte[bufferSize]; int read; do { System.Windows.Forms.Application.DoEvents(); read = fs.Read(buffer, 0, bufferSize); Console.WriteLine("Feeding {0} bytes", read); if (read > 0) codecs.FeedLoad(buffer, 0, read); } while (read > 0 && !codecs.IsFeedLoadDone); } RasterImage image = codecs.StopFeedLoad(); Console.WriteLine("{0} pages loaded", image.PageCount); // Save the image to disk codecs.Save(image, destFileName, RasterImageFormat.Tif, 1, 1, -1, 1, CodecsSavePageMode.Overwrite); image.Dispose(); // Clean up codecs.Dispose(); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }
RasterCodecsExamples.prototype.FeedLoadMultiExample = function ( ) { Tools.SetLicense ( ) ; with ( Leadtools ) { with ( Leadtools.Codecs ) { var codecs = new RasterCodecs(); var srcFileName = "Assets\\Eye.gif"; var destFileName = "FeedLoadMulti.tif"; var image ; // Load pages 2 through 5 from the file by reading chunks from the stream codecs.startFeedLoad(0, CodecsLoadByteOrder.bgrOrGray, 2, 5); return Tools.AppInstallFolder().getFileAsync(srcFileName).then ( function ( loadFile ) { return loadFile.openAsync(Windows.Storage.FileAccessMode.read)}) .then ( function ( randomAccessStream ) { var bufferSize = 1024; var buffer = new Windows.Storage.Streams.Buffer(bufferSize); return ReadStreamAsync (randomAccessStream, buffer, bufferSize, codecs ) }) .then ( function ( ) { image = codecs.stopFeedLoad(); console.info(image.pageCount, " pages loaded"); // Save the image to disk return Tools.AppLocalFolder().createFileAsync(destFileName)}) .then ( function ( saveFile ) { return codecs.saveAsync(image, LeadStreamFactory.create(saveFile), RasterImageFormat.tif, 1, 1, -1, 1, CodecsSavePageMode.overwrite)}) .then ( function ( ) { image.close(); // Clean up codecs.close(); }); } } } function ReadStreamAsync (randomAccessStream, buffer, bufferSize, codecs ) { var read; return randomAccessStream.readAsync(buffer, bufferSize, Windows.Storage.Streams.InputStreamOptions.none).then(function (readBuffer) { console.info("Feeding " + readBuffer.length + " bytes"); if (readBuffer.length > 0) codecs.feedLoad(ToArray(readBuffer), 0, readBuffer.length); if (readBuffer.length > 0 && !codecs.isFeedLoadDone) return ReadStreamAsync(randomAccessStream, buffer, bufferSize, codecs) }); } function ToArray ( buffer ) { uselessReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer); var array = new Uint8Array(buffer.length); uselessReader.readBytes( array ); uselessReader.close ( ); return array; }
using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; using Leadtools.ImageProcessing.Color; public async Task FeedLoadMultiExample() { RasterCodecs codecs = new RasterCodecs(); string srcFileName = @"Assets\Eye.gif"; string destFileName = @"FeedLoadMulti.tif"; // Load pages 2 through 5 from the file by reading chunks from the stream codecs.StartFeedLoad(0, CodecsLoadByteOrder.BgrOrGray, 2, 5); StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName); using (IRandomAccessStream randomAccessStream = await loadFile.OpenAsync(FileAccessMode.Read)) { using (Stream memStream = randomAccessStream.AsStream()) { const int bufferSize = 1024; byte[] buffer = new byte[bufferSize]; int read; do { read = memStream.Read(buffer, 0, bufferSize); Debug.WriteLine("Feeding {0} bytes", read); if (read > 0) codecs.FeedLoad(buffer, 0, read); } while (read > 0 && !codecs.IsFeedLoadDone); } } RasterImage image = codecs.StopFeedLoad(); Debug.WriteLine("{0} pages loaded", image.PageCount); // Save the image to disk StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(destFileName); await codecs.SaveAsync(image, LeadStreamFactory.Create(saveFile), RasterImageFormat.Tif, 1, 1, -1, 1, CodecsSavePageMode.Overwrite); image.Dispose(); // Clean up codecs.Dispose(); }