2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
25 typedef void (*VBitmapCleanupFunction)(void *);
28 enum class Format { Invalid, Alpha8, ARGB32, ARGB32_Premultiplied, Last };
31 VBitmap(const VBitmap &other);
32 VBitmap(VBitmap &&other);
33 VBitmap &operator=(const VBitmap &);
34 VBitmap &operator=(VBitmap &&other);
36 VBitmap(int w, int h, VBitmap::Format format);
37 VBitmap(uchar *data, int w, int h, int bytesPerLine, VBitmap::Format format,
38 VBitmapCleanupFunction f = nullptr, void *cleanupInfo = nullptr);
40 VBitmap copy(const VRect &rect = VRect()) const;
41 void fill(uint pixel);
46 const uchar * bits() const;
47 uchar * scanLine(int);
48 const uchar * scanLine(int) const;
51 VBitmap::Format format() const;
55 void cleanUp(VBitmapData *x);
56 VBitmapData *d{nullptr};