Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lvandeve/lodepng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLode <lvandeve@gmail.com>2018-12-30 16:35:48 +0300
committerLode <lvandeve@gmail.com>2018-12-30 16:35:48 +0300
commit472d085f80c8a5a8e46c162b79f5e4e28fd5515b (patch)
tree2fe076b8d7390414c7d2a291a8fd3a1a6f0515c8 /lodepng.h
parent2e6b2bac160f153f3890a8a10810c4a7f4ad3aed (diff)
change brace indent style: don't break before opening brace
Diffstat (limited to 'lodepng.h')
-rw-r--r--lodepng.h51
1 files changed, 18 insertions, 33 deletions
diff --git a/lodepng.h b/lodepng.h
index 2780e09..6f16160 100644
--- a/lodepng.h
+++ b/lodepng.h
@@ -1,5 +1,5 @@
/*
-LodePNG version 20180910
+LodePNG version 20181230
Copyright (c) 2005-2018 Lode Vandevenne
@@ -88,8 +88,7 @@ source files with custom allocators.*/
#ifdef LODEPNG_COMPILE_PNG
/*The PNG color types (also used for raw).*/
-typedef enum LodePNGColorType
-{
+typedef enum LodePNGColorType {
LCT_GREY = 0, /*greyscale: 1,2,4,8,16 bit*/
LCT_RGB = 2, /*RGB: 8,16 bit*/
LCT_PALETTE = 3, /*palette: 1,2,4,8 bit*/
@@ -196,8 +195,7 @@ unsigned lodepng_encode24_file(const char* filename,
#ifdef LODEPNG_COMPILE_CPP
-namespace lodepng
-{
+namespace lodepng {
#ifdef LODEPNG_COMPILE_DECODER
/*Same as lodepng_decode_memory, but decodes to an std::vector. The colortype
is the format to output the pixels to. Default is RGBA 8-bit per channel.*/
@@ -253,8 +251,7 @@ const char* lodepng_error_text(unsigned code);
#ifdef LODEPNG_COMPILE_DECODER
/*Settings for zlib decompression*/
typedef struct LodePNGDecompressSettings LodePNGDecompressSettings;
-struct LodePNGDecompressSettings
-{
+struct LodePNGDecompressSettings {
/* Check LodePNGDecoderSettings for more ignorable errors such as ignore_crc */
unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/
@@ -282,8 +279,7 @@ Settings for zlib compression. Tweaking these settings tweaks the balance
between speed and compression ratio.
*/
typedef struct LodePNGCompressSettings LodePNGCompressSettings;
-struct LodePNGCompressSettings /*deflate = compress*/
-{
+struct LodePNGCompressSettings /*deflate = compress*/ {
/*LZ77 related settings*/
unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.*/
unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/
@@ -316,8 +312,7 @@ Color mode of an image. Contains all information required to decode the pixel
bits to RGBA colors. This information is the same as used in the PNG file
format, and is used both for PNG and raw image data in LodePNG.
*/
-typedef struct LodePNGColorMode
-{
+typedef struct LodePNGColorMode {
/*header (IHDR)*/
LodePNGColorType colortype; /*color type, see PNG standard or documentation further in this header file*/
unsigned bitdepth; /*bits per sample, see PNG standard or documentation further in this header file*/
@@ -395,8 +390,7 @@ size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* colo
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
/*The information of a Time chunk in PNG.*/
-typedef struct LodePNGTime
-{
+typedef struct LodePNGTime {
unsigned year; /*2 bytes used (0-65535)*/
unsigned month; /*1-12*/
unsigned day; /*1-31*/
@@ -407,8 +401,7 @@ typedef struct LodePNGTime
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
/*Information about the PNG image, except pixels, width and height.*/
-typedef struct LodePNGInfo
-{
+typedef struct LodePNGInfo {
/*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/
unsigned compression_method;/*compression method of the original file. Always 0.*/
unsigned filter_method; /*filter method of the original file*/
@@ -614,8 +607,7 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in,
Settings for the decoder. This contains settings for the PNG and the Zlib
decoder, but not the Info settings from the Info structs.
*/
-typedef struct LodePNGDecoderSettings
-{
+typedef struct LodePNGDecoderSettings {
LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/
/* Check LodePNGDecompressSettings for more ignorable errors such as ignore_adler32 */
@@ -641,8 +633,7 @@ void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings);
#ifdef LODEPNG_COMPILE_ENCODER
/*automatically use color type with less bits per pixel if losslessly possible. Default: AUTO*/
-typedef enum LodePNGFilterStrategy
-{
+typedef enum LodePNGFilterStrategy {
/*every filter at zero*/
LFS_ZERO,
/*Use filter that gives minimum sum, as described in the official PNG filter heuristic.*/
@@ -664,8 +655,7 @@ which helps decide which color model to use for encoding.
Used internally by default if "auto_convert" is enabled. Public because it's useful for custom algorithms.
NOTE: This is not related to the ICC color profile, search "iccp_profile" instead to find the ICC/chromacity/...
fields in this header file.*/
-typedef struct LodePNGColorProfile
-{
+typedef struct LodePNGColorProfile {
unsigned colored; /*not greyscale*/
unsigned key; /*image is not opaque and color key is possible instead of full alpha*/
unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 65535 means 255*/
@@ -693,8 +683,7 @@ unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out,
const LodePNGColorMode* mode_in);
/*Settings for the encoder.*/
-typedef struct LodePNGEncoderSettings
-{
+typedef struct LodePNGEncoderSettings {
LodePNGCompressSettings zlibsettings; /*settings for the zlib encoder, such as window size, ...*/
unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/
@@ -730,8 +719,7 @@ void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings);
#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER)
/*The settings, state and information for extended encoding and decoding.*/
-typedef struct LodePNGState
-{
+typedef struct LodePNGState {
#ifdef LODEPNG_COMPILE_DECODER
LodePNGDecoderSettings decoder; /*the decoding settings*/
#endif /*LODEPNG_COMPILE_DECODER*/
@@ -965,11 +953,9 @@ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const
#ifdef LODEPNG_COMPILE_CPP
/* The LodePNG C++ wrapper uses std::vectors instead of manually allocated memory buffers. */
-namespace lodepng
-{
+namespace lodepng {
#ifdef LODEPNG_COMPILE_PNG
-class State : public LodePNGState
-{
+class State : public LodePNGState {
public:
State();
State(const State& other);
@@ -1673,8 +1659,7 @@ examples can be found on the LodePNG website.
#include "lodepng.h"
#include <iostream>
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
const char* filename = argc > 1 ? argv[1] : "test.png";
//load and decode
@@ -1693,8 +1678,7 @@ int main(int argc, char *argv[])
#include "lodepng.h"
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
unsigned error;
unsigned char* image;
size_t width, height;
@@ -1763,6 +1747,7 @@ yyyymmdd.
Some changes aren't backwards compatible. Those are indicated with a (!)
symbol.
+*) 30 dec 2018: code style changes only: removed newlines before opening braces.
*) 10 sep 2018: added way to inspect metadata chunks without full decoding.
*) 19 aug 2018 (!): fixed color mode bKGD is encoded with and made it use
palette index in case of palette.