#include <exception>
#include <cstring>
#include <cstdio>
#include "chomp/system/config.h"
#include "chomp/system/textfile.h"
#include "chomp/system/timeused.h"
#include "chomp/system/arg.h"
#include "pngimage.h"
Go to the source code of this file.
Functions | |
| int | pngSmall (const char *inName, const char *outName, int maxWidth, int maxHeight, int scalingFactor) |
| The main function of the program "pngsmall". | |
| int | main (int argc, char *argv[]) |
| The main procedure of the program. | |
Variables | |
| const char * | title |
| The title of the program which is displayed every time the program is launcued. | |
| const char * | helpinfo |
| The help information about the program which is displayed if the program is launched without command-line arguments or with incorrect arguments. | |
Definition in file pngsmall.cpp.
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
The main procedure of the program.
Returns: 0 = Ok, -1 = Error, 1 = Help displayed, 2 = Wrong arguments.
Definition at line 210 of file pngsmall.cpp.
References helpinfo, pngSmall(), and title.
| int pngSmall | ( | const char * | inName, | |
| const char * | outName, | |||
| int | maxWidth, | |||
| int | maxHeight, | |||
| int | scalingFactor | |||
| ) |
The main function of the program "pngsmall".
This function downscales the given PNG image and saves the result as another PNG image. The scaling factor is determined on the basis of the provided maximal allowed width and/or height of the image, unless specified explicitly. Returns 0, or throws an error message in case of failure.
Definition at line 88 of file pngsmall.cpp.
Referenced by main().
| const char* helpinfo |
Initial value:
"\ This program reads a given PNG images and writes another PNG image\n\ which is the original one scaled down so that the provided width\n\ and height are not exceeded. The down-scaling factors are limited\n\ to the integer numbers for optimal efficiency. The colors of output\n\ pixels are computed by means of an arithmetic average of the input ones.\n\ Command line arguments:\n\ input.png - the name of the input PNG image file to be down-scaled,\n\ output.png - the name of the output PNG file (rewrites the input if none),\n\ -w width - the maximal allowed width of the output PNG image,\n\ -h height - the maximal allowed height of the output PNG image,\n\ -s scaling - the downscaling factor (overrides max width/height settings),\n\ --quiet - makes the program run quietly, without any output messages,\n\ --help - shows this brief help information on the program's usage.\n\ For more information consult the accompanying documentation (if available)\n\ or ask the program's author at http://www.PawelPilarczyk.com/."
Definition at line 60 of file pngsmall.cpp.
| const char* title |
Initial value:
"\ PNGSMALL, ver. 0.01, 04/10/08. Copyright (C) 2008 by Pawel Pilarczyk.\n\ This is free software. No warranty. Consult 'license.txt' for details."
Definition at line 53 of file pngsmall.cpp.
1.5.3