Mercurial > hg > dmlib
diff tools/libgfx.c @ 2156:e6ec7fad9ce2
Rename DMImageConvSpec to DMImageWriteSpec to better reflec the struct's purpose.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 04 Jun 2019 16:18:41 +0300 |
parents | 1c111bfc17d4 |
children | 9a9493809b3a |
line wrap: on
line diff
--- a/tools/libgfx.c Tue Jun 04 16:15:58 2019 +0300 +++ b/tools/libgfx.c Tue Jun 04 16:18:41 2019 +0300 @@ -330,7 +330,7 @@ int dmWriteImageData(const DMImage *img, void *cbdata, int (*writeRowCB)(void *, const Uint8 *, const size_t), - const DMImageConvSpec *spec) + const DMImageWriteSpec *spec) { int x, y, yscale, xscale, res = 0, rowSize, rowWidth; Uint8 *row = NULL; @@ -574,7 +574,7 @@ int dmWriteIFFMasterRAWHeader( DMResource *fp, const char *filename, const char *prefix, - const DMImage *img, const DMImageConvSpec *spec) + const DMImage *img, const DMImageWriteSpec *spec) { if (dmfprintf(fp, "%s_width: dw.w %d\n" @@ -625,7 +625,7 @@ static int dmWriteRAWRow(DMBitStreamContext *bs, const DMImage *img, - const DMImageConvSpec *spec, const int yc, const int plane) + const DMImageWriteSpec *spec, const int yc, const int plane) { const Uint8 *sp = img->data + (yc * img->pitch); for (int xc = 0; xc < img->width; xc++) @@ -650,7 +650,7 @@ } -int dmWriteRAWImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) +int dmWriteRAWImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *spec) { int res; DMBitStreamContext ctx; @@ -698,7 +698,7 @@ } -int dmWriteCDumpImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) +int dmWriteCDumpImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *spec) { int res; DMBitStreamContext ctx; @@ -765,9 +765,9 @@ } -int dmWritePPMImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) +int dmWritePPMImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *spec) { - DMImageConvSpec tmpSpec; + DMImageWriteSpec tmpSpec; char *tmpFmt; // Check if we can do this @@ -778,7 +778,7 @@ "Conversion of non-indexed image to indexed not supported yet.\n"); } - memcpy(&tmpSpec, spec, sizeof(DMImageConvSpec)); + memcpy(&tmpSpec, spec, sizeof(DMImageWriteSpec)); switch (spec->format) { @@ -974,7 +974,7 @@ } -int dmWritePNGImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) +int dmWritePNGImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *spec) { png_structp png_ptr = NULL; png_infop info_ptr = NULL; @@ -1415,15 +1415,15 @@ } -int dmWritePCXImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *pspec) +int dmWritePCXImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *pspec) { DMPCXData pcx; DMPCXHeader hdr; - DMImageConvSpec spec; + DMImageWriteSpec spec; int res; // Always force planar for PCX - memcpy(&spec, pspec, sizeof(DMImageConvSpec)); + memcpy(&spec, pspec, sizeof(DMImageWriteSpec)); spec.planar = TRUE; // XXX: 24bit PCX does not work yet .. @@ -2630,7 +2630,7 @@ } -int dmWriteIFFImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) +int dmWriteIFFImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *spec) { DMIFF iff; Uint8 *buf = NULL;