Beatmup
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 <jni.h>
22
23
#include <
android/bitmap.h
>
24
25
#include <
core/bitmap/abstract_bitmap.h
>
26
#include <
core/context.h
>
27
28
namespace
Beatmup
{
29
namespace
Android {
30
31
/**
32
Wrapper of Android.Graphics.Bitmap object
33
*/
34
class
Bitmap
:
public
AbstractBitmap
{
35
private
:
36
jobject
bitmap
;
//!< java object representing the bitmap
37
JavaVM *
jvm
;
//!< java environment
38
39
void
*
lockedPixels
;
//!< pixel buffer; available only after calling lockPixelData()
40
int
lockedWidth
,
lockedHeight
;
41
PixelFormat
lockedPixelFormat
;
42
43
AndroidBitmapInfo
getInfo
()
const
;
44
45
JNIEnv *
getEnv
()
const
;
46
47
void
lockPixelData
();
48
49
void
unlockPixelData
();
50
51
public
:
52
/**
53
Creates the bitmap from Android Bitmap java object
54
*/
55
Bitmap
(
Beatmup::Context
&, JNIEnv *,
jobject
);
56
57
~Bitmap
();
58
59
const
PixelFormat
getPixelFormat
()
const
;
60
61
const
int
getWidth
()
const
;
62
63
const
int
getHeight
()
const
;
64
65
const
pixbyte
*
getData
(
int
x
,
int
y
)
const
;
66
pixbyte
*
getData
(
int
x
,
int
y
);
67
68
const
msize
getMemorySize
()
const
;
69
};
70
71
}
72
}
abstract_bitmap.h
Beatmup::AbstractBitmap
A very basic class for any image.
Definition:
abstract_bitmap.h:87
Beatmup::Android::Bitmap
Wrapper of Android.Graphics.Bitmap object.
Definition:
bitmap.h:34
Beatmup::Android::Bitmap::getEnv
JNIEnv * getEnv() const
Definition:
bitmap.cpp:28
Beatmup::Android::Bitmap::Bitmap
Bitmap(Beatmup::Context &, JNIEnv *, jobject)
Creates the bitmap from Android Bitmap java object.
Beatmup::Android::Bitmap::getWidth
const int getWidth() const
Width of the texture in pixels.
Definition:
bitmap.cpp:82
Beatmup::Android::Bitmap::getPixelFormat
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
Definition:
bitmap.cpp:65
Beatmup::Android::Bitmap::~Bitmap
~Bitmap()
Definition:
bitmap.cpp:51
Beatmup::Android::Bitmap::getMemorySize
const msize getMemorySize() const
Bitmap size in bytes.
Definition:
bitmap.cpp:132
Beatmup::Android::Bitmap::lockedPixels
void * lockedPixels
pixel buffer; available only after calling lockPixelData()
Definition:
bitmap.h:39
Beatmup::Android::Bitmap::lockedHeight
int lockedHeight
Definition:
bitmap.h:40
Beatmup::Android::Bitmap::jvm
JavaVM * jvm
java environment
Definition:
bitmap.h:37
Beatmup::Android::Bitmap::lockedPixelFormat
PixelFormat lockedPixelFormat
Definition:
bitmap.h:41
Beatmup::Android::Bitmap::lockedWidth
int lockedWidth
Definition:
bitmap.h:40
Beatmup::Android::Bitmap::getInfo
AndroidBitmapInfo getInfo() const
Definition:
bitmap.cpp:56
Beatmup::Android::Bitmap::bitmap
jobject bitmap
java object representing the bitmap
Definition:
bitmap.h:36
Beatmup::Android::Bitmap::getData
const pixbyte * getData(int x, int y) const
Returns a pointer to given pixel.
Definition:
bitmap.cpp:114
Beatmup::Android::Bitmap::unlockPixelData
void unlockPixelData()
Unlocks access to the CPU memory buffer containing pixel data.
Definition:
bitmap.cpp:107
Beatmup::Android::Bitmap::lockPixelData
void lockPixelData()
Locks access to the CPU memory buffer containing pixel data.
Definition:
bitmap.cpp:96
Beatmup::Android::Bitmap::getHeight
const int getHeight() const
Height of the texture in pixels.
Definition:
bitmap.cpp:89
Beatmup::Context
Basic class: task and memory management, any kind of static data.
Definition:
context.h:59
context.h
bitmap.h
Beatmup
Definition:
basic_types.h:22
Beatmup::msize
uint32_t msize
memory size
Definition:
basic_types.h:30
Beatmup::pixbyte
uint8_t pixbyte
Definition:
basic_types.h:34
Beatmup::PixelFormat
PixelFormat
Definition:
abstract_bitmap.h:70
jobject
JNIEnv jobject
Definition:
wrapper_audio.cpp:120
y
jobject jlong jint jint y
Definition:
wrapper_core.cpp:253
x
jobject jlong jint x
Definition:
wrapper_core.cpp:253
jni
android
bitmap.h
Generated on Tue Nov 21 2023 13:54:27 for Beatmup by
1.9.1