summaryrefslogtreecommitdiffstats
path: root/src/trace/imagemap.cpp
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2006-03-30 13:01:30 +0000
committerishmal <ishmal@users.sourceforge.net>2006-03-30 13:01:30 +0000
commita06db29330c8286f4325229579b58e6487677727 (patch)
tree7db263afc8f4aec3108470f220d02085c10e4adc /src/trace/imagemap.cpp
parentWIP. siox election progress. fix api a bit. (diff)
downloadinkscape-a06db29330c8286f4325229579b58e6487677727.tar.gz
inkscape-a06db29330c8286f4325229579b58e6487677727.zip
clean up PPM output code
(bzr r373)
Diffstat (limited to 'src/trace/imagemap.cpp')
-rw-r--r--src/trace/imagemap.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/trace/imagemap.cpp b/src/trace/imagemap.cpp
index 0d4a01d7e..a89cfaa05 100644
--- a/src/trace/imagemap.cpp
+++ b/src/trace/imagemap.cpp
@@ -29,8 +29,7 @@ static int gWritePPM(GrayMap *me, char *fileName)
if (!fileName)
return FALSE;
- Inkscape::IO::dump_fopen_call( fileName, "C" );
- FILE *f = Inkscape::IO::fopen_utf8name(fileName, "wb");
+ FILE *f = fopen(fileName, "wb");
if (!f)
return FALSE;
@@ -42,9 +41,9 @@ static int gWritePPM(GrayMap *me, char *fileName)
{
unsigned long pix = me->getPixel(me, x, y) / 3;
unsigned char pixb = (unsigned char) (pix & 0xff);
- fwrite(&pixb, 1, 1, f);
- fwrite(&pixb, 1, 1, f);
- fwrite(&pixb, 1, 1, f);
+ fputc(pixb, f);
+ fputc(pixb, f);
+ fputc(pixb, f);
}
}
fclose(f);
@@ -134,8 +133,7 @@ static int ppWritePPM(PackedPixelMap *me, char *fileName)
if (!fileName)
return FALSE;
- Inkscape::IO::dump_fopen_call(fileName, "D");
- FILE *f = Inkscape::IO::fopen_utf8name(fileName, "wb");
+ FILE *f = fopen(fileName, "wb");
if (!f)
return FALSE;
@@ -243,8 +241,7 @@ static int rWritePPM(RgbMap *me, char *fileName)
if (!fileName)
return FALSE;
- Inkscape::IO::dump_fopen_call(fileName, "D");
- FILE *f = Inkscape::IO::fopen_utf8name(fileName, "wb");
+ FILE *f = fopen(fileName, "wb");
if (!f)
return FALSE;
@@ -255,9 +252,9 @@ static int rWritePPM(RgbMap *me, char *fileName)
for (int x=0 ; x<me->width ; x++)
{
RGB rgb = me->getPixel(me, x, y);
- fwrite(&(rgb.r), 1, 1, f);
- fwrite(&(rgb.g), 1, 1, f);
- fwrite(&(rgb.b), 1, 1, f);
+ fputc(rgb.r, f);
+ fputc(rgb.g, f);
+ fputc(rgb.b, f);
}
}
fclose(f);
@@ -350,8 +347,7 @@ static int iWritePPM(IndexedMap *me, char *fileName)
if (!fileName)
return FALSE;
- Inkscape::IO::dump_fopen_call(fileName, "D");
- FILE *f = Inkscape::IO::fopen_utf8name(fileName, "wb");
+ FILE *f = fopen(fileName, "wb");
if (!f)
return FALSE;
@@ -362,9 +358,9 @@ static int iWritePPM(IndexedMap *me, char *fileName)
for (int x=0 ; x<me->width ; x++)
{
RGB rgb = me->getPixelValue(me, x, y);
- fwrite(&(rgb.r), 1, 1, f);
- fwrite(&(rgb.g), 1, 1, f);
- fwrite(&(rgb.b), 1, 1, f);
+ fputc(rgb.r, f);
+ fputc(rgb.g, f);
+ fputc(rgb.b, f);
}
}
fclose(f);