update test schematics

This commit is contained in:
stefan schippers 2023-01-23 18:23:18 +01:00
parent 1da5e47d4a
commit 48549f1212
5 changed files with 27 additions and 20 deletions

View File

@ -22,13 +22,11 @@ BEGIN{
while(getline < filename) {
if(create_id == 0) {
if(!start) f = f "\n"
start = 0
str = gensub(/(my_(malloc|calloc|realloc|free|strdup|strdup2))\([0-9]+,/, "\\1(_ALLOC_ID_,", "G")
if(str != $0) changed = 1
f = f str
} else {
if(!start) f = f "\n"
start = 0
if($0 !~ /^#define *_ALLOC_ID_/) {
while(sub(/_ALLOC_ID_/, cnt)) {
changed = 1
@ -37,6 +35,7 @@ BEGIN{
}
f = f $0
}
start = 0
}
close(filename)
if(changed) {

View File

@ -127,7 +127,6 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
const char *quality_attr;
size_t image_data_len;
size_t oLength;
int idx = 0;
quality_attr = get_tok_value(r->prop_ptr, "jpeg_quality", 0);
if(quality_attr[0]) quality = atoi(quality_attr);
@ -190,7 +189,7 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
}
cairo_surface_mark_dirty(surface);
cairo_image_surface_write_to_jpeg_mem(surface, &jpgData, &fileSize, quality);
ascii85EncodedJpeg = ascii85_encode(jpgData, fileSize, &oLength, 0);
ascii85EncodedJpeg = ascii85_encode(jpgData, fileSize, &oLength);
fprintf(fd, "gsave\n");
fprintf(fd, "save\n");
fprintf(fd, "/RawData currentfile /ASCII85Decode filter def\n");
@ -235,18 +234,20 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
fprintf(fd, " restore\n");
fprintf(fd, "} exec\n");
#if 1 /* break lines */
for (i = 0; i < oLength; i++)
{
fputc(ascii85EncodedJpeg[i],fd);
idx++;
if(idx==64)
if(i > 0 && (i % 64) == 0)
{
idx=0;
fputc('\n',fd);
/* if (ascii85Encode[i+1]=='%') idx=63; imageMagic does this for some reason?!
* Doesn't seem to be necesary. */
}
}
#else
fprintf(fd, "%s", ascii85EncodedJpeg);
#endif
fprintf(fd, "~>\n");
fprintf(fd, "grestore\n");
@ -274,7 +275,7 @@ void ps_embedded_graph(xRect* r, double rx1, double ry1, double rx2, double ry2)
int quality=100;
const char *quality_attr;
size_t oLength;
int i, idx = 0;
int i;
quality_attr = get_tok_value(r->prop_ptr, "jpeg_quality", 0);
if(quality_attr[0]) quality = atoi(quality_attr);
@ -331,7 +332,7 @@ void ps_embedded_graph(xRect* r, double rx1, double ry1, double rx2, double ry2)
#endif
cairo_image_surface_write_to_jpeg_mem(png_sfc, &jpgData, &fileSize, quality);
ascii85EncodedJpeg = ascii85_encode(jpgData, fileSize, &oLength, 0);
ascii85EncodedJpeg = ascii85_encode(jpgData, fileSize, &oLength);
free(jpgData);
cairo_surface_destroy(png_sfc);
@ -365,18 +366,20 @@ void ps_embedded_graph(xRect* r, double rx1, double ry1, double rx2, double ry2)
fprintf(fd, " restore\n");
fprintf(fd, "} exec\n");
#if 1 /* break lines */
for (i = 0; i < oLength; i++)
{
fputc(ascii85EncodedJpeg[i],fd);
idx++;
if(idx==64)
if(i > 0 && (i % 64) == 0)
{
idx=0;
fputc('\n',fd);
/* if (ascii85Encode[i+1]=='%') idx=63; imageMagic does this for some reason?!
* Doesn't seem to be necesary. */
}
}
#else
fprintf(fd, "%s", ascii85EncodedJpeg);
#endif
fprintf(fd, "~>\n");
fprintf(fd, "grestore\n");

View File

@ -287,7 +287,7 @@ unsigned char *base64_decode(const char *data, const size_t input_length, size_t
/* Caller should free returned buffer */
/* set brk to 1 if you want newlines added */
unsigned char *ascii85_encode(const unsigned char *data, const size_t input_length, size_t *output_length, int brk) {
unsigned char *ascii85_encode(const unsigned char *data, const size_t input_length, size_t *output_length) {
static const char b85_enc[] = {
'!', '"', '#', '$', '%', '&', '\'', '(',
')', '*', '+', ',', '-', '.', '/', '0',

View File

@ -1087,7 +1087,7 @@ extern int set_rect_flags(xRect *r);
extern int set_rect_extraptr(int what, xRect *drptr);
extern unsigned char *base64_decode(const char *data, const size_t input_length, size_t *output_length);
extern char *base64_encode(const unsigned char *data, const size_t input_length, size_t *output_length, int brk);
extern unsigned char *ascii85_encode(const unsigned char *data, const size_t input_length, size_t *output_length, int brk);
extern unsigned char *ascii85_encode(const unsigned char *data, const size_t input_length, size_t *output_length);
extern int get_raw_index(const char *node);
extern void free_rawfile(int dr);
extern int raw_read(const char *f, const char *type);

File diff suppressed because one or more lines are too long