diff options
Diffstat (limited to 'kviewshell/plugins/djvu/libdjvu')
23 files changed, 398 insertions, 398 deletions
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp index d6f5555c..9e8b5fd7 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp @@ -147,13 +147,13 @@ DjVmNav::DjVuBookMark::encode(const GP<ByteStream> &gstr) ByteStream &bs=*gstr; #ifdef DJVMNAV_WITH_256LIMIT if (count>255) - G_THROW("Excessive number of tqchildren in bookmark tree"); + G_THROW("Excessive number of children in bookmark tree"); bs.write8(count); textsize = displayname.length(); bs.write24( textsize ); #else if (count>65535) - G_THROW("Excessive number of tqchildren in bookmark tree"); + G_THROW("Excessive number of children in bookmark tree"); bs.write8( count & 0xff ); bs.write8( (count>>8) & 0xff ); textsize = displayname.length(); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.h b/kviewshell/plugins/djvu/libdjvu/DjVmNav.h index 612cd100..46c5d57f 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.h @@ -115,7 +115,7 @@ private: /** The DjVuBookMark. Each entry in the Navigation chunk (NAVM) is a bookmark. A bookmark - contains a count of immediate tqchildren, a display string and a url. + contains a count of immediate children, a display string and a url. **/ class DjVmNav::DjVuBookMark : public GPEnabled @@ -131,7 +131,7 @@ public: void encode(const GP<ByteStream> &stream); void dump(const GP<ByteStream> &stream); void decode(const GP<ByteStream> &stream); - int count; // count of immediate tqchildren. + int count; // count of immediate children. GUTF8String displayname; // example: "Section 3.5 - Encryption" GUTF8String url; // url, may be blank or relative. }; diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp index f3a53bf7..7cece60b 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp @@ -978,16 +978,16 @@ DjVuANT::get_mode(GLParser & parser) return retval; } -static inline DjVuANT::tqalignment +static inline DjVuANT::alignment legal_halign(const int i) { - DjVuANT::tqalignment retval; - switch((DjVuANT::tqalignment)i) + DjVuANT::alignment retval; + switch((DjVuANT::alignment)i) { case DjVuANT::ALIGN_LEFT: case DjVuANT::ALIGN_CENTER: case DjVuANT::ALIGN_RIGHT: - retval=(DjVuANT::tqalignment)i; + retval=(DjVuANT::alignment)i; break; default: retval=DjVuANT::ALIGN_UNSPEC; @@ -996,16 +996,16 @@ legal_halign(const int i) return retval; } -static inline DjVuANT::tqalignment +static inline DjVuANT::alignment legal_valign(const int i) { - DjVuANT::tqalignment retval; - switch((DjVuANT::tqalignment)i) + DjVuANT::alignment retval; + switch((DjVuANT::alignment)i) { case DjVuANT::ALIGN_CENTER: case DjVuANT::ALIGN_TOP: case DjVuANT::ALIGN_BOTTOM: - retval=(DjVuANT::tqalignment)i; + retval=(DjVuANT::alignment)i; break; default: retval=DjVuANT::ALIGN_UNSPEC; @@ -1014,12 +1014,12 @@ legal_valign(const int i) return retval; } -DjVuANT::tqalignment +DjVuANT::alignment DjVuANT::get_hor_align(GLParser & parser) { DEBUG_MSG("DjVuAnt::get_hor_align(): getting hor page alignemnt ...\n"); DEBUG_MAKE_INDENT(3); - tqalignment retval=ALIGN_UNSPEC; + alignment retval=ALIGN_UNSPEC; G_TRY { GP<GLObject> obj=parser.get_object(ALIGN_TAG); @@ -1030,7 +1030,7 @@ DjVuANT::get_hor_align(GLParser & parser) for(int i=(int)ALIGN_UNSPEC;(i<align_strings_size);++i) { - const tqalignment j=legal_halign(i); + const alignment j=legal_halign(i); if((i == (int)j)&&(align == align_strings[i])) { retval=j; @@ -1048,18 +1048,18 @@ DjVuANT::get_hor_align(GLParser & parser) #ifndef NDEBUG if(retval == ALIGN_UNSPEC) { - DEBUG_MSG("resetting tqalignment to ALIGN_UNSPEC\n"); + DEBUG_MSG("resetting alignment to ALIGN_UNSPEC\n"); } #endif // NDEBUG return retval; } -DjVuANT::tqalignment +DjVuANT::alignment DjVuANT::get_ver_align(GLParser & parser) { DEBUG_MSG("DjVuAnt::get_ver_align(): getting vert page alignemnt ...\n"); DEBUG_MAKE_INDENT(3); - tqalignment retval=ALIGN_UNSPEC; + alignment retval=ALIGN_UNSPEC; G_TRY { GP<GLObject> obj=parser.get_object(ALIGN_TAG); @@ -1069,7 +1069,7 @@ DjVuANT::get_ver_align(GLParser & parser) DEBUG_MSG("ver_align='" << align << "'\n"); for(int i=(int)ALIGN_UNSPEC;(i<align_strings_size);++i) { - const tqalignment j=legal_valign(i); + const alignment j=legal_valign(i); if((i == (int)j)&&(align == align_strings[i])) { retval=j; @@ -1087,7 +1087,7 @@ DjVuANT::get_ver_align(GLParser & parser) #ifndef NDEBUG if(retval == ALIGN_UNSPEC) { - DEBUG_MSG("resetting tqalignment to ALIGN_UNSPEC\n"); + DEBUG_MSG("resetting alignment to ALIGN_UNSPEC\n"); } #endif // NDEBUG return retval; @@ -1166,38 +1166,38 @@ DjVuANT::get_map_areas(GLParser & parser) DEBUG_MSG("found maparea '" << comment << "' (" << url << ":" << target << ")\n"); - GLObject * tqshape=obj[2]; + GLObject * shape=obj[2]; GP<GMapArea> map_area; - if (tqshape->get_type()==GLObject::LIST) + if (shape->get_type()==GLObject::LIST) { - if (tqshape->get_name()==GMapArea::RECT_TAG) + if (shape->get_name()==GMapArea::RECT_TAG) { DEBUG_MSG("it's a rectangle.\n"); - GRect grect((*tqshape)[0]->get_number(), - (*tqshape)[1]->get_number(), - (*tqshape)[2]->get_number(), - (*tqshape)[3]->get_number()); + GRect grect((*shape)[0]->get_number(), + (*shape)[1]->get_number(), + (*shape)[2]->get_number(), + (*shape)[3]->get_number()); GP<GMapRect> map_rect=GMapRect::create(grect); map_area=(GMapRect *)map_rect; - } else if (tqshape->get_name()==GMapArea::POLY_TAG) + } else if (shape->get_name()==GMapArea::POLY_TAG) { DEBUG_MSG("it's a polygon.\n"); - int points=tqshape->get_list().size()/2; + int points=shape->get_list().size()/2; GTArray<int> xx(points-1), yy(points-1); for(int i=0;i<points;i++) { - xx[i]=(*tqshape)[2*i]->get_number(); - yy[i]=(*tqshape)[2*i+1]->get_number(); + xx[i]=(*shape)[2*i]->get_number(); + yy[i]=(*shape)[2*i+1]->get_number(); } GP<GMapPoly> map_poly=GMapPoly::create(xx,yy,points); map_area=(GMapPoly *)map_poly; - } else if (tqshape->get_name()==GMapArea::OVAL_TAG) + } else if (shape->get_name()==GMapArea::OVAL_TAG) { DEBUG_MSG("it's an ellipse.\n"); - GRect grect((*tqshape)[0]->get_number(), - (*tqshape)[1]->get_number(), - (*tqshape)[2]->get_number(), - (*tqshape)[3]->get_number()); + GRect grect((*shape)[0]->get_number(), + (*shape)[1]->get_number(), + (*shape)[2]->get_number(), + (*shape)[3]->get_number()); GP<GMapOval> map_oval=GMapOval::create(grect); map_area=(GMapOval *)map_oval; } diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h index b59fe37d..ed82f933 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h @@ -104,7 +104,7 @@ class ByteStream; // -------- DJVUANT -------- /** This class contains some trivial annotations of the page or of the - document such as page border color, page tqalignment, initial zoom and + document such as page border color, page alignment, initial zoom and display mode, hyperlinks and highlighted areas. All this information is put inside a textual chunk #ANTa# in pseudo-lisp format. Decoding and encoding are normally done by \Ref{DjVuANT::decode}() and @@ -120,7 +120,7 @@ public: enum { MODE_UNSPEC=0, MODE_COLOR, MODE_FORE, MODE_BACK, MODE_BW }; enum { ZOOM_STRETCH=-4, ZOOM_ONE2ONE=-3, ZOOM_WIDTH=-2, ZOOM_PAGE=-1, ZOOM_UNSPEC=0 }; - enum tqalignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, + enum alignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_TOP, ALIGN_BOTTOM }; /// Creates an empty annotation object. @@ -152,12 +152,12 @@ public: special cases. \end{description} */ int mode; - /**Qt::Horizontal page tqalignment. Possible values are #ALIGN_LEFT#, + /**Qt::Horizontal page alignment. Possible values are #ALIGN_LEFT#, #ALIGN_CENTER#, #ALIGN_RIGHT# and #ALIGN_UNSPEC#. */ - tqalignment hor_align; - /**Qt::Vertical page tqalignment. Possible values are #ALIGN_TOP#, + alignment hor_align; + /**Qt::Vertical page alignment. Possible values are #ALIGN_TOP#, #ALIGN_CENTER#, #ALIGN_BOTTOM# and #ALIGN_UNSPEC#. */ - tqalignment ver_align; + alignment ver_align; /** List of defined map areas. They may be just areas of highlighting or hyperlink. Please refer to \Ref{GMapArea}, \Ref{GMapRect}, \Ref{GMapPoly} and \Ref{GMapOval} for details. */ @@ -213,8 +213,8 @@ private: static unsigned long int get_bg_color(class GLParser & parser); static int get_zoom(class GLParser & parser); static int get_mode(class GLParser & parser); - static tqalignment get_hor_align(class GLParser & parser); - static tqalignment get_ver_align(class GLParser & parser); + static alignment get_hor_align(class GLParser & parser); + static alignment get_ver_align(class GLParser & parser); static GPList<GMapArea> get_map_areas(class GLParser & parser); #ifndef NO_METADATA_IN_ANT_CHUNK static GMap<GUTF8String, GUTF8String>get_metadata(GLParser & parser); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp index 67223e1f..542faa7a 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp @@ -651,7 +651,7 @@ DjVuDocEditor::insert_file(const GP<DataPool> &file_pool, // Good. Before we continue with the included files we want to // complete insertion of this one. Notice, that insertion of - // tqchildren may fail, in which case we will have to modify + // children may fail, in which case we will have to modify // data for this file to get rid of invalid INCL // Create a file record with the chosen ID @@ -994,7 +994,7 @@ DjVuDocEditor::remove_file(const GUTF8String &id, bool remove_unref, // We will accumulate errors here. GUTF8String errors; - // Now modify the ref_map and process tqchildren if necessary + // Now modify the ref_map and process children if necessary GP<DjVuFile> file=get_djvu_file(id); if (file) { diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp index 862c5fd0..73e3a9c2 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp @@ -419,7 +419,7 @@ DjVuFile::notify_file_flags_changed(const DjVuFile * src, { if (src!=this && are_incl_files_created() && is_data_present()) { - // Check if all tqchildren have data + // Check if all children have data bool all=true; { GCriticalSectionLock lock(&inc_files_lock); @@ -488,7 +488,7 @@ DjVuFile::decode_func(void) while(wait_for_finish(0)) continue; - DEBUG_MSG("waiting for tqchildren termination\n"); + DEBUG_MSG("waiting for children termination\n"); // Check for termination status GCriticalSectionLock lock(&inc_files_lock); for(GPosition pos=inc_files_list;pos;++pos) @@ -928,7 +928,7 @@ DjVuFile::decode_chunk( const GUTF8String &id, const GP<ByteStream> &gbs, GP<JB2Dict> fgjd = JB2Dict::create(); fgjd->decode(gbs); this->fgjd = fgjd; - desc.format( ERR_MSG("DjVuFile.tqshape_dict") "\t%d", fgjd->get_tqshape_count() ); + desc.format( ERR_MSG("DjVuFile.shape_dict") "\t%d", fgjd->get_shape_count() ); } // Sjbz (JB2 encoded mask) diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h index e81ef2d5..ea0e6db3 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h @@ -134,7 +134,7 @@ class DjVuNavDir; {\bf Inclusion} is also a new feature specifically designed for a multipage document. Indeed, inside a given document there can be a lot of things shared between its pages. Examples can be the document - annotation (\Ref{DjVuAnno}) and other things like shared tqshapes and + annotation (\Ref{DjVuAnno}) and other things like shared shapes and dictionary (to be implemented). To avoid putting these chunks into every page, we have invented new chunk called #INCL# which purpose is to make the decoder open the specified file and decode it. @@ -217,7 +217,7 @@ public: GP<GPixmap> bgpm; /// Pointer to the mask of foreground component of DjVu image (JB2 encoded). GP<JB2Image> fgjb; - /// Pointer to the optional tqshape dictionary for the mask (JB2 encoded). + /// Pointer to the optional shape dictionary for the mask (JB2 encoded). GP<JB2Dict> fgjd; /// Pointer to a colors layer for the foreground component of DjVu image. GP<GPixmap> fgpm; @@ -648,7 +648,7 @@ private: const GP<ByteStream> &str, bool djvi, bool djvu, bool iw44); int get_dpi(int w, int h); - // Functions dealing with the tqshape directory (fgjd) + // Functions dealing with the shape directory (fgjd) static GP<JB2Dict> static_get_fgjd(void *); GP<JB2Dict> get_fgjd(int block=0); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp index 54f24f1e..802f0edf 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp @@ -848,17 +848,17 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect, for (int blitno = 0; blitno < jimg->get_blit_count(); blitno++) { const JB2Blit *pblit = jimg->get_blit(blitno); - const JB2Shape &ptqshape = jimg->get_tqshape(pblit->tqshapeno); - if (ptqshape.bits && + const JB2Shape &pshape = jimg->get_shape(pblit->shapeno); + if (pshape.bits && pblit->left <= rect.xmax * subsample && pblit->bottom <= rect.ymax * subsample && - pblit->left + (int)ptqshape.bits->columns() >= rect.xmin * subsample && - pblit->bottom + (int)ptqshape.bits->rows() >= rect.ymin * subsample ) + pblit->left + (int)pshape.bits->columns() >= rect.xmin * subsample && + pblit->bottom + (int)pshape.bits->rows() >= rect.ymin * subsample ) { // Record component list if (fgbc) components.append(blitno); // Blit - bm->blit(ptqshape.bits, + bm->blit(pshape.bits, pblit->left - rxmin, pblit->bottom - rymin, subsample); } @@ -902,9 +902,9 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect, lastx = pblit->left; if (fg->colordata[blitno] == colorindex) { - const JB2Shape &ptqshape = jimg->get_tqshape(pblit->tqshapeno); + const JB2Shape &pshape = jimg->get_shape(pblit->shapeno); GRect rect(pblit->left, pblit->bottom, - ptqshape.bits->columns(), ptqshape.bits->rows()); + pshape.bits->columns(), pshape.bits->rows()); comprect.recthull(comprect, rect); compset.insert_before(nullpos, components, pos); continue; @@ -927,8 +927,8 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect, { int blitno = compset[pos]; const JB2Blit *pblit = jimg->get_blit(blitno); - const JB2Shape &ptqshape = jimg->get_tqshape(pblit->tqshapeno); - bm->blit(ptqshape.bits, + const JB2Shape &pshape = jimg->get_shape(pblit->shapeno); + bm->blit(pshape.bits, pblit->left - rxmin, pblit->bottom - rymin, subsample); } diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h index 84c9165d..aabf9ecf 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h @@ -353,7 +353,7 @@ public: GP<GPixmap> get_pixmap(const GRect &rect, const GRect &all, double gamma=0) const; /** Renders the mask of the foreground layer of the DjVu image. This functions is a wrapper for \Ref{JB2Image::get_bitmap}. Argument #align# - specified the tqalignment of the rows of the returned images. Setting + specified the alignment of the rows of the returned images. Setting #align# to #4#, for instance, will adjust the bitmap border in order to make sure that each row of the returned image starts on a word (four byte) boundary. This function returns a null pointer if there is not diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPort.h b/kviewshell/plugins/djvu/libdjvu/DjVuPort.h index 3e63c901..3c742128 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuPort.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuPort.h @@ -213,7 +213,7 @@ public: @param source The sender of the request */ virtual void notify_redisplay(const class DjVuImage * source); - /** This notification is sent by \ref{DjVuImage} when its tqgeometry + /** This notification is sent by \ref{DjVuImage} when its geometry has been changed as a result of decoding. It may be used to implement progressive redisplay. */ virtual void notify_retqlayout(const class DjVuImage * source); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp index 6b460864..5be8cbe7 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp @@ -108,8 +108,8 @@ DjVuTXT::Zone::append_child() empty.text_start = 0; empty.text_length = 0; empty.zone_parent=this; - tqchildren.append(empty); - return & tqchildren[tqchildren.lastpos()]; + children.append(empty); + return & children[children.lastpos()]; } void @@ -117,8 +117,8 @@ DjVuTXT::Zone::cleartext() { text_start = 0; text_length = 0; - for (GPosition i=tqchildren; i; ++i) - tqchildren[i].cleartext(); + for (GPosition i=children; i; ++i) + children[i].cleartext(); } void @@ -128,8 +128,8 @@ DjVuTXT::Zone::normtext(const char *instr, GUTF8String &outstr) { // Descend collecting text below text_start = outstr.length(); - for (GPosition i=tqchildren; i; ++i) - tqchildren[i].normtext(instr, outstr); + for (GPosition i=children; i; ++i) + children[i].normtext(instr, outstr); text_length = outstr.length() - text_start; // Ignore empty zones if (text_length == 0) @@ -142,8 +142,8 @@ DjVuTXT::Zone::normtext(const char *instr, GUTF8String &outstr) outstr = outstr + GUTF8String(instr+text_start, text_length); text_start = new_start; // Clear textual information on lower level nodes - for (GPosition i=tqchildren; i; ++i) - tqchildren[i].cleartext(); + for (GPosition i=children; i; ++i) + children[i].cleartext(); } // Determine standard separator char sep; @@ -174,8 +174,8 @@ unsigned int DjVuTXT::Zone::memuse() const { int memuse = sizeof(*this); - for (GPosition i=tqchildren; i; ++i) - memuse += tqchildren[i].memuse(); + for (GPosition i=children; i; ++i) + memuse += children[i].memuse(); return memuse; } @@ -228,15 +228,15 @@ DjVuTXT::Zone::encode( // Encode text info bs.write16(0x8000+start); bs.write24(text_length); - // Encode number of tqchildren - bs.write24(tqchildren.size()); + // Encode number of children + bs.write24(children.size()); const Zone * prev_child=0; - // Encode all tqchildren - for (GPosition i=tqchildren; i; ++i) + // Encode all children + for (GPosition i=children; i; ++i) { - tqchildren[i].encode(gbs, this, prev_child); - prev_child=&tqchildren[i]; + children[i].encode(gbs, this, prev_child); + prev_child=&children[i]; } } #endif @@ -280,16 +280,16 @@ DjVuTXT::Zone::decode(const GP<ByteStream> &gbs, int maxtext, text_start+=parent->text_start; } rect=GRect(x, y, width, height); - // Get tqchildren size + // Get children size int size = bs.read24(); // Checks if (rect.isempty() || text_start<0 || text_start+text_length>maxtext ) G_THROW( ERR_MSG("DjVuText.corrupt_text") ); - // Process tqchildren + // Process children const Zone * prev_child=0; - tqchildren.empty(); + children.empty(); while (size-- > 0) { Zone *z = append_child(); @@ -311,7 +311,7 @@ DjVuTXT::has_valid_zones() const { if (!textUTF8) return false; - if (page_zone.tqchildren.isempty() || page_zone.rect.isempty()) + if (page_zone.children.isempty() || page_zone.rect.isempty()) return false; return true; } @@ -382,7 +382,7 @@ void DjVuTXT::Zone::get_text_with_rect(const GRect &box, int &string_start, int &string_end) const { - GPosition pos=tqchildren; + GPosition pos=children; if(pos?box.contains(rect):intersects_zone(box,rect)) { const int text_end=text_start+text_length; @@ -401,7 +401,7 @@ DjVuTXT::Zone::get_text_with_rect(const GRect &box, { do { - tqchildren[pos].get_text_with_rect(box,string_start,string_end); + children[pos].get_text_with_rect(box,string_start,string_end); } while(++pos); } } @@ -419,18 +419,18 @@ DjVuTXT::Zone::find_zones(GList<Zone *> &list, } else if(text_start < string_end) { - if (tqchildren.size()) - for (GPosition pos=tqchildren; pos; ++pos) - tqchildren[pos].find_zones(list,string_start,string_end); + if (children.size()) + for (GPosition pos=children; pos; ++pos) + children[pos].find_zones(list,string_start,string_end); else list.append(const_cast<Zone *>(this)); } } else if( text_end > string_start) { - if (tqchildren.size()) - for (GPosition pos=tqchildren; pos; ++pos) - tqchildren[pos].find_zones(list,string_start,string_end); + if (children.size()) + for (GPosition pos=children; pos; ++pos) + children[pos].find_zones(list,string_start,string_end); else list.append(const_cast<Zone *>(this)); } @@ -439,11 +439,11 @@ DjVuTXT::Zone::find_zones(GList<Zone *> &list, void DjVuTXT::Zone::get_smallest(GList<GRect> &list) const { - GPosition pos=tqchildren; + GPosition pos=children; if(pos) { do { - tqchildren[pos].get_smallest(list); + children[pos].get_smallest(list); } while (++pos); } else @@ -455,11 +455,11 @@ DjVuTXT::Zone::get_smallest(GList<GRect> &list) const void DjVuTXT::Zone::get_smallest(GList<GRect> &list, const int padding) const { - GPosition pos=tqchildren; + GPosition pos=children; if(pos) { do { - tqchildren[pos].get_smallest(list,padding); + children[pos].get_smallest(list,padding); } while (++pos); } else if(zone_parent && zone_parent->ztype >= PARAGRAPH) @@ -493,17 +493,17 @@ DjVuTXT::get_zones(int zone_type, const Zone *parent, for( int cur_ztype=zone->ztype; cur_ztype<zone_type; ++cur_ztype ) { GPosition pos; - for(pos=zone->tqchildren; pos; ++pos) + for(pos=zone->children; pos; ++pos) { - Zone *zcur=(Zone *)&zone->tqchildren[pos]; + Zone *zcur=(Zone *)&zone->children[pos]; if ( zcur->ztype == zone_type ) { GPosition zpos=zone_list; if ( !zone_list.search(zcur,zpos) ) zone_list.append(zcur); } - else if ( zone->tqchildren[pos].ztype < zone_type ) - get_zones(zone_type, &zone->tqchildren[pos], zone_list); + else if ( zone->children[pos].ztype < zone_type ) + get_zones(zone_type, &zone->children[pos], zone_list); } } } @@ -864,7 +864,7 @@ static void writeText( ByteStream & str_out, const GUTF8String &textUTF8, const DjVuTXT::ZoneType zlayer, - const GList<DjVuTXT::Zone> &tqchildren, + const GList<DjVuTXT::Zone> &children, const int WindowHeight ) { // assert( txt->has_valid_zones() ); @@ -873,12 +873,12 @@ writeText( ByteStream & str_out, // Beginning tags for missing layers int layer=(int)zlayer; // Output the next layer - for(GPosition pos=tqchildren ; pos ; ++pos ) + for(GPosition pos=children ; pos ; ++pos ) { - str_out.writestring(tolayer(layer,tqchildren[pos].ztype)); + str_out.writestring(tolayer(layer,children[pos].ztype)); writeText( str_out, textUTF8, - tqchildren[pos], + children[pos], WindowHeight ); } str_out.writestring(tolayer(layer,zlayer)); @@ -893,7 +893,7 @@ writeText( ByteStream & str_out, // DEBUG_MSG( "--zonetype=" << zone.ztype << "\n" ); const GUTF8String xindent(indent( 2 * zone.ztype + 2 )); - GPosition pos=zone.tqchildren; + GPosition pos=zone.children; // Build attribute string if( ! pos ) { @@ -908,7 +908,7 @@ writeText( ByteStream & str_out, str_out.writestring(end_tag(zone.ztype)); } else { - writeText(str_out,textUTF8,zone.ztype,zone.tqchildren,WindowHeight); + writeText(str_out,textUTF8,zone.ztype,zone.children,WindowHeight); } } @@ -917,7 +917,7 @@ DjVuTXT::writeText(ByteStream &str_out,const int height) const { if(has_valid_zones()) { - ::writeText(str_out,textUTF8,DjVuTXT::PAGE,page_zone.tqchildren,height); + ::writeText(str_out,textUTF8,DjVuTXT::PAGE,page_zone.children,height); }else { str_out.writestring(start_tag(DjVuTXT::PAGE)); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.h b/kviewshell/plugins/djvu/libdjvu/DjVuText.h index 54708324..b06536c7 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuText.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.h @@ -133,8 +133,8 @@ public: int text_start; /** Length of the zone text in string #textUTF8#. */ int text_length; - /** List of tqchildren zone. */ - GList<Zone> tqchildren; + /** List of children zone. */ + GList<Zone> children; /** Appends another subzone inside this zone. The new zone is initialized with an empty rectangle, empty text, and has the same type as this zone. */ diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp index 618cb108..d18c7801 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp @@ -953,14 +953,14 @@ print_fg_2layer(ByteStream &str, if (options.get_color()) { write(str,"/%d %d %d %f %f %f c\n", - blit->tqshapeno, + blit->shapeno, blit->left-currentx, blit->bottom-currenty, ramp[p.r]/255.0, ramp[p.g]/255.0, ramp[p.b]/255.0); } else { write(str,"/%d %d %d %f c\n", - blit->tqshapeno, + blit->shapeno, blit->left-currentx, blit->bottom-currenty, ramp[GRAY(p.r, p.g, p.b)]/255.0); } @@ -968,7 +968,7 @@ print_fg_2layer(ByteStream &str, else { write(str,"/%d %d %d s\n", - blit->tqshapeno, + blit->shapeno, blit->left-currentx, blit->bottom-currenty); } currentx = blit->left; @@ -1047,8 +1047,8 @@ print_fg_3layer(ByteStream &str, { JB2Blit *blit = jb2->get_blit(current_blit); GRect rect2(blit->left, blit->bottom, - jb2->get_tqshape(blit->tqshapeno).bits->columns(), - jb2->get_tqshape(blit->tqshapeno).bits->rows()); + jb2->get_shape(blit->shapeno).bits->columns(), + jb2->get_shape(blit->shapeno).bits->rows()); if (rect2.intersect(rect1,rect2)) break; } @@ -1087,12 +1087,12 @@ print_fg_3layer(ByteStream &str, { JB2Blit *blit = jb2->get_blit(current_blit); GRect rect2(blit->left, blit->bottom, - jb2->get_tqshape(blit->tqshapeno).bits->columns(), - jb2->get_tqshape(blit->tqshapeno).bits->rows()); + jb2->get_shape(blit->shapeno).bits->columns(), + jb2->get_shape(blit->shapeno).bits->rows()); if (rect2.intersect(rect1,rect2)) { write(str,"/%d %d %d s\n", - blit->tqshapeno, + blit->shapeno, blit->left-currentx, blit->bottom-currenty); currentx = blit->left; currenty = blit->bottom; @@ -1113,27 +1113,27 @@ print_fg(ByteStream &str, GP<JB2Image> jb2=dimg->get_fgjb(); if (! jb2) return; int num_blits = jb2->get_blit_count(); - int num_tqshapes = jb2->get_tqshape_count(); - unsigned char *dict_tqshapes = 0; + int num_shapes = jb2->get_shape_count(); + unsigned char *dict_shapes = 0; unsigned char *blit_list = 0; - GPBuffer<unsigned char> gdict_tqshapes(dict_tqshapes,num_tqshapes); + GPBuffer<unsigned char> gdict_shapes(dict_shapes,num_shapes); GPBuffer<unsigned char> gblit_list(blit_list,num_blits); - for(int i=0; i<num_tqshapes; i++) + for(int i=0; i<num_shapes; i++) { - dict_tqshapes[i]=0; + dict_shapes[i]=0; } for(int current_blit=0; current_blit<num_blits; current_blit++) { JB2Blit *blit = jb2->get_blit(current_blit); - JB2Shape *tqshape = & jb2->get_tqshape(blit->tqshapeno); + JB2Shape *shape = & jb2->get_shape(blit->shapeno); blit_list[current_blit] = 0; - if (! tqshape->bits) + if (! shape->bits) continue; GRect rect2(blit->left, blit->bottom, - tqshape->bits->columns(), tqshape->bits->rows()); + shape->bits->columns(), shape->bits->rows()); if (rect2.intersect(rect2, prn_rect)) { - dict_tqshapes[blit->tqshapeno] = 1; + dict_shapes[blit->shapeno] = 1; blit_list[current_blit] = 1; } } @@ -1152,13 +1152,13 @@ print_fg(ByteStream &str, "0 1 1 {Encoding exch /.notdef put} for \n" "CharStrings begin\n" "/.notdef {} def\n", - num_tqshapes+1); - for(int current_tqshape=0; current_tqshape<num_tqshapes; current_tqshape++) + num_shapes+1); + for(int current_shape=0; current_shape<num_shapes; current_shape++) { - if (dict_tqshapes[current_tqshape]) + if (dict_shapes[current_shape]) { - JB2Shape *tqshape = & jb2->get_tqshape(current_tqshape); - GP<GBitmap> bitmap = tqshape->bits; + JB2Shape *shape = & jb2->get_shape(current_shape); + GP<GBitmap> bitmap = shape->bits; int rows = bitmap->rows(); int columns = bitmap->columns(); int nbytes = (columns+7)/8*rows+1; @@ -1173,7 +1173,7 @@ print_fg(ByteStream &str, GPBuffer<unsigned char> gs_start(s_start,nbytes); unsigned char *s_ascii; GPBuffer<unsigned char> gs_ascii(s_ascii,nbytes*2); - write(str,"/%d {",current_tqshape); + write(str,"/%d {",current_shape); unsigned char *s = s_start; for(int current_row=0; current_row<rows; current_row++) @@ -1942,8 +1942,8 @@ print_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone, default: separator = 0; break; } - // Zone tqchildren - if (zone.tqchildren.isempty()) + // Zone children + if (zone.children.isempty()) { const char *data = (const char*)txt.textUTF8 + zone.text_start; int length = zone.text_length; @@ -1968,8 +1968,8 @@ print_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone, message.format("%d F\n",zone.rect.ymax-zone.rect.ymin); out.write((const char*)message,message.length()); } - for (GPosition pos=zone.tqchildren; pos; ++pos) - print_txt_sub(txt, zone.tqchildren[pos], out,lastx,lasty); + for (GPosition pos=zone.children; pos; ++pos) + print_txt_sub(txt, zone.children[pos], out,lastx,lasty); } } diff --git a/kviewshell/plugins/djvu/libdjvu/GBitmap.h b/kviewshell/plugins/djvu/libdjvu/GBitmap.h index 4eef4e2a..74669c05 100644 --- a/kviewshell/plugins/djvu/libdjvu/GBitmap.h +++ b/kviewshell/plugins/djvu/libdjvu/GBitmap.h @@ -365,7 +365,7 @@ public: discussion, the position is (#x/subsample#,#y/subsample#). In other words, you can position the blit with a sub-pixel resolution. The resulting anti-aliasing changes are paramount to the image quality. */ - void blit(const GBitmap *tqshape, int x, int y, int subsample); + void blit(const GBitmap *shape, int x, int y, int subsample); //@} /** @name Saving images. diff --git a/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp b/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp index ef364e79..5a85e1fc 100644 --- a/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp +++ b/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp @@ -953,7 +953,7 @@ static GUTF8String GMapArea2xmltag(const GMapArea &area,const GUTF8String &coords) { GUTF8String retval("<AREA coords=\"" - +coords+"\" tqshape=\""+area.get_tqshape_name()+"\" " + +coords+"\" shape=\""+area.get_shape_name()+"\" " +"alt=\""+area.comment.toEscaped()+"\" "); if(area.url.length()) { diff --git a/kviewshell/plugins/djvu/libdjvu/GMapAreas.h b/kviewshell/plugins/djvu/libdjvu/GMapAreas.h index f96c0695..251427ed 100644 --- a/kviewshell/plugins/djvu/libdjvu/GMapAreas.h +++ b/kviewshell/plugins/djvu/libdjvu/GMapAreas.h @@ -86,12 +86,12 @@ namespace DJVU { The currently supported areas can be rectangular (\Ref{GMapRect}), elliptical (\Ref{GMapOval}) and polygonal (\Ref{GMapPoly}). Every - map area besides the definition of its tqshape contains information + map area besides the definition of its shape contains information about display style and optional {\bf URL}, which it may refer to. If this {\bf URL} is not empty then the map area will work like a hyperlink. - The classes also implement some useful functions to ease tqgeometry + The classes also implement some useful functions to ease geometry manipulations @memo Definition of base map area classes @@ -247,10 +247,10 @@ public: virtual GUTF8String get_xmltag(const int height) const=0; - /// Virtual function returning the tqshape type. - virtual MapAreaType const get_tqshape_type( void ) const { return UNKNOWN; }; - /// Virtual function returning the tqshape name. - virtual char const * const get_tqshape_name(void) const=0; + /// Virtual function returning the shape type. + virtual MapAreaType const get_shape_type( void ) const { return UNKNOWN; }; + /// Virtual function returning the shape name. + virtual char const * const get_shape_name(void) const=0; /// Virtual function generating a copy of this object virtual GP<GMapArea> get_copy(void) const=0; /// Virtual function generating a list of defining coordinates @@ -305,7 +305,7 @@ public: /// Returns the height of the rectangle int get_height(void) const { return ymax-ymin; } - /// Changes the #GMapRect#'s tqgeometry + /// Changes the #GMapRect#'s geometry GMapRect & operator=(const GRect & rect); /// Returns \Ref{GRect} describing the map area's rectangle @@ -313,9 +313,9 @@ public: virtual GUTF8String get_xmltag(const int height) const; /// Returns MapRect - virtual MapAreaType const get_tqshape_type( void ) const { return RECT; }; + virtual MapAreaType const get_shape_type( void ) const { return RECT; }; /// Returns #"rect"# - virtual char const * const get_tqshape_name(void) const; + virtual char const * const get_shape_name(void) const; /// Returns a copy of the rectangle virtual GP<GMapArea> get_copy(void) const; /// Virtual function maps rectangle from one area to another using mapper @@ -392,9 +392,9 @@ public: virtual GUTF8String get_xmltag(const int height) const; /// Returns MapPoly - virtual MapAreaType const get_tqshape_type( void ) const { return POLY; }; + virtual MapAreaType const get_shape_type( void ) const { return POLY; }; /// Returns #"poly"# all the time - virtual char const * const get_tqshape_name(void) const; + virtual char const * const get_shape_name(void) const; /// Returns a copy of the polygon virtual GP<GMapArea> get_copy(void) const; /// Virtual function generating a list of defining coordinates @@ -458,9 +458,9 @@ public: virtual GUTF8String get_xmltag(const int height) const; /// Returns MapOval - virtual MapAreaType const get_tqshape_type( void ) const { return OVAL; }; + virtual MapAreaType const get_shape_type( void ) const { return OVAL; }; /// Returns #"oval"# - virtual char const * const get_tqshape_name(void) const; + virtual char const * const get_shape_name(void) const; /// Returns a copy of the oval virtual GP<GMapArea> get_copy(void) const; /// Virtual function maps oval from one area to another using mapper @@ -509,7 +509,7 @@ inline char const * const GMapRect::gma_check_object(void) const{ return ""; } inline char const * const -GMapRect::get_tqshape_name(void) const { return RECT_TAG; } +GMapRect::get_shape_name(void) const { return RECT_TAG; } inline int GMapPoly::get_points_num(void) const { return points; } @@ -524,7 +524,7 @@ inline int GMapPoly::get_y(int i) const { return yy[i]; } inline char const * const -GMapPoly::get_tqshape_name(void) const { return POLY_TAG; } +GMapPoly::get_shape_name(void) const { return POLY_TAG; } inline int GMapOval::get_a(void) const { return a; } @@ -551,7 +551,7 @@ inline int GMapOval::gma_get_ymax(void) const { return ymax; } inline char const * const -GMapOval::get_tqshape_name(void) const { return OVAL_TAG; } +GMapOval::get_shape_name(void) const { return OVAL_TAG; } //@} diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp index 4ddc297e..2cadf4f9 100644 --- a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp +++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp @@ -638,7 +638,7 @@ IW44Image::Map::alloc(int n) short ** IW44Image::Map::allocp(int n) { - // Allocate enough room for pointers plus tqalignment + // Allocate enough room for pointers plus alignment short *p = alloc( (n+1) * sizeof(short*) / sizeof(short) ); // Align on pointer size while ( ((long)p) & (sizeof(short*)-1) ) diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.h b/kviewshell/plugins/djvu/libdjvu/IW44Image.h index 43c14be9..56cf00fa 100644 --- a/kviewshell/plugins/djvu/libdjvu/IW44Image.h +++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.h @@ -618,7 +618,7 @@ public: int pixsep=1, int fast=0); // array of blocks IW44Image::Block *blocks; - // tqgeometry + // geometry int iw, ih; int bw, bh; int nb; diff --git a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp index 8abefffe..054d4e09 100644 --- a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp +++ b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp @@ -104,13 +104,13 @@ public: protected: void CodeNum(const int num, const int lo, const int hi, NumContext &ctx); - void encode_libonly_tqshape(const GP<JB2Image> &jim, int tqshapeno); + void encode_libonly_shape(const GP<JB2Image> &jim, int shapeno); // virtual bool CodeBit(const bool bit, BitContext &ctx); void code_comment(GUTF8String &comment); void code_record_type(int &rectype); int code_match_index(int &index, JB2Dict &jim); - void code_inherited_tqshape_count(JB2Dict &jim); + void code_inherited_shape_count(JB2Dict &jim); void code_image_size(JB2Dict &jim); void code_image_size(JB2Image &jim); void code_absolute_location(JB2Blit *jblt, int rows, int columns); @@ -228,18 +228,18 @@ JB2Dict::JB2Codec::Encode::code_record_type(int &rectype) int JB2Dict::JB2Codec::Encode::code_match_index(int &index, JB2Dict &jim) { - int match=tqshape2lib[index]; - CodeNum(match, 0, lib2tqshape.hbound(), dist_match_index); + int match=shape2lib[index]; + CodeNum(match, 0, lib2shape.hbound(), dist_match_index); return match; } // CODE PAIRS void -JB2Dict::JB2Codec::Encode::code_inherited_tqshape_count(JB2Dict &jim) +JB2Dict::JB2Codec::Encode::code_inherited_shape_count(JB2Dict &jim) { - CodeNum(jim.get_inherited_tqshape_count(), - 0, BIGPOSITIVE, inherited_tqshape_count_dist); + CodeNum(jim.get_inherited_shape_count(), + 0, BIGPOSITIVE, inherited_shape_count_dist); } void @@ -360,12 +360,12 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim) // ------------------------- // THIS IS THE ENCODING PART // ------------------------- - int firsttqshape = jim.get_inherited_tqshape_count(); - int ntqshape = jim.get_tqshape_count(); + int firstshape = jim.get_inherited_shape_count(); + int nshape = jim.get_shape_count(); init_library(jim); // Code headers. int rectype = RETQUIRED_DICT_OR_RESET; - if (jim.get_inherited_tqshape_count() > 0) + if (jim.get_inherited_shape_count() > 0) code_record(rectype, gjim, 0); rectype = START_OF_DATA; code_record(rectype, gjim, 0); @@ -373,18 +373,18 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim) rectype = PRESERVED_COMMENT; if (!! jim.comment) code_record(rectype, gjim, 0); - // Encode every tqshape - int tqshapeno; - DJVU_PROGRESS_TASK(jb2code,"jb2 encode", ntqshape-firsttqshape); - for (tqshapeno=firsttqshape; tqshapeno<ntqshape; tqshapeno++) + // Encode every shape + int shapeno; + DJVU_PROGRESS_TASK(jb2code,"jb2 encode", nshape-firstshape); + for (shapeno=firstshape; shapeno<nshape; shapeno++) { - DJVU_PROGRESS_RUN(jb2code, (tqshapeno-firsttqshape)|0xff); - // Code tqshape - JB2Shape &jshp = jim.get_tqshape(tqshapeno); + DJVU_PROGRESS_RUN(jb2code, (shapeno-firstshape)|0xff); + // Code shape + JB2Shape &jshp = jim.get_shape(shapeno); rectype=(jshp.parent >= 0) ?MATCHED_REFINE_LIBRARY_ONLY:NEW_MARK_LIBRARY_ONLY; code_record(rectype, gjim, &jshp); - add_library(tqshapeno, jshp); + add_library(shapeno, jshp); // Check numcoder status if (cur_ncell > CELLCHUNK) { @@ -413,35 +413,35 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) // ------------------------- int i; init_library(jim); - int firsttqshape = jim.get_inherited_tqshape_count(); - int ntqshape = jim.get_tqshape_count(); + int firstshape = jim.get_inherited_shape_count(); + int nshape = jim.get_shape_count(); int nblit = jim.get_blit_count(); - // Initialize tqshape2lib - tqshape2lib.resize(0,ntqshape-1); - for (i=firsttqshape; i<ntqshape; i++) - tqshape2lib[i] = -1; - // Determine tqshapes that go into library (tqshapeno>=firsttqshape) - // tqshape2lib is -2 if used by one blit - // tqshape2lib is -3 if used by more than one blit - // tqshape2lib is -4 if used as a parent + // Initialize shape2lib + shape2lib.resize(0,nshape-1); + for (i=firstshape; i<nshape; i++) + shape2lib[i] = -1; + // Determine shapes that go into library (shapeno>=firstshape) + // shape2lib is -2 if used by one blit + // shape2lib is -3 if used by more than one blit + // shape2lib is -4 if used as a parent for (i=0; i<nblit; i++) { JB2Blit *jblt = jim.get_blit(i); - int tqshapeno = jblt->tqshapeno; - if (tqshapeno < firsttqshape) + int shapeno = jblt->shapeno; + if (shapeno < firstshape) continue; - if (tqshape2lib[tqshapeno] >= -2) - tqshape2lib[tqshapeno] -= 1; - tqshapeno = jim.get_tqshape(tqshapeno).parent; - while (tqshapeno>=firsttqshape && tqshape2lib[tqshapeno]>=-3) + if (shape2lib[shapeno] >= -2) + shape2lib[shapeno] -= 1; + shapeno = jim.get_shape(shapeno).parent; + while (shapeno>=firstshape && shape2lib[shapeno]>=-3) { - tqshape2lib[tqshapeno] = -4; - tqshapeno = jim.get_tqshape(tqshapeno).parent; + shape2lib[shapeno] = -4; + shapeno = jim.get_shape(shapeno).parent; } } // Code headers. int rectype = RETQUIRED_DICT_OR_RESET; - if (jim.get_inherited_tqshape_count() > 0) + if (jim.get_inherited_shape_count() > 0) code_record(rectype, gjim, 0, 0); rectype = START_OF_DATA; code_record(rectype, gjim, 0, 0); @@ -456,20 +456,20 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) { DJVU_PROGRESS_RUN(jb2code, blitno|0xff); JB2Blit *jblt = jim.get_blit(blitno); - int tqshapeno = jblt->tqshapeno; - JB2Shape &jshp = jim.get_tqshape(tqshapeno); - // Tests if tqshape exists in library - if (tqshape2lib[tqshapeno] >= 0) + int shapeno = jblt->shapeno; + JB2Shape &jshp = jim.get_shape(shapeno); + // Tests if shape exists in library + if (shape2lib[shapeno] >= 0) { int rectype = MATCHED_COPY; code_record(rectype, gjim, 0, jblt); } - // Avoid coding null tqshapes/blits + // Avoid coding null shapes/blits else if (jshp.bits) { // Make sure all parents have been coded - if (jshp.parent>=0 && tqshape2lib[jshp.parent]<0) - encode_libonly_tqshape(gjim, jshp.parent); + if (jshp.parent>=0 && shape2lib[jshp.parent]<0) + encode_libonly_shape(gjim, jshp.parent); // Allocate library entry when needed #define LIBRARY_CONTAINS_ALL int libraryp = 0; @@ -478,7 +478,7 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) libraryp = 1; #endif #ifdef LIBRARY_CONTAINS_SHARED // worse - if (tqshape2lib[tqshapeno] <= -3) + if (shape2lib[shapeno] <= -3) libraryp = 1; #endif #ifdef LIBRARY_CONTAINS_ALL // better @@ -500,9 +500,9 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) int rectype = (libraryp ? MATCHED_REFINE : MATCHED_REFINE_IMAGE_ONLY); code_record(rectype, gjim, &jshp, jblt); } - // Add tqshape to library + // Add shape to library if (libraryp) - add_library(tqshapeno, jshp); + add_library(shapeno, jshp); } // Check numcoder status if (cur_ncell > CELLCHUNK) @@ -522,27 +522,27 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) //////////////////////////////////////// void -JB2Dict::JB2Codec::Encode::encode_libonly_tqshape( - const GP<JB2Image> &gjim, int tqshapeno ) +JB2Dict::JB2Codec::Encode::encode_libonly_shape( + const GP<JB2Image> &gjim, int shapeno ) { if(!gjim) { G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Image &jim=*gjim; - // Recursively encode parent tqshape - JB2Shape &jshp = jim.get_tqshape(tqshapeno); - if (jshp.parent>=0 && tqshape2lib[jshp.parent]<0) - encode_libonly_tqshape(gjim, jshp.parent); - // Test that library tqshape must be encoded - if (tqshape2lib[tqshapeno] < 0) + // Recursively encode parent shape + JB2Shape &jshp = jim.get_shape(shapeno); + if (jshp.parent>=0 && shape2lib[jshp.parent]<0) + encode_libonly_shape(gjim, jshp.parent); + // Test that library shape must be encoded + if (shape2lib[shapeno] < 0) { // Code library entry int rectype=(jshp.parent >= 0) ?NEW_MARK_LIBRARY_ONLY:MATCHED_REFINE_LIBRARY_ONLY; code_record(rectype, gjim, &jshp, 0); - // Add tqshape to library - add_library(tqshapeno, jshp); + // Add shape to library + add_library(shapeno, jshp); // Check numcoder status if (cur_ncell > CELLCHUNK) { diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp index 7cd8a46e..bbc06623 100644 --- a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp +++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp @@ -110,7 +110,7 @@ protected: void code_comment(GUTF8String &comment); void code_record_type(int &rectype); int code_match_index(int &index, JB2Dict &jim); - void code_inherited_tqshape_count(JB2Dict &jim); + void code_inherited_shape_count(JB2Dict &jim); void code_image_size(JB2Dict &jim); void code_image_size(JB2Image &jim); void code_absolute_location(JB2Blit *jblt, int rows, int columns); @@ -136,28 +136,28 @@ private: JB2Dict::JB2Dict() - : inherited_tqshapes(0) + : inherited_shapes(0) { } void JB2Dict::init() { - inherited_tqshapes = 0; + inherited_shapes = 0; inherited_dict = 0; - tqshapes.empty(); + shapes.empty(); } JB2Shape & -JB2Dict::get_tqshape(const int tqshapeno) +JB2Dict::get_shape(const int shapeno) { JB2Shape *retval; - if(tqshapeno >= inherited_tqshapes) + if(shapeno >= inherited_shapes) { - retval=&tqshapes[tqshapeno - inherited_tqshapes]; + retval=&shapes[shapeno - inherited_shapes]; }else if(inherited_dict) { - retval=&(inherited_dict->get_tqshape(tqshapeno)); + retval=&(inherited_dict->get_shape(shapeno)); }else { G_THROW( ERR_MSG("JB2Image.bad_number") ); @@ -166,15 +166,15 @@ JB2Dict::get_tqshape(const int tqshapeno) } const JB2Shape & -JB2Dict::get_tqshape(const int tqshapeno) const +JB2Dict::get_shape(const int shapeno) const { const JB2Shape *retval; - if(tqshapeno >= inherited_tqshapes) + if(shapeno >= inherited_shapes) { - retval=&tqshapes[tqshapeno - inherited_tqshapes]; + retval=&shapes[shapeno - inherited_shapes]; }else if(inherited_dict) { - retval=&(inherited_dict->get_tqshape(tqshapeno)); + retval=&(inherited_dict->get_shape(shapeno)); }else { G_THROW( ERR_MSG("JB2Image.bad_number") ); @@ -185,16 +185,16 @@ JB2Dict::get_tqshape(const int tqshapeno) const void JB2Dict::set_inherited_dict(const GP<JB2Dict> &dict) { - if (tqshapes.size() > 0) + if (shapes.size() > 0) G_THROW( ERR_MSG("JB2Image.cant_set") ); if (inherited_dict) G_THROW( ERR_MSG("JB2Image.cant_change") ); inherited_dict = dict; - inherited_tqshapes = dict->get_tqshape_count(); + inherited_shapes = dict->get_shape_count(); // Make sure that inherited bitmaps are marked as shared - for (int i=0; i<inherited_tqshapes; i++) + for (int i=0; i<inherited_shapes; i++) { - JB2Shape &jshp = dict->get_tqshape(i); + JB2Shape &jshp = dict->get_shape(i); if (jshp.bits) jshp.bits->share(); } } @@ -202,30 +202,30 @@ JB2Dict::set_inherited_dict(const GP<JB2Dict> &dict) void JB2Dict::compress() { - for (int i=tqshapes.lbound(); i<=tqshapes.hbound(); i++) - tqshapes[i].bits->compress(); + for (int i=shapes.lbound(); i<=shapes.hbound(); i++) + shapes[i].bits->compress(); } unsigned int JB2Dict::get_memory_usage() const { unsigned int usage = sizeof(JB2Dict); - usage += sizeof(JB2Shape) * tqshapes.size(); - for (int i=tqshapes.lbound(); i<=tqshapes.hbound(); i++) - if (tqshapes[i].bits) - usage += tqshapes[i].bits->get_memory_usage(); + usage += sizeof(JB2Shape) * shapes.size(); + for (int i=shapes.lbound(); i<=shapes.hbound(); i++) + if (shapes[i].bits) + usage += shapes[i].bits->get_memory_usage(); return usage; } int -JB2Dict::add_tqshape(const JB2Shape &tqshape) +JB2Dict::add_shape(const JB2Shape &shape) { - if (tqshape.parent >= get_tqshape_count()) - G_THROW( ERR_MSG("JB2Image.bad_parent_tqshape") ); - int index = tqshapes.size(); - tqshapes.touch(index); - tqshapes[index] = tqshape; - return index + inherited_tqshapes; + if (shape.parent >= get_shape_count()) + G_THROW( ERR_MSG("JB2Image.bad_parent_shape") ); + int index = shapes.size(); + shapes.touch(index); + shapes[index] = shape; + return index + inherited_shapes; } void @@ -277,8 +277,8 @@ JB2Image::set_dimension(int awidth, int aheight) int JB2Image::add_blit(const JB2Blit &blit) { - if (blit.tqshapeno >= (unsigned int)get_tqshape_count()) - G_THROW( ERR_MSG("JB2Image.bad_tqshape") ); + if (blit.shapeno >= (unsigned int)get_shape_count()) + G_THROW( ERR_MSG("JB2Image.bad_shape") ); int index = blits.size(); blits.touch(index); blits[index] = blit; @@ -298,9 +298,9 @@ JB2Image::get_bitmap(int subsample, int align) const for (int blitno = 0; blitno < get_blit_count(); blitno++) { const JB2Blit *pblit = get_blit(blitno); - const JB2Shape &ptqshape = get_tqshape(pblit->tqshapeno); - if (ptqshape.bits) - bm->blit(ptqshape.bits, pblit->left, pblit->bottom, subsample); + const JB2Shape &pshape = get_shape(pblit->shapeno); + if (pshape.bits) + bm->blit(pshape.bits, pblit->left, pblit->bottom, subsample); } return bm; } @@ -320,9 +320,9 @@ JB2Image::get_bitmap(const GRect &rect, int subsample, int align, int dispy) con for (int blitno = 0; blitno < get_blit_count(); blitno++) { const JB2Blit *pblit = get_blit(blitno); - const JB2Shape &ptqshape = get_tqshape(pblit->tqshapeno); - if (ptqshape.bits) - bm->blit(ptqshape.bits, pblit->left-rxmin, pblit->bottom-rymin+dispy, subsample); + const JB2Shape &pshape = get_shape(pblit->shapeno); + if (pshape.bits) + bm->blit(pshape.bits, pblit->left-rxmin, pblit->bottom-rymin+dispy, subsample); } return bm; } @@ -397,7 +397,7 @@ JB2Dict::JB2Codec::JB2Codec(const bool xencoding) abs_size_x(0), abs_size_y(0), image_size_dist(0), - inherited_tqshape_count_dist(0), + inherited_shape_count_dist(0), offset_type_dist(0), rel_loc_x_current(0), rel_loc_x_last(0), @@ -428,7 +428,7 @@ JB2Dict::JB2Codec::reset_numcoder() abs_size_x = 0; abs_size_y = 0; image_size_dist = 0; - inherited_tqshape_count_dist = 0; + inherited_shape_count_dist = 0; rel_loc_x_current = 0; rel_loc_x_last = 0; rel_loc_y_current = 0; @@ -573,27 +573,27 @@ JB2Dict::JB2Codec::Decode::code_comment(GUTF8String &comment) void JB2Dict::JB2Codec::init_library(JB2Dict &jim) { - int ntqshape = jim.get_inherited_tqshape_count(); - tqshape2lib.resize(0,ntqshape-1); - lib2tqshape.resize(0,ntqshape-1); - libinfo.resize(0,ntqshape-1); - for (int i=0; i<ntqshape; i++) + int nshape = jim.get_inherited_shape_count(); + shape2lib.resize(0,nshape-1); + lib2shape.resize(0,nshape-1); + libinfo.resize(0,nshape-1); + for (int i=0; i<nshape; i++) { - tqshape2lib[i] = i; - lib2tqshape[i] = i; - JB2Shape &jshp = jim.get_tqshape(i); + shape2lib[i] = i; + lib2shape[i] = i; + JB2Shape &jshp = jim.get_shape(i); libinfo[i].compute_bounding_box(*(jshp.bits)); } } int -JB2Dict::JB2Codec::add_library(const int tqshapeno, JB2Shape &jshp) +JB2Dict::JB2Codec::add_library(const int shapeno, JB2Shape &jshp) { - const int libno = lib2tqshape.hbound() + 1; - lib2tqshape.touch(libno); - lib2tqshape[libno] = tqshapeno; - tqshape2lib.touch(tqshapeno); - tqshape2lib[tqshapeno] = libno; + const int libno = lib2shape.hbound() + 1; + lib2shape.touch(libno); + lib2shape[libno] = shapeno; + shape2lib.touch(shapeno); + shape2lib[shapeno] = libno; libinfo.touch(libno); libinfo[libno].compute_bounding_box(*(jshp.bits)); return libno; @@ -611,8 +611,8 @@ JB2Dict::JB2Codec::Decode::code_record_type(int &rectype) int JB2Dict::JB2Codec::Decode::code_match_index(int &index, JB2Dict &) { - int match=CodeNum(0, lib2tqshape.hbound(), dist_match_index); - index = lib2tqshape[match]; + int match=CodeNum(0, lib2shape.hbound(), dist_match_index); + index = lib2shape[match]; return match; } @@ -638,9 +638,9 @@ JB2Dict::JB2Codec::update_short_list(const int v) void -JB2Dict::JB2Codec::Decode::code_inherited_tqshape_count(JB2Dict &jim) +JB2Dict::JB2Codec::Decode::code_inherited_shape_count(JB2Dict &jim) { - int size=CodeNum(0, BIGPOSITIVE, inherited_tqshape_count_dist); + int size=CodeNum(0, BIGPOSITIVE, inherited_shape_count_dist); { GP<JB2Dict> dict = jim.get_inherited_dict(); if (!dict && size>0) @@ -653,7 +653,7 @@ JB2Dict::JB2Codec::Decode::code_inherited_tqshape_count(JB2Dict &jim) } if (!dict && size>0) G_THROW( ERR_MSG("JB2Image.need_dict") ); - if (dict && size!=dict->get_tqshape_count()) + if (dict && size!=dict->get_shape_count()) G_THROW( ERR_MSG("JB2Image.bad_dict") ); } } @@ -927,7 +927,7 @@ JB2Dict::JB2Codec::code_record( { GP<GBitmap> cbm; GP<GBitmap> bm; - int tqshapeno = -1; + int shapeno = -1; // Code record type code_record_type(rectype); @@ -983,7 +983,7 @@ JB2Dict::JB2Codec::code_record( JB2Dict &jim=*gjim; JB2Shape &jshp=*xjshp; int match = code_match_index (jshp.parent, jim); - cbm = jim.get_tqshape(jshp.parent).bits; + cbm = jim.get_shape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); code_bitmap_by_cross_coding (*bm, cbm, jshp.parent); @@ -1003,12 +1003,12 @@ JB2Dict::JB2Codec::code_record( { if (! gotstartrecordp) { - // Indicates need for a tqshape dictionary + // Indicates need for a shape dictionary if(!gjim) { G_THROW( ERR_MSG("JB2Image.bad_number") ); } - code_inherited_tqshape_count(*gjim); + code_inherited_shape_count(*gjim); }else // Reset all numerical contexts to zero reset_numcoder(); @@ -1026,7 +1026,7 @@ JB2Dict::JB2Codec::code_record( // Post-coding action if (!encoding) { - // add tqshape to dictionary + // add shape to dictionary switch(rectype) { case NEW_MARK_LIBRARY_ONLY: @@ -1037,8 +1037,8 @@ JB2Dict::JB2Codec::code_record( G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Shape &jshp=*xjshp; - tqshapeno = gjim->add_tqshape(jshp); - add_library(tqshapeno, jshp); + shapeno = gjim->add_shape(jshp); + add_library(shapeno, jshp); break; } } @@ -1064,10 +1064,10 @@ JB2Dict::JB2Codec::Decode::code(const GP<JB2Dict> &gjim) // THIS IS THE DECODING PART // ------------------------- int rectype; - JB2Shape tmptqshape; + JB2Shape tmpshape; do { - code_record(rectype, gjim, &tmptqshape); + code_record(rectype, gjim, &tmpshape); } while(rectype != END_OF_DATA); if (!gotstartrecordp) @@ -1085,7 +1085,7 @@ JB2Dict::JB2Codec::code_record( { GP<GBitmap> bm; GP<GBitmap> cbm; - int tqshapeno = -1; + int shapeno = -1; int match; // Code record type @@ -1163,7 +1163,7 @@ JB2Dict::JB2Codec::code_record( JB2Shape &jshp=*xjshp; JB2Image &jim=*gjim; match = code_match_index (jshp.parent, jim); - cbm = jim.get_tqshape(jshp.parent).bits; + cbm = jim.get_shape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); code_bitmap_by_cross_coding (*bm, cbm, match); @@ -1179,7 +1179,7 @@ JB2Dict::JB2Codec::code_record( JB2Image &jim=*gjim; JB2Shape &jshp=*xjshp; match = code_match_index (jshp.parent, jim); - cbm = jim.get_tqshape(jshp.parent).bits; + cbm = jim.get_shape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); break; @@ -1193,7 +1193,7 @@ JB2Dict::JB2Codec::code_record( JB2Image &jim=*gjim; JB2Shape &jshp=*xjshp; match = code_match_index (jshp.parent, jim); - cbm = jim.get_tqshape(jshp.parent).bits; + cbm = jim.get_shape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); code_bitmap_by_cross_coding (*bm, cbm, match); @@ -1203,15 +1203,15 @@ JB2Dict::JB2Codec::code_record( case MATCHED_COPY: { int temp; - if (encoding) temp = jblt->tqshapeno; + if (encoding) temp = jblt->shapeno; if(!gjim) { G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Image &jim=*gjim; match = code_match_index (temp, jim); - if (!encoding) jblt->tqshapeno = temp; - bm = jim.get_tqshape(jblt->tqshapeno).bits; + if (!encoding) jblt->shapeno = temp; + bm = jim.get_shape(jblt->shapeno).bits; LibRect &l = libinfo[match]; jblt->left += l.left; jblt->bottom += l.bottom; @@ -1248,8 +1248,8 @@ JB2Dict::JB2Codec::code_record( } JB2Image &jim=*gjim; if (! gotstartrecordp) - // Indicates need for a tqshape dictionary - code_inherited_tqshape_count(jim); + // Indicates need for a shape dictionary + code_inherited_shape_count(jim); else // Reset all numerical contexts to zero reset_numcoder(); @@ -1268,7 +1268,7 @@ JB2Dict::JB2Codec::code_record( // Post-coding action if (!encoding) { - // add tqshape to image + // add shape to image switch(rectype) { case NEW_MARK: @@ -1284,13 +1284,13 @@ JB2Dict::JB2Codec::code_record( G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Shape &jshp=*xjshp; - tqshapeno = gjim->add_tqshape(jshp); - tqshape2lib.touch(tqshapeno); - tqshape2lib[tqshapeno] = -1; + shapeno = gjim->add_shape(jshp); + shape2lib.touch(shapeno); + shape2lib[shapeno] = -1; break; } } - // add tqshape to library + // add shape to library switch(rectype) { case NEW_MARK: @@ -1301,7 +1301,7 @@ JB2Dict::JB2Codec::code_record( { G_THROW( ERR_MSG("JB2Image.bad_number") ); } - add_library(tqshapeno, *xjshp); + add_library(shapeno, *xjshp); break; } // make sure everything is compacted @@ -1316,7 +1316,7 @@ JB2Dict::JB2Codec::code_record( case MATCHED_REFINE: case MATCHED_REFINE_IMAGE_ONLY: case NON_MARK_DATA: - jblt->tqshapeno = tqshapeno; + jblt->shapeno = shapeno; case MATCHED_COPY: if(!gjim) { @@ -1344,10 +1344,10 @@ JB2Dict::JB2Codec::Decode::code(const GP<JB2Image> &gjim) // ------------------------- int rectype; JB2Blit tmpblit; - JB2Shape tmptqshape; + JB2Shape tmpshape; do { - code_record(rectype, gjim, &tmptqshape, &tmpblit); + code_record(rectype, gjim, &tmpshape, &tmpblit); } while(rectype!=END_OF_DATA); if (!gotstartrecordp) diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.h b/kviewshell/plugins/djvu/libdjvu/JB2Image.h index 0cf9da47..6733e9f5 100644 --- a/kviewshell/plugins/djvu/libdjvu/JB2Image.h +++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.h @@ -83,47 +83,47 @@ be implemented in the future. {\bf JB2 Images} --- Class \Ref{JB2Image} is the central data structure - implemented here. A #JB2Image# is composed of an array of tqshapes - and an array of blits. Each tqshape contains a small bitmap representing an + implemented here. A #JB2Image# is composed of an array of shapes + and an array of blits. Each shape contains a small bitmap representing an elementary blob of ink, such as a character or a segment of line art. - Each blit instructs the decoder to render a particular tqshape at a + Each blit instructs the decoder to render a particular shape at a specified position in the image. Some compression is already achieved - because several blits can refer to the same tqshape. A tqshape can also - contain a pointer to a parent tqshape. Additional compression is achieved - when both tqshapes are similar because each tqshape is encoded using the - parent tqshape as a model. A #"O"# tqshape for instance could be a parent for - both a #"C"# tqshape and a #"Q"# tqshape. + because several blits can refer to the same shape. A shape can also + contain a pointer to a parent shape. Additional compression is achieved + when both shapes are similar because each shape is encoded using the + parent shape as a model. A #"O"# shape for instance could be a parent for + both a #"C"# shape and a #"Q"# shape. {\bf JB2 Dictionary} --- Class \Ref{JB2Dict} is a peculiar kind of - JB2Image which only contains an array of tqshapes. These tqshapes can be + JB2Image which only contains an array of shapes. These shapes can be referenced from another JB2Dict/JB2Image. This is arranged by setting the ``inherited dictionary'' of a JB2Dict/JB2Image using function - \Ref{JB2Dict::set_inherited_dict}. Several JB2Images can use tqshapes from a + \Ref{JB2Dict::set_inherited_dict}. Several JB2Images can use shapes from a same JB2Dict encoded separately. This is how several pages of a same document can share information. {\bf Decoding JB2 data} --- The first step for decoding JB2 data consists of creating an empty #JB2Image# object. Function \Ref{JB2Image::decode} then - reads the data and populates the #JB2Image# with the tqshapes and the blits. + reads the data and populates the #JB2Image# with the shapes and the blits. Function \Ref{JB2Image::get_bitmap} finally produces an anti-aliased image. {\bf Encoding JB2 data} --- The first step for decoding JB2 data also consists of creating an empty #JB2Image# object. You must then use - functions \Ref{JB2Image::add_tqshape} and \Ref{JB2Image::add_blit} to + functions \Ref{JB2Image::add_shape} and \Ref{JB2Image::add_blit} to populate the #JB2Image# object. Function \Ref{JB2Image::encode} finally produces the JB2 data. Function #encode# sequentially encodes the blits - and the necessary tqshapes. The compression ratio depends on several + and the necessary shapes. The compression ratio depends on several factors: \begin{itemize} - \item Blits should reuse tqshapes as often as possible. + \item Blits should reuse shapes as often as possible. \item Blits should be sorted in reading order because this facilitates the prediction of the blit coordinates. \item Shapes should be sorted according to the order of first appearance in the sequence of blits because this facilitates the prediction of the - tqshape indices. - \item Shapes should be compared to all previous tqshapes in the tqshape array. - The tqshape parent pointer should be set to a suitable parent tqshape if - such a parent tqshape exists. The parent tqshape should have almost the + shape indices. + \item Shapes should be compared to all previous shapes in the shape array. + The shape parent pointer should be set to a suitable parent shape if + such a parent shape exists. The parent shape should have almost the same size and the same pixels. \end{itemize} All this is quite easy to achieve in the case of an electronically @@ -131,16 +131,16 @@ characters are and where they are located. If you only have a scanned image however you must first locate the characters (connected component analysis) and cut the remaining pieces of ink into smaller blobs. - Ordering the blits and matching the tqshapes is then an essentially + Ordering the blits and matching the shapes is then an essentially heuristic process. Although the quality of the heuristics substantially - effects the file size, misordering blits or mismatching tqshapes never + effects the file size, misordering blits or mismatching shapes never effects the quality of the image. The last refinement consists in - smoothing the tqshapes in order to reduce the noise and maximize the - similarities between tqshapes. + smoothing the shapes in order to reduce the noise and maximize the + similarities between shapes. {\bf JB2 extensions} --- Two extensions of the JB2 encoding format have been introduced with DjVu files version 21. The first - extension addresses the shared tqshape dictionaries. The second extension + extension addresses the shared shape dictionaries. The second extension bounds the number of probability contexts used for coding numbers. Both extensions maintain backward compatibility with JB2 as described in the ICFDD proposal. A more complete discussion @@ -190,10 +190,10 @@ class ByteStream; /** Blit data structure. A #JB2Image# contains an array of #JB2Blit# data structures. Each array entry instructs the decoder to render a particular - tqshape at a particular location. Members #left# and #bottom# specify the - coordinates of the bottom left corner of the tqshape bitmap. All + shape at a particular location. Members #left# and #bottom# specify the + coordinates of the bottom left corner of the shape bitmap. All coordinates are relative to the bottom left corner of the image. Member - #tqshapeno# is the subscript of the tqshape to be rendered. */ + #shapeno# is the subscript of the shape to be rendered. */ class JB2Blit { public: @@ -201,31 +201,31 @@ public: unsigned short left; /**Qt::Vertical coordinate of the blit. */ unsigned short bottom; - /** Index of the tqshape to blit. */ - unsigned int tqshapeno; + /** Index of the shape to blit. */ + unsigned int shapeno; }; /** Shape data structure. A #JB2Image# contains an array of #JB2Shape# data structures. Each array entry represents an elementary blob of ink such as a character or a segment of line art. Member #bits# points to a bilevel - image representing the tqshape pixels. Member #parent# is the subscript of - the parent tqshape. */ + image representing the shape pixels. Member #parent# is the subscript of + the parent shape. */ class JB2Shape { public: - /** Subscript of the parent tqshape. The parent tqshape must always be located - before the current tqshape in the tqshape array. A negative value indicates + /** Subscript of the parent shape. The parent shape must always be located + before the current shape in the shape array. A negative value indicates that this shape.has no parent. Any negative values smaller than #-1# - further indicates that this tqshape does not look like a character. This + further indicates that this shape does not look like a character. This is used to enable a few internal optimizations. This information is saved into the JB2 file, but the actual value of the #parent# variable is not. */ int parent; - /** Bilevel image of the tqshape pixels. This must be a pointer to a bilevel + /** Bilevel image of the shape pixels. This must be a pointer to a bilevel #GBitmap# image. This pointer can also be null. The encoder will just - silently discard all blits referring to a tqshape containing a null + silently discard all blits referring to a shape containing a null bitmap. */ GP<GBitmap> bits; /** Private user data. This long word is provided as a convenience for users @@ -238,14 +238,14 @@ public: /** JB2 Dictionary callback. The decoding function call this callback function when they discover that - the current JB2Image or JB2Dict needs a pre-existing tqshape dictionary. + the current JB2Image or JB2Dict needs a pre-existing shape dictionary. The callback function must return a pointer to the dictionary or NULL if none is found. */ typedef GP<JB2Dict> JB2DecoderCallback ( void* ); -/** Dictionary of JB2 tqshapes. */ +/** Dictionary of JB2 shapes. */ class JB2Dict : public GPEnabled { @@ -257,43 +257,43 @@ public: // CONSTRUCTION /** Default creator. Constructs an empty #JB2Dict# object. You can then call the decoding function #decode#. You can also manually set the - image size using #add_tqshape#. */ + image size using #add_shape#. */ static GP<JB2Dict> create(void); // INITIALIZATION - /** Resets the #JB2Image# object. This function reinitializes both the tqshape + /** Resets the #JB2Image# object. This function reinitializes both the shape and the blit arrays. All allocated memory is freed. */ void init(void); // INHERITED /** Returns the inherited dictionary. */ GP<JB2Dict> get_inherited_dict(void) const; - /** Returns the number of inherited tqshapes. */ - int get_inherited_tqshape_count(void) const; + /** Returns the number of inherited shapes. */ + int get_inherited_shape_count(void) const; /** Sets the inherited dictionary. */ void set_inherited_dict(const GP<JB2Dict> &dict); // ACCESSING THE SHAPE LIBRARY - /** Returns the total number of tqshapes. - Shape indices range from #0# to #get_tqshape_count()-1#. */ - int get_tqshape_count(void) const; - /** Returns a pointer to tqshape #tqshapeno#. - The returned pointer directly points into the tqshape array. - This pointer can be used for reading or writing the tqshape data. */ - JB2Shape &get_tqshape(const int tqshapeno); - /** Returns a constant pointer to tqshape #tqshapeno#. - The returned pointer directly points into the tqshape array. - This pointer can only be used for reading the tqshape data. */ - const JB2Shape &get_tqshape(const int tqshapeno) const; - /** Appends a tqshape to the tqshape array. This function appends a copy of - tqshape #tqshape# to the tqshape array and returns the subscript of the new - tqshape. The subscript of the parent tqshape #tqshape.parent# must - actually designate an already existing tqshape. */ - int add_tqshape(const JB2Shape &tqshape); + /** Returns the total number of shapes. + Shape indices range from #0# to #get_shape_count()-1#. */ + int get_shape_count(void) const; + /** Returns a pointer to shape #shapeno#. + The returned pointer directly points into the shape array. + This pointer can be used for reading or writing the shape data. */ + JB2Shape &get_shape(const int shapeno); + /** Returns a constant pointer to shape #shapeno#. + The returned pointer directly points into the shape array. + This pointer can only be used for reading the shape data. */ + const JB2Shape &get_shape(const int shapeno) const; + /** Appends a shape to the shape array. This function appends a copy of + shape #shape# to the shape array and returns the subscript of the new + shape. The subscript of the parent shape #shape.parent# must + actually designate an already existing shape. */ + int add_shape(const JB2Shape &shape); // MEMORY OPTIMIZATION - /** Compresses all tqshape bitmaps. This function reduces the memory required - by the #JB2Image# by calling \Ref{GBitmap::compress} on all tqshapes + /** Compresses all shape bitmaps. This function reduces the memory required + by the #JB2Image# by calling \Ref{GBitmap::compress} on all shapes bitmaps. This function is best called after decoding a #JB2Image#, because function \Ref{get_bitmap} can directly use the compressed bitmaps. */ @@ -307,9 +307,9 @@ public: This function generates the JB2 data stream without any header. */ void encode(const GP<ByteStream> &gbs) const; /** Decodes JB2 data from ByteStream #bs#. This function decodes the image - size and populates the tqshape and blit arrays. The callback function + size and populates the shape and blit arrays. The callback function #cb# is called when the decoder determines that the ByteStream data - requires a tqshape dictionary which has not been set with + requires a shape dictionary which has not been set with \Ref{JB2Dict::set_inherited_dict}. The callback receives argument #arg# and must return a suitable dictionary which will be installed as the inherited dictionary. The callback should return null if no such @@ -322,15 +322,15 @@ public: GUTF8String comment; private: - int inherited_tqshapes; + int inherited_shapes; GP<JB2Dict> inherited_dict; - GArray<JB2Shape> tqshapes; + GArray<JB2Shape> shapes; }; -/** Main JB2 data structure. Each #JB2Image# consists of an array of tqshapes +/** Main JB2 data structure. Each #JB2Image# consists of an array of shapes and an array of blits. These arrays can be populated by hand using - functions \Ref{add_tqshape} and \Ref{add_blit}, or by decoding JB2 data + functions \Ref{add_shape} and \Ref{add_blit}, or by decoding JB2 data using function \Ref{decode}. You can then use function \Ref{get_bitmap} to render anti-aliased images, or use function \Ref{encode} to generate JB2 data. */ @@ -343,12 +343,12 @@ public: /** Creates an empty #JB2Image# object. You can then call the decoding function #decode#. You can also manually set the - image size using #set_dimension# and populate the tqshape and blit arrays - using #add_tqshape# and #add_blit#. */ + image size using #set_dimension# and populate the shape and blit arrays + using #add_shape# and #add_blit#. */ static GP<JB2Image> create(void) { return new JB2Image(); } // INITIALIZATION - /** Resets the #JB2Image# object. This function reinitializes both the tqshape + /** Resets the #JB2Image# object. This function reinitializes both the shape and the blit arrays. All allocated memory is freed. */ void init(void); @@ -370,7 +370,7 @@ public: JB2Image as a bilevel or gray level image. Argument #subsample# specifies the desired subsampling ratio in range #1# to #15#. The returned image uses #1+subsample^2# gray levels for representing - anti-aliased edges. Argument #align# specified the tqalignment of the + anti-aliased edges. Argument #align# specified the alignment of the rows of the returned images. Setting #align# to #4#, for instance, will adjust the bitmap border in order to make sure that each row of the returned image starts on a word (four byte) boundary. */ @@ -380,7 +380,7 @@ public: this function first renders the full JB2Image with subsampling ratio #subsample# and then extracts rectangle #rect# in the subsampled image. Both operations of course are efficiently performed simultaneously. - Argument #align# specified the tqalignment of the rows of the returned + Argument #align# specified the alignment of the rows of the returned images, as explained above. Argument #dispy# should remain null. */ GP<GBitmap> get_bitmap(const GRect &rect, int subsample=1, int align=1, int dispy=0) const; @@ -393,13 +393,13 @@ public: This pointer can be used for reading or writing the blit data. */ JB2Blit *get_blit(int blitno); /** Returns a constant pointer to blit #blitno#. - The returned pointer directly points into the tqshape array. - This pointer can only be used for reading the tqshape data. */ + The returned pointer directly points into the shape array. + This pointer can only be used for reading the shape data. */ const JB2Blit *get_blit(int blitno) const; /** Appends a blit to the blit array. This function appends a copy of blit #blit# to the blit array and returns the subscript of the new blit. The - tqshape subscript #blit.tqshapeno# must actually designate an already - existing tqshape. */ + shape subscript #blit.shapeno# must actually designate an already + existing shape. */ int add_blit(const JB2Blit &blit); // MEMORY OPTIMIZATION @@ -412,9 +412,9 @@ public: This function generates the JB2 data stream without any header. */ void encode(const GP<ByteStream> &gbs) const; /** Decodes JB2 data from ByteStream #bs#. This function decodes the image - size and populates the tqshape and blit arrays. The callback function + size and populates the shape and blit arrays. The callback function #cb# is called when the decoder determines that the ByteStream data - requires a tqshape dictionary which has not been set with + requires a shape dictionary which has not been set with \Ref{JB2Dict::set_inherited_dict}. The callback receives argument #arg# and must return a suitable dictionary which will be installed as the inherited dictionary. The callback should return null if no such @@ -438,15 +438,15 @@ public: // JB2DICT INLINE FUNCTIONS inline int -JB2Dict::get_tqshape_count(void) const +JB2Dict::get_shape_count(void) const { - return inherited_tqshapes + tqshapes.size(); + return inherited_shapes + shapes.size(); } inline int -JB2Dict::get_inherited_tqshape_count(void) const +JB2Dict::get_inherited_shape_count(void) const { - return inherited_tqshapes; + return inherited_shapes; } inline GP<JB2Dict> @@ -612,7 +612,7 @@ protected: void reset_numcoder(void); inline void code_eventual_lossless_refinement(void); void init_library(JB2Dict &jim); - int add_library(const int tqshapeno, JB2Shape &jshp); + int add_library(const int shapeno, JB2Shape &jshp); void code_relative_location(JB2Blit *jblt, int rows, int columns); void code_bitmap_directly (GBitmap &bm); void code_bitmap_by_cross_coding (GBitmap &bm, GP<GBitmap> &cbm, const int libno); @@ -640,7 +640,7 @@ protected: virtual void code_comment(GUTF8String &comment) = 0; virtual void code_record_type(int &rectype) = 0; virtual int code_match_index(int &index, JB2Dict &jim)=0; - virtual void code_inherited_tqshape_count(JB2Dict &jim)=0; + virtual void code_inherited_shape_count(JB2Dict &jim)=0; virtual void code_image_size(JB2Dict &jim); virtual void code_image_size(JB2Image &jim); virtual void code_absolute_location(JB2Blit *jblt, int rows, int columns)=0; @@ -678,8 +678,8 @@ protected: NumContext dist_match_index; BitContext dist_refinement_flag; // Library - GTArray<int> tqshape2lib; - GTArray<int> lib2tqshape; + GTArray<int> shape2lib; + GTArray<int> lib2shape; GTArray<LibRect> libinfo; // Code pairs NumContext abs_loc_x; @@ -687,7 +687,7 @@ protected: NumContext abs_size_x; NumContext abs_size_y; NumContext image_size_dist; - NumContext inherited_tqshape_count_dist; + NumContext inherited_shape_count_dist; BitContext offset_type_dist; NumContext rel_loc_x_current; NumContext rel_loc_x_last; diff --git a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp index 5d3d62ef..f0185bc8 100644 --- a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp +++ b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp @@ -933,16 +933,16 @@ MMRDecoder::decode(GP<ByteStream> gbs) // Insert blocks into JB2Image for (int b=0; b<blocksperline; b++) { - JB2Shape tqshape; - tqshape.bits = blocks[b]; - if (tqshape.bits) + JB2Shape shape; + shape.bits = blocks[b]; + if (shape.bits) { - tqshape.parent = -1; - tqshape.bits->compress(); + shape.parent = -1; + shape.bits->compress(); JB2Blit blit; blit.left = b*blocksize; blit.bottom = line+1; - blit.tqshapeno = jimg->add_tqshape(tqshape); + blit.shapeno = jimg->add_shape(shape); jimg->add_blit(blit); } } diff --git a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp index 0c39a745..b1d9f469 100644 --- a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp +++ b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp @@ -373,20 +373,20 @@ lt_XMLParser::Impl::ChangeAnno( } } } - GUTF8String tqshape; + GUTF8String shape; { - GPosition tqshape_pos=args.contains("tqshape"); - if(tqshape_pos) + GPosition shape_pos=args.contains("shape"); + if(shape_pos) { - tqshape=args[tqshape_pos]; + shape=args[shape_pos]; } } GP<GMapArea> a; - if(tqshape == "default") + if(shape == "default") { GRect rect(0,0,w,h); a=GMapRect::create(rect); - }else if(!tqshape.length() || tqshape == "rect") + }else if(!shape.length() || shape == "rect") { int xx[4]; int i=0; @@ -420,7 +420,7 @@ lt_XMLParser::Impl::ChangeAnno( } GRect rect(xmin,ymin,xmax-xmin,ymax-ymin); a=GMapRect::create(rect); - }else if(tqshape == "circle") + }else if(shape == "circle") { int xx[4]; int i=0; @@ -440,7 +440,7 @@ lt_XMLParser::Impl::ChangeAnno( int x=xx[0],y=xx[1],rx=xx[2],ry=(h-xx[3])-1; GRect rect(x-rx,y-ry,2*rx,2*ry); a=GMapOval::create(rect); - }else if(tqshape == "oval") + }else if(shape == "oval") { int xx[4]; int i=0; @@ -474,7 +474,7 @@ lt_XMLParser::Impl::ChangeAnno( } GRect rect(xmin,ymin,xmax-xmin,ymax-ymin); a=GMapOval::create(rect); - }else if(tqshape == "poly") + }else if(shape == "poly") { GP<GMapPoly> p=GMapPoly::create(); for(GPosition poly_pos=coords;poly_pos;++poly_pos) @@ -489,7 +489,7 @@ lt_XMLParser::Impl::ChangeAnno( a=p; }else { - G_THROW( ( ERR_MSG("XMLAnno.unknown_tqshape") "\t")+tqshape ); + G_THROW( ( ERR_MSG("XMLAnno.unknown_shape") "\t")+shape ); } if(a) { |