void libass_override_styles(LibassConfiguration *libass_conf,ASS_Track *track, Palette *palette) { assert(track != NULL); int styles_count = track->n_styles; int i = 0, j = 0, len = 0; char **styles_list = NULL; char *setting_value[] = { color2hex(&(palette->foreground)), color2hex(&(palette->foreground)), color2hex(&(palette->outline)), "1", "4", "0"}; char *setting_label[] = { "PrimaryColour", "SecondaryColour", "OutlineColour", "BorderStyle", "Outline", "Shadow" }; printf("Max styles allocated : %i\n",track->max_styles); printf("Number styles used : %i\n", track->n_styles); styles_list = (char **) calloc(sizeof(char *) * 6, 1); for (j=0;j<6;j++){ len = strlen(setting_label[j]) + 1 + strlen(setting_value[j]) + 1; styles_list[j] = (char *)calloc(sizeof(char), len); sprintf(styles_list[j], "%s=%s",setting_label[j], setting_value[j]); } ass_set_style_overrides(libass_conf->library,styles_list); ass_process_force_style(track); }
void VStyleActor::serialize(serializedata* data) { Actor::serialize(data); if (_vstyle.getColor() != Color(0xffffffff)) data->node.append_attribute("color").set_value(color2hex(_vstyle.getColor()).c_str()); //if (_vstyle.getBlendMode() != ) //data->node.append_attribute("blend").set_value(color2hex(_vstyle.getColor()).c_str()); data->node.set_name("VStyleActor"); }
void VStyleActor::serialize(serializedata* data) { inherited::serialize(data); if (_vstyle.getColor() != Color(0xffffffff)) data->node.append_attribute("color").set_value(color2hex(_vstyle.getColor()).c_str()); if (_vstyle.getBlendMode() != blend_premultiplied_alpha) data->node.append_attribute("blend").set_value(_vstyle.getBlendMode()); data->node.set_name("VStyleActor"); }