Beatmup
gdi_bitmap.h
Go to the documentation of this file.
1 /*
2  Beatmup image and signal processing library
3  Copyright (C) 2019, lnstadrum
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 
21 #include "../abstract_bitmap.h"
22 #ifndef BEATMUP_PLATFORM_WINDOWS
23  #error GDI bitmap is Windows-specific.
24 #endif
25 
26 namespace Beatmup {
27 
28  /**
29  A simple wrapper of GDI bitmap
30  */
31  class GDIBitmap : public AbstractBitmap {
32  private:
33  class Impl;
35 
36  public:
37  GDIBitmap(Context &ctx, const wchar_t* filename);
38 
40 
41  const PixelFormat getPixelFormat() const;
42 
43  const int getWidth() const;
44 
45  const int getHeight() const;
46 
47  int getStride() const;
48 
49  const msize getMemorySize() const;
50 
51  void lockPixelData();
52 
53  void unlockPixelData();
54 
55  const pixbyte* getData(int x, int y) const;
56 
57  void save(const wchar_t* filename);
58  };
59 
60 }
A very basic class for any image.
Context & ctx
context managing this bitmap
Basic class: task and memory management, any kind of static data.
Definition: context.h:59
A simple wrapper of GDI bitmap.
Definition: gdi_bitmap.h:31
void unlockPixelData()
Unlocks access to the CPU memory buffer containing pixel data.
Definition: gdi_bitmap.cpp:209
GDIBitmap(Context &ctx, const wchar_t *filename)
Definition: gdi_bitmap.cpp:167
const int getHeight() const
Height of the texture in pixels.
Definition: gdi_bitmap.cpp:189
void lockPixelData()
Locks access to the CPU memory buffer containing pixel data.
Definition: gdi_bitmap.cpp:204
const msize getMemorySize() const
Bitmap size in bytes.
Definition: gdi_bitmap.cpp:199
void save(const wchar_t *filename)
Definition: gdi_bitmap.cpp:219
const int getWidth() const
Width of the texture in pixels.
Definition: gdi_bitmap.cpp:184
const pixbyte * getData(int x, int y) const
Returns a pointer to given pixel.
Definition: gdi_bitmap.cpp:214
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
Definition: gdi_bitmap.cpp:179
int getStride() const
Definition: gdi_bitmap.cpp:194
A simple wrapper of IL image.
Definition: gdi_bitmap.cpp:32
uint32_t msize
memory size
Definition: basic_types.h:30
uint8_t pixbyte
Definition: basic_types.h:34
JNIEnv jobject jint format
jobject jlong jint jint y
JNIEnv jlong jstring filename
jlong jint width
jlong jint jint height
jobject jlong jint x