Exemple #1
0
 public static VP8StatusCode WebPDecode(IntPtr data, UIntPtr data_size, ref WebPDecoderConfig config)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPDecode(data, data_size, ref config));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPDecode(data, data_size, ref config));
     }
     else
     {
         return(NativeBindings_OSX.WebPDecode(data, data_size, ref config));
     }
 }
Exemple #2
0
 public static int WebPGetEncoderVersion()
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPGetEncoderVersion());
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPGetEncoderVersion());
     }
     else
     {
         return(NativeBindings_OSX.WebPGetEncoderVersion());
     }
 }
Exemple #3
0
 public static UIntPtr WebPEncodeRGBA(IntPtr rgba, int width, int height, int stride, float quality_factor, ref IntPtr output)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPEncodeRGBA(rgba, width, height, stride, quality_factor, ref output));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPEncodeRGBA(rgba, width, height, stride, quality_factor, ref output));
     }
     else
     {
         return(NativeBindings_OSX.WebPEncodeRGBA(rgba, width, height, stride, quality_factor, ref output));
     }
 }
Exemple #4
0
 public static void WebPSafeFree(IntPtr toDeallocate)
 {
     if (GetPlatformName() == "android")
     {
         NativeBindings_Android.WebPSafeFree(toDeallocate);
     }
     else if (GetPlatformName() == "ios")
     {
         NativeBindings_iOS.WebPSafeFree(toDeallocate);
     }
     else
     {
         NativeBindings_OSX.WebPSafeFree(toDeallocate);
     }
 }
Exemple #5
0
 /// <summary>
 /// Should always be called, to initialize the structure. Returns false in case
 /// of version mismatch. WebPPictureInit() must have succeeded before using the
 /// 'picture' object.
 /// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.
 /// </summary>
 /// <param name="picture"></param>
 /// <returns></returns>
 public static int WebPPictureInit(ref WebPPicture picture)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPPictureInit(ref picture));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPPictureInit(ref picture));
     }
     else
     {
         return(NativeBindings_OSX.WebPPictureInit(ref picture));
     }
 }
Exemple #6
0
 public static UIntPtr WebPEncodeLosslessRGBA(IntPtr rgb, int width, int height, int stride, ref IntPtr output)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPEncodeLosslessRGBA(rgb, width, height, stride, ref output));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPEncodeLosslessRGBA(rgb, width, height, stride, ref output));
     }
     else
     {
         return(NativeBindings_OSX.WebPEncodeLosslessRGBA(rgb, width, height, stride, ref output));
     }
 }
Exemple #7
0
 /// <summary>
 /// This function will initialize the configuration according to a predefined
 /// set of parameters (referred to by 'preset') and a given quality factor.
 /// This function can be called as a replacement to WebPConfigInit(). Will return false in case of error.
 /// </summary>
 /// <param name="config"></param>
 /// <param name="preset"></param>
 /// <param name="quality"></param>
 /// <returns></returns>
 public static int WebPConfigPreset(ref WebPConfig config, WebPPreset preset, float quality)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPConfigInit(ref config));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPConfigInit(ref config));
     }
     else
     {
         return(NativeBindings_OSX.WebPConfigInit(ref config));
     }
 }
Exemple #8
0
 /// <summary>
 /// Initialize the structure as empty. Must be called before any other use. Returns false in case of version mismatch
 /// </summary>
 /// <param name="buffer"></param>
 /// <returns></returns>
 public static int WebPInitDecBuffer(ref WebPDecBuffer buffer)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPInitDecBuffer(ref buffer));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPInitDecBuffer(ref buffer));
     }
     else
     {
         return(NativeBindings_OSX.WebPInitDecBuffer(ref buffer));
     }
 }
Exemple #9
0
 public static int WebPGetInfo(IntPtr data, UIntPtr data_size, ref int width, ref int height)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPGetInfo(data, data_size, ref width, ref height));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPGetInfo(data, data_size, ref width, ref height));
     }
     else
     {
         return(NativeBindings_OSX.WebPGetInfo(data, data_size, ref width, ref height));
     }
 }
Exemple #10
0
 /// <summary>
 /// Initialize the configuration as empty. This function must always be
 /// called first, unless WebPGetFeatures() is to be called.
 /// Returns false in case of mismatched version.
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 public static int WebPInitDecoderConfig(ref WebPDecoderConfig config)
 {
     if (GetPlatformName() == "android")
     {
         return(NativeBindings_Android.WebPInitDecoderConfig(ref config));
     }
     else if (GetPlatformName() == "ios")
     {
         return(NativeBindings_iOS.WebPInitDecoderConfig(ref config));
     }
     else
     {
         return(NativeBindings_OSX.WebPInitDecoderConfig(ref config));
     }
 }
Exemple #11
0
        //

        /// <summary>
        /// Retrieve features from the bitstream. The *features structure is filled
        /// with information gathered from the bitstream.
        /// Returns false in case of error or version mismatch.
        /// In case of error, features->bitstream_status will reflect the error code.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="data_size"></param>
        /// <param name="features"></param>
        /// <returns></returns>
        public static VP8StatusCode WebPGetFeatures(IntPtr data, UIntPtr data_size, ref WebPBitstreamFeatures features)
        {
            if (GetPlatformName() == "android")
            {
                return(NativeBindings_Android.WebPGetFeatures(data, data_size, ref features));
            }
            else if (GetPlatformName() == "ios")
            {
                return(NativeBindings_iOS.WebPGetFeatures(data, data_size, ref features));
            }
            else
            {
                return(NativeBindings_OSX.WebPGetFeatures(data, data_size, ref features));
            }
        }
Exemple #12
0
 /// <summary>
 /// Should always be called, to initialize the structure. Returns false in case
 /// of version mismatch. WebPPictureInit() must have succeeded before using the
 /// 'picture' object.
 /// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.
 /// </summary>
 /// <param name="picture"></param>
 /// <returns></returns>
 public static int WebPPictureInit(ref WebPPicture picture)
 {
     return(NativeBindings_iOS.WebPPictureInitInternal(ref picture, WEBP_ENCODER_ABI_VERSION));
 }
Exemple #13
0
 /// <summary>
 /// This function will initialize the configuration according to a predefined
 /// set of parameters (referred to by 'preset') and a given quality factor.
 /// This function can be called as a replacement to WebPConfigInit(). Will return false in case of error.
 /// </summary>
 /// <param name="config"></param>
 /// <param name="preset"></param>
 /// <param name="quality"></param>
 /// <returns></returns>
 public static int WebPConfigPreset(ref WebPConfig config, WebPPreset preset, float quality)
 {
     return(NativeBindings_iOS.WebPConfigInitInternal(ref config, preset, quality, WEBP_ENCODER_ABI_VERSION));
 }
Exemple #14
0
        //    // Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the

        //// alpha information (if present). Kept for backward compatibility.

        //public IntPtr WebPIDecGetYUV(IntPtr decoder, int* last_y, uint8_t** u, uint8_t** v,

        //    int* width, int* height, int* stride, int* uv_stride) {

        //  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,

        //                         stride, uv_stride, NULL);

        /// <summary>
        /// Should always be called, to initialize a fresh WebPConfig structure before
        /// modification. Returns false in case of version mismatch. WebPConfigInit()
        /// must have succeeded before using the 'config' object.
        /// Note that the default values are lossless=0 and quality=75.
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public static int WebPConfigInit(ref WebPConfig config)
        {
            return(NativeBindings_iOS.WebPConfigInitInternal(ref config, WebPPreset.WEBP_PRESET_DEFAULT, 75.0f, WEBP_ENCODER_ABI_VERSION));
        }
Exemple #15
0
        //

        /// <summary>
        /// Retrieve features from the bitstream. The *features structure is filled
        /// with information gathered from the bitstream.
        /// Returns false in case of error or version mismatch.
        /// In case of error, features->bitstream_status will reflect the error code.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="data_size"></param>
        /// <param name="features"></param>
        /// <returns></returns>
        public static VP8StatusCode WebPGetFeatures(IntPtr data, UIntPtr data_size, ref WebPBitstreamFeatures features)
        {
            return(NativeBindings_iOS.WebPGetFeaturesInternal(data, data_size, ref features, WEBP_DECODER_ABI_VERSION));
        }