search for: swfdeccolortransform

Displaying 20 results from an estimated 40 matches for "swfdeccolortransform".

2007 Feb 06
0
21 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c
...ee3a63f 100644 --- a/libswfdec/swfdec_color.c +++ b/libswfdec/swfdec_color.c @@ -56,6 +56,32 @@ swfdec_color_set_source (cairo_t *cr, Sw SWFDEC_COLOR_B (color) / 255.0, SWFDEC_COLOR_A (color) / 255.0); } +SwfdecColor +swfdec_color_apply_transform_premultiplied (SwfdecColor in, + const SwfdecColorTransform * trans) +{ + int r, g, b, a, aold; + + aold = SWFDEC_COLOR_A (in); + if (aold == 0) + return 0; + + a = (aold * trans->aa >> 8) + trans->ab; + a = CLAMP (a, 0, 255); + + r = SWFDEC_COLOR_R (in); + g = SWFDEC_COLOR_G (in); + b = SWFDEC_COLOR_B (in); + r = (r * trans->ra *...
2007 Mar 29
0
libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_audio_flv.h libswfdec/swfdec_audio_stream.h libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_cache.c
...xff) -SwfdecColor swfdec_color_apply_morph (SwfdecColor start, SwfdecColor end, unsigned int ratio); +SwfdecColor swfdec_color_apply_morph (SwfdecColor start, SwfdecColor end, guint ratio); void swfdec_color_set_source (cairo_t *cr, SwfdecColor color); void swfdec_color_transform_init_identity (SwfdecColorTransform * trans); void swfdec_color_transform_init_color (SwfdecColorTransform *trans, SwfdecColor color); diff --git a/libswfdec/swfdec_debug.c b/libswfdec/swfdec_debug.c index cf95a14..d18e8a7 100644 --- a/libswfdec/swfdec_debug.c +++ b/libswfdec/swfdec_debug.c @@ -39,10 +39,10 @@ static const char *swf...
2007 Oct 17
0
libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie.c
...nclude <string.h> #include "swfdec_text_field.h" @@ -91,293 +90,6 @@ swfdec_text_field_init (SwfdecTextField * text) text->scroll = 1; } -SwfdecLayout * -swfdec_text_field_generate_layouts (SwfdecTextField *text, cairo_t *cr, - const SwfdecParagraph *paragraphs, const SwfdecColorTransform *trans, - const SwfdecRect *inval, int *num) -{ - GArray *layouts; - guint i; - - g_return_val_if_fail (SWFDEC_IS_TEXT_FIELD (text), NULL); - g_return_val_if_fail (cr != NULL, NULL); - g_return_val_if_fail (paragraphs != NULL, NULL); - - layouts = g_array_new (TRUE, TRUE, sizeof (SwfdecLay...
2007 Apr 16
0
7 commits - libswfdec/swfdec_codec_gst.c libswfdec/swfdec_font.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_shape.c libswfdec/swfdec_shape.h libswfdec/swfdec_sprite.c
...else { stroke->start_color = swfdec_bits_get_rgba (bits); diff --git a/libswfdec/swfdec_stroke.h b/libswfdec/swfdec_stroke.h index 016d3ca..9ad694c 100644 --- a/libswfdec/swfdec_stroke.h +++ b/libswfdec/swfdec_stroke.h @@ -70,8 +70,8 @@ void swfdec_stroke_paint (SwfdecStroke const SwfdecColorTransform *trans, guint ratio); -SwfdecStroke * swfdec_stroke_parse (SwfdecSwfDecoder * dec, - gboolean rgba); +SwfdecStroke * swfdec_stroke_parse (SwfdecSwfDecoder * dec); +SwfdecStroke * swfdec_stroke_parse_rgba (SwfdecSwfDecoder * dec); SwfdecStroke * swfdec_stroke_parse_extend...
2007 Feb 06
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c libswfdec/swfdec_sprite.c test/dump.c
...git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c index e276508..224e101 100644 --- a/libswfdec/swfdec_image.c +++ b/libswfdec/swfdec_image.c @@ -647,7 +647,7 @@ swfdec_image_create_surface (SwfdecImage } cairo_surface_t * -swfdec_image_get_surface_transformed (SwfdecImage *image, const SwfdecColorTransform *trans) +swfdec_image_create_surface_transformed (SwfdecImage *image, const SwfdecColorTransform *trans) { static const cairo_user_data_key_t key; cairo_surface_t *surface; @@ -659,6 +659,10 @@ swfdec_image_get_surface_transformed (Sw g_return_val_if_fail (SWFDEC_IS_IMAGE (image), NULL);...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...xff) -SwfdecColor swfdec_color_apply_morph (SwfdecColor start, SwfdecColor end, unsigned int ratio); +SwfdecColor swfdec_color_apply_morph (SwfdecColor start, SwfdecColor end, guint ratio); void swfdec_color_set_source (cairo_t *cr, SwfdecColor color); void swfdec_color_transform_init_identity (SwfdecColorTransform * trans); void swfdec_color_transform_init_color (SwfdecColorTransform *trans, SwfdecColor color); diff --git a/libswfdec/swfdec_debug.c b/libswfdec/swfdec_debug.c index cf95a14..d18e8a7 100644 --- a/libswfdec/swfdec_debug.c +++ b/libswfdec/swfdec_debug.c @@ -39,10 +39,10 @@ static const char *swf...
2007 Jun 28
0
Branch 'as' - 4 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c test/image
...vie.c b/libswfdec/swfdec_movie.c index e157437..d7403c5 100644 --- a/libswfdec/swfdec_movie.c +++ b/libswfdec/swfdec_movie.c @@ -943,10 +943,11 @@ swfdec_movie_new (SwfdecPlayer *player, */ void swfdec_movie_set_static_properties (SwfdecMovie *movie, const cairo_matrix_t *transform, - const SwfdecColorTransform *ctrans, guint ratio, int clip_depth, SwfdecEventList *events) + const SwfdecColorTransform *ctrans, int ratio, int clip_depth, SwfdecEventList *events) { g_return_if_fail (SWFDEC_IS_MOVIE (movie)); g_return_if_fail (clip_depth >= -16384 || clip_depth <= 0); + g_return_if_fail (rat...
2007 Feb 06
0
Branch 'interpreter' - 15 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_image.c libswfdec/swfdec_sprite_movie.c
...ee3a63f 100644 --- a/libswfdec/swfdec_color.c +++ b/libswfdec/swfdec_color.c @@ -56,6 +56,32 @@ swfdec_color_set_source (cairo_t *cr, Sw SWFDEC_COLOR_B (color) / 255.0, SWFDEC_COLOR_A (color) / 255.0); } +SwfdecColor +swfdec_color_apply_transform_premultiplied (SwfdecColor in, + const SwfdecColorTransform * trans) +{ + int r, g, b, a, aold; + + aold = SWFDEC_COLOR_A (in); + if (aold == 0) + return 0; + + a = (aold * trans->aa >> 8) + trans->ab; + a = CLAMP (a, 0, 255); + + r = SWFDEC_COLOR_R (in); + g = SWFDEC_COLOR_G (in); + b = SWFDEC_COLOR_B (in); + r = (r * trans->ra *...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...s_write (SwfeditToken *token, gpointer data, SwfdecOut *out, gconstpointer hint) { swfdec_out_put_color_transform (out, data); } static gpointer -swfedit_ctrans_read (SwfdecBits *bits, gconstpointer hint) +swfedit_ctrans_read (SwfeditToken *token, SwfdecBits *bits, gconstpointer hint) { SwfdecColorTransform *ctrans = g_new (SwfdecColorTransform, 1); @@ -202,7 +203,7 @@ swfedit_ctrans_read (SwfdecBits *bits, g } static void -swfedit_script_write (gpointer data, SwfdecOut *out, gconstpointer hint) +swfedit_script_write (SwfeditToken *token, gpointer data, SwfdecOut *out, gconstpointer hint) {...
2007 Nov 20
0
19 commits - libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_image.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h
...Tue Nov 20 10:03:22 2007 +0100 add swfdec_color_transform_is_mask() macro diff --git a/libswfdec/swfdec_color.h b/libswfdec/swfdec_color.h index ec8ef1f..d2ba7a1 100644 --- a/libswfdec/swfdec_color.h +++ b/libswfdec/swfdec_color.h @@ -56,6 +56,7 @@ void swfdec_color_transform_init_identity (SwfdecColorTransform * trans); void swfdec_color_transform_init_mask (SwfdecColorTransform * trans); void swfdec_color_transform_init_color (SwfdecColorTransform *trans, SwfdecColor color); gboolean swfdec_color_transform_is_identity (const SwfdecColorTransform * trans); +#define swfdec_color_transform_is_mask(trans...
2007 Feb 19
0
2 commits - libswfdec/swfdec_script.c test/swfdec-extract.c
...sound in sprite %u", SWFDEC_CHARACTER (sprite)->id); + g_printerr ("No sound in sprite %u\n", SWFDEC_CHARACTER (sprite)->id); return FALSE; } audio = swfdec_audio_stream_new (NULL, sprite, i); @@ -185,11 +185,11 @@ export_graphic (SwfdecGraphic *graphic, const SwfdecColorTransform trans = { 256, 0, 256, 0, 256, 0, 256, 0 }; if (SWFDEC_IS_SPRITE (graphic)) { - g_printerr ("Sprites can not be exported"); + g_printerr ("Sprites can not be exported\n"); return FALSE; } if (SWFDEC_IS_BUTTON (graphic)) { - g_printerr ("Buttons can...
2007 Oct 15
0
6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_video.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c
...TextFieldClass * g_class) static void swfdec_text_field_init (SwfdecTextField * text) { + text->scroll = 1; text->max_length = G_MAXUINT; } -GList * +SwfdecLayout * swfdec_text_field_generate_layouts (SwfdecTextField *text, cairo_t *cr, const SwfdecParagraph *paragraphs, const SwfdecColorTransform *trans, - const SwfdecRect *inval) + const SwfdecRect *inval, int *num) { - GList *layouts; + GArray *layouts; guint i; g_return_val_if_fail (SWFDEC_IS_TEXT_FIELD (text), NULL); g_return_val_if_fail (cr != NULL, NULL); g_return_val_if_fail (paragraphs != NULL, NULL); - if...
2007 Apr 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_font.c libswfdec/swfdec_loadertarget.c libswfdec/swfdec_movie.h libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_player.c
...t.x, data[i+2].point.y, x, y); - i += 3; - break; - case CAIRO_PATH_CLOSE_PATH: - /* doesn't exist in our code */ - default: - g_assert_not_reached (); - } - } -} - -static void -swfdec_stroke_pattern_paint (SwfdecPattern *pattern, cairo_t *cr, const cairo_path_t *path, - const SwfdecColorTransform *trans, guint ratio) -{ - SwfdecColor color; - double width; - SwfdecStrokePattern *stroke = SWFDEC_STROKE_PATTERN (pattern); - - swfdec_pattern_append_path_snapped (cr, path); - color = swfdec_color_apply_morph (stroke->start_color, stroke->end_color, ratio); - color = swfdec_color_app...
2007 Aug 29
0
15 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_system_as.c
..."blend mode %u unimplemented in cairo", blend_mode); + return CAIRO_OPERATOR_OVER; + default: + SWFDEC_WARNING ("invalid blend mode %u", blend_mode); + return CAIRO_OPERATOR_OVER; + } +} + void swfdec_movie_render (SwfdecMovie *movie, cairo_t *cr, const SwfdecColorTransform *color_transform, const SwfdecRect *inval, gboolean fill) @@ -694,6 +731,7 @@ swfdec_movie_render (SwfdecMovie *movie, int clip_depth = 0; SwfdecColorTransform trans; SwfdecRect rect; + gboolean group; g_return_if_fail (SWFDEC_IS_MOVIE (movie)); g_return_if_fail (cr != NULL); @@ -...
2007 Jun 14
0
Branch 'as' - 4 commits - libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie.c player/swfdec_debug_movies.c
...dec_movie_queue_script (movie, SWFDEC_EVENT_LOAD); diff --git a/libswfdec/swfdec_movie.h b/libswfdec/swfdec_movie.h index 0b89f52..418236a 100644 --- a/libswfdec/swfdec_movie.h +++ b/libswfdec/swfdec_movie.h @@ -54,6 +54,8 @@ struct _SwfdecContent { guint ratio; cairo_matrix_t transform; SwfdecColorTransform color_transform; + gboolean has_transform : 1; + gboolean has_color_transform : 1; char * name; SwfdecEventList * events; cairo_operator_t operator; /* operator to use when painting (aka blend mode) */ diff --git a/libswfdec/swfdec_sprite.c b/libswfdec/swfdec_sprite.c index de4c741...
2008 Jan 07
0
12 commits - configure.ac doc/swfdec.types Makefile.am test/crashfinder.c test/dump.c test/Makefile.am test/swfdec-extract.c test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_list.c test/swfedit_list.h
...tatus)); - cairo_surface_destroy (surface); - return FALSE; - } - } - cairo_surface_destroy (surface); - return TRUE; -} - -static gboolean -export_graphic (SwfdecGraphic *graphic, const char *filename) -{ - cairo_surface_t *surface; - cairo_t *cr; - guint width, height; - const SwfdecColorTransform trans = { 256, 0, 256, 0, 256, 0, 256, 0 }; - - if (SWFDEC_IS_SPRITE (graphic)) { - g_printerr ("Sprites can not be exported\n"); - return FALSE; - } - if (SWFDEC_IS_BUTTON (graphic)) { - g_printerr ("Buttons can not be exported\n"); - return FALSE; - } - width...
2007 Dec 03
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_pattern.c
...ex ca5f8c4..2f63634 100644 --- a/libswfdec/swfdec_gradient_pattern.c +++ b/libswfdec/swfdec_gradient_pattern.c @@ -56,7 +56,7 @@ swfdec_gradient_pattern_morph (SwfdecDraw *dest, SwfdecDraw *source, guint ratio static cairo_pattern_t * swfdec_gradient_pattern_get_pattern (SwfdecPattern *pat, const SwfdecColorTransform *trans) { - guint i; + guint i, ratio; cairo_pattern_t *pattern; SwfdecColor color; double offset; @@ -89,13 +89,20 @@ swfdec_gradient_pattern_get_pattern (SwfdecPattern *pat, const SwfdecColorTransf } #endif cairo_pattern_set_extend (pattern, gradient->extend); + /* we check...
2007 Jun 27
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie_as.c
...klass->goto_frame (movie, frame); -} - char * swfdec_movie_get_path (SwfdecMovie *movie) { diff --git a/libswfdec/swfdec_movie.h b/libswfdec/swfdec_movie.h index 2d3f20d..a347951 100644 --- a/libswfdec/swfdec_movie.h +++ b/libswfdec/swfdec_movie.h @@ -115,9 +115,6 @@ struct _SwfdecMovie { SwfdecColorTransform color_transform; /* scripted color transformation */ /* iteration state */ - guint frame; /* current frame */ - guint n_frames; /* amount of frames */ - gboolean stopped; /* if we currently iterate */ gboolean visible; /* whether we currently can be seen or iterate */ gbool...
2007 Nov 10
1
3 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h
...t_user_data (image->surface, &key, image->data, g_free); - cairo_surface_reference (image->surface); - return image->surface; - } + return cairo_surface_reference (image->surface); } cairo_surface_t * swfdec_image_create_surface_transformed (SwfdecImage *image, const SwfdecColorTransform *trans) { - static const cairo_user_data_key_t key; - cairo_surface_t *surface; + cairo_surface_t *surface, *source; guint8 *tdata; const guint8 *sdata; guint i, n; @@ -648,21 +621,21 @@ swfdec_image_create_surface_transformed (SwfdecImage *image, const SwfdecColorTr if (swfdec_colo...
2007 Dec 10
0
5 commits - libswfdec/jpeg libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_cached.c libswfdec/swfdec_codec_adpcm.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_flash_security.c libswfdec/swfdec_image.c
...) ptr) = GUINT32_FROM_BE (*((guint32 *) ptr)); - ptr += 4; + *p = GUINT32_FROM_BE (*p); + p++; } } /* FIXME: this can fail if the returned buffer does not contain malloc'd @@ -633,8 +636,8 @@ cairo_surface_t * swfdec_image_create_surface_transformed (SwfdecImage *image, const SwfdecColorTransform *trans) { cairo_surface_t *surface, *source; - guint8 *tdata; - const guint8 *sdata; + guint32 *tdata; + const guint32 *sdata; guint i, n; gboolean has_alpha = FALSE; @@ -653,15 +656,16 @@ swfdec_image_create_surface_transformed (SwfdecImage *image, const SwfdecColorTr return N...