/* === M A C R O S ========================================================= */
-#define TILE_SIZE 128
+#define TILE_SIZE 120
/* === T Y P E D E F S ===================================================== */
DEFINE_ACTION("quality-08", _("Use Quality Level 8"));
DEFINE_ACTION("quality-09", _("Use Quality Level 9"));
DEFINE_ACTION("quality-10", _("Use Quality Level 10"));
- DEFINE_ACTION("lowres-pixel-01", _("Set Low-Res pixel size to 2^1"));
- DEFINE_ACTION("lowres-pixel-02", _("Set Low-Res pixel size to 2^2"));
- DEFINE_ACTION("lowres-pixel-03", _("Set Low-Res pixel size to 2^3"));
- DEFINE_ACTION("lowres-pixel-04", _("Set Low-Res pixel size to 2^4"));
- DEFINE_ACTION("lowres-pixel-05", _("Set Low-Res pixel size to 2^5"));
- DEFINE_ACTION("lowres-pixel-06", _("Set Low-Res pixel size to 2^6"));
+ DEFINE_ACTION("lowres-pixel-2", _("Set Low-Res pixel size to 2"));
+ DEFINE_ACTION("lowres-pixel-3", _("Set Low-Res pixel size to 3"));
+ DEFINE_ACTION("lowres-pixel-4", _("Set Low-Res pixel size to 4"));
+ DEFINE_ACTION("lowres-pixel-5", _("Set Low-Res pixel size to 5"));
+ DEFINE_ACTION("lowres-pixel-6", _("Set Low-Res pixel size to 6"));
+ DEFINE_ACTION("lowres-pixel-8", _("Set Low-Res pixel size to 8"));
+ DEFINE_ACTION("lowres-pixel-10", _("Set Low-Res pixel size to 10"));
+ DEFINE_ACTION("lowres-pixel-12", _("Set Low-Res pixel size to 12"));
+ DEFINE_ACTION("lowres-pixel-15", _("Set Low-Res pixel size to 15"));
+ DEFINE_ACTION("lowres-pixel-20", _("Set Low-Res pixel size to 20"));
+ DEFINE_ACTION("lowres-pixel-24", _("Set Low-Res pixel size to 24"));
+ DEFINE_ACTION("lowres-pixel-30", _("Set Low-Res pixel size to 30"));
+ DEFINE_ACTION("lowres-pixel-40", _("Set Low-Res pixel size to 40"));
+ DEFINE_ACTION("lowres-pixel-60", _("Set Low-Res pixel size to 60"));
+ DEFINE_ACTION("lowres-pixel-120", _("Set Low-Res pixel size to 120"));
DEFINE_ACTION("play", _("Play"));
// DEFINE_ACTION("pause", _("Pause"));
DEFINE_ACTION("stop", _("Stop"));
" <menuitem action='quality-10' />"
" </menu>"
" <menu action='menu-lowres-pixel'>"
-" <menuitem action='lowres-pixel-01' />"
-" <menuitem action='lowres-pixel-02' />"
-" <menuitem action='lowres-pixel-03' />"
-" <menuitem action='lowres-pixel-04' />"
-" <menuitem action='lowres-pixel-05' />"
-" <menuitem action='lowres-pixel-06' />"
+" <menuitem action='lowres-pixel-2' />"
+" <menuitem action='lowres-pixel-3' />"
+" <menuitem action='lowres-pixel-4' />"
+" <menuitem action='lowres-pixel-5' />"
+" <menuitem action='lowres-pixel-6' />"
+" <menuitem action='lowres-pixel-8' />"
+" <menuitem action='lowres-pixel-10' />"
+" <menuitem action='lowres-pixel-12' />"
+" <menuitem action='lowres-pixel-15' />"
+" <menuitem action='lowres-pixel-20' />"
+" <menuitem action='lowres-pixel-24' />"
+" <menuitem action='lowres-pixel-30' />"
+" <menuitem action='lowres-pixel-40' />"
+" <menuitem action='lowres-pixel-60' />"
+" <menuitem action='lowres-pixel-120' />"
" </menu>"
" <separator name='bleh08'/>"
" <menuitem action='play'/>"
}
}
+ // prime factors of 120 are 2, 2, 2, 3, 5
+ int pixel_size_array[] = {2,3,4,5,6,8,10,12,15,20,24,30,40,60,120};
+ list<int> pixel_sizes(pixel_size_array, pixel_size_array + sizeof(pixel_size_array) / sizeof(int));
+
// Low-Res Quality Menu
{
int i;
- for(i=1;i<=6;i++)
+ for(list<int>::iterator iter = pixel_sizes.begin(); iter != pixel_sizes.end(); iter++)
{
- Glib::RefPtr<Gtk::RadioAction> action(Gtk::RadioAction::create(quality_group,strprintf("lowres-pixel-%02d",i),
- strprintf(_("Set Low-Res pixel size to 2^%d"),i)));
- if(i==1) // default quality
+ i = *iter;
+ Glib::RefPtr<Gtk::RadioAction> action(Gtk::RadioAction::create(low_res_pixel_size_group,strprintf("lowres-pixel-%d",i),
+ strprintf(_("Set Low-Res pixel size to %d"),i)));
+ if(i==2) // default pixel size
{
action->set_active();
- work_area->set_lowrespixel(i);
+ work_area->set_low_res_pixel_size(i);
}
action_group->add( action,
sigc::bind(
- sigc::mem_fun(*work_area, &studio::WorkArea::set_lowrespixel),
+ sigc::mem_fun(*work_area, &studio::WorkArea::set_low_res_pixel_size),
i
)
);
Glib::RefPtr<Gtk::ToggleAction> duck_mask_angle;
Gtk::RadioButtonGroup quality_group;
- Gtk::RadioButtonGroup lowrespixel_group;
+ Gtk::RadioButtonGroup low_res_pixel_size_group;
Glib::RefPtr<Gtk::ActionGroup> action_group;
}
else
{
- int div = 1 << get_work_area()->get_lowrespixel();
+ int div = get_work_area()->get_low_res_pixel_size();
const int width_in_tiles(w/tile_w+(((get_work_area()->get_low_resolution_flag())?((w/div)%(tile_w/div)):(w%tile_w))?1:0));
const int height_in_tiles(h/tile_h+(h%tile_h?1:0));
set_clipping(true);
if(low_res)
{
- int div = 1 << workarea->get_lowrespixel();
+ int div = workarea->get_low_res_pixel_size();
set_tile_w(workarea->tile_w/div);
set_tile_h(workarea->tile_h/div);
}
assert(workarea);
newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
if(low_res) {
- int div = 1 << workarea->get_lowrespixel();
+ int div = workarea->get_low_res_pixel_size();
newdesc->set_wh(w/div,h/div);
}
else
int h(get_tile_h());
int x(surface.get_w()*surface.get_h());
//if(low_res) {
- // int div = 1 << workarea->get_lowrespixel();
+ // int div = workarea->get_low_res_pixel_size();
// w/=div,h/=div;
//}
Color dark(0.6,0.6,0.6);
if(low_res)
{
// We need to scale up
- int div = 1 << workarea->get_lowrespixel();
+ int div = workarea->get_low_res_pixel_size();
pixbuf=pixbuf->scale_simple(
surface.get_w()*div,
surface.get_h()*div,
newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
if(low_res)
{
- int div = 1 << workarea->get_lowrespixel();
+ int div = workarea->get_low_res_pixel_size();
newdesc->set_wh(w/div,h/div);
}
else
//int h(surface.get_h());
int x(surface.get_w()*surface.get_h());
//if(low_res) {
- // int div = 1 << workarea->get_lowrespixel();
+ // int div = workarea->get_low_res_pixel_size();
// w/=div,h/=div;
//}
Color dark(0.6,0.6,0.6);
int th=workarea->tile_h;
if(low_res)
{
- int div = 1 << workarea->get_lowrespixel();
+ int div = workarea->get_low_res_pixel_size();
tw/=div;
th/=div;
}
if(low_res)
{
// We need to scale up
- int div = 1 << workarea->get_lowrespixel();
+ int div = workarea->get_low_res_pixel_size();
pixbuf=pixbuf->scale_simple(
surface.get_w()*div,
surface.get_h()*div,
render_idle_func_id=0;
zoom=prev_zoom=1.0;
quality=10;
- lowrespixel=1;
+ low_res_pixel_size=2;
rendering=false;
canceled_=false;
low_resolution=true;
x(focus_point[0]/pw+drawing_area->get_width()/2-w/2),
y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
- int div = 1 << lowrespixel;
+ int div = low_res_pixel_size;
const int width_in_tiles(w/tile_w+((low_resolution?((w/div)%(tile_w/div)):(w%tile_w))?1:0));
const int height_in_tiles(h/tile_h+(h%tile_h?1:0));
}
void
-WorkArea::set_lowrespixel(int x)
+WorkArea::set_low_res_pixel_size(int x)
{
- if(x==lowrespixel)
+ if(x==low_res_pixel_size)
return;
- lowrespixel=x;
+ low_res_pixel_size=x;
queue_render_preview();
}
// if we have lots of pixels to render and the tile renderer isn't disabled, use it
int div;
- div = low_resolution ? (1 << lowrespixel) : 1;
+ div = low_resolution ? low_res_pixel_size : 1;
if (w*h > 240*div*135*div && !getenv("SYNFIG_DISABLE_TILE_RENDER"))
{
// do a tile render
bool canceled_;
int quality;
- int lowrespixel;
+ int low_res_pixel_size;
bool dirty_trap_enabled;
void popup_menu();
int get_quality()const { return quality; }
- int get_lowrespixel()const { return lowrespixel; }
+ int get_low_res_pixel_size()const { return low_res_pixel_size; }
void set_quality(int x);
- void set_lowrespixel(int x);
+ void set_low_res_pixel_size(int x);
int get_w()const { return w; }