예제 #1
0
파일: ImageWEBP.cs 프로젝트: Casidi/GARbro
 public override ImageData Read(Stream stream, ImageMetaData info)
 {
     using (var reader = new WebPDecoder (stream, (WebPMetaData)info))
     {
         reader.Decode();
         return ImageData.Create (info, reader.Format, null, reader.Output);
     }
 }
예제 #2
0
파일: Decoder.cs 프로젝트: Casidi/GARbro
        int last_y; // coordinate of the line that was last output

        #endregion Fields

        #region Methods

        public int EmitSampledRGB(WebPDecoder dec)
        {
            var input = dec.Cache;
            var output = dec.Output;
            int dst_stride = dec.Stride;
            int dst = mb_y * dst_stride;
            for (int j = 0; j < mb_h; ++j)
            {
                YuvToBgraRow (input, y, u, v, output, dst, mb_w);
                y += y_stride;
                if (0 != (j & 1))
                {
                    u += uv_stride;
                    v += uv_stride;
                }
                dst += dst_stride;
            }
            return mb_h;
        }
예제 #3
0
파일: Decoder.cs 프로젝트: Casidi/GARbro
 void EmitAlphaRGB(WebPDecoder dec, int expected_num_lines_out)
 {
     int base_rgba = mb_y * dec.Stride;
     int dst = base_rgba + 3;
     DispatchAlpha (alpha_plane, a, width, mb_w, mb_h, dec.Output, dst, dec.Stride);
 }
예제 #4
0
파일: Decoder.cs 프로젝트: Casidi/GARbro
 public bool Put(WebPDecoder dec)
 {
     if (mb_w <= 0 || mb_h <= 0)
         return false;
     int num_lines_out = EmitSampledRGB (dec);
     if (alpha_plane != null)
         EmitAlphaRGB (dec, num_lines_out);
     last_y += num_lines_out;
     return true;
 }
예제 #5
0
파일: Decoder.cs 프로젝트: Casidi/GARbro
 public void Init(WebPDecoder dec)
 {
     mb_y = 0;
     y = dec.cache_y_;
     u = dec.cache_u_;
     v = dec.cache_v_;
     y_stride = dec.cache_y_stride_;
     uv_stride = dec.cache_uv_stride_;
     alpha_plane = dec.AlphaPlane;
     a = 0;
     last_y = 0;
 }