App

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

- File List
- File Members

mhr_appcore_transform_Transform.cpp
Go to the documentation of this file.
1 #include "mhr_appcore_transform_Transform.hpp"
2 #include "../app/app_all.hpp"
3
4 using namespace app;
5
6
7 JNIEXPORT jint JNICALL Java_mhr_appcore_transform_Transform_applyMatrixTo (JNIEnv * pEnv, jclass pThisClass, jint nativeType, jlong dstAdress, jlong srcAdress, jint interpolatorType,
8 jdouble a11, jdouble a12, jdouble a13,
9 jdouble a21, jdouble a22, jdouble a23,
10 jdouble a31, jdouble a32, jdouble a33) {
11
12
13 int retVal = -1;
14
15 Matrix3x3 m(a11, a12, a13, a21, a22, a23, a31, a32, a33);
16
17 switch ((BitmapNativeType) nativeType) {
18 case mono_8_bit:
19
20 break;
21
22 case rgba_8_bit: {
23
24 switch ((InterpolatorNativeType) interpolatorType) {
25 case NEAREST_NEIGHBOUR: {
26 TTransform<px_4x8bit, px_1x8bit, TNearestFInt<px_4x8bit, px_1x8bit>> * t = new TTransform<px_4x8bit, px_1x8bit, TNearestFInt<px_4x8bit, px_1x8bit>>();
27 if (t == NULL) {
28 return retVal;
29 }
30 retVal = t->applyMatrix(*((rgba_8bit_bitmap *)dstAdress), *((rgba_8bit_bitmap *)srcAdress), m);
31 delete t;
32 break;
33 }
34 case LINEAR: {
35 TTransform<px_4x8bit, px_1x8bit, TLinearFInt<px_4x8bit, px_1x8bit>> * t = new TTransform<px_4x8bit, px_1x8bit, TLinearFInt<px_4x8bit, px_1x8bit>>();
36 if (t == NULL) {
37 return retVal;
38 }
39 retVal = t->applyMatrix(*((rgba_8bit_bitmap *)dstAdress), *((rgba_8bit_bitmap *)srcAdress), m);
40 delete t;
41 break;
42 }
43 case CUBIC: {
44 TTransform<px_4x8bit, px_1x8bit, TCubicFInt<px_4x8bit, px_1x8bit>> * t = new TTransform<px_4x8bit, px_1x8bit, TCubicFInt<px_4x8bit, px_1x8bit>>();
45 if (t == NULL) {
46 return retVal;
47 }
48 retVal = t->applyMatrix(*((rgba_8bit_bitmap *)dstAdress), *((rgba_8bit_bitmap *)srcAdress), m);
49 delete t;
50 break;
51 }
52
53 default:
54
55 break;
56 }
57
58 break;
59 }
60 default:
61 break;
62 }
63
64 return retVal;
65 }
66