Esempio n. 1
0
        public Msdf(MsdfMode mode, int width, int height)
        {
            _nativeHandle = MsdfNative.MSDF_Create(mode, width, height);
            MsdfNative.CheckAndThrow();

            Shape = new Shape(MsdfNative.MSDF_GetShape(_nativeHandle));
        }
Esempio n. 2
0
 public void Dispose()
 {
     if (_owner)
     {
         MsdfNative.MSDF_Bitmap_Delete(NativeHandle);
     }
 }
Esempio n. 3
0
 public bool Save(string filename, Format format)
 {
     if (MsdfNative.MSDF_Save(_nativeHandle, filename, format))
     {
         return(true);
     }
     MsdfNative.CheckAndThrow();
     return(false);
 }
Esempio n. 4
0
 public bool ApplyScanlinePass()
 {
     if (MsdfNative.MSDF_ApplyScanlinePass(_nativeHandle))
     {
         return(true);
     }
     MsdfNative.CheckAndThrow();
     return(false);
 }
Esempio n. 5
0
 public bool ApplyOutputDistanceShift()
 {
     if (MsdfNative.MSDF_ApplyOutputDistanceShift(_nativeHandle))
     {
         return(true);
     }
     MsdfNative.CheckAndThrow();
     return(false);
 }
Esempio n. 6
0
 public bool ApplyOrientation()
 {
     if (MsdfNative.MSDF_ApplyOrientation(_nativeHandle))
     {
         return(true);
     }
     MsdfNative.CheckAndThrow();
     return(false);
 }
Esempio n. 7
0
 public bool TestRenderMulti(MsdfNative.BitmapBase *renderDestination)
 {
     if (MsdfNative.MSDF_TestRenderMulti(_nativeHandle, renderDestination))
     {
         return(true);
     }
     MsdfNative.CheckAndThrow();
     return(false);
 }
Esempio n. 8
0
        public BitmapBase(MsdfNative.BitmapBase *bitmapBase, bool owner = false)
        {
            NativeHandle = bitmapBase;
            _owner       = false;

            PixelData = MsdfNative.MSDF_Bitmap_GetPixelData(NativeHandle, out var width, out var height, out var channelCount);

            Width        = width;
            Height       = height;
            ChannelCount = channelCount;
            MsdfNative.CheckAndThrow();
        }
Esempio n. 9
0
 public BitmapBase(int channels, int width, int height)
     : this(MsdfNative.MSDF_Bitmap_Create(channels, width, height), true)
 {
 }
Esempio n. 10
0
 public static delegate * < MsdfNative.Shape *, double, ulong, void > GetColoringStrategy(MsdfColoringStrategy coloringStrategy)
 {
     return(MsdfNative.MSDF_GetColoringStrategy(coloringStrategy));
 }