App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

Functions
mhr_appcore_bitmap_NBitmap.hpp File Reference
`#include <jni.h>`

Go to the source code of this file.

## Functions
JNIEXPORT jlong JNICALL | Java_mhr_appcore_bitmap_NBitmap_createTBitmap__IIIIZ (JNIEnv *, jobject, jint, jint, jint, jint, jboolean)
JNIEXPORT jlong JNICALL | Java_mhr_appcore_bitmap_NBitmap_createTBitmap__IJ (JNIEnv *, jobject, jint, jlong)
JNIEXPORT jlong JNICALL | Java_mhr_appcore_bitmap_NBitmap_wrapAsTBitmap (JNIEnv *, jobject, jint, jlong, jint, jint, jint, jboolean)
JNIEXPORT jint JNICALL | Java_mhr_appcore_bitmap_NBitmap_premultiply (JNIEnv *, jobject, jint, jlong)
JNIEXPORT jint JNICALL | Java_mhr_appcore_bitmap_NBitmap_demultiply (JNIEnv *, jobject, jint, jlong)
JNIEXPORT jlong JNICALL | Java_mhr_appcore_bitmap_NBitmap_getChannel (JNIEnv *, jobject, jint, jlong, jint)
JNIEXPORT jint JNICALL | Java_mhr_appcore_bitmap_NBitmap_fill (JNIEnv *, jobject, jint, jlong, jint, jint, jint, jint, jint)
JNIEXPORT jint JNICALL | Java_mhr_appcore_bitmap_NBitmap_copyTo (JNIEnv *, jobject, jint, jlong, jlong, jint, jint, jint, jint, jint, jint)
JNIEXPORT jint JNICALL | Java_mhr_appcore_bitmap_NBitmap_dispose (JNIEnv *, jobject, jint, jlong)
JNIEXPORT jint JNICALL | Java_mhr_appcore_bitmap_NBitmap_setPremultiplied (JNIEnv *, jobject, jint, jlong, jboolean)

## Function Documentation

JNIEXPORT jint JNICALL Java_mhr_appcore_bitmap_NBitmap_copyTo | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress,
|  | jlong | dstAdress,
|  | jint | tlx,
|  | jint | tly,
|  | jint | brx,
|  | jint | bry,
|  | jint | srcOrigX,
|  | jint | srcOrigY
| ) |  |

protected native int copyTo(int nativeType, long adress, long dstAdress, int tlx, int tly, int brx, int bry, int srcOrigX, int srcOrigY);

Definition at line 202 of file mhr_appcore_bitmap_NBitmap.cpp.

{
int retVal = 0;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit: {
retVal = ((mono_8bit_bitmap *) adress)->copyTo(*(mono_8bit_bitmap *) dstAdress, Rect(tlx, tly, brx, bry), Point(srcOrigX, srcOrigY));
break;
}
case rgba_8_bit: {
retVal = ((rgba_8bit_bitmap *) adress)->copyTo(*(rgba_8bit_bitmap *) dstAdress, Rect(tlx, tly, brx, bry), Point(srcOrigX, srcOrigY));
break;
}
default:
retVal = -1;
break;
}
return retVal;
}

JNIEXPORT jlong JNICALL Java_mhr_appcore_bitmap_NBitmap_createTBitmap__IIIIZ | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jint | width,
|  | jint | height,
|  | jint | colorMode,
|  | jboolean | premultiplied
| ) |  |

protected native long createTBitmap(int nativeType, int width, int height, int colorMode, int premultiplied);

Definition at line 9 of file mhr_appcore_bitmap_NBitmap.cpp.

{
void * vPtr = NULL;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit:
vPtr = new mono_8bit_bitmap(width, height, (ColorMode) colorMode, premultiplied);
if (vPtr == NULL) {
return 0;
}
if (((mono_8bit_bitmap*) vPtr)->getData() == NULL) {
delete (mono_8bit_bitmap*) vPtr;
return 0;
}
break;
case rgba_8_bit:
vPtr = new rgba_8bit_bitmap(width, height, (ColorMode) colorMode, premultiplied);
if (vPtr == NULL) {
return 0;
}
if (((rgba_8bit_bitmap*) vPtr)->getData() == NULL) {
delete (rgba_8bit_bitmap*) vPtr;
return 0;
}
break;
default:
break;
}
return (long long) vPtr;
}

JNIEXPORT jlong JNICALL Java_mhr_appcore_bitmap_NBitmap_createTBitmap__IJ | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress
| ) |  |

protected native long createTBitmap(int nativeType, long adress);

Definition at line 42 of file mhr_appcore_bitmap_NBitmap.cpp.

{
void * vPtr = NULL;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit:
vPtr = new mono_8bit_bitmap(*((mono_8bit_bitmap *) adress));
if (vPtr == NULL) {
return 0;
}
if (((mono_8bit_bitmap*) vPtr)->getData() == NULL) {
delete (mono_8bit_bitmap*) vPtr;
return 0;
}
break;
case rgba_8_bit:
vPtr = new rgba_8bit_bitmap(*((rgba_8bit_bitmap *) adress));
if (vPtr == NULL) {
return 0;
}
if (((rgba_8bit_bitmap*) vPtr)->getData() == NULL) {
delete (rgba_8bit_bitmap*) vPtr;
return 0;
}
break;
default:
break;
}
return (long long) vPtr;
}

JNIEXPORT jint JNICALL Java_mhr_appcore_bitmap_NBitmap_demultiply | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress
| ) |  |

protected native int demultiply(int nativeType, long adress);

Definition at line 122 of file mhr_appcore_bitmap_NBitmap.cpp.

{
int retVal = 0;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit: {
retVal = -1;
break;
}
case rgba_8_bit: {
rgba_8bit_bitmap * b = (rgba_8bit_bitmap *) adress;
retVal = b->demultiply();
break;
}
default:
retVal = -1;
break;
}
return retVal;
}

JNIEXPORT jint JNICALL Java_mhr_appcore_bitmap_NBitmap_dispose | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress
| ) |  |

protected native int dispose(int nativeType, long adress);

Definition at line 224 of file mhr_appcore_bitmap_NBitmap.cpp.

{
switch ((BitmapNativeType) nativeType) {
case mono_8_bit: {
delete (mono_8bit_bitmap *) adress;
break;
}
case rgba_8_bit: {
delete (rgba_8bit_bitmap *) adress;
break;
}
default:
break;
}
return 0;
}

JNIEXPORT jint JNICALL Java_mhr_appcore_bitmap_NBitmap_fill | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress,
|  | jint | tlx,
|  | jint | tly,
|  | jint | brx,
|  | jint | bry,
|  | jint | color
| ) |  |

protected native int fill(int nativeType, long adress, int tlx, int tly, int brx, int bry, int color);

Definition at line 177 of file mhr_appcore_bitmap_NBitmap.cpp.

{
int retVal = 0;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit: {
mono_8bit_bitmap * b = (mono_8bit_bitmap *) adress;
px_1x8bit fill = color;
retVal = b->fill(Rect(tlx, tly, brx, bry), &fill);
break;
}
case rgba_8_bit: {
rgba_8bit_bitmap * b = (rgba_8bit_bitmap *) adress;
px_4x8bit fill = color;
retVal = b->fill(Rect(tlx, tly, brx, bry), &fill);
break;
}
default:
retVal = -1;
break;
}
return retVal;
}

JNIEXPORT jlong JNICALL Java_mhr_appcore_bitmap_NBitmap_getChannel | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress,
|  | jint | index
| ) |  |

protected native long getChannel(int nativeType, long adress, int index);

Definition at line 144 of file mhr_appcore_bitmap_NBitmap.cpp.

{
void * vPtr = NULL;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit:
vPtr = ((mono_8bit_bitmap *) adress)->getChannel(index);
if (vPtr == NULL) {
return 0;
}
if (((mono_8bit_bitmap*) vPtr)->getData() == NULL) {
delete (mono_8bit_bitmap*) vPtr;
return 0;
}
break;
case rgba_8_bit:
vPtr = ((rgba_8bit_bitmap *) adress)->getChannel(index);
if (vPtr == NULL) {
return 0;
}
if (((rgba_8bit_bitmap*) vPtr)->getData() == NULL) {
delete (rgba_8bit_bitmap*) vPtr;
return 0;
}
break;
default:
break;
}
return (long long) vPtr;
}

JNIEXPORT jint JNICALL Java_mhr_appcore_bitmap_NBitmap_premultiply | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress
| ) |  |

protected native int premultiply(int nativeType, long adress);

Definition at line 100 of file mhr_appcore_bitmap_NBitmap.cpp.

{
int retVal = 0;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit: {
retVal = -1;
break;
}
case rgba_8_bit: {
rgba_8bit_bitmap * b = (rgba_8bit_bitmap *) adress;
retVal = b->premultiply();
break;
}
default:
retVal = -1;
break;
}
return retVal;
}

JNIEXPORT jint JNICALL Java_mhr_appcore_bitmap_NBitmap_setPremultiplied | ( | JNIEnv * | ,
|  | jobject | ,
|  | jint | ,
|  | jlong | ,
|  | jboolean |
| ) |  |

Definition at line 240 of file mhr_appcore_bitmap_NBitmap.cpp.

{
int retVal = 0;
switch ((BitmapNativeType) nativeType) {
case rgba_8_bit: {
((rgba_8bit_bitmap *) adress)->setPremultiplied(premultiplied);
break;
}
default:
retVal = -1;
break;
}
return retVal;
}

JNIEXPORT jlong JNICALL Java_mhr_appcore_bitmap_NBitmap_wrapAsTBitmap | ( | JNIEnv * | pEnv,
|  | jobject | pThis,
|  | jint | nativeType,
|  | jlong | adress,
|  | jint | width,
|  | jint | height,
|  | jint | colorMode,
|  | jboolean | premultiplied
| ) |  |

protected native long wrapAsTBitmap(int nativeType, long adress, int width, int height, int colorMode, int premultiplied);

Definition at line 74 of file mhr_appcore_bitmap_NBitmap.cpp.

{
void * vPtr = NULL;
switch ((BitmapNativeType) nativeType) {
case mono_8_bit:
vPtr = new mono_8bit_bitmap((void *) adress, width, height, (ColorMode) colorMode, premultiplied);
if (vPtr == NULL) {
return 0;
}
// Testovat data na NULL nema vyznam, o alokaci se stara nekdo jiny
break;
case rgba_8_bit:
vPtr = new rgba_8bit_bitmap((void *) adress, width, height, (ColorMode) colorMode, premultiplied);
if (vPtr == NULL) {
return 0;
}
break;
default:
break;
}
return (long long) vPtr;
}