CMYKBitmap.cpp 459 B

123456789101112131415161718
  1. /*
  2. * Copyright (c) 2024, Nico Weber <thakis@chromium.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGfx/CMYKBitmap.h>
  7. namespace Gfx {
  8. ErrorOr<NonnullRefPtr<CMYKBitmap>> CMYKBitmap::create_with_size(IntSize const& size)
  9. {
  10. VERIFY(size.width() >= 0 && size.height() >= 0);
  11. auto data = TRY(ByteBuffer::create_uninitialized(size.width() * size.height() * sizeof(CMYK)));
  12. return adopt_ref(*new CMYKBitmap(size, move(data)));
  13. }
  14. }