5 const char *Rescale::scale_types[] = {
6 "None", "Scaled", "Cropped", "Filled", "Horiz Edge", "Vert Edge",
9 Rescale::Rescale(int w, int h, double aspect)
13 this->aspect = aspect;
16 Rescale::Rescale(Indexable *in)
18 this->w = in->get_w();
19 this->h = in->get_h();
21 MWindow::create_aspect_ratio(aw, ah, this->w, this->h);
22 this->aspect = ah > 0 ? aw / ah : 1;
29 void Rescale::rescale(Rescale &out, int type,
30 float &src_w,float &src_h, float &dst_w,float &dst_h)
32 int in_w = w, in_h = h;
33 int out_w = out.w, out_h = out.h;
35 src_w = in_w; src_h = in_h;
36 dst_w = out_w; dst_h = out_h;
37 double r = out.aspect / aspect;