Lines Matching refs:lc
151 pump_data(Image *image, LoadContext* lc)
159 ddjvu_stream_write(lc->document, lc->streamid, data, size);
162 ddjvu_stream_write(lc->document, lc->streamid, data, size);
163 ddjvu_stream_close(lc->document, lc->streamid, 0);
169 pump_data_until_message(LoadContext *lc,Image *image) /* ddjvu_context_t *context, type ddjvu_document_type_t */
178 while (!(message = ddjvu_message_peek(lc->context))
180 ddjvu_stream_write(lc->document, lc->streamid, (char *) data, size);
185 ddjvu_stream_write(lc->document, lc->streamid, (char *) data, size);
186 ddjvu_stream_close(lc->document, lc->streamid, 0);
241 LoadContext *lc = (LoadContext *) ddjvu_document_get_user_data(document);
242 lc->pages = ddjvu_document_get_pagenum(document);
329 get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h, ExceptionInfo *exception ) {
352 image = lc->image;
353 type = ddjvu_page_get_type(lc->page);
466 get_page_line(LoadContext *lc, int row, QuantumInfo* quantum_info)
483 rect.w = lc->image->columns; /* /10 */
488 pagerect.w = lc->image->columns;
489 pagerect.h = lc->image->rows;
507 q = (unsigned char *) AcquireQuantumMemory(lc->image->columns,stride);
509 ret = ddjvu_page_render(lc->page,
517 ImportQuantumPixels(lc->image,
525 ,q,&lc->image->exception);
564 static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,
580 image = lc->image;
590 lc->page = ddjvu_page_create_by_pageno(lc->document, pagenum); /* 0? */
595 while ((message = ddjvu_message_peek(lc->context)))
599 ddjvu_message_pop(lc->context);
602 /* if (lc->error) break; */
604 message = pump_data_until_message(lc,image);
609 ddjvu_message_pop(lc->context);
610 } while ((message = ddjvu_message_peek(lc->context)));
611 } while (!ddjvu_page_decoding_done(lc->page));
613 ddjvu_document_get_pageinfo(lc->document, pagenum, &info);
637 type = ddjvu_page_get_type(lc->page);
640 /* image->gamma = (float)ddjvu_page_get_gamma(lc->page); */
678 get_page_image(lc, lc->page, 0, 0, info.width, info.height, exception);
685 get_page_line(lc, i, quantum_info);
704 if (lc->page) {
705 ddjvu_page_release(lc->page);
706 lc->page = NULL;
731 static void djvu_close_lc(LoadContext* lc)
733 if (lc->document)
734 ddjvu_document_release(lc->document);
735 if (lc->context)
736 ddjvu_context_release(lc->context);
737 if (lc->page)
738 ddjvu_page_release(lc->page);
739 RelinquishMagickMemory(lc);
760 *lc;
788 lc = (LoadContext *) NULL;
807 lc = (LoadContext *) AcquireMagickMemory(sizeof(*lc));
808 if (lc == NULL)
815 (void) ResetMagickMemory(lc,0,sizeof(LoadContext));
817 lc->image = image;
818 lc->pages = 0;
819 lc->context = ddjvu_context_create("ImageMagick djvu loader"); /* g_program_name */
821 ddjvu_cache_set_size(lc->context, 1); /* right? */
825 lc->document = ddjvu_document_create(lc->context, url, use_cache); /* don't cache */
826 ddjvu_document_set_user_data(lc->document, lc);
830 message = ddjvu_message_wait(lc->context);
835 ddjvu_document_release(lc->document);
836 ddjvu_context_release(lc->context);
838 RelinquishMagickMemory(lc);
844 lc->streamid = message->m_newstream.streamid;
845 ddjvu_message_pop(lc->context);
847 message = pump_data_until_message(lc,image);
853 ddjvu_message_pop(lc->context);
854 } while ((message = ddjvu_message_peek(lc->context)));
858 while (lc->pages == 0) {
859 message = ddjvu_message_wait(lc->context);
861 ddjvu_message_pop(lc->context);
868 for ( ; i < (ssize_t) lc->pages; i++)
870 image=ReadOneDJVUImage(lc,i,image_info,exception);
880 djvu_close_lc(lc);