Example #1
0
GMPErr GMPPlaneImpl::Copy(int32_t aSize, int32_t aStride,
                          const uint8_t* aBuffer) {
  GMPErr err = MaybeResize(aSize);
  if (err != GMPNoErr) {
    return err;
  }

  if (aBuffer && aSize > 0) {
    memcpy(Buffer(), aBuffer, aSize);
  }

  mSize = aSize;
  mStride = aStride;

  return GMPNoErr;
}
Example #2
0
GMPErr GMPPlaneImpl::CreateEmptyPlane(int32_t aAllocatedSize, int32_t aStride,
                                      int32_t aPlaneSize) {
  if (aAllocatedSize < 1 || aStride < 1 || aPlaneSize < 1) {
    return GMPGenericErr;
  }

  GMPErr err = MaybeResize(aAllocatedSize);
  if (err != GMPNoErr) {
    return err;
  }

  mSize = aPlaneSize;
  mStride = aStride;

  return GMPNoErr;
}
Example #3
0
GMPErr GMPPlaneImpl::Copy(const GMPPlane& aPlane) {
  auto& planeimpl = static_cast<const GMPPlaneImpl&>(aPlane);

  GMPErr err = MaybeResize(planeimpl.mSize);
  if (err != GMPNoErr) {
    return err;
  }

  if (planeimpl.Buffer() && planeimpl.mSize > 0) {
    memcpy(Buffer(), planeimpl.Buffer(), mSize);
  }

  mSize = planeimpl.mSize;
  mStride = planeimpl.mStride;

  return GMPNoErr;
}
Example #4
0
//
/// Add new cel(s) to the CelArray - return index of new addition.
/// No mask bitmap is added.
//
int
TCelArray::Add(const TBitmap& image)
{
  int width = image.Width();
  int count = width / CelSize().cx;

  if (!MaybeResize(count))
    return -1;

  OwlCopyBmp(*Bitmap, image, CelOffset(NCelsUsed,0), image.Size());

  int index = NCelsUsed;
  NCelsUsed += count;

  TRACEX(OwlGadget, 1, "TCelArray @" << (void*)this << " added bitmap @" <<
    (void*)&image);

  return index;
}