LEADTOOLS画像処理(Leadtools.ImageProcessing.Coreアセンブリ)

フレームを表示

CountLookupTableColorsメソッド








このメソッドによって塗りつぶされる8ビットルックアップテーブル配列。
LookupTableが符号付きか符号なしデータを格納するかどうかについて示すフラグ。
開始色と終了色の間のエントリ総数、および開始色のうち最後に見つかったインデックスを取得します。始まりと終了色は、内部的に決定されます。
構文
'Declaration
 
Public Shared Function CountLookupTableColors( _
   ByVal lookupTable() As RasterColor, _
   ByVal type As CountLookupTableColorsType _
) As CountLookupTableColorsResult
'Usage
 
Dim lookupTable() As RasterColor
Dim type As CountLookupTableColorsType
Dim value As CountLookupTableColorsResult
 
value = CoreUtilities.CountLookupTableColors(lookupTable, type)
+ (nullable LTCountLookupTableColorsResult*)countLookupTableColors:(nullable NSArray<LTRasterColor *> *)lookupTable
                                                              type:(LTCountLookupTableColorsType)type
                                                             error:(NSError **)error
            
public static CountLookupTableColorsResult countLookupTableColors(
   RasterColor[] lookupTable, 
   CountLookupTableColorsType type
) 
            
 function Leadtools.ImageProcessing.Core.CoreUtilities.CountLookupTableColors( 
   lookupTable ,
   type 
)

パラメーター

lookupTableな
このメソッドによって塗りつぶされる8ビットルックアップテーブル配列。
LookupTableが符号付きか符号なしデータを格納するかどうかについて示すフラグ。
解説
サンプル

エントリの数を取得して、imageからインデックスを開始するために、CountLookupTableColorsメソッドを実行します。

Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

   
Public Sub CountLookupTableColorsExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "RGSRef.cmp"))

   ' Set the new lookup table
   leadImage.UseLookupTable = True
   leadImage.SetLookupTable(New RasterColor(3) {})

   ' Prepare the command
   Dim command As CountLookupTableColorsResult = CoreUtilities.CountLookupTableColors(leadImage.GetLookupTable, CountLookupTableColorsType.Signed)
   MessageBox.Show("First Index = " + command.FirstIndex.ToString + Chr(13) + "Number Of Entries = " + command.NumberOfEntries.ToString)

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.Core;

      
public void CountLookupTableColorsExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "RGSRef.cmp"));

   // Set the new lookup table
   image.UseLookupTable = true;
   image.SetLookupTable(new RasterColor[3]);

   // Prepare the command
   CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColors(image.GetLookupTable(), CountLookupTableColorsType.Signed);
   MessageBox.Show("First Index = " + command.FirstIndex + "\n" +
      "Number Of Entries = " + command.NumberOfEntries);

}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
//   
//   public async Task CountLookupTableColorsExample()
//   {
//      // Load an image
//      RasterCodecs codecs = new RasterCodecs();
//      codecs.ThrowExceptionsOnInvalidImages = true;

//      // Load the image
//      string srcFileName = @"Assets\Image1.cmp";
//      StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
//      RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

//      // Prepare the command
//      CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColors(image.GetLookupTable(), CountLookupTableColorsType.Signed);
//      Debug.WriteLine("First Index = " + command.FirstIndex + "\n" +
//         "Number Of Entries = " + command.NumberOfEntries);

//   }
//
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

      
public async Task CountLookupTableColorsExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   // Load the image
   string srcFileName = @"Assets\Image1.cmp";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColors(image.GetLookupTable(), CountLookupTableColorsType.Signed);
   Debug.WriteLine("First Index = " + command.FirstIndex + "\n" +
      "Number Of Entries = " + command.NumberOfEntries);

}
using Leadtools;
using Leadtools.Examples;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

public void CountLookupTableColorsExample(RasterImage image)
{
   // Prepare the command
   CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColors(image.GetLookupTable(), CountLookupTableColorsType.Signed);
   Debug.WriteLine("First Index = " + command.FirstIndex + "\n" +
      "Number Of Entries = " + command.NumberOfEntries);
   image.Dispose();
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

Public Sub CountLookupTableColorsExample(ByVal image As RasterImage)
   ' Prepare the command
   Dim command As CountLookupTableColorsResult = CoreUtilities.CountLookupTableColors(image.GetLookupTable(), CountLookupTableColorsType.Signed)
   Debug.WriteLine("First Index = " & command.FirstIndex + Constants.vbLf & "Number Of Entries = " & command.NumberOfEntries)
   image.Dispose()
End Sub
必要条件

ターゲットプラットホーム

参照

参照

CoreUtilitiesクラス
CoreUtilitiesメンバ
CountLookupTableColorsExtメソッド
登録商標の検出
WindowLevelCommandクラス
Leadtools.RasterPalette.WindowLevelFillLookupTable(Leadtools.RasterColor[]、Leadtools.RasterColor、Leadtools.RasterColor、System.Int32、System.Int32、System.Int32、System.Int32、System.Int32、System.Int32、System.Int32、Leadtools.RasterPaletteWindowLevelFlags)
Leadtools.ImageProcessing.Effects.EffectsUtilities.GetUserLookupTable(System.Int32[]、Leadtools.LeadPoint[])
Leadtools.ImageProcessing.Color.RemapIntensityCommand
ApplyLinearVoiLookupTableCommandクラス