App

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

- File List
- File Members

mhr_appcore_filters_Filter.cpp
Go to the documentation of this file.
1 #include "mhr_appcore_filters_Filter.hpp"
2 #include "../app/app_all.hpp"
3
4 using namespace app;
5
6 JNIEXPORT jint JNICALL Java_mhr_appcore_filters_Filter_disposeFilter(JNIEnv * pEnv, jclass pThisClass, jlong adress) {
7 TFilter<px_4x8bit, px_1x8bit> * f = (TFilter<px_4x8bit, px_1x8bit> *) adress;
8 delete f;
9 return 0;
10 }
11
12 JNIEXPORT jlong JNICALL Java_mhr_appcore_filters_Filter_createGaussianBlurFilter(JNIEnv * pEnv, jclass pThisClass, jdouble xSigma, jdouble ySigma) {
13 TSeparableFilter<px_4x8bit, px_1x8bit> * retVal = new TGaussianBlur<px_4x8bit, px_1x8bit>(xSigma, ySigma);
14 if (retVal != NULL) {
15 if (retVal->isInitOk()) {
16 return (long long) retVal;
17 } else {
18 delete retVal;
19 }
20 }
21 return 0x0;
22 }
23
24 JNIEXPORT jlong JNICALL Java_mhr_appcore_filters_Filter_createLaplaceSharpenFilter(JNIEnv * pEnv, jclass pThisClass, jdouble force) {
25 TFilter<px_4x8bit, px_1x8bit> * retVal = new TLaplaceSharpen<px_4x8bit, px_1x8bit>(force);
26 if (retVal != NULL) {
27 if (retVal->isInitOk()) {
28 return (long long) retVal;
29 } else {
30 delete retVal;
31 }
32 }
33 return 0x0;
34 }
35
36 JNIEXPORT jlong JNICALL Java_mhr_appcore_filters_Filter_createGaussianSharpenFilter(JNIEnv * pEnv, jclass pThisClass, jdouble sigma, jdouble force) {
37 TFilter<px_4x8bit, px_1x8bit> * retVal = new TGSharpen<px_4x8bit, px_1x8bit>(sigma, force);
38 if (retVal != NULL) {
39 if (retVal->isInitOk()) {
40 return (long long) retVal;
41 } else {
42 delete retVal;
43 }
44 }
45 return 0x0;
46 }
47
48 JNIEXPORT jlong JNICALL Java_mhr_appcore_filters_Filter_createLaplacianOfGaussianSharpenFilter(JNIEnv * pEnv, jclass pThisClass, jdouble sigma, jdouble force, jboolean area) {
49 TFilter<px_4x8bit, px_1x8bit> * retVal = new TLoGSharpen<px_4x8bit, px_1x8bit>(sigma, force, area);
50 if (retVal != NULL) {
51 if (retVal->isInitOk()) {
52 return (long long) retVal;
53 } else {
54 delete retVal;
55 }
56 }
57 return 0x0;
58 }
59
60 JNIEXPORT jlong JNICALL Java_mhr_appcore_filters_Filter_createDifferenceOfGaussianSharpenFilter(JNIEnv * pEnv, jclass pThisClass, jdouble sigma, jdouble k, jdouble force, jboolean area) {
61 TFilter<px_4x8bit, px_1x8bit> * retVal = new TDoGSharpen<px_4x8bit, px_1x8bit>(sigma, k, force, area);
62 if (retVal != NULL) {
63 if (retVal->isInitOk()) {
64 return (long long) retVal;
65 } else {
66 delete retVal;
67 }
68 }
69 return 0x0;
70 }
71
72
73
74 JNIEXPORT jint JNICALL Java_mhr_appcore_filters_Filter_applyTo__JJIIII(JNIEnv *pEnv, jclass pThisClass, jlong filterAdress, jlong dstAdress, jint dstTlx, jint dstTly, jint dstBrx,
75 jint dstBry) {
76 TFilter<px_4x8bit, px_1x8bit> * f = (TFilter<px_4x8bit, px_1x8bit> *) filterAdress;
77 rgba_8bit_bitmap * dst = (rgba_8bit_bitmap *) dstAdress;
78 return f->applyTo(*dst, Rect(dstTlx, dstTly, dstBrx, dstBry));
79 }
80
81 JNIEXPORT jint JNICALL Java_mhr_appcore_filters_Filter_applyTo__JJIIIID(JNIEnv *pEnv, jclass pThisClass, jlong filterAdress, jlong dstAdress, jint dstTlx, jint dstTly, jint dstBrx,
82 jint dstBry, jdouble alpha) {
83 TFilter<px_4x8bit, px_1x8bit> * f = (TFilter<px_4x8bit, px_1x8bit> *) filterAdress;
84 rgba_8bit_bitmap * dst = (rgba_8bit_bitmap *) dstAdress;
85 return f->applyTo(*dst, Rect(dstTlx, dstTly, dstBrx, dstBry), alpha);
86 }
87
88 JNIEXPORT jint JNICALL Java_mhr_appcore_filters_Filter_applyTo__JJJIIIIII(JNIEnv * pEnv, jclass pThisClass, jlong filterAdress, jlong dstAdress, jlong mskAdress, jint mskTlx,
89 jint mskTly, jint mskBrx, jint mskBry, jint mskOrigX, jint mskOrigY) {
90 TFilter<px_4x8bit, px_1x8bit> * f = (TFilter<px_4x8bit, px_1x8bit> *) filterAdress;
91 rgba_8bit_bitmap * dst = (rgba_8bit_bitmap *) dstAdress;
92 mono_8bit_bitmap * msk = (mono_8bit_bitmap *) mskAdress;
93 return f->applyTo(*dst, *msk, Rect(mskTlx, mskTly, mskBrx, mskBry), Point(mskOrigX, mskOrigY));
94 }
95
96 JNIEXPORT jint JNICALL Java_mhr_appcore_filters_Filter_applyTo__JJJIIIIIID(JNIEnv * pEnv, jclass pThisClass, jlong filterAdress, jlong dstAdress, jlong mskAdress, jint mskTlx,
97 jint mskTly, jint mskBrx, jint mskBry, jint mskOrigX, jint mskOrigY, jdouble alpha) {
98 TFilter<px_4x8bit, px_1x8bit> * f = (TFilter<px_4x8bit, px_1x8bit> *) filterAdress;
99 rgba_8bit_bitmap * dst = (rgba_8bit_bitmap *) dstAdress;
100 mono_8bit_bitmap * msk = (mono_8bit_bitmap *) mskAdress;
101 return f->applyTo(*dst, *msk, Rect(mskTlx, mskTly, mskBrx, mskBry), Point(mskOrigX, mskOrigY), alpha);
102 }