\hypertarget{group__Eet__File__Image__Group}{\section{Image Store and Load}
\label{group__Eet__File__Image__Group}\index{Image Store and Load@{Image Store and Load}}
}


Eet efficiently stores and loads images, including alpha channels and lossy compressions.  


\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eet__File__Image__Cipher__Group}{Image Store and Load using a Cipher}
\begin{DoxyCompactList}\small\item\em Most of the \hyperlink{group__Eet__File__Image__Group}{Image Store and Load} have alternative versions that accounts for ciphers to protect their content. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File} $\ast$ef, const char $\ast$name, unsigned int $\ast$w, unsigned int $\ast$h, int $\ast$alpha, int $\ast$compress, int $\ast$quality, Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$lossy)
\begin{DoxyCompactList}\small\item\em Read just the header data for an image and dont decode the pixels. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File} $\ast$ef, const char $\ast$name, unsigned int $\ast$w, unsigned int $\ast$h, int $\ast$alpha, int $\ast$compress, int $\ast$quality, Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$lossy)
\begin{DoxyCompactList}\small\item\em Read image data from the named key in the eet file. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Image__Group_gab0ac3f0dd4bf6e690be0e8d2859868b6}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File} $\ast$ef, const char $\ast$name, unsigned int src\+\_\+x, unsigned int src\+\_\+y, unsigned int $\ast$d, unsigned int w, unsigned int h, unsigned int row\+\_\+stride, int $\ast$alpha, int $\ast$compress, int $\ast$quality, Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$lossy)
\begin{DoxyCompactList}\small\item\em Read image data from the named key in the eet file and store it in the given buffer. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Image__Group_ga793af643214aaaf0404b1c948c648e13}{eet\+\_\+data\+\_\+image\+\_\+write} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File} $\ast$ef, const char $\ast$name, const void $\ast$data, unsigned int w, unsigned int h, int alpha, int compress, int quality, Eet\+\_\+\+Image\+\_\+\+Encoding lossy)
\begin{DoxyCompactList}\small\item\em Write image data to the named key in an eet file. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Image__Group_ga909c869cabe1a4785224b949cd3ca657}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode} (const void $\ast$data, int size, unsigned int $\ast$w, unsigned int $\ast$h, int $\ast$alpha, int $\ast$compress, int $\ast$quality, Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$lossy)
\begin{DoxyCompactList}\small\item\em Decode Image data header only to get information. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Eet__File__Image__Group_ga848ee5403e866b7a363da3f39e175970}{eet\+\_\+data\+\_\+image\+\_\+decode} (const void $\ast$data, int size, unsigned int $\ast$w, unsigned int $\ast$h, int $\ast$alpha, int $\ast$compress, int $\ast$quality, Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$lossy)
\begin{DoxyCompactList}\small\item\em Decode Image data into pixel data. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Image__Group_ga8c7e57f32570095018ef294a17dd1f2c}{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface} (const void $\ast$data, int size, unsigned int src\+\_\+x, unsigned int src\+\_\+y, unsigned int $\ast$d, unsigned int w, unsigned int h, unsigned int row\+\_\+stride, int $\ast$alpha, int $\ast$compress, int $\ast$quality, Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$lossy)
\begin{DoxyCompactList}\small\item\em Decode Image data into pixel data and stores in the given buffer. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Eet__File__Image__Group_ga2537c91d5a62dc14c7a006f3f36077fd}{eet\+\_\+data\+\_\+image\+\_\+encode} (const void $\ast$data, int $\ast$size\+\_\+ret, unsigned int w, unsigned int h, int alpha, int compress, int quality, Eet\+\_\+\+Image\+\_\+\+Encoding lossy)
\begin{DoxyCompactList}\small\item\em Encode image data for storage or transmission. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Image__Group_gaaede1b1c1f586c3ff0a7aea6cc1d589c}{eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File} $\ast$ef, const char $\ast$name, const char $\ast$cipher\+\_\+key, const Eet\+\_\+\+Colorspace $\ast$$\ast$cspaces)
\begin{DoxyCompactList}\small\item\em Get the colorspace Eet can decode into of a given eet image ressource. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Eet efficiently stores and loads images, including alpha channels and lossy compressions. 

Eet can handle both lossy compression with different levels of quality and non-\/lossy compression with different compression levels. It's also possible, given an image data, to only read its header to get the image information without decoding the entire content for it.

The encode family of functions will take an image raw buffer and its parameters and compress it in memory, returning the new buffer. Likewise, the decode functions will read from the given location in memory and return the uncompressed image.

The read and write functions will, respectively, encode and decode to or from an Eet file, under the specified key.

These functions are fairly low level and the same functionality can be achieved using Evas and Edje, making it much easier to work with images as well as not needing to worry about things like scaling them. 

\subsection{Function Documentation}
\hypertarget{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read@{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read}}
\index{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read@{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read (
\begin{DoxyParamCaption}
\item[{{\bf Eet\+\_\+\+File} $\ast$}]{ef, }
\item[{const char $\ast$}]{name, }
\item[{unsigned int $\ast$}]{w, }
\item[{unsigned int $\ast$}]{h, }
\item[{int $\ast$}]{alpha, }
\item[{int $\ast$}]{compress, }
\item[{int $\ast$}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}


Read just the header data for an image and dont decode the pixels. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for reading. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em w} & A pointer to the unsigned int to hold the width in pixels. \\
\hline
{\em h} & A pointer to the unsigned int to hold the height in pixels. \\
\hline
{\em alpha} & A pointer to the int to hold the alpha flag. \\
\hline
{\em compress} & A pointer to the int to hold the compression amount. \\
\hline
{\em quality} & A pointer to the int to hold the quality amount. \\
\hline
{\em lossy} & A pointer to the int to hold the lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on successful decode, 0 otherwise
\end{DoxyReturn}
Reads and decodes the image header data stored under the given key and Eet file.

The information decoded is placed in each of the parameters, which must be provided. The width and height, measured in pixels, will be stored under the variables pointed by {\ttfamily w} and {\ttfamily h}, respectively. If the read or decode of the header fails, this values will be 0. The {\ttfamily alpha} parameter will be 1 or 0, denoting if the alpha channel of the image is used or not. If the image was losslessly compressed, the {\ttfamily compress} parameter will hold the compression amount used, ranging from 0 to 9 and {\ttfamily lossy} will be 0. In the case of lossy compression, {\ttfamily lossy} will be 1, and the compression quality will be placed under {\ttfamily quality}, with a value ranging from 0 to 100.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_ga909c869cabe1a4785224b949cd3ca657}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_ga32c48cbd5dfe3a6f5fc3cace1b83a879}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+read@{eet\+\_\+data\+\_\+image\+\_\+read}}
\index{eet\+\_\+data\+\_\+image\+\_\+read@{eet\+\_\+data\+\_\+image\+\_\+read}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+read}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void$\ast$ eet\+\_\+data\+\_\+image\+\_\+read (
\begin{DoxyParamCaption}
\item[{{\bf Eet\+\_\+\+File} $\ast$}]{ef, }
\item[{const char $\ast$}]{name, }
\item[{unsigned int $\ast$}]{w, }
\item[{unsigned int $\ast$}]{h, }
\item[{int $\ast$}]{alpha, }
\item[{int $\ast$}]{compress, }
\item[{int $\ast$}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}


Read image data from the named key in the eet file. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for reading. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em w} & A pointer to the unsigned int to hold the width in pixels. \\
\hline
{\em h} & A pointer to the unsigned int to hold the height in pixels. \\
\hline
{\em alpha} & A pointer to the int to hold the alpha flag. \\
\hline
{\em compress} & A pointer to the int to hold the compression amount. \\
\hline
{\em quality} & A pointer to the int to hold the quality amount. \\
\hline
{\em lossy} & A pointer to the int to hold the lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The image pixel data decoded
\end{DoxyReturn}
Reads and decodes the image stored in the given Eet file under the named key.

The returned pixel data is a linear array of pixels starting from the top-\/left of the image, scanning row by row from left to right. Each pile is a 32bit value, with the high byte being the alpha channel, the next being red, then green, and the low byte being blue.

The rest of the parameters are the same as in \hyperlink{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read()}.

On success the function returns a pointer to the image data decoded. The calling application is responsible for calling free() on the image data when it is done with it. On failure N\+U\+L\+L is returned and the parameter values may not contain any sensible data.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read()} 

\hyperlink{group__Eet__File__Image__Group_ga848ee5403e866b7a363da3f39e175970}{eet\+\_\+data\+\_\+image\+\_\+decode()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_gab56ba9c7f727d611055df6f7e384f8e1}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+cipher()} 

\hyperlink{group__Eet__File__Image__Group_gab0ac3f0dd4bf6e690be0e8d2859868b6}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+read\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_gab0ac3f0dd4bf6e690be0e8d2859868b6}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface@{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface}}
\index{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface@{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface (
\begin{DoxyParamCaption}
\item[{{\bf Eet\+\_\+\+File} $\ast$}]{ef, }
\item[{const char $\ast$}]{name, }
\item[{unsigned int}]{src\+\_\+x, }
\item[{unsigned int}]{src\+\_\+y, }
\item[{unsigned int $\ast$}]{d, }
\item[{unsigned int}]{w, }
\item[{unsigned int}]{h, }
\item[{unsigned int}]{row\+\_\+stride, }
\item[{int $\ast$}]{alpha, }
\item[{int $\ast$}]{compress, }
\item[{int $\ast$}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_gab0ac3f0dd4bf6e690be0e8d2859868b6}


Read image data from the named key in the eet file and store it in the given buffer. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for reading. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em src\+\_\+x} & The starting x coordinate from where to dump the stream. \\
\hline
{\em src\+\_\+y} & The starting y coordinate from where to dump the stream. \\
\hline
{\em d} & A pointer to the pixel surface. \\
\hline
{\em w} & The expected width in pixels of the pixel surface to decode. \\
\hline
{\em h} & The expected height in pixels of the pixel surface to decode. \\
\hline
{\em row\+\_\+stride} & The length of a pixels line in the destination surface. \\
\hline
{\em alpha} & A pointer to the int to hold the alpha flag. \\
\hline
{\em compress} & A pointer to the int to hold the compression amount. \\
\hline
{\em quality} & A pointer to the int to hold the quality amount. \\
\hline
{\em lossy} & A pointer to the int to hold the lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 otherwise.
\end{DoxyReturn}
Reads and decodes the image stored in the given Eet file, placing the resulting pixel data in the buffer pointed by the user.

Like \hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()}, it takes the image data stored under the {\ttfamily name} key in the {\ttfamily ef} file, but instead of returning a new buffer with the pixel data, it places the result in the buffer pointed by {\ttfamily d}, which must be provided by the user and of sufficient size to hold the requested portion of the image.

The {\ttfamily src\+\_\+x} and {\ttfamily src\+\_\+y} parameters indicate the top-\/left corner of the section of the image to decode. These have to be higher or equal than 0 and less than the respective total width and height of the image. The width and height of the section of the image to decode are given in {\ttfamily w} and {\ttfamily h} and also can't be higher than the total width and height of the image.

The {\ttfamily row\+\_\+stride} parameter indicates the length in bytes of each line in the destination buffer and it has to be at least {\ttfamily w} $\ast$ 4.

All the other parameters are the same as in \hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()}.

On success the function returns 1, and 0 on failure. On failure the parameter values may not contain any sensible data.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()} 

\hyperlink{group__Eet__File__Image__Group_ga848ee5403e866b7a363da3f39e175970}{eet\+\_\+data\+\_\+image\+\_\+decode()} 

\hyperlink{group__Eet__File__Image__Group_ga8c7e57f32570095018ef294a17dd1f2c}{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_ga5a3e9c25254e023dd1ce4f47f6955c1f}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface\+\_\+cipher()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_ga5cbbcbc74f8f91267cd29b594b9cda8c}{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+cspace\+\_\+surface\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+2 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_ga793af643214aaaf0404b1c948c648e13}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+write@{eet\+\_\+data\+\_\+image\+\_\+write}}
\index{eet\+\_\+data\+\_\+image\+\_\+write@{eet\+\_\+data\+\_\+image\+\_\+write}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+write}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+data\+\_\+image\+\_\+write (
\begin{DoxyParamCaption}
\item[{{\bf Eet\+\_\+\+File} $\ast$}]{ef, }
\item[{const char $\ast$}]{name, }
\item[{const void $\ast$}]{data, }
\item[{unsigned int}]{w, }
\item[{unsigned int}]{h, }
\item[{int}]{alpha, }
\item[{int}]{compress, }
\item[{int}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_ga793af643214aaaf0404b1c948c648e13}


Write image data to the named key in an eet file. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for writing. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em data} & A pointer to the image pixel data. \\
\hline
{\em w} & The width of the image in pixels. \\
\hline
{\em h} & The height of the image in pixels. \\
\hline
{\em alpha} & The alpha channel flag. \\
\hline
{\em compress} & The compression amount. \\
\hline
{\em quality} & The quality encoding amount. \\
\hline
{\em lossy} & The lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Success if the data was encoded and written or not.
\end{DoxyReturn}
This function takes image pixel data and encodes it in an eet file stored under the supplied name key, and returns how many bytes were actually written to encode the image data.

The data expected is the same format as returned by eet\+\_\+data\+\_\+image\+\_\+read. If this is not the case weird things may happen. Width and height must be between 1 and 8000 pixels. The alpha flags can be 0 or 1 (0 meaning the alpha values are not useful and 1 meaning they are). Compress can be from 0 to 9 (0 meaning no compression, 9 meaning full compression). This is only used if the image is not lossily encoded. Quality is used on lossy compression and should be a value from 0 to 100. The lossy flag can be 0 or 1. 0 means encode losslessly and 1 means to encode with image quality loss (but then have a much smaller encoding).

On success this function returns the number of bytes that were required to encode the image data, or on failure it returns 0.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()} 

\hyperlink{group__Eet__File__Image__Group_ga2537c91d5a62dc14c7a006f3f36077fd}{eet\+\_\+data\+\_\+image\+\_\+encode()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_ga71bcbecdbb40470e722bdb0a5abfc1bb}{eet\+\_\+data\+\_\+image\+\_\+write\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+write\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_ga909c869cabe1a4785224b949cd3ca657}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode@{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode}}
\index{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode@{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode (
\begin{DoxyParamCaption}
\item[{const void $\ast$}]{data, }
\item[{int}]{size, }
\item[{unsigned int $\ast$}]{w, }
\item[{unsigned int $\ast$}]{h, }
\item[{int $\ast$}]{alpha, }
\item[{int $\ast$}]{compress, }
\item[{int $\ast$}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_ga909c869cabe1a4785224b949cd3ca657}


Decode Image data header only to get information. 


\begin{DoxyParams}{Parameters}
{\em data} & The encoded pixel data. \\
\hline
{\em size} & The size, in bytes, of the encoded pixel data. \\
\hline
{\em w} & A pointer to the unsigned int to hold the width in pixels. \\
\hline
{\em h} & A pointer to the unsigned int to hold the height in pixels. \\
\hline
{\em alpha} & A pointer to the int to hold the alpha flag. \\
\hline
{\em compress} & A pointer to the int to hold the compression amount. \\
\hline
{\em quality} & A pointer to the int to hold the quality amount. \\
\hline
{\em lossy} & A pointer to the int to hold the lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 on failure.
\end{DoxyReturn}
This function works exactly like \hyperlink{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read()}, but instead of reading from an Eet file, it takes the buffer of size {\ttfamily size} pointed by {\ttfamily data}, which must be a valid Eet encoded image.

On success the function returns 1 indicating the header was read and decoded properly, or 0 on failure.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_gaa0e884cb39877ca363aaadabcda87dd5}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_gac7bbd94ae9d67e00fa39e275a9935b3c}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+header\+\_\+decode\+\_\+cipher().



Referenced by eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+cipher(), eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+cspace\+\_\+surface\+\_\+cipher(), and eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_ga848ee5403e866b7a363da3f39e175970}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+decode@{eet\+\_\+data\+\_\+image\+\_\+decode}}
\index{eet\+\_\+data\+\_\+image\+\_\+decode@{eet\+\_\+data\+\_\+image\+\_\+decode}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+decode}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void$\ast$ eet\+\_\+data\+\_\+image\+\_\+decode (
\begin{DoxyParamCaption}
\item[{const void $\ast$}]{data, }
\item[{int}]{size, }
\item[{unsigned int $\ast$}]{w, }
\item[{unsigned int $\ast$}]{h, }
\item[{int $\ast$}]{alpha, }
\item[{int $\ast$}]{compress, }
\item[{int $\ast$}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_ga848ee5403e866b7a363da3f39e175970}


Decode Image data into pixel data. 


\begin{DoxyParams}{Parameters}
{\em data} & The encoded pixel data. \\
\hline
{\em size} & The size, in bytes, of the encoded pixel data. \\
\hline
{\em w} & A pointer to the unsigned int to hold the width in pixels. \\
\hline
{\em h} & A pointer to the unsigned int to hold the height in pixels. \\
\hline
{\em alpha} & A pointer to the int to hold the alpha flag. \\
\hline
{\em compress} & A pointer to the int to hold the compression amount. \\
\hline
{\em quality} & A pointer to the int to hold the quality amount. \\
\hline
{\em lossy} & A pointer to the int to hold the lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The image pixel data decoded
\end{DoxyReturn}
This function takes encoded pixel data and decodes it into raw R\+G\+B\+A pixels on success.

It works exactly like \hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()}, but it takes the encoded data in the {\ttfamily data} buffer of size {\ttfamily size}, instead of reading from a file. All the others parameters are also the same.

On success the function returns a pointer to the image data decoded. The calling application is responsible for calling free() on the image data when it is done with it. On failure N\+U\+L\+L is returned and the parameter values may not contain any sensible data.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_gad5ed35797beed83522844f64dc193048}{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+cipher().



Referenced by eet\+\_\+data\+\_\+image\+\_\+read\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_ga8c7e57f32570095018ef294a17dd1f2c}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface@{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface}}
\index{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface@{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface (
\begin{DoxyParamCaption}
\item[{const void $\ast$}]{data, }
\item[{int}]{size, }
\item[{unsigned int}]{src\+\_\+x, }
\item[{unsigned int}]{src\+\_\+y, }
\item[{unsigned int $\ast$}]{d, }
\item[{unsigned int}]{w, }
\item[{unsigned int}]{h, }
\item[{unsigned int}]{row\+\_\+stride, }
\item[{int $\ast$}]{alpha, }
\item[{int $\ast$}]{compress, }
\item[{int $\ast$}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding $\ast$}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_ga8c7e57f32570095018ef294a17dd1f2c}


Decode Image data into pixel data and stores in the given buffer. 


\begin{DoxyParams}{Parameters}
{\em data} & The encoded pixel data. \\
\hline
{\em size} & The size, in bytes, of the encoded pixel data. \\
\hline
{\em src\+\_\+x} & The starting x coordinate from where to dump the stream. \\
\hline
{\em src\+\_\+y} & The starting y coordinate from where to dump the stream. \\
\hline
{\em d} & A pointer to the pixel surface. \\
\hline
{\em w} & The expected width in pixels of the pixel surface to decode. \\
\hline
{\em h} & The expected height in pixels of the pixel surface to decode. \\
\hline
{\em row\+\_\+stride} & The length of a pixels line in the destination surface. \\
\hline
{\em alpha} & A pointer to the int to hold the alpha flag. \\
\hline
{\em compress} & A pointer to the int to hold the compression amount. \\
\hline
{\em quality} & A pointer to the int to hold the quality amount. \\
\hline
{\em lossy} & A pointer to the int to hold the lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 otherwise.
\end{DoxyReturn}
Like \hyperlink{group__Eet__File__Image__Group_gab0ac3f0dd4bf6e690be0e8d2859868b6}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface()}, but reading the given {\ttfamily data} buffer instead of a file.

On success the function returns 1, and 0 on failure. On failure the parameter values may not contain any sensible data.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_gab0ac3f0dd4bf6e690be0e8d2859868b6}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+surface()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_ga131db5528cb0b8381fbef91c899831ee}{eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+2 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+decode\+\_\+to\+\_\+surface\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_ga2537c91d5a62dc14c7a006f3f36077fd}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+encode@{eet\+\_\+data\+\_\+image\+\_\+encode}}
\index{eet\+\_\+data\+\_\+image\+\_\+encode@{eet\+\_\+data\+\_\+image\+\_\+encode}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+encode}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void$\ast$ eet\+\_\+data\+\_\+image\+\_\+encode (
\begin{DoxyParamCaption}
\item[{const void $\ast$}]{data, }
\item[{int $\ast$}]{size\+\_\+ret, }
\item[{unsigned int}]{w, }
\item[{unsigned int}]{h, }
\item[{int}]{alpha, }
\item[{int}]{compress, }
\item[{int}]{quality, }
\item[{Eet\+\_\+\+Image\+\_\+\+Encoding}]{lossy}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_ga2537c91d5a62dc14c7a006f3f36077fd}


Encode image data for storage or transmission. 


\begin{DoxyParams}{Parameters}
{\em data} & A pointer to the image pixel data. \\
\hline
{\em size\+\_\+ret} & A pointer to an int to hold the size of the returned data. \\
\hline
{\em w} & The width of the image in pixels. \\
\hline
{\em h} & The height of the image in pixels. \\
\hline
{\em alpha} & The alpha channel flag. \\
\hline
{\em compress} & The compression amount. \\
\hline
{\em quality} & The quality encoding amount. \\
\hline
{\em lossy} & The lossiness flag. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The encoded image data.
\end{DoxyReturn}
This function stakes image pixel data and encodes it with compression and possible loss of quality (as a trade off for size) for storage or transmission to another system.

It works like \hyperlink{group__Eet__File__Image__Group_ga793af643214aaaf0404b1c948c648e13}{eet\+\_\+data\+\_\+image\+\_\+write()}, but instead of writing the encoded image into an Eet file, it allocates a new buffer of the size required and returns the encoded data in it.

On success this function returns a pointer to the encoded data that you can free with free() when no longer needed.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eet__File__Image__Group_ga793af643214aaaf0404b1c948c648e13}{eet\+\_\+data\+\_\+image\+\_\+write()} 

\hyperlink{group__Eet__File__Image__Group_ga6cd40c855fad3b52528ee3434ad6c9cf}{eet\+\_\+data\+\_\+image\+\_\+read()} 

\hyperlink{group__Eet__File__Image__Cipher__Group_ga97289ef89e6a1d7863a8b87f54cc0399}{eet\+\_\+data\+\_\+image\+\_\+encode\+\_\+cipher()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+encode\+\_\+cipher().



Referenced by eet\+\_\+data\+\_\+image\+\_\+write\+\_\+cipher().

\hypertarget{group__Eet__File__Image__Group_gaaede1b1c1f586c3ff0a7aea6cc1d589c}{\index{Image Store and Load@{Image Store and Load}!eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get@{eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get}}
\index{eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get@{eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get}!Image Store and Load@{Image Store and Load}}
\subsubsection[{eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get (
\begin{DoxyParamCaption}
\item[{{\bf Eet\+\_\+\+File} $\ast$}]{ef, }
\item[{const char $\ast$}]{name, }
\item[{const char $\ast$}]{cipher\+\_\+key, }
\item[{const Eet\+\_\+\+Colorspace $\ast$$\ast$}]{cspaces}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Image__Group_gaaede1b1c1f586c3ff0a7aea6cc1d589c}


Get the colorspace Eet can decode into of a given eet image ressource. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for reading. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em cspaces} & Returned pointer by Eet to a list of possible decoding colorspace finished by {\ttfamily E\+E\+T\+\_\+\+C\+O\+L\+O\+R\+S\+P\+A\+C\+E\+\_\+\+A\+R\+G\+B8888}. If {\ttfamily N\+U\+L\+L}, only E\+E\+T\+\_\+\+C\+O\+L\+O\+R\+S\+P\+A\+C\+E\+\_\+\+A\+R\+G\+B8888 is supported. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on successful get, 0 otherwise.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+10.\+0 
\end{DoxySince}


References eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read\+\_\+cipher().

