Example #1
0
 inline double height() const
 {
     if (is_bitmap())
         return (*bitmap_data_)->height();
     else if (is_vector())
         return (*vector_data_)->bounding_box().height();
     return 0;
 }
Example #2
0
 inline double width() const
 {
     if (is_bitmap())
         return (*bitmap_data_)->width();
     else if (is_vector())
         return (*vector_data_)->bounding_box().width();
     return 0;
 }
Example #3
0
 inline unsigned height() const
 {
     if (is_bitmap())
         return (*bitmap_data_)->height();
     else if (is_vector())
         return static_cast<unsigned>((*vector_data_)->bounding_box().height());
     return 0;
 }
Example #4
0
 box2d<double> bounding_box() const
 {
     if (is_vector())
     {
         return (*vector_data_)->bounding_box();
     }
     if (is_bitmap())
     {
         double width = (*bitmap_data_)->width();
         double height = (*bitmap_data_)->height();
         return box2d<double>(0, 0, width, height);
     }
     return box2d<double>();
 }