• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:env

2  * Copyright (C)2011-2018 D. R. Commander.  All Rights Reserved.
7 * - Redistributions of source code must retain the above copyright notice,
9 * - Redistributions in binary form must reproduce the above copyright notice,
12 * - Neither the name of the libjpeg-turbo Project nor the names of its
40 #define PAD(v, p) ((v + (p) - 1) & (~((p) - 1)))
43 if (!(f) || (*env)->ExceptionCheck(env)) { \
49 jclass _exccls = (*env)->FindClass(env, exceptionClass); \
52 (*env)->ThrowNew(env, _exccls, msg); \
62 BAILIF0(_errstr = (*env)->NewStringUTF(env, tjGetErrorStr2(handle))); \
63 BAILIF0(_exccls = (*env)->FindClass(env, \
65 BAILIF0(_excid = (*env)->GetMethodID(env, _exccls, "<init>", \
67 BAILIF0(_excobj = (*env)->NewObject(env, _exccls, _excid, _errstr, \
69 (*env)->Throw(env, _excobj); \
79 jclass _cls = (*env)->GetObjectClass(env, obj); \
83 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "handle", "J")); \
84 handle = (tjhandle)(size_t)(*env)->GetLongField(env, obj, _fid);
91 if ((jName = (*env)->NewStringUTF(env, property)) != NULL && \
92 (jValue = (*env)->CallStaticObjectMethod(env, cls, mid, \
94 if ((value = (*env)->GetStringUTFChars(env, jValue, 0)) != NULL) { \
96 (*env)->ReleaseStringUTFChars(env, jValue, value); \
101 int ProcessSystemProperties(JNIEnv *env) in ProcessSystemProperties() argument
108 BAILIF0(cls = (*env)->FindClass(env, "java/lang/System")); in ProcessSystemProperties()
109 BAILIF0(mid = (*env)->GetStaticMethodID(env, cls, "getProperty", in ProcessSystemProperties()
119 return -1; in ProcessSystemProperties()
124 (JNIEnv *env, jclass cls, jint width, jint height, jint jpegSubsamp) in Java_org_libjpegturbo_turbojpeg_TJ_bufSize() argument
128 if (retval == -1) THROW_ARG(tjGetErrorStr()); in Java_org_libjpegturbo_turbojpeg_TJ_bufSize()
136 (JNIEnv *env, jclass cls, jint width, jint pad, jint height, jint subsamp) in Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII() argument
140 if (retval == -1) THROW_ARG(tjGetErrorStr()); in Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII()
148 (JNIEnv *env, jclass cls, jint width, jint height, jint subsamp) in Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III() argument
150 return Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII(env, cls, width, in Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III()
157 (JNIEnv *env, jclass cls, jint componentID, jint width, jint stride, in Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII() argument
163 if (retval == -1) THROW_ARG(tjGetErrorStr()); in Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII()
171 (JNIEnv *env, jclass cls, jint componentID, jint width, jint subsamp) in Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III() argument
175 if (retval == -1) THROW_ARG(tjGetErrorStr()); in Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III()
183 (JNIEnv *env, jclass cls, jint componentID, jint height, jint subsamp) in Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III() argument
187 if (retval == -1) THROW_ARG(tjGetErrorStr()); in Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III()
195 (JNIEnv *env, jobject obj) in Java_org_libjpegturbo_turbojpeg_TJCompressor_init() argument
204 BAILIF0(cls = (*env)->GetObjectClass(env, obj)); in Java_org_libjpegturbo_turbojpeg_TJCompressor_init()
205 BAILIF0(fid = (*env)->GetFieldID(env, cls, "handle", "J")); in Java_org_libjpegturbo_turbojpeg_TJCompressor_init()
206 (*env)->SetLongField(env, obj, fid, (size_t)handle); in Java_org_libjpegturbo_turbojpeg_TJCompressor_init()
213 (JNIEnv *env, jobject obj, jarray src, jint srcElementSize, jint x, jint y, in TJCompressor_compress() argument
231 arraySize = (y + height - 1) * actualPitch + (x + width) * tjPixelSize[pf]; in TJCompressor_compress()
232 if ((*env)->GetArrayLength(env, src) * srcElementSize < arraySize) in TJCompressor_compress()
235 if ((*env)->GetArrayLength(env, dst) < (jsize)jpegSize) in TJCompressor_compress()
238 if (ProcessSystemProperties(env) < 0) goto bailout; in TJCompressor_compress()
240 BAILIF0(srcBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in TJCompressor_compress()
241 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0)); in TJCompressor_compress()
245 jpegQual, flags | TJFLAG_NOREALLOC) == -1) in TJCompressor_compress()
249 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0); in TJCompressor_compress()
250 if (srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0); in TJCompressor_compress()
256 (JNIEnv *env, jobject obj, jbyteArray src, jint x, jint y, jint width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII() argument
260 return TJCompressor_compress(env, obj, src, 1, x, y, width, pitch, height, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII()
266 (JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII() argument
270 return TJCompressor_compress(env, obj, src, 1, 0, 0, width, pitch, height, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII()
276 (JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII() argument
283 THROW_ARG("Pixel format must be 32-bit when compressing from an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII()
285 return TJCompressor_compress(env, obj, src, sizeof(jint), x, y, width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII()
295 (JNIEnv *env, jobject obj, jintArray src, jint width, jint stride, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII() argument
302 THROW_ARG("Pixel format must be 32-bit when compressing from an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII()
304 return TJCompressor_compress(env, obj, src, sizeof(jint), 0, 0, width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII()
314 (JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets, in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII() argument
333 if ((*env)->GetArrayLength(env, srcobjs) < nc) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
335 if ((*env)->GetArrayLength(env, jSrcOffsets) < nc) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
337 if ((*env)->GetArrayLength(env, jSrcStrides) < nc) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
341 if ((*env)->GetArrayLength(env, dst) < (jsize)jpegSize) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
344 if (ProcessSystemProperties(env) < 0) goto bailout; in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
346 BAILIF0(srcOffsets = (*env)->GetPrimitiveArrayCritical(env, jSrcOffsets, 0)); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
347 BAILIF0(srcStrides = (*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0)); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
357 if (srcStrides[i] < 0 && srcOffsets[i] - planeSize + pw < 0) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
360 BAILIF0(jSrcPlanes[i] = (*env)->GetObjectArrayElement(env, srcobjs, i)); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
361 if ((*env)->GetArrayLength(env, jSrcPlanes[i]) < srcOffsets[i] + planeSize) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
365 (*env)->GetPrimitiveArrayCritical(env, jSrcPlanes[i], 0)); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
368 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0)); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
372 flags | TJFLAG_NOREALLOC) == -1) in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
376 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
379 (*env)->ReleasePrimitiveArrayCritical(env, jSrcPlanes[i], in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
383 (*env)->ReleasePrimitiveArrayCritical(env, jSrcStrides, srcStrides, 0); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
385 (*env)->ReleasePrimitiveArrayCritical(env, jSrcOffsets, srcOffsets, 0); in Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII()
390 (JNIEnv *env, jobject obj, jarray src, jint srcElementSize, jint x, jint y, in TJCompressor_encodeYUV() argument
411 if ((*env)->GetArrayLength(env, dstobjs) < nc) in TJCompressor_encodeYUV()
413 if ((*env)->GetArrayLength(env, jDstOffsets) < nc) in TJCompressor_encodeYUV()
415 if ((*env)->GetArrayLength(env, jDstStrides) < nc) in TJCompressor_encodeYUV()
419 arraySize = (y + height - 1) * actualPitch + (x + width) * tjPixelSize[pf]; in TJCompressor_encodeYUV()
420 if ((*env)->GetArrayLength(env, src) * srcElementSize < arraySize) in TJCompressor_encodeYUV()
423 BAILIF0(dstOffsets = (*env)->GetPrimitiveArrayCritical(env, jDstOffsets, 0)); in TJCompressor_encodeYUV()
424 BAILIF0(dstStrides = (*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0)); in TJCompressor_encodeYUV()
434 if (dstStrides[i] < 0 && dstOffsets[i] - planeSize + pw < 0) in TJCompressor_encodeYUV()
437 BAILIF0(jDstPlanes[i] = (*env)->GetObjectArrayElement(env, dstobjs, i)); in TJCompressor_encodeYUV()
438 if ((*env)->GetArrayLength(env, jDstPlanes[i]) < dstOffsets[i] + planeSize) in TJCompressor_encodeYUV()
442 (*env)->GetPrimitiveArrayCritical(env, jDstPlanes[i], 0)); in TJCompressor_encodeYUV()
445 BAILIF0(srcBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in TJCompressor_encodeYUV()
449 subsamp, flags) == -1) in TJCompressor_encodeYUV()
453 if (srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0); in TJCompressor_encodeYUV()
456 (*env)->ReleasePrimitiveArrayCritical(env, jDstPlanes[i], dstPlanes[i], in TJCompressor_encodeYUV()
460 (*env)->ReleasePrimitiveArrayCritical(env, jDstStrides, dstStrides, 0); in TJCompressor_encodeYUV()
462 (*env)->ReleasePrimitiveArrayCritical(env, jDstOffsets, dstOffsets, 0); in TJCompressor_encodeYUV()
467 (JNIEnv *env, jobject obj, jbyteArray src, jint x, jint y, jint width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III() argument
471 TJCompressor_encodeYUV(env, obj, src, 1, x, y, width, pitch, height, pf, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III()
477 (JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III() argument
484 THROW_ARG("Pixel format must be 32-bit when encoding from an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III()
486 TJCompressor_encodeYUV(env, obj, src, sizeof(jint), x, y, width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III()
495 (JNIEnv *env, jobject obj, jarray src, jint srcElementSize, jint width, in TJCompressor_encodeYUV_12() argument
511 if ((*env)->GetArrayLength(env, src) * srcElementSize < arraySize) in TJCompressor_encodeYUV_12()
513 if ((*env)->GetArrayLength(env, dst) < in TJCompressor_encodeYUV_12()
517 BAILIF0(srcBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in TJCompressor_encodeYUV_12()
518 BAILIF0(dstBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0)); in TJCompressor_encodeYUV_12()
521 flags) == -1) in TJCompressor_encodeYUV_12()
525 if (dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); in TJCompressor_encodeYUV_12()
526 if (srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0); in TJCompressor_encodeYUV_12()
531 (JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII() argument
534 TJCompressor_encodeYUV_12(env, obj, src, 1, width, pitch, height, pf, dst, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII()
540 (JNIEnv *env, jobject obj, jintArray src, jint width, jint stride, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII() argument
546 THROW_ARG("Pixel format must be 32-bit when encoding from an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII()
548 TJCompressor_encodeYUV_12(env, obj, src, sizeof(jint), width, in Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII()
558 (JNIEnv *env, jobject obj) in Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy() argument
564 if (tjDestroy(handle) == -1) THROW_TJ(); in Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy()
565 (*env)->SetLongField(env, obj, _fid, 0); in Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy()
573 (JNIEnv *env, jobject obj) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_init() argument
582 BAILIF0(cls = (*env)->GetObjectClass(env, obj)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_init()
583 BAILIF0(fid = (*env)->GetFieldID(env, cls, "handle", "J")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_init()
584 (*env)->SetLongField(env, obj, fid, (size_t)handle); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_init()
592 (JNIEnv *env, jclass cls) in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors() argument
604 BAILIF0(sfcls = (*env)->FindClass(env, in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
606 BAILIF0(sfjava = (jobjectArray)(*env)->NewObjectArray(env, n, sfcls, 0)); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
609 BAILIF0(sfobj = (*env)->AllocObject(env, sfcls)); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
610 BAILIF0(fid = (*env)->GetFieldID(env, sfcls, "num", "I")); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
611 (*env)->SetIntField(env, sfobj, fid, sf[i].num); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
612 BAILIF0(fid = (*env)->GetFieldID(env, sfcls, "denom", "I")); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
613 (*env)->SetIntField(env, sfobj, fid, sf[i].denom); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
614 (*env)->SetObjectArrayElement(env, sfjava, i, sfobj); in Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors()
623 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader() argument
627 int width = 0, height = 0, jpegSubsamp = -1, jpegColorspace = -1; in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
631 if ((*env)->GetArrayLength(env, src) < jpegSize) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
634 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
637 &height, &jpegSubsamp, &jpegColorspace) == -1) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
640 (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
643 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
644 (*env)->SetIntField(env, obj, _fid, jpegSubsamp); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
645 if ((_fid = (*env)->GetFieldID(env, _cls, "jpegColorspace", "I")) == 0) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
646 (*env)->ExceptionClear(env); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
648 (*env)->SetIntField(env, obj, _fid, jpegColorspace); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
649 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegWidth", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
650 (*env)->SetIntField(env, obj, _fid, width); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
651 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegHeight", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
652 (*env)->SetIntField(env, obj, _fid, height); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
655 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader()
659 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jarray dst, in TJDecompressor_decompress() argument
674 if ((*env)->GetArrayLength(env, src) < jpegSize) in TJDecompressor_decompress()
677 arraySize = (y + height - 1) * actualPitch + (x + width) * tjPixelSize[pf]; in TJDecompressor_decompress()
678 if ((*env)->GetArrayLength(env, dst) * dstElementSize < arraySize) in TJDecompressor_decompress()
681 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in TJDecompressor_decompress()
682 BAILIF0(dstBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0)); in TJDecompressor_decompress()
686 pitch, height, pf, flags) == -1) in TJDecompressor_decompress()
690 if (dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); in TJDecompressor_decompress()
691 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); in TJDecompressor_decompress()
696 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII() argument
699 TJDecompressor_decompress(env, obj, src, jpegSize, dst, 1, x, y, width, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII()
705 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII() argument
708 TJDecompressor_decompress(env, obj, src, jpegSize, dst, 1, 0, 0, width, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII()
714 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jintArray dst, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII() argument
720 THROW_ARG("Pixel format must be 32-bit when decompressing to an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII()
722 TJDecompressor_decompress(env, obj, src, jpegSize, dst, sizeof(jint), x, y, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII()
731 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jintArray dst, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII() argument
737 THROW_ARG("Pixel format must be 32-bit when decompressing to an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII()
739 TJDecompressor_decompress(env, obj, src, jpegSize, dst, sizeof(jint), 0, 0, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII()
748 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III() argument
756 int jpegSubsamp = -1, jpegWidth = 0, jpegHeight = 0; in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
762 if ((*env)->GetArrayLength(env, src) < jpegSize) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
764 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
765 jpegSubsamp = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
766 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegWidth", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
767 jpegWidth = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
768 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegHeight", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
769 jpegHeight = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
789 BAILIF0(dstOffsets = (*env)->GetPrimitiveArrayCritical(env, jDstOffsets, 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
790 BAILIF0(dstStrides = (*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
801 if (dstStrides[i] < 0 && dstOffsets[i] - planeSize + pw < 0) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
804 BAILIF0(jDstPlanes[i] = (*env)->GetObjectArrayElement(env, dstobjs, i)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
805 if ((*env)->GetArrayLength(env, jDstPlanes[i]) < dstOffsets[i] + planeSize) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
809 (*env)->GetPrimitiveArrayCritical(env, jDstPlanes[i], 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
812 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
816 desiredHeight, flags) == -1) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
820 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
823 (*env)->ReleasePrimitiveArrayCritical(env, jDstPlanes[i], dstPlanes[i], in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
827 (*env)->ReleasePrimitiveArrayCritical(env, jDstStrides, dstStrides, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
829 (*env)->ReleasePrimitiveArrayCritical(env, jDstOffsets, dstOffsets, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III()
834 (JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI() argument
839 int jpegSubsamp = -1, jpegWidth = 0, jpegHeight = 0; in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
843 if ((*env)->GetArrayLength(env, src) < jpegSize) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
845 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
846 jpegSubsamp = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
847 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegWidth", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
848 jpegWidth = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
849 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegHeight", "I")); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
850 jpegHeight = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
851 if ((*env)->GetArrayLength(env, dst) < in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
855 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
856 BAILIF0(dstBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0)); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
859 flags) == -1) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
863 if (dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
864 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI()
868 (JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets, in TJDecompressor_decodeYUV() argument
889 if ((*env)->GetArrayLength(env, srcobjs) < nc) in TJDecompressor_decodeYUV()
891 if ((*env)->GetArrayLength(env, jSrcOffsets) < nc) in TJDecompressor_decodeYUV()
893 if ((*env)->GetArrayLength(env, jSrcStrides) < nc) in TJDecompressor_decodeYUV()
897 arraySize = (y + height - 1) * actualPitch + (x + width) * tjPixelSize[pf]; in TJDecompressor_decodeYUV()
898 if ((*env)->GetArrayLength(env, dst) * dstElementSize < arraySize) in TJDecompressor_decodeYUV()
901 BAILIF0(srcOffsets = (*env)->GetPrimitiveArrayCritical(env, jSrcOffsets, 0)); in TJDecompressor_decodeYUV()
902 BAILIF0(srcStrides = (*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0)); in TJDecompressor_decodeYUV()
912 if (srcStrides[i] < 0 && srcOffsets[i] - planeSize + pw < 0) in TJDecompressor_decodeYUV()
915 BAILIF0(jSrcPlanes[i] = (*env)->GetObjectArrayElement(env, srcobjs, i)); in TJDecompressor_decodeYUV()
916 if ((*env)->GetArrayLength(env, jSrcPlanes[i]) < srcOffsets[i] + planeSize) in TJDecompressor_decodeYUV()
920 (*env)->GetPrimitiveArrayCritical(env, jSrcPlanes[i], 0)); in TJDecompressor_decodeYUV()
923 BAILIF0(dstBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0)); in TJDecompressor_decodeYUV()
927 pitch, height, pf, flags) == -1) in TJDecompressor_decodeYUV()
931 if (dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); in TJDecompressor_decodeYUV()
934 (*env)->ReleasePrimitiveArrayCritical(env, jSrcPlanes[i], in TJDecompressor_decodeYUV()
938 (*env)->ReleasePrimitiveArrayCritical(env, jSrcStrides, srcStrides, 0); in TJDecompressor_decodeYUV()
940 (*env)->ReleasePrimitiveArrayCritical(env, jSrcOffsets, srcOffsets, 0); in TJDecompressor_decodeYUV()
945 (JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII() argument
949 TJDecompressor_decodeYUV(env, obj, srcobjs, jSrcOffsets, jSrcStrides, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII()
956 (JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII() argument
963 THROW_ARG("Pixel format must be 32-bit when decoding to an integer buffer."); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII()
965 TJDecompressor_decodeYUV(env, obj, srcobjs, jSrcOffsets, jSrcStrides, in Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII()
975 (JNIEnv *env, jobject obj) in Java_org_libjpegturbo_turbojpeg_TJTransformer_init() argument
984 BAILIF0(cls = (*env)->GetObjectClass(env, obj)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_init()
985 BAILIF0(fid = (*env)->GetFieldID(env, cls, "handle", "J")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_init()
986 (*env)->SetLongField(env, obj, fid, (size_t)handle); in Java_org_libjpegturbo_turbojpeg_TJTransformer_init()
993 JNIEnv *env; member
1002 JNICustomFilterParams *params = (JNICustomFilterParams *)transform->data; in JNICustomFilter()
1003 JNIEnv *env = params->env; in JNICustomFilter() local
1004 jobject tobj = params->tobj, cfobj = params->cfobj; in JNICustomFilter()
1010 BAILIF0(bufobj = (*env)->NewDirectByteBuffer(env, coeffs, in JNICustomFilter()
1012 BAILIF0(cls = (*env)->FindClass(env, "java/nio/ByteOrder")); in JNICustomFilter()
1013 BAILIF0(mid = (*env)->GetStaticMethodID(env, cls, "nativeOrder", in JNICustomFilter()
1015 BAILIF0(borobj = (*env)->CallStaticObjectMethod(env, cls, mid)); in JNICustomFilter()
1016 BAILIF0(cls = (*env)->GetObjectClass(env, bufobj)); in JNICustomFilter()
1017 BAILIF0(mid = (*env)->GetMethodID(env, cls, "order", in JNICustomFilter()
1019 (*env)->CallObjectMethod(env, bufobj, mid, borobj); in JNICustomFilter()
1020 BAILIF0(mid = (*env)->GetMethodID(env, cls, "asShortBuffer", in JNICustomFilter()
1022 BAILIF0(bufobj = (*env)->CallObjectMethod(env, bufobj, mid)); in JNICustomFilter()
1024 BAILIF0(cls = (*env)->FindClass(env, "java/awt/Rectangle")); in JNICustomFilter()
1025 BAILIF0(arrayRegionObj = (*env)->AllocObject(env, cls)); in JNICustomFilter()
1026 BAILIF0(fid = (*env)->GetFieldID(env, cls, "x", "I")); in JNICustomFilter()
1027 (*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.x); in JNICustomFilter()
1028 BAILIF0(fid = (*env)->GetFieldID(env, cls, "y", "I")); in JNICustomFilter()
1029 (*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.y); in JNICustomFilter()
1030 BAILIF0(fid = (*env)->GetFieldID(env, cls, "width", "I")); in JNICustomFilter()
1031 (*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.w); in JNICustomFilter()
1032 BAILIF0(fid = (*env)->GetFieldID(env, cls, "height", "I")); in JNICustomFilter()
1033 (*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.h); in JNICustomFilter()
1035 BAILIF0(planeRegionObj = (*env)->AllocObject(env, cls)); in JNICustomFilter()
1036 BAILIF0(fid = (*env)->GetFieldID(env, cls, "x", "I")); in JNICustomFilter()
1037 (*env)->SetIntField(env, planeRegionObj, fid, planeRegion.x); in JNICustomFilter()
1038 BAILIF0(fid = (*env)->GetFieldID(env, cls, "y", "I")); in JNICustomFilter()
1039 (*env)->SetIntField(env, planeRegionObj, fid, planeRegion.y); in JNICustomFilter()
1040 BAILIF0(fid = (*env)->GetFieldID(env, cls, "width", "I")); in JNICustomFilter()
1041 (*env)->SetIntField(env, planeRegionObj, fid, planeRegion.w); in JNICustomFilter()
1042 BAILIF0(fid = (*env)->GetFieldID(env, cls, "height", "I")); in JNICustomFilter()
1043 (*env)->SetIntField(env, planeRegionObj, fid, planeRegion.h); in JNICustomFilter()
1045 BAILIF0(cls = (*env)->GetObjectClass(env, cfobj)); in JNICustomFilter()
1046 BAILIF0(mid = (*env)->GetMethodID(env, cls, "customFilter", in JNICustomFilter()
1048 (*env)->CallVoidMethod(env, cfobj, mid, bufobj, arrayRegionObj, in JNICustomFilter()
1054 return -1; in JNICustomFilter()
1059 (JNIEnv *env, jobject obj, jbyteArray jsrcBuf, jint jpegSize, in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform() argument
1075 if ((*env)->GetArrayLength(env, jsrcBuf) < jpegSize) in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1077 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegWidth", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1078 jpegWidth = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1079 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegHeight", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1080 jpegHeight = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1081 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1082 jpegSubsamp = (int)(*env)->GetIntField(env, obj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1084 n = (*env)->GetArrayLength(env, dstobjs); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1085 if (n != (*env)->GetArrayLength(env, tobjs)) in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1109 BAILIF0(tobj = (*env)->GetObjectArrayElement(env, tobjs, i)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1110 BAILIF0(_cls = (*env)->GetObjectClass(env, tobj)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1111 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "op", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1112 t[i].op = (*env)->GetIntField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1113 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "options", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1114 t[i].options = (*env)->GetIntField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1115 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "x", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1116 t[i].r.x = (*env)->GetIntField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1117 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "y", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1118 t[i].r.y = (*env)->GetIntField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1119 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "width", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1120 t[i].r.w = (*env)->GetIntField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1121 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "height", "I")); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1122 t[i].r.h = (*env)->GetIntField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1124 BAILIF0(_fid = (*env)->GetFieldID(env, _cls, "cf", in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1126 cfobj = (*env)->GetObjectField(env, tobj, _fid); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1128 params[i].env = env; in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1141 BAILIF0(jdstBufs[i] = (*env)->GetObjectArrayElement(env, dstobjs, i)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1142 if ((unsigned long)(*env)->GetArrayLength(env, jdstBufs[i]) < in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1146 BAILIF0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, jsrcBuf, 0)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1149 (*env)->GetPrimitiveArrayCritical(env, jdstBufs[i], 0)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1152 flags | TJFLAG_NOREALLOC) == -1) in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1156 (*env)->ReleasePrimitiveArrayCritical(env, jdstBufs[i], dstBufs[i], 0); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1159 (*env)->ReleasePrimitiveArrayCritical(env, jsrcBuf, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1162 jdstSizes = (*env)->NewIntArray(env, n); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1163 BAILIF0(dstSizesi = (*env)->GetIntArrayElements(env, jdstSizes, 0)); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1167 if (dstSizesi) (*env)->ReleaseIntArrayElements(env, jdstSizes, dstSizesi, 0); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1171 (*env)->ReleasePrimitiveArrayCritical(env, jdstBufs[i], dstBufs[i], 0); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1175 if (jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, jsrcBuf, jpegBuf, 0); in Java_org_libjpegturbo_turbojpeg_TJTransformer_transform()
1184 (JNIEnv *env, jobject obj) in Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy() argument
1186 Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy(env, obj); in Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy()