\begin{DoxyDate}{Date}
2000 (created)
\end{DoxyDate}
\hypertarget{eina_cxx_main_toc}{}\section{Table of Contents}\label{eina_cxx_main_toc}
\begin{DoxyItemize}
\item \hyperlink{evas_main_evas_main_intro}{Introduction} \item \hyperlink{evas_main_evas_main_work}{How does Evas work?} \item \hyperlink{evas_main_evas_main_compiling}{How to compile} \item \hyperlink{evas_main_evas_main_next_steps}{Next Steps} \item \hyperlink{evas_main_evas_main_intro_example}{Introductory Example}\end{DoxyItemize}
\hypertarget{evas_main_evas_main_intro}{}\section{Introduction}\label{evas_main_evas_main_intro}
Evas is a clean display canvas A\+P\+I for several target display systems that can draw anti-\/aliased text, smooth super and sub-\/sampled scaled images, alpha-\/blend objects and much more.

It abstracts any need to know much about what the characteristics of your display system are or what graphics calls are used to draw them and how. It deals on an object level where all you do is create and manipulate objects in a canvas, set their properties, and the rest is done for you.

Evas optimises the rendering pipeline to minimise effort in redrawing changes made to the canvas and so takes this work out of the programmers hand, saving a lot of time and energy.

It is small and lean, and is designed to work on embedded systems all the way to large and powerful multi-\/\+C\+P\+U workstations. It can be compiled to only have the features you need for your target platform if you so wish, thus keeping it small and lean. It has several display back-\/ends, letting it display on several display systems, making it portable for cross-\/device and cross-\/platform development.\hypertarget{evas_main_evas_main_intro_not_evas}{}\subsection{What Evas is not?}\label{evas_main_evas_main_intro_not_evas}
Evas is not a widget set or widget toolkit, however it is their base. See Elementary (\href{http://docs.enlightenment.org/auto/elementary/}{\tt http\+://docs.\+enlightenment.\+org/auto/elementary/}) for a toolkit based on \hyperlink{group__Evas}{Evas}, \hyperlink{group__Edje}{Edje}, \hyperlink{group__Ecore}{Ecore} and other Enlightenment technologies.

It is not dependent or aware of main loops, input or output systems. Input should be polled from various sources and fed to Evas. Similarly, it does not create windows or report windows updates to your system, but just draws the pixels and report to the user the areas that were changed. Of course these operations are quite common and thus they are ready to use in \hyperlink{group__Ecore}{Ecore}, particularly in \hyperlink{group__Ecore__Evas__Group}{Ecore\+\_\+\+Evas wrapper/helper set of functions}.\hypertarget{evas_main_evas_main_work}{}\section{How does Evas work?}\label{evas_main_evas_main_work}
Evas is a canvas display library. This is markedly different from most display and windowing systems as a canvas is structural and is also a state engine, whereas most display and windowing systems are immediate mode display targets. Evas handles the logic between a structural display via its state engine, and controls the target windowing system in order to produce rendered results of the current canvas' state on the display.

Immediate mode display systems retain very little, or no state. A program executes a series of commands, as in the pseudo code\+:

\begin{DoxyVerb}draw line from position (0, 0) to position (100, 200);

draw rectangle from position (10, 30) to position (50, 500);

bitmap_handle = create_bitmap();
scale bitmap_handle to size 100 x 100;
draw image bitmap_handle at position (10, 30);
\end{DoxyVerb}


The series of commands is executed by the windowing system and the results are displayed on the screen (normally). Once the commands are executed the display system has little or no idea of how to reproduce this image again, and so has to be instructed by the application on how to redraw sections of the screen whenever needed. Each successive command is executed as instructed by the application and either emulated by software or sent to the graphics hardware on the device to be performed.

The advantage of such a system is that it is simple, and gives a program tight control over how something looks and is drawn. Given the increasing complexity of displays and demands by users to have better looking interfaces, more and more work is needing to be done at this level by the internals of widget sets, custom display widgets and other programs. This means that more and more logic and display rendering code needs to be written each time the application needs to figure out how to minimise redraws so that display is fast and interactive, and keeps track of redraw logic. The power comes at a high-\/price with lots of extra code and work. Programmers not very familiar with graphics programming often make mistakes at this level and produce code that is sub optimal. Those familiar with this kind of programming simply get bored by writing the same code again and again.

For example, if in the above scene, the windowing system requires the application to redraw the area from 0, 0 to 50, 50 (also referred as \char`\"{}expose event\char`\"{}), then the programmer must calculate manually the updates and repaint it again\+:

\begin{DoxyVerb}Redraw from position (0, 0) to position (50, 50):

// what is in area (0, 0, 50, 50)?

// 1. intersection part of line (0, 0) to (100, 200)?
   draw line from position (0, 0) to position (25, 50);

// 2. intersection part of rectangle (10, 30) to (50, 500)?
   draw rectangle from position (10, 30) to position (50, 50)

// 3. intersection part of image at (10, 30), size 100 x 100?
   bitmap_subimage = subregion from position (0, 0) to position (40, 20)
   draw image bitmap_subimage at position (10, 30);
\end{DoxyVerb}


You might have noticed that, if all elements in the above scene are opaque, then the system is doing useless paints\+: part of the line is behind the rectangle, and part of the rectangle is behind the image. These useless paints tend to be very costly, as pixels tend to be 4 bytes in size; thus an overlapping region of 100 x 100 pixels is around 40000 useless writes! You could write code to calculate the overlapping areas and avoid painting then, but then it should be mixed with the \char`\"{}expose event\char`\"{} handling mentioned above and you quickly realize that the initially simpler method became really complex.

Evas is a structural system in which the programmer creates and manages display objects and their properties, and as a result of this higher level state management, the canvas is able to redraw the set of objects when needed to represent the current state of the canvas.

For example, the pseudo code\+:

\begin{DoxyVerb}line_handle = create_line();
set line_handle from position (0, 0) to position (100, 200);
show line_handle;

rectangle_handle = create_rectangle();
move rectangle_handle to position (10, 30);
resize rectangle_handle to size 40 x 470;
show rectangle_handle;

bitmap_handle = create_bitmap();
scale bitmap_handle to size 100 x 100;
move bitmap_handle to position (10, 30);
show bitmap_handle;

render scene;
\end{DoxyVerb}


This may look longer, but when the display needs to be refreshed or updated, you move, resize, show, or hide the objects that need to change. You can simply think at the object logic level, and the canvas software does the rest of the work for you, figuring out what actually changed in the canvas since it had been last drawn, how to most efficiently redraw the canvas and its contents to reflect the current state, and then it can go off and do the actual drawing of the canvas.

This lets you think in a more natural way when dealing with a display, and saves time and effort of working out how to load and display images, render given the current display system, and so on. Since Evas also is portable across different display systems, this also gives you the ability to have their code ported and displayed on different display systems with very little work.

Evas can be seen as a display system that stands somewhere between a widget set and an immediate mode display system. It retains basic display logic, but does very little high-\/level logic such as scrollbars, sliders, and push buttons.\hypertarget{evas_main_evas_main_compiling}{}\section{How to compile}\label{evas_main_evas_main_compiling}
Evas is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the {\ttfamily pkg-\/config} script outputs. For example\+:

Compiling C or C++ files into object files\+:

\begin{DoxyVerb}gcc -c -o main.o main.c `pkg-config --cflags evas`
\end{DoxyVerb}


Linking object files into a binary executable\+:

\begin{DoxyVerb}gcc -o my_application main.o `pkg-config --libs evas`
\end{DoxyVerb}


See \hyperlink{pkgconfig}{pkgconfig}\hypertarget{evas_main_evas_main_next_steps}{}\section{Next Steps}\label{evas_main_evas_main_next_steps}
After you understood what Evas is and installed it in your system you should proceed understanding the programming interface for all objects, then see the specific for the most used elements. We'd recommend you to take a while to learn \hyperlink{group__Ecore}{Ecore}, \hyperlink{group__Edje}{Edje} and Elementary (\href{http://docs.enlightenment.org/auto/elementary/}{\tt http\+://docs.\+enlightenment.\+org/auto/elementary/}) as they will likely save you tons of work compared to using just Evas directly.

Recommended reading\+:

\begin{DoxyItemize}
\item \hyperlink{group__Evas__Object__Group}{Generic Object Functions}, where you'll get how to basically manipulate generic objects lying on an Evas canvas, handle canvas and object events, etc. \item \hyperlink{group__Evas__Object__Rectangle}{Rectangle Object Functions}, to learn about the most basic object type on Evas -- the rectangle. \item \hyperlink{group__Evas__Object__Polygon}{Polygon Object Functions}, to learn how to create polygon elements on the canvas. \item \hyperlink{group__Evas__Line__Group}{Line Object Functions}, to learn how to create line elements on the canvas. \item \hyperlink{group__Evas__Object__Image}{Image Object Functions}, to learn about image objects, over which Evas can do a plethora of operations. \item \hyperlink{group__Evas__Object__Text}{Text Object Functions}, to learn how to create textual elements on the canvas. \item \hyperlink{group__Evas__Object__Textblock}{Textblock Object Functions}, to learn how to create multiline textual elements on the canvas. \item \hyperlink{group__Evas__Smart__Object__Group}{Smart Object Functions} and \hyperlink{group__Evas__Smart__Group}{Smart Functions}, to define new objects that provide {\bfseries custom} functions to handle clipping, hiding, moving, resizing, color setting and more. These could be as simple as a group of objects that move together (see \hyperlink{group__Evas__Smart__Object__Clipped}{Clipped Smart Object}) up to implementations of what ends to be a widget, providing some intelligence (thus the name) to Evas objects -- like a button or check box, for example.\end{DoxyItemize}
\hypertarget{evas_main_evas_main_intro_example}{}\section{Introductory Example}\label{evas_main_evas_main_intro_example}

\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#include <Evas.h>}
\textcolor{preprocessor}{#include <Evas\_Engine\_Buffer.h>}
\textcolor{preprocessor}{#include <stdio.h>}
\textcolor{preprocessor}{#include <errno.h>}

\textcolor{preprocessor}{#define WIDTH (320)}
\textcolor{preprocessor}{#define HEIGHT (240)}

\textcolor{comment}{/*}
\textcolor{comment}{ * create\_canvas(), destroy\_canvas() and draw\_scene() are support functions.}
\textcolor{comment}{ *}
\textcolor{comment}{ * They are only required to use raw Evas, but for real world usage,}
\textcolor{comment}{ * it is recommended to use ecore and its ecore-evas submodule, that}
\textcolor{comment}{ * provide convenience canvas creators, integration with main loop and}
\textcolor{comment}{ * automatic render of updates (draw\_scene()) when system goes back to}
\textcolor{comment}{ * main loop.}
\textcolor{comment}{ */}
\textcolor{keyword}{static} \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *create\_canvas(\textcolor{keywordtype}{int} width, \textcolor{keywordtype}{int} height);
\textcolor{keyword}{static} \textcolor{keywordtype}{void} destroy\_canvas(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas);
\textcolor{keyword}{static} \textcolor{keywordtype}{void} draw\_scene(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas);

\textcolor{comment}{// support function to save scene as PPM image}
\textcolor{keyword}{static} \textcolor{keywordtype}{void} save\_scene(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *dest);

\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{void})
\{
   \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *bg, *r1, *r2, *r3;

   \hyperlink{group__Evas__Main__Group_ga65b3f060b6dd9e488afd0b8cbe101869}{evas\_init}();

   \textcolor{comment}{// create your canvas}
   \textcolor{comment}{// NOTE: consider using ecore\_evas\_buffer\_new() instead!}
   canvas = create\_canvas(WIDTH, HEIGHT);
   \textcolor{keywordflow}{if} (!canvas)
     \textcolor{keywordflow}{return} -1;

   bg = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(canvas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(bg, 255, 255, 255, 255); \textcolor{comment}{// white bg}
   evas\_object\_move(bg, 0, 0);                    \textcolor{comment}{// at origin}
   evas\_object\_resize(bg, WIDTH, HEIGHT);         \textcolor{comment}{// covers full canvas}
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(bg);

   puts(\textcolor{stringliteral}{"initial scene, with just background:"});
   draw\_scene(canvas);

   r1 = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(canvas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(r1, 255, 0, 0, 255); \textcolor{comment}{// 100% opaque red}
   evas\_object\_move(r1, 10, 10);
   evas\_object\_resize(r1, 100, 100);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(r1);

   \textcolor{comment}{// pay attention to transparency! Evas color values are pre-multiplied by}
   \textcolor{comment}{// alpha, so 50% opaque green is:}
   \textcolor{comment}{// non-premul: r=0, g=255, b=0    a=128 (50% alpha)}
   \textcolor{comment}{// premul:}
   \textcolor{comment}{//         r\_premul = r * a / 255 =      0 * 128 / 255 =      0}
   \textcolor{comment}{//         g\_premul = g * a / 255 =    255 * 128 / 255 =    128}
   \textcolor{comment}{//         b\_premul = b * a / 255 =      0 * 128 / 255 =      0}
   \textcolor{comment}{//}
   \textcolor{comment}{// this 50% green is over a red background, so it will show in the}
   \textcolor{comment}{// final output as yellow (green + red = yellow)}
   r2 = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(canvas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(r2, 0, 128, 0, 128); \textcolor{comment}{// 50% opaque green}
   evas\_object\_move(r2, 10, 10);
   evas\_object\_resize(r2, 50, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(r2);

   r3 = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(canvas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(r3, 0, 128, 0, 255); \textcolor{comment}{// 100% opaque dark green}
   evas\_object\_move(r3, 60, 60);
   evas\_object\_resize(r3, 50, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(r3);

   puts(\textcolor{stringliteral}{"final scene (note updates):"});
   draw\_scene(canvas);
   save\_scene(canvas, \textcolor{stringliteral}{"/tmp/evas-buffer-simple-render.ppm"});

   \textcolor{comment}{// NOTE: use ecore\_evas\_buffer\_new() and here ecore\_evas\_free()}
   destroy\_canvas(canvas);

   \hyperlink{group__Evas__Main__Group_ga95a8864f81d944a92bb012b77ffd1b09}{evas\_shutdown}();

   \textcolor{keywordflow}{return} 0;
\}

\textcolor{keyword}{static} \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *create\_canvas(\textcolor{keywordtype}{int} width, \textcolor{keywordtype}{int} height)
\{
   \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas;
   Evas\_Engine\_Info\_Buffer *einfo;
   \textcolor{keywordtype}{int} method;
   \textcolor{keywordtype}{void} *pixels;

   method = \hyperlink{group__Evas__Output__Method_ga9f9871fdcc40ce1062d6565308020eb8}{evas\_render\_method\_lookup}(\textcolor{stringliteral}{"buffer"});
   \textcolor{keywordflow}{if} (method <= 0)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: evas was not compiled with 'buffer' engine!\(\backslash\)n"}, stderr);
        \textcolor{keywordflow}{return} NULL;
     \}

   canvas = \hyperlink{group__Evas__Canvas_ga67e8eb17d2a676bfdfb8794fc5f72bc0}{evas\_new}();
   \textcolor{keywordflow}{if} (!canvas)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: could not instantiate new evas canvas.\(\backslash\)n"}, stderr);
        \textcolor{keywordflow}{return} NULL;
     \}

   \hyperlink{group__Evas__Output__Method_ga17f2ac9f3bef135cd825774c33762ef2}{evas\_output\_method\_set}(canvas, method);
   \hyperlink{group__Evas__Output__Size_ga681f2af7d325735af201e18f56f6ef61}{evas\_output\_size\_set}(canvas, width, height);
   \hyperlink{group__Evas__Output__Size_ga0a14db31aa30b701688caf67a4649239}{evas\_output\_viewport\_set}(canvas, 0, 0, width, height);

   einfo = (Evas\_Engine\_Info\_Buffer *)\hyperlink{group__Evas__Output__Method_ga33a6cd095bc7499dbfcb39ad253607b1}{evas\_engine\_info\_get}(canvas);
   \textcolor{keywordflow}{if} (!einfo)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: could not get evas engine info!\(\backslash\)n"}, stderr);
        \hyperlink{group__Evas__Canvas_gaa0d5d3f1a1e1ffa3b14b09bb374215b4}{evas\_free}(canvas);
        \textcolor{keywordflow}{return} NULL;
     \}

   \textcolor{comment}{// ARGB32 is sizeof(int), that is 4 bytes, per pixel}
   pixels = malloc(width * height * \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}));
   \textcolor{keywordflow}{if} (!pixels)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: could not allocate canvas pixels!\(\backslash\)n"}, stderr);
        \hyperlink{group__Evas__Canvas_gaa0d5d3f1a1e1ffa3b14b09bb374215b4}{evas\_free}(canvas);
        \textcolor{keywordflow}{return} NULL;
     \}

   einfo->info.depth\_type = EVAS\_ENGINE\_BUFFER\_DEPTH\_ARGB32;
   einfo->info.dest\_buffer = pixels;
   einfo->info.dest\_buffer\_row\_bytes = width * \textcolor{keyword}{sizeof}(int);
   einfo->info.use\_color\_key = 0;
   einfo->info.alpha\_threshold = 0;
   einfo->info.func.new\_update\_region = NULL;
   einfo->info.func.free\_update\_region = NULL;
   \hyperlink{group__Evas__Output__Method_ga7244385cf5bad0591ab82e4437c4694b}{evas\_engine\_info\_set}(canvas, (\hyperlink{struct__Evas__Engine__Info}{Evas\_Engine\_Info} *)einfo);

   \textcolor{keywordflow}{return} canvas;
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void} destroy\_canvas(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas)
\{
   Evas\_Engine\_Info\_Buffer *einfo;

   einfo = (Evas\_Engine\_Info\_Buffer *)\hyperlink{group__Evas__Output__Method_ga33a6cd095bc7499dbfcb39ad253607b1}{evas\_engine\_info\_get}(canvas);
   \textcolor{keywordflow}{if} (!einfo)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: could not get evas engine info!\(\backslash\)n"}, stderr);
        \hyperlink{group__Evas__Canvas_gaa0d5d3f1a1e1ffa3b14b09bb374215b4}{evas\_free}(canvas);
        \textcolor{keywordflow}{return};
     \}

   free(einfo->info.dest\_buffer);
   \hyperlink{group__Evas__Canvas_gaa0d5d3f1a1e1ffa3b14b09bb374215b4}{evas\_free}(canvas);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void} draw\_scene(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas)
\{
   \hyperlink{struct__Eina__List}{Eina\_List} *updates, *n;
   \hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle} *update;

   \textcolor{comment}{// render and get the updated rectangles:}
   updates = \hyperlink{group__Evas__Canvas_ga1867d9f5f97545418598496af93e4c71}{evas\_render\_updates}(canvas);

   \textcolor{comment}{// informative only here, just print the updated areas:}
   \hyperlink{group__Eina__List__Group_gad02f746a08ee0b12b7ed66d4bc0d71d8}{EINA\_LIST\_FOREACH}(updates, n, update)
     printf("UPDATED REGION: pos: %3d, %3d    size: %3dx%3d\(\backslash\)n",
            update->x, update->y, update->w, update->h);

   \textcolor{comment}{// free list of updates}
   \hyperlink{group__Evas__Canvas_ga038d98c7c13a86b6ba4de51f8aba3595}{evas\_render\_updates\_free}(updates);
\}

static \textcolor{keywordtype}{void} save\_scene(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas, const \textcolor{keywordtype}{char} *dest)
\{
   Evas\_Engine\_Info\_Buffer *einfo;
   \textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} *pixels, *pixels\_end;
   \textcolor{keywordtype}{int} width, height;
   FILE *f;

   einfo = (Evas\_Engine\_Info\_Buffer *)\hyperlink{group__Evas__Output__Method_ga33a6cd095bc7499dbfcb39ad253607b1}{evas\_engine\_info\_get}(canvas);
   \textcolor{keywordflow}{if} (!einfo)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: could not get evas engine info!\(\backslash\)n"}, stderr);
        \textcolor{keywordflow}{return};
     \}
   \hyperlink{group__Evas__Output__Size_gab2bf31509c58449bc94473f81b1e5ed5}{evas\_output\_size\_get}(canvas, &width, &height);

   f = fopen(dest, \textcolor{stringliteral}{"wb+"});
   \textcolor{keywordflow}{if} (!f)
     \{
        fprintf(stderr, \textcolor{stringliteral}{"ERROR: could not open for writing '%s': %s\(\backslash\)n"},
                dest, strerror(errno));
        \textcolor{keywordflow}{return};
     \}

   pixels = einfo->info.dest\_buffer;
   pixels\_end = pixels + (width * height);

   \textcolor{comment}{// PPM P6 format is dead simple to write:}
   fprintf(f, \textcolor{stringliteral}{"P6\(\backslash\)n%d %d\(\backslash\)n255\(\backslash\)n"},  width, height);
   \textcolor{keywordflow}{for} (; pixels < pixels\_end; pixels++)
     \{
        \textcolor{keywordtype}{int} r, g, b;

        r = ((*pixels) & 0xff0000) >> 16;
        g = ((*pixels) & 0x00ff00) >> 8;
        b = (*pixels) & 0x0000ff;

        fprintf(f, \textcolor{stringliteral}{"%c%c%c"}, r, g, b);
     \}

   fclose(f);
   printf(\textcolor{stringliteral}{"saved scene as '%s'\(\backslash\)n"}, dest);
\}
\end{DoxyCodeInclude}


More examples can be found at \hyperlink{evas_examples}{Evas Examples}. 