Exemplo n.º 1
0
Arquivo: utils.c Projeto: FEDE0D/godot
void WebPCopyPixels(const WebPPicture* const src, WebPPicture* const dst) {
  assert(src != NULL && dst != NULL);
  assert(src->width == dst->width && src->height == dst->height);
  assert(src->use_argb && dst->use_argb);
  WebPCopyPlane((uint8_t*)src->argb, 4 * src->argb_stride, (uint8_t*)dst->argb,
                4 * dst->argb_stride, 4 * src->width, src->height);
}
Exemplo n.º 2
0
void GIFDisposeFrame(GIFDisposeMethod dispose, const GIFFrameRect* const rect,
                     const WebPPicture* const prev_canvas,
                     WebPPicture* const curr_canvas) {
  assert(rect != NULL);
  if (dispose == GIF_DISPOSE_BACKGROUND) {
    GIFClearPic(curr_canvas, rect);
  } else if (dispose == GIF_DISPOSE_RESTORE_PREVIOUS) {
    const size_t src_stride = prev_canvas->argb_stride;
    const uint32_t* const src = prev_canvas->argb + rect->x_offset
                              + rect->y_offset * src_stride;
    const size_t dst_stride = curr_canvas->argb_stride;
    uint32_t* const dst = curr_canvas->argb + rect->x_offset
                        + rect->y_offset * dst_stride;
    assert(prev_canvas != NULL);
    WebPCopyPlane((uint8_t*)src, (int)(4 * src_stride),
                  (uint8_t*)dst, (int)(4 * dst_stride),
                  4 * rect->width, rect->height);
  }
}