libiz.cpp
Go to the documentation of this file.
1 #include <imagezero/libiz.h>
2 #include <imagezero/encoder.h>
3 #include <imagezero/decoder.h>
4 
5 namespace IZ
6 {
7  unsigned char* encodeImage(const Image<>& im, unsigned char* dest)
8  {
10  ic.begin(dest);
11  ic.encodeImageSize(im);
12  ic.encodeImagePixels(im);
13  return ic.end();
14  }
15 
16  const unsigned char* decodeImage(Image<>& im, const unsigned char* src)
17  {
18  ImageDecoder<> ic;
19  ic.begin(src);
20  ic.skipImageSize();
21  ic.decodeImagePixels(im);
22  return ic.end();
23  }
24 
25  void decodeImageSize(Image<>& im, const unsigned char* src)
26  {
27  ImageDecoder<> ic;
28  ic.begin(src);
29  ic.decodeImageSize(im);
30  ic.end();
31  }
32 } // namespace IZ
const unsigned char * end()
Definition: bitcoder.h:126
void begin(const unsigned char *ptr)
Definition: bitcoder.h:74
void decodeImageSize(Image<> &im)
Definition: decoder.h:66
void encodeImageSize(const Image<> &im)
Definition: encoder.h:65
Definition: bitcoder.h:6
void decodeImagePixels(Image<> &im) __attribute__((always_inline))
Definition: decoder.h:40
void encodeImagePixels(const Image<> &im) __attribute__((always_inline))
Definition: encoder.h:40
void skipImageSize()
Definition: decoder.h:75
void begin(unsigned char *ptr)
Definition: bitcoder.h:149
unsigned char * encodeImage(const Image<> &im, unsigned char *dest)
Definition: libiz.cpp:7
unsigned char * end()
Definition: bitcoder.h:192
const unsigned char * decodeImage(Image<> &im, const unsigned char *src)
Definition: libiz.cpp:16
void decodeImageSize(Image<> &im, const unsigned char *src)
Definition: libiz.cpp:25


imagezero
Author(s):
autogenerated on Mon Jun 10 2019 13:37:22