Diff of /pteditor.c [357c36] .. [91c838] Maximize Restore

  Switch to unified view

a/pteditor.c b/pteditor.c
...
...
10
10
11
static Image *pano = NULL;
11
static Image *pano = NULL;
12
12
13
13
14
JNIEXPORT void JNICALL Java_pteditor_CLoadImage
14
JNIEXPORT void JNICALL Java_pteditor_CLoadImage
15
    (JNIEnv *env, jobject obj, jstring path){
15
    (JNIEnv *env, jobject obj PT_UNUSED, jstring path){
16
    fullPath fp;
16
    fullPath fp;
17
    const char *jpath = (*env)->GetStringUTFChars(env, path, 0);
17
    const char *jpath = (*env)->GetStringUTFChars(env, path, 0);
18
18
19
#ifdef __Mac__
19
#ifdef __Mac__
20
    setLibToResFile();
20
    setLibToResFile();
...
...
48
48
49
}
49
}
50
50
51
51
52
JNIEXPORT void JNICALL Java_pteditor_CSaveImage
52
JNIEXPORT void JNICALL Java_pteditor_CSaveImage
53
    (JNIEnv *env, jobject obj, jstring path){
53
    (JNIEnv *env, jobject obj PT_UNUSED, jstring path){
54
    fullPath fp;
54
    fullPath fp;
55
    const char *jpath = (*env)->GetStringUTFChars(env, path, 0);
55
    const char *jpath = (*env)->GetStringUTFChars(env, path, 0);
56
56
57
#ifdef __Mac__
57
#ifdef __Mac__
58
    setLibToResFile();
58
    setLibToResFile();
...
...
75
75
76
}
76
}
77
77
78
78
79
JNIEXPORT jint JNICALL Java_pteditor_CGetImageWidth
79
JNIEXPORT jint JNICALL Java_pteditor_CGetImageWidth
80
  (JNIEnv *env, jobject obj){
80
  (JNIEnv *env PT_UNUSED, jobject obj PT_UNUSED){
81
    if(pano != NULL)
81
    if(pano != NULL)
82
        return pano->width;
82
        return pano->width;
83
    else
83
    else
84
        return 0;
84
        return 0;
85
}
85
}
86
86
87
JNIEXPORT jint JNICALL Java_pteditor_CGetImageHeight
87
JNIEXPORT jint JNICALL Java_pteditor_CGetImageHeight
88
  (JNIEnv *env, jobject obj){
88
  (JNIEnv *env PT_UNUSED, jobject obj PT_UNUSED){
89
    if(pano != NULL)
89
    if(pano != NULL)
90
        return pano->height;
90
        return pano->height;
91
    else
91
    else
92
        return 0;
92
        return 0;
93
}
93
}
94
94
95
JNIEXPORT void JNICALL Java_pteditor_CGetImageRow
95
JNIEXPORT void JNICALL Java_pteditor_CGetImageRow
96
  (JNIEnv *env, jobject obj, jintArray jdata, jint nrow){
96
  (JNIEnv *env, jobject obj PT_UNUSED, jintArray jdata, jint nrow){
97
    if(pano == NULL) return;
97
    if(pano == NULL) return;
98
    if(pano->data != NULL){
98
    if(pano->data != NULL){
99
        jint *pix = (jint*)malloc(pano->width * sizeof(jint));
99
        jint *pix = (jint*)malloc(pano->width * sizeof(jint));
100
        if( pix == NULL ) return;
100
        if( pix == NULL ) return;
101
        if( pano->bitsPerPixel == 64 ){
101
        if( pano->bitsPerPixel == 64 ){
...
...
124
    }
124
    }
125
}
125
}
126
 
126
 
127
 
127
 
128
JNIEXPORT void JNICALL Java_pteditor_CExtract
128
JNIEXPORT void JNICALL Java_pteditor_CExtract
129
  (JNIEnv *env, jobject obj, jstring path, jdouble yaw, jdouble pitch, jdouble hfov, jdouble aspect, jint format, jdouble phfov ){
129
  (JNIEnv *env, jobject obj PT_UNUSED, jstring path, jdouble yaw, jdouble pitch, jdouble hfov, jdouble aspect, jint format, jdouble phfov ){
130
    aPrefs              ap;
130
    aPrefs              ap;
131
    TrformStr           Tr;
131
    TrformStr           Tr;
132
    Image               dest;
132
    Image               dest;
133
    struct size_Prefs   spref;
133
    struct size_Prefs   spref;
134
    fullPath fp;
134
    fullPath fp;
...
...
197
#endif
197
#endif
198
198
199
}
199
}
200
200
201
JNIEXPORT void JNICALL Java_pteditor_CInsert
201
JNIEXPORT void JNICALL Java_pteditor_CInsert
202
  (JNIEnv *env, jobject obj, jstring path, jdouble yaw, jdouble pitch, jdouble rot, jdouble hfov, jint format){
202
  (JNIEnv *env, jobject obj PT_UNUSED, jstring path, jdouble yaw, jdouble pitch, jdouble rot, jdouble hfov, jint format){
203
    aPrefs              ap;
203
    aPrefs              ap;
204
    TrformStr           Tr;
204
    TrformStr           Tr;
205
    struct size_Prefs   spref;
205
    struct size_Prefs   spref;
206
    fullPath fp;
206
    fullPath fp;
207
    Image   src, dest;
207
    Image   src, dest;
...
...
285
285
286
}
286
}
287
287
288
288
289
JNIEXPORT void JNICALL Java_pteditor_CSetImageWidth
289
JNIEXPORT void JNICALL Java_pteditor_CSetImageWidth
290
  (JNIEnv *env, jobject obj, jint width){
290
  (JNIEnv *env PT_UNUSED, jobject obj PT_UNUSED, jint width){
291
    if( pano != NULL ){
291
    if( pano != NULL ){
292
        if( pano->data != NULL ){
292
        if( pano->data != NULL ){
293
            myfree((void**)pano->data);
293
            myfree((void**)pano->data);
294
            pano->data = NULL;
294
            pano->data = NULL;
295
        }
295
        }
...
...
299
    }
299
    }
300
    pano->width = width;
300
    pano->width = width;
301
}
301
}
302
302
303
JNIEXPORT void JNICALL Java_pteditor_CSetImageHeight
303
JNIEXPORT void JNICALL Java_pteditor_CSetImageHeight
304
  (JNIEnv *env, jobject obj, jint height){
304
  (JNIEnv *env PT_UNUSED, jobject obj PT_UNUSED, jint height){
305
    if( pano != NULL ){
305
    if( pano != NULL ){
306
        if( pano->data != NULL ){
306
        if( pano->data != NULL ){
307
            myfree((void**)pano->data);
307
            myfree((void**)pano->data);
308
            pano->data = NULL;
308
            pano->data = NULL;
309
        }
309
        }
...
...
314
    
314
    
315
    pano->height = height;
315
    pano->height = height;
316
}
316
}
317
317
318
JNIEXPORT void JNICALL Java_pteditor_CSetImageRow
318
JNIEXPORT void JNICALL Java_pteditor_CSetImageRow
319
  (JNIEnv *env, jobject obj, jintArray jdata, jint nrow){
319
  (JNIEnv *env, jobject obj PT_UNUSED, jintArray jdata, jint nrow){
320
    if( pano == NULL ) return;
320
    if( pano == NULL ) return;
321
    if( pano->width == 0 || pano->height == 0 ) return;
321
    if( pano->width == 0 || pano->height == 0 ) return;
322
    
322
    
323
    if( pano->data == NULL){
323
    if( pano->data == NULL){
324
        pano->bitsPerPixel = 32;
324
        pano->bitsPerPixel = 32;