projects
/
rigol
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3df1471
)
initialize zlib
author
Michael Gernoth
<michael@gernoth.net>
Sun, 6 Jun 2010 01:37:49 +0000
(
03:37
+0200)
committer
Michael Gernoth
<michael@gernoth.net>
Sun, 6 Jun 2010 01:37:49 +0000
(
03:37
+0200)
png.c
patch
|
blob
|
blame
|
history
diff --git
a/png.c
b/png.c
index 98d599371717c7f4fe3062d92328530fc426ad6f..accf41540995ca4acee6274414e99790c7f0cb0f 100644
(file)
--- a/
png.c
+++ b/
png.c
@@
-2,6
+2,8
@@
#include <stdint.h>
#include <arpa/inet.h>
#include <zlib.h>
#include <stdint.h>
#include <arpa/inet.h>
#include <zlib.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "png.h"
#include "png.h"
@@
-76,6
+78,7
@@
unsigned char *lcd2png(unsigned char *lcd, int *len)
uint32_t l;
int i;
int toalloc = 0;
uint32_t l;
int i;
int toalloc = 0;
+ z_stream strm;
for(i = 0; i < 256; i++) {
lut[i][0] = ((i >> 6) * 0x55);
for(i = 0; i < 256; i++) {
lut[i][0] = ((i >> 6) * 0x55);
@@
-89,6
+92,15
@@
unsigned char *lcd2png(unsigned char *lcd, int *len)
screen_conv[i+2] = lut[lcd[i/3]][2];
}
screen_conv[i+2] = lut[lcd[i/3]][2];
}
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ if (deflateInit(&strm, 9) != Z_OK) {
+ perror("deflateInit");
+ exit(EXIT_FAILURE);
+ }
+
+
image = malloc(320*234*2); /* TODO: FIXME! */
outpos = image;
memcpy(outpos, png, sizeof(png));
image = malloc(320*234*2); /* TODO: FIXME! */
outpos = image;
memcpy(outpos, png, sizeof(png));
Impressum
,
Datenschutz