Logo Search packages:      
Sourcecode: djvulibre version File versions

GP< DjVuAnno > DjVuImage::get_decoded_anno (  ) 

returns decoded annotations in DjVuAnno object in which all hyperlinks and hilighted areas are rotated as per rotation setting

map hyperlinks correctly for rotation

Definition at line 1242 of file DjVuImage.cpp.

References GRectMapper::clear(), DjVuAnno::create(), get_anno(), get_height(), get_real_height(), get_real_width(), get_rotate(), get_width(), GRectMapper::rotate(), GRectMapper::set_input(), and GRectMapper::set_output().

{
    GP<DjVuAnno> djvuanno = DjVuAnno::create();
    GP<ByteStream> bs=get_anno();
    if( bs )
    {
        djvuanno->decode(bs);
       
        const int rotate_count=get_rotate(); 
        if( rotate_count % 4 )
        {   
            ///map hyperlinks correctly for rotation           
            GRect input, output;
            input = GRect(0,0,get_width(), get_height());
            output = GRect(0,0,  get_real_width(), get_real_height());

            GRectMapper mapper;
            mapper.clear();
            mapper.set_input(input);
            mapper.set_output(output);               
            mapper.rotate((4-rotate_count)%4);

            GPList<GMapArea> &list=djvuanno->ant->map_areas;
            for(GPosition pos=list;pos;++pos)
            {
                list[pos]->unmap(mapper);
            }
        }
        return djvuanno;
    }
    else
        return NULL;
}


Generated by  Doxygen 1.6.0   Back to index