Mercurial > vba-clojure
diff src/clojure/clojure.cpp @ 496:a6d060a64246
pixel introspection. but entire image is upside down.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 11 Jun 2012 06:04:25 -0500 |
parents | 09b3bc0b71b5 |
children | 5596cd4a3fc6 |
line wrap: on
line diff
1.1 --- a/src/clojure/clojure.cpp Mon Jun 11 00:55:51 2012 -0500 1.2 +++ b/src/clojure/clojure.cpp Mon Jun 11 06:04:25 2012 -0500 1.3 @@ -310,3 +310,29 @@ 1.4 env->ReleaseIntArrayElements(rgb, RGB_Arr, 0); 1.5 env->ReleaseIntArrayElements(store, store_Arr, 0); 1.6 } 1.7 + 1.8 + 1.9 +/* 1.10 + * Class: com_aurellem_gb_Gb 1.11 + * Method: getPixels 1.12 + * Signature: ([I)V 1.13 + */ 1.14 +JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_getPixels 1.15 +(JNIEnv *env, jclass clazz, jintArray arr){ 1.16 + jint *pixel_store = env->GetIntArrayElements(arr, 0); 1.17 + getPixels32(pixel_store); 1.18 + env->ReleaseIntArrayElements(arr, pixel_store, 0); 1.19 +} 1.20 + 1.21 +/* 1.22 + * Class: com_aurellem_gb_Gb 1.23 + * Method: nwritePNG 1.24 + * Signature: (Ljava/lang/String;)V 1.25 + */ 1.26 +JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_nwritePNG 1.27 +(JNIEnv *env, jclass clazz, jstring filename){ 1.28 + const char *_filename = env->GetStringUTFChars(filename, 0); 1.29 + gbWritePNGFile(_filename); 1.30 +} 1.31 + 1.32 +