~eda-qa/dhlib/main

« back to all changes in this revision

Viewing changes to restricted/wordlib/src/writepng.cc

  • Committer: edA-qa mort-ora-y
  • Date: 2010-04-03 10:34:57 UTC
  • Revision ID: eda-qa@disemia.com-20100403103457-ro7xslj1ct0wpnm1
adding common button base

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include <cstdio>
4
4
#include <string>
5
5
#include <cassert>
6
 
#include <core/stdtypes.h>
7
6
 
8
 
void writePNG( const std::string& file, const _uint8* data, unsigned len )
 
7
void writePNG( const std::string& file, const uint8_t* data, unsigned len )
9
8
{
10
9
        gdImagePtr im;
11
10
 
35
34
        gdImageDestroy(im);
36
35
}
37
36
 
38
 
_uint8* loadPNG( const std::string& file )
 
37
uint8_t* loadPNG( const std::string& file )
39
38
{
40
39
        FILE* pngin = fopen( file.c_str(), "rb" );
41
40
        
43
42
        
44
43
        unsigned width = gdImageSX(im);
45
44
        unsigned height = gdImageSY(im);
46
 
        _uint8* data = new _uint8[ width * height ];
 
45
        uint8_t* data = new uint8_t[ width * height ];
47
46
        for( unsigned y = 0; y < height; y++ )
48
47
                for( unsigned x = 0; x < width; x++ )
49
48
                {