Lines Matching defs:this
8 * this list of conditions and the following disclaimer.
10 * this list of conditions and the following disclaimer in the documentation
13 * contributors may be used to endorse or promote products derived from this
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 /* TurboJPEG/OSS: this implements the TurboJPEG API using libjpeg-turbo */
109 #define getinstance(handle) tjinstance *this=(tjinstance *)handle; \
112 if(!this) {snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
114 cinfo=&this->cinfo; dinfo=&this->dinfo;
289 /* Conversion functions to emulate the colorspace extensions. This allows the
441 if(setjmp(this->jerr.setjmp_buffer)) return -1;
442 if(this->init&COMPRESS) jpeg_destroy_compress(cinfo);
443 if(this->init&DECOMPRESS) jpeg_destroy_decompress(dinfo);
444 free(this);
461 static tjhandle _tjInitCompress(tjinstance *this)
463 /* This is also straight out of example.c */
464 this->cinfo.err=jpeg_std_error(&this->jerr.pub);
465 this->jerr.pub.error_exit=my_error_exit;
466 this->jerr.pub.output_message=my_output_message;
468 if(setjmp(this->jerr.setjmp_buffer))
471 if(this) free(this); return NULL;
474 jpeg_create_compress(&this->cinfo);
475 this->cinfo.dest=&this->jdst;
476 this->jdst.init_destination=dst_noop;
477 this->jdst.empty_output_buffer=empty_output_buffer;
478 this->jdst.term_destination=dst_noop;
480 this->init|=COMPRESS;
481 return (tjhandle)this;
486 tjinstance *this=NULL;
487 if((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)
493 MEMZERO(this, sizeof(tjinstance));
494 return _tjInitCompress(this);
505 // This allows for rare corner cases in which a JPEG image can actually be
524 // This allows for rare corner cases in which a JPEG image can actually be
544 if((this->init&COMPRESS)==0)
552 if(setjmp(this->jerr.setjmp_buffer))
581 this->jdst.next_output_byte=*jpegBuf;
582 this->jdst.free_in_buffer=tjBufSize(width, height, jpegSubsamp);
599 -(unsigned long)(this->jdst.free_in_buffer);
641 static tjhandle _tjInitDecompress(tjinstance *this)
643 /* This is also straight out of example.c */
644 this->dinfo.err=jpeg_std_error(&this->jerr.pub);
645 this->jerr.pub.error_exit=my_error_exit;
646 this->jerr.pub.output_message=my_output_message;
648 if(setjmp(this->jerr.setjmp_buffer))
651 if(this) free(this); return NULL;
654 jpeg_create_decompress(&this->dinfo);
655 this->dinfo.src=&this->jsrc;
656 this->jsrc.init_source=src_noop;
657 this->jsrc.fill_input_buffer=fill_input_buffer;
658 this->jsrc.skip_input_data=skip_input_data;
659 this->jsrc.resync_to_restart=jpeg_resync_to_restart;
660 this->jsrc.term_source=src_noop;
662 this->init|=DECOMPRESS;
663 return (tjhandle)this;
668 tjinstance *this;
669 if((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)
675 MEMZERO(this, sizeof(tjinstance));
676 return _tjInitDecompress(this);
687 if((this->init&DECOMPRESS)==0)
694 if(setjmp(this->jerr.setjmp_buffer))
700 this->jsrc.bytes_in_buffer=jpegSize;
701 this->jsrc.next_input_byte=jpegBuf;
754 if((this->init&DECOMPRESS)==0)
765 if(setjmp(this->jerr.setjmp_buffer))
772 this->jsrc.bytes_in_buffer=jpegSize;
773 this->jsrc.next_input_byte=jpegBuf;