search for: swfdec_image_ensure_loaded

Displaying 6 results from an estimated 6 matches for "swfdec_image_ensure_loaded".

2007 Nov 10
1
3 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h
...e->width * 4); + cairo_surface_set_user_data (image->surface, &key, data, g_free); + cairo_surface_reference (image->surface); } int @@ -551,13 +564,13 @@ swfdec_image_png_load (SwfdecImage *image) SWFDEC_ERROR ("implement loading PNG images"); } -static gboolean -swfdec_image_ensure_loaded (SwfdecImage *image) +cairo_surface_t * +swfdec_image_create_surface (SwfdecImage *image) { if (image->raw_data == NULL) - return FALSE; + return NULL; - if (image->data == NULL) { + if (image->surface == NULL) { switch (image->type) { case SWFDEC_IMAGE_TYPE_JP...
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
...es, they are already premultiplied - Use swfdec_color_apply_transform_premultiplied since the image is premultiplied diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c index 224e101..4463228 100644 --- a/libswfdec/swfdec_image.c +++ b/libswfdec/swfdec_image.c @@ -588,24 +588,6 @@ swfdec_image_ensure_loaded (SwfdecImage return TRUE; } -static void -swfdec_image_premultiply (guint8 *data, guint n) -{ - guint i; - - for (i = 0; i < n; i++, data += 4) { - if (data[SWFDEC_COLOR_INDEX_ALPHA] == 0xFF) - continue; - if (data[SWFDEC_COLOR_INDEX_ALPHA] == 0) { - data[SWFDEC_COLOR_IN...
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
...6 +659,10 @@ swfdec_image_get_surface_transformed (Sw g_return_val_if_fail (SWFDEC_IS_IMAGE (image), NULL); g_return_val_if_fail (trans != NULL, NULL); + /* obvious optimization */ + if (swfdec_color_transform_is_identity (trans)) + return swfdec_image_create_surface (image); + if (!swfdec_image_ensure_loaded (image)) return NULL; diff --git a/libswfdec/swfdec_image.h b/libswfdec/swfdec_image.h index ad40181..3c1e71e 100644 --- a/libswfdec/swfdec_image.h +++ b/libswfdec/swfdec_image.h @@ -66,8 +66,8 @@ struct _SwfdecImageClass { GType swfdec_image_get_type (void); -cairo_surface_t * swfde...
2007 Apr 17
0
15 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_edittext.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sprite.c
...ata->data, + image->raw_data->length); jpeg_decoder_parse (dec); jpeg_decoder_get_image_size (dec, &image->width, &image->height); if (image->width == 0 || image->height == 0) { @@ -539,6 +535,9 @@ swfdec_image_colormap_decode (SwfdecImag static gboolean swfdec_image_ensure_loaded (SwfdecImage *image) { + if (image->raw_data == NULL) + return FALSE; + if (image->data == NULL) { switch (image->type) { case SWFDEC_IMAGE_TYPE_JPEG: diff-tree 3f4fa05395690c80c19ead02027ee4beb71f9f2d (from d7461508e0d76b7eaa89cc67427f8415884d29f7) Author: Benjamin Ott...
2007 Apr 17
0
Branch 'as' - 17 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sound.c libswfdec/swfdec_sprite.c
...ata->data, + image->raw_data->length); jpeg_decoder_parse (dec); jpeg_decoder_get_image_size (dec, &image->width, &image->height); if (image->width == 0 || image->height == 0) { @@ -539,6 +535,9 @@ swfdec_image_colormap_decode (SwfdecImag static gboolean swfdec_image_ensure_loaded (SwfdecImage *image) { + if (image->raw_data == NULL) + return FALSE; + if (image->data == NULL) { switch (image->type) { case SWFDEC_IMAGE_TYPE_JPEG: diff-tree 3f4fa05395690c80c19ead02027ee4beb71f9f2d (from d7461508e0d76b7eaa89cc67427f8415884d29f7) Author: Benjamin Ott...
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
...es, they are already premultiplied - Use swfdec_color_apply_transform_premultiplied since the image is premultiplied diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c index 224e101..4463228 100644 --- a/libswfdec/swfdec_image.c +++ b/libswfdec/swfdec_image.c @@ -588,24 +588,6 @@ swfdec_image_ensure_loaded (SwfdecImage return TRUE; } -static void -swfdec_image_premultiply (guint8 *data, guint n) -{ - guint i; - - for (i = 0; i < n; i++, data += 4) { - if (data[SWFDEC_COLOR_INDEX_ALPHA] == 0xFF) - continue; - if (data[SWFDEC_COLOR_INDEX_ALPHA] == 0) { - data[SWFDEC_COLOR_IN...