Displaying 20 results from an estimated 36 matches for "cairo_surface_t".
2007 Jan 26
0
libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c
...;
@@ -513,7 +514,7 @@ swfdec_image_lossless_load (SwfdecImage
}
}
- swfdec_image_create_surface (image, image_data);
+ swfdec_image_create_surface (image, image_data, have_alpha);
}
int
@@ -626,3 +627,33 @@ swfdec_image_get_surface (SwfdecImage *i
return image->surface;
}
+cairo_surface_t *
+swfdec_image_get_surface_for_target (SwfdecImage *image, cairo_surface_t *target)
+{
+ cairo_surface_t *current, *similar;
+ cairo_t *copy;
+ cairo_content_t content;
+
+ current = swfdec_image_get_surface (image);
+ if (cairo_surface_get_type (current) == cairo_surface_get_type (target))
+...
2007 Nov 10
1
3 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h
...d
swfdec_image_png_load (SwfdecImage *image)
{
- SWFDEC_ERROR ("implement loading PNG images");
+ SwfdecBits bits;
+
+ swfdec_bits_init (&bits, image->raw_data);
+ image->surface = cairo_image_surface_create_from_png_stream (
+ swfdec_image_png_read, &bits);
}
cairo_surface_t *
commit c13bbaaf453acdab1f5189990fe2ff91ed887bc8
Author: Benjamin Otte <otte at gnome.org>
Date: Sun Nov 11 00:15:38 2007 +0100
get rid of rowstride and data members and decode directly to a surface
This prepares loading PNG files, as we can do this directly with cairo, and...
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
...diff = 255;
+ diff_pixel |= diff << (channel*8);
+ }
+
+ row[x] = diff_pixel;
+ if (diff_pixel)
+ result = FALSE;
+ } else {
+ row[x] = 0;
+ }
+ row[x] |= 0xff000000; /* Set ALPHA to 100% (opaque) */
+ }
+ }
+ return result;
+}
+
static gboolean
image_diff (cairo_surface_t *surface, const char *filename)
{
- cairo_surface_t *image;
+ cairo_surface_t *image, *diff = NULL;
int w, h;
char *real;
@@ -49,28 +106,45 @@ image_diff (cairo_surface_t *surface, co
w, h);
goto dump;
}
+ diff = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
g_ass...
2007 Mar 02
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_audio_flv.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_js_video.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h
...ov->original_extents.y1 - mov->original_extents.y0) / movie->image_height);
cairo_set_source_surface (cr, movie->image, 0.0, 0.0);
cairo_paint (cr);
}
@@ -140,15 +142,20 @@ swfdec_video_movie_clear (SwfdecVideoMov
}
void
-swfdec_video_movie_new_image (SwfdecVideoMovie *movie, cairo_surface_t *image)
+swfdec_video_movie_new_image (SwfdecVideoMovie *movie, cairo_surface_t *image,
+ guint width, guint height)
{
g_return_if_fail (SWFDEC_IS_VIDEO_MOVIE (movie));
g_return_if_fail (image != NULL);
+ g_return_if_fail (width > 0);
+ g_return_if_fail (height > 0);
if (movi...
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
...h>
#include <libswfdec/swfdec_root_movie.h>
#include <libswfdec/swfdec_sound.h>
@@ -206,6 +207,16 @@ export_graphic (SwfdecGraphic *graphic,
return surface_destroy_for_type (surface, filename);
}
+static gboolean
+export_image (SwfdecImage *image, const char *filename)
+{
+ cairo_surface_t *surface = swfdec_image_create_surface (image);
+
+ if (surface == NULL)
+ return FALSE;
+ return surface_destroy_for_type (surface, filename);
+}
+
static void
usage (const char *app)
{
@@ -258,6 +269,9 @@ main (int argc, char *argv[])
} else if (SWFDEC_IS_GRAPHIC (character)) {
if...
2007 Nov 07
1
thumbnailer/swfdec-thumbnailer.c
...644
--- a/thumbnailer/swfdec-thumbnailer.c
+++ b/thumbnailer/swfdec-thumbnailer.c
@@ -86,7 +86,7 @@ main (int argc, char **argv)
GError *err;
SwfdecPlayer *player;
SwfdecLoader *loader;
- int width, height;
+ guint width, height;
double scale, scaled_size, x, y, w, h;
guint try;
cairo_surface_t *surface;
@@ -147,7 +147,7 @@ main (int argc, char **argv)
cr = cairo_create (surface);
// get image size
- swfdec_player_get_image_size (player, &width, &height);
+ swfdec_player_get_default_size (player, &width, &height);
if (width == 0 || height == 0) {
/* force...
2007 Apr 06
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_codec.c libswfdec/swfdec_codec_ffmpeg.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_codec.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_codec_video.c
...wfdecBuffer *) data)->ref_count);
+ swfdec_buffer_unref (data);
+}
+/**
+ * swfdec_video_decoder_decode:
+ * @decoder: a #SwfdecVideoDecoder
+ * @buffer: buffer to decode
+ *
+ * Decodes the given buffer into an image surface.
+ *
+ * Returns: a new cairo image surface or %NULL on error.
+ **/
+cairo_surface_t *
+swfdec_video_decoder_decode (SwfdecVideoDecoder *decoder, SwfdecBuffer *buffer)
+{
+ static const cairo_user_data_key_t key;
+ cairo_surface_t *surface;
+ guint width, height, rowstride;
+
+ g_return_val_if_fail (decoder != NULL, NULL);
+ g_return_val_if_fail (buffer != NULL, NULL);
+
+ if...
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
...diff = 255;
+ diff_pixel |= diff << (channel*8);
+ }
+
+ row[x] = diff_pixel;
+ if (diff_pixel)
+ result = FALSE;
+ } else {
+ row[x] = 0;
+ }
+ row[x] |= 0xff000000; /* Set ALPHA to 100% (opaque) */
+ }
+ }
+ return result;
+}
+
static gboolean
image_diff (cairo_surface_t *surface, const char *filename)
{
- cairo_surface_t *image;
+ cairo_surface_t *image, *diff = NULL;
int w, h;
char *real;
@@ -49,28 +106,45 @@ image_diff (cairo_surface_t *surface, co
w, h);
goto dump;
}
+ diff = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
g_ass...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...@@ swfdec_image_get_surface_for_target (Swf
/* FIXME: we might want to create multiple surfaces here if there's multiple
* live rendering sources. Right now, this is the quick fix, that transforms
* the cache to the most recent used type */
- if (cairo_surface_get_type (current) == CAIRO_SURFACE_TYPE_IMAGE &&
- cairo_image_surface_get_format (current) == CAIRO_FORMAT_RGB24)
- content = CAIRO_CONTENT_COLOR;
- else
- content = CAIRO_CONTENT_COLOR_ALPHA;
+ content = swfdec_image_has_alpha (image) ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR;
similar = cairo_surface_...
2008 Jan 08
0
4 commits - test/.gitignore test/image test/Makefile.am test/swfdec_test_function.c test/swfdec_test_image.c test/swfdec_test_image.h test/swfdec_test_initialize.as test/swfdec_test_initialize.h test/swfdec_test_test.c test/trace
...diff = 255;
- diff_pixel |= diff << (channel*8);
- }
-
- row[x] = diff_pixel;
- if (diff_pixel)
- result = FALSE;
- } else {
- row[x] = 0;
- }
- row[x] |= 0xff000000; /* Set ALPHA to 100% (opaque) */
- }
- }
- return result;
-}
-
-static gboolean
-image_diff (cairo_surface_t *surface, const char *filename)
-{
- cairo_surface_t *image, *diff = NULL;
- int w, h;
- char *real;
-
- real = g_strdup_printf ("%s.png", filename);
- image = cairo_image_surface_create_from_png (real);
- if (cairo_surface_status (image)) {
- g_print (" ERROR: Could not lo...
2010 Jan 17
1
screenshot of swf file
...found at
http://www.mail-archive.com/swfdec at lists.freedesktop.org/msg00821.html.
#include <stdlib.h>
#include <stdio.h>
#include <swfdec/swfdec.h>
#include <cairo.h>
void swfdec_player_save (SwfdecPlayer *player, guint width, guint
height, const char *filename) {
cairo_surface_t *surface;
cairo_t *cr;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width,
height);
cr = cairo_create (surface);
swfdec_player_render (player, cr);
cairo_destroy (cr);
cairo_surface_write_to_png (surface, filename);
cairo_surface_destroy (surface);...
2007 Nov 08
0
configure.ac libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_as_date.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_audio_flv.c libswfdec/swfdec_audio_flv.h
...t;)
diff --git a/libswfdec-gtk/swfdec_gtk_widget.c b/libswfdec-gtk/swfdec_gtk_widget.c
index 8d617fd..eb92313 100644
--- a/libswfdec-gtk/swfdec_gtk_widget.c
+++ b/libswfdec-gtk/swfdec_gtk_widget.c
@@ -193,14 +193,11 @@ swfdec_gtk_widget_key_release (GtkWidget *gtkwidget, GdkEventKey *event)
static cairo_surface_t *
swfdec_gtk_widget_create_renderer (cairo_surface_type_t type, int width, int height)
{
- switch (type) {
- case CAIRO_SURFACE_TYPE_IMAGE:
- return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
- default:
- break;
+ if (type == CAIRO_SURFACE_TYPE_IMAGE) {
+...
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
...ge->height; j++) {
for (i = 0; i < image->width; i++) {
- *((guint32 *) 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 @@ swf...
2007 Nov 12
0
13 commits - libswfdec/Makefile.am libswfdec/swfdec_decoder.c libswfdec/swfdec_decoder.h libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_flv_decoder.h libswfdec/swfdec_image.c libswfdec/swfdec_image_decoder.c libswfdec/swfdec_image_decoder.h
...swfdec_rect_union (rect, rect, &SWFDEC_MOVIE (walk->data)->extents);
}
@@ -880,6 +887,20 @@ swfdec_movie_render (SwfdecMovie *movie, cairo_t *cr,
swfdec_draw_paint (draw, cr, &trans);
}
+ /* if the movie loaded an image, draw it here now */
+ if (movie->image) {
+ cairo_surface_t *surface = swfdec_image_create_surface_transformed (movie->image,
+ &trans);
+ if (surface) {
+ static const cairo_matrix_t matrix = { 1.0 / SWFDEC_TWIPS_SCALE_FACTOR, 0, 0, 1.0 / SWFDEC_TWIPS_SCALE_FACTOR, 0, 0 };
+ cairo_pattern_t *pattern = cairo_pattern_create_for_surface (s...
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
...it a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c
index 11540ba..d6e89e9 100644
--- a/libswfdec/swfdec_text_field_movie.c
+++ b/libswfdec/swfdec_text_field_movie.c
@@ -364,9 +364,6 @@ swfdec_text_field_movie_free_paragraphs (SwfdecTextFieldMovie *text)
}
}
-static cairo_surface_t *surface = NULL;
-static cairo_t *cr = NULL;
-
static SwfdecLayout *
swfdec_text_field_movie_get_layouts (SwfdecTextFieldMovie *text, int *num)
{
@@ -375,14 +372,7 @@ swfdec_text_field_movie_get_layouts (SwfdecTextFieldMovie *text, int *num)
if (text->paragraphs == NULL)
swfdec_text_f...
2007 Oct 18
0
18 commits - doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_flash_security.c
...= walk->next) {
- swfdec_video_movie_new_image (walk->data, stream->surface);
+ swfdec_video_movie_new_image (walk->data);
}
}
}
@@ -350,6 +350,14 @@ swfdec_net_stream_input_disconnect (SwfdecVideoMovieInput *input, SwfdecVideoMov
g_object_unref (stream);
}
+static cairo_surface_t *
+swfdec_net_stream_input_get_image (SwfdecVideoMovieInput *input)
+{
+ SwfdecNetStream *stream = SWFDEC_NET_STREAM ((guchar *) input - G_STRUCT_OFFSET (SwfdecNetStream, input));
+
+ return stream->surface;
+}
+
/*** SWFDEC_NET_STREAM ***/
G_DEFINE_TYPE_WITH_CODE (SwfdecNetStream, swfdec_...
2007 Dec 19
1
some questions about swfdec
...lowing would fill out a memory buffer with
the current contents:
for (walk = priv->roots; walk; walk = walk->next) {
swfdec_movie_render (walk->data, cr, &trans, &real);
}
SWFDEC_INFO ("=== %p: END RENDER ===", player);
cairo_restore (cr);
// new stuff
cairo_surface_t surf=cairo_get_target(cr);
memcpy(imgbuf,cairo_image_surface_get_data(surf),bufsize);
Presumably one could also hide the cairo window, so that the content could
be displayed by an external app.
is there a better way of doing it ?
Regards,
salsaman,
http://lives.sf.net
2007 Nov 01
0
4 commits - libswfdec/swfdec_sound_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/crashfinder.c test/Makefile.am
...fth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <libswfdec/swfdec.h>
+
+int
+main (int argc, char **argv)
+{
+ GOptionContext *context;
+ GError *err;
+ SwfdecPlayer *player;
+ SwfdecLoader *loader;
+ guint i;
+ cairo_surface_t *surface;
+ cairo_t *cr;
+ gboolean aborts;
+ glong play_per_file = 30;
+ glong max_per_file = 60;
+ glong max_per_advance = 10;
+ GTimer *timer;
+ char **filenames = NULL;
+ const GOptionEntry entries[] = {
+ {
+ "play-time", 'p', 0, G_OPTION_ARG_INT, &play_pe...
2010 Jul 20
1
Building rattle on Solaris 10u7 X86
...pe for: cairo_t
"cairoDevice.c", line 437: undefined struct/union member: cr_custom
"cairoDevice.c", line 437: warning: implicit function declaration:
cairo_reference
"cairoDevice.c", line 437: undefined symbol: cr
"cairoDevice.c", line 451: undefined symbol: cairo_surface_t
"cairoDevice.c", line 451: undefined symbol: surface
"cairoDevice.c", line 456: warning: implicit function declaration:
cairo_image_surface_create
"cairoDevice.c", line 456: undefined symbol: CAIRO_FORMAT_ARGB32
"cairoDevice.c", line 485: undefined struct/uni...
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
...fth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <libswfdec/swfdec.h>
-
-int
-main (int argc, char **argv)
-{
- GOptionContext *context;
- GError *err;
- SwfdecPlayer *player;
- SwfdecLoader *loader;
- guint i;
- cairo_surface_t *surface;
- cairo_t *cr;
- gboolean aborts;
- glong play_per_file = 30;
- glong max_per_file = 60;
- glong max_per_advance = 10;
- GTimer *timer;
- char **filenames = NULL;
- const GOptionEntry entries[] = {
- {
- "play-time", 'p', 0, G_OPTION_ARG_INT, &play_pe...