Exemplo n.º 1
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(Decode.WebPPictureInitInternal(ref picture, WEBP_ENCODER_ABI_VERSION));
 }
Exemplo n.º 2
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(Decode.WebPConfigInitInternal(ref config, WebPPreset.WEBP_PRESET_DEFAULT, 75.0f, WEBP_ENCODER_ABI_VERSION));
        }
Exemplo n.º 3
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(Decode.WebPConfigInitInternal(ref config, preset, quality, WEBP_ENCODER_ABI_VERSION));
 }
Exemplo n.º 4
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(Decode.WebPGetFeaturesInternal(data, data_size, ref features, WEBP_DECODER_ABI_VERSION));
        }