| 405 | |
| 406 | GLOBAL(void) |
| 407 | devil_jpeg_write_init(j_compress_ptr cinfo) |
| 408 | { |
| 409 | iwrite_ptr dest; |
| 410 | |
| 411 | if (cinfo->dest == NULL) { // first time for this JPEG object? |
| 412 | cinfo->dest = (struct jpeg_destination_mgr *) |
| 413 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, |
| 414 | sizeof(iwrite_mgr)); |
| 415 | dest = (iwrite_ptr)cinfo->dest; |
| 416 | } |
| 417 | |
| 418 | dest = (iwrite_ptr)cinfo->dest; |
| 419 | dest->pub.init_destination = init_destination; |
| 420 | dest->pub.empty_output_buffer = empty_output_buffer; |
| 421 | dest->pub.term_destination = term_destination; |
| 422 | |
| 423 | return; |
| 424 | } |
| 425 | |
| 426 | |
| 427 | //! Writes a Jpeg file |