6 const char *Rescale::scale_types[] = {
7 N_("None"), N_("Scaled"), N_("Cropped"), N_("Filled"), N_("Horiz Edge"), N_("Vert Edge"),
10 Rescale::Rescale(int w, int h, double aspect)
14 this->aspect = aspect;
17 Rescale::Rescale(Indexable *in)
19 this->w = in->get_w();
20 this->h = in->get_h();
22 MWindow::create_aspect_ratio(aw, ah, this->w, this->h);
23 this->aspect = ah > 0 ? aw / ah : 1;
30 void Rescale::rescale(Rescale &out, int type,
31 float &src_w,float &src_h, float &dst_w,float &dst_h)
33 int in_w = w, in_h = h;
34 int out_w = out.w, out_h = out.h;
36 src_w = in_w; src_h = in_h;
37 dst_w = out_w; dst_h = out_h;
38 double r = out.aspect / aspect;