←Select platform

IsFloat Property

Summary
Determines whether the image data is float.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public bool IsFloat { get; } 
@property (nonatomic, assign, readonly) BOOL IsFloat; 
public boolean IsFloat() 
public: 
property bool IsFloat { 
   bool get(); 
} 
IsFloat # get  (CodecsImageInfo) 

Property Value

true if the image data contains signed (negative) values; false, otherwise. The default value is false.

Floating point values are usually converted during load to integer values. You can avoid this conversion by setting CodecsLoadOptions.NoImageDataConversion = true to load the original floating point values. See Working With Floating Point Images for more details.

The floating point values can be positive or negative even when CodecsImageInfo.IsSigned is set to false.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
 
 
 
public void CodecsImageInfoIsFloatExample() 
{ 
   string srcFile = Path.Combine(LEAD_VARS.ImagesDir, "cannon_noisy.png"); 
   using (RasterCodecs codecs = new RasterCodecs()) 
   using (CodecsImageInfo info = codecs.GetInformation(srcFile, true)) 
   { 
      if (info.IsFloat) 
      { 
         Debug.WriteLine("The source file has floating point image data"); 
         codecs.Options.Load.NoImageDataConversion = true; 
         using (RasterImage image = codecs.Load(srcFile, 1)) 
         { 
            /* do something with the floating point image data */ 
         } 
      } 
      else 
         Debug.WriteLine("The source file does not have floating point image data"); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.