MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


User Commands                               gdk-pixbuf-csource(1)



NAME
     gdk-pixbuf-csource - C code generator for GdkPixbuf images.

SYNOPSIS
     gdk-pixbuf-csource  [--decoder]  [--extern]  [--help]  [--g-
     fatal-warnings]  [--macros]  [--name=identifier] [--raw] [--
     rle] [--static] [--stream] [--struct] [--version] {image}

     gdk-pixbuf-csource  [--decoder]  [--extern]  [--help]  [--g-
     fatal-warnings]  [--macros]  [--raw]  [--rle] [--static] [--
     stream]   [--struct]   [--version]   [--build-list]   {[name
     image]...}

DESCRIPTION
     The gdk-pixbuf-csource utility generates C  code  containing
     images.  You  can  use  gdk-pixbuf-csource to compile images
     directly into programs.

     You can use the following types of  input  with  gdk-pixbuf-
     csource:

       ]o  A single file, to generate code for the file.

       ]o  A list of [name image] pairs,  using  the  --build-list
          option,  to  generate  code  for  a list of images into
          named variables.


OPTIONS
     The following options are supported:

     --build-list            Enable  [name  image]  pair  parsing
                             mode.



     --decoder               Provide the following macro  defini-
                             tion  to  decode  run-length encoded
                             image data:


                                  *RUNLENGTHDECODE

                                  imagebuf, rledata, size, bpp



     --extern                Generate extern symbols. This option
                             is  only  useful with --stream or --
                             struct. The ---extern option  causes
                             the  structure created to be defined
                             as: const [...]



SunOS 5.11         Last change: 02 April 2003                   1






User Commands                               gdk-pixbuf-csource(1)



     -h, ---help             Print brief help and exit.



     --g-fatal-warnings      Make  warnings  fatal.  This  option
                             causes  the  program  to  abort when
                             warnings occur.



     --macros                Generate the following macro defini-
                             tions for the image:

                               ]o  *ROWSTRIDE

                               ]o  *WIDTH

                               ]o  *HEIGHT

                               ]o  *BYTESPERPIXEL

                               ]o  *RLEPIXELDATA             or
                                  *PIXELDATA




     --name=identifier       Specify the identifier name, or pre-
                             fix, for  the generated variables or
                             macros. This option is  useful  only
                             if you do not specify --build-list.



     --raw                   Disable run-length encoding for  the
                             generated   pixel  data.  The  --raw
                             option  dumps  out  each  "(line  of
                             data)" in raw image format



     --rle                   Enable run-length encoding  for  the
                             generated   pixel  data.  The  --rle
                             option dumps out each line  of  data
                             in  run-length-encoding format. This
                             is a default setting.



     --static                Generate static symbols. This  is  a
                             default setting. This option is only
                             useful with  --stream  or  --struct.



SunOS 5.11         Last change: 02 April 2003                   2






User Commands                               gdk-pixbuf-csource(1)



                             The   --static   option  causes  the
                             structure created to be defined  as:
                             static const [...]



     --stream                Generate a  pixbuf  data  stream;  a
                             single  string  containing a serial-
                             ized GdkPixdata structure in network
                             byte order.



     --struct                Generate GdkPixdata structure; needs
                             the  GdkPixdata            structure
                             definition from gdk-pixdata.h.



     -v, --version           Print version and exit.



EXAMPLES
     Example 1: To Generate Code From a File

     example% gdk-pixbuf-csource inputfilename

     Running gdk-pixbuf-csource without any options is  the  same
     as specifying the following options:

       ]o  --stream

       ]o  --rle

       ]o  --static


     Example 2: To Specify a Value for the Structure in the  Gen-
     erated Output

     example% gdk-pixbuf-csource --name=mystruct --struct inputfilename

     The --name option affects the name of the structure  in  the
     generated  output when you use either the --stream option or
     the --struct option.  The --name option affects the name  of
     the macro when you use the --macros option.

     If you use  either  the  --stream  option  or  the  --struct
     option,  but  you do not specify the --name option, then the
     default name of the structure in  the  generated  output  is
     mypixbuf.



SunOS 5.11         Last change: 02 April 2003                   3






User Commands                               gdk-pixbuf-csource(1)



     If you use the --macros option, but you do not  specify  the
     --name  option,  then  the  default macro names are prefixed
     with MYPIXBUF.

     Example 3: To Display the Command  Output  as  an  Array  of
     Strings

     example% gdk-pixbuf-csource --name=mystruct --stream inputfilename

     static const guint8 mystruct[] =
     { ""
       /* Pixbuf magic (0x47646b50) */
       "GdkP"
       /* length: header (24) ] pixeldata (215281) */
       " 3I11"
       /* pixdatatype (0x2010001) */
       "21 1"
       /* rowstride (960) */
       "  3300"
       /* width (320) */
       "  1@"
       /* height (240) */
       "   360"
       /* pixeldata: */
       "(line of data)"
     [...]

     Example 4: To Display the Output as a GdkPixdata Structure

     example% gdk-pixbuf-csource --name=mystruct --struct inputfilename

     const GdkPixdata mystruct = {
       0x47646b50, /* Pixbuf magic: 'GdkP' */
       24 ] 215281, /* header length ] pixeldata length */
       0x2010001, /* pixdatatype */
       960, /* rowstride */
       320, /* width */
       240, /* height */
       /* pixeldata: */
       "(line of data)"
     [...]

     Example 5: To Display the Output as C Macros

     example% gdk-pixbuf-csource --name=mystruct --macros inputfilename

     #define MYSTRUCTROWSTRIDE (960)
     #define MYSTRUCTWIDTH (320)
     #define MYSTRUCTHEIGHT (240)
     #define MYSTRUCTBYTESPERPIXEL (3) /* 3:RGB, 4:RGBA */
     #define MYSTRUCTRLEPIXELDATA ((guint8*)   "(line of data)" [...]




SunOS 5.11         Last change: 02 April 2003                   4






User Commands                               gdk-pixbuf-csource(1)



EXIT STATUS
     The following exit values are returned:

     0        Application exited successfully.



     1        Application exited with failure, if any file speci-
              fied on the command line cannot be read.



FILES
     The following files are used by this application:

     /usr/bin/gdk-pixbuf-csource

         The command-line executable for the application.



     /usr/share/gtk-doc/html/gdk-pixbuf

         Location of developer documentation



ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Availability                 SUNWgnome-base-libs-devel   
    
     Interface stability          Committed                   
    


SEE ALSO
     gdk-pixbuf-query-loaders(1),    glib-genmarshal(1),    glib-
     gettextize(1),   glib-mkenums(1),   gobject-query(1),   gtk-
     query-immodules-2.0(1),            gtk-update-icon-cache(1),
     libgdkpixbuf-2.0(3), attributes(5), gnome-interfaces(5)

NOTES
     Updated by Brian Cameron, Sun Microsystems Inc., April 2003,
     2006.

     Written by Tim Janik timj@gtk.org




SunOS 5.11         Last change: 02 April 2003                   5



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™