mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 05:46:06 -04:00
--User changes
-Add two new options --width and --height to EmberRender and EmberAnimate to allow the user to specify absolute dimensions to render the image at.
This commit is contained in:
@ -262,6 +262,21 @@ bool EmberAnimate(int argc, _TCHAR* argv[], EmberOptions& opt)
|
||||
const auto h = std::max<size_t>(size_t(ember.m_OrigFinalRasH * opt.HeightScale()), 10);
|
||||
ember.SetSizeAndAdjustScale(w, h, false, scaleType);
|
||||
}
|
||||
else if (opt.Width() || opt.Height())
|
||||
{
|
||||
auto scaleType = eScaleType::SCALE_NONE;
|
||||
|
||||
if (ToLower(opt.ScaleType()) == "width")
|
||||
scaleType = eScaleType::SCALE_WIDTH;
|
||||
else if (ToLower(opt.ScaleType()) == "height")
|
||||
scaleType = eScaleType::SCALE_HEIGHT;
|
||||
else if (ToLower(opt.ScaleType()) != "none")
|
||||
cout << "Scale type must be width height or none. Setting to none.\n";
|
||||
|
||||
auto w = opt.Width() ? opt.Width() : ember.m_OrigFinalRasW;
|
||||
auto h = opt.Height() ? opt.Height() : ember.m_OrigFinalRasH;
|
||||
ember.SetSizeAndAdjustScale(w, h, false, scaleType);
|
||||
}
|
||||
|
||||
//Cast to double in case the value exceeds 2^32.
|
||||
const auto imageMem = 4 * static_cast<double>(ember.m_FinalRasW)
|
||||
|
Reference in New Issue
Block a user