OPNGTRANS is a PNG Transformer. More...
#include "opngcore.h"
Go to the source code of this file.
Typedefs | |
typedef struct opng_transformer | opng_transformer_t |
The transformer type. | |
Functions | |
opng_transformer_t * | opng_create_transformer (void) |
Creates a transformer object. | |
void | opng_set_transformer (opng_optimizer_t *optimizer, opng_transformer_t *transformer) |
Sets the transformer in an optimizer object. | |
int | opng_transform_set_object (opng_transformer_t *transformer, const char *object_name_eq_value, size_t *err_objname_offset_ptr, size_t *err_objname_length_ptr, const char **err_message_ptr) |
Specifies an object to be set to a given value by the given transformer. | |
int | opng_transform_reset_objects (opng_transformer_t *transformer, const char *object_names, size_t *err_objname_offset_ptr, size_t *err_objname_length_ptr, const char **err_message_ptr) |
Specifies a list of objects to be reset by the given transformer. | |
int | opng_transform_strip_objects (opng_transformer_t *transformer, const char *object_names, size_t *err_objname_offset_ptr, size_t *err_objname_length_ptr, const char **err_message_ptr) |
Specifies a list of objects to be stripped by the given transformer. | |
int | opng_transform_protect_objects (opng_transformer_t *transformer, const char *object_names, size_t *err_objname_offset_ptr, size_t *err_objname_length_ptr, const char **err_message_ptr) |
Specifies a list of objects to be protected (i.e. | |
const opng_transformer_t * | opng_seal_transformer (opng_transformer_t *transformer) |
Seals a transformer object. | |
void | opng_destroy_transformer (opng_transformer_t *transformer) |
Destroys a transformer object. | |
OPNGTRANS is a PNG Transformer.
Copyright (C) 2001-2011 Cosmin Truta.
This software is distributed under the zlib license. Please see the accompanying LICENSE file, or visit http://www.opensource.org/licenses/zlib-license.php
typedef struct opng_transformer opng_transformer_t |
The transformer type.
A transformer object can be used to apply transformations to the image properties or to the image contents.
Currently-supported transformations are: erasing channels (alpha channel only) and stripping metadata.
Other transformations, hopefully to be implemented in some future, are: erasing other channels (e.g. chroma), altering the sample precision (e.g. 16-to-8 bits for all channels, any-to-1 bit for the alpha channel), etc.
opng_transformer_t* opng_create_transformer | ( | void | ) |
Creates a transformer object.
NULL
on failure. void opng_destroy_transformer | ( | opng_transformer_t * | transformer | ) |
Destroys a transformer object.
transformer | the transformer object to be destroyed. |
const opng_transformer_t* opng_seal_transformer | ( | opng_transformer_t * | transformer | ) |
Seals a transformer object.
transformer | the transformer object to be sealed. |
void opng_set_transformer | ( | opng_optimizer_t * | optimizer, |
opng_transformer_t * | transformer | ||
) |
Sets the transformer in an optimizer object.
optimizer | the optimizer object whose transformer is changed. By default, the optimizer has a NULL transformer. |
transformer | the transformer to be changed. It can be NULL , which means that the optimized images are not altered. |
int opng_transform_protect_objects | ( | opng_transformer_t * | transformer, |
const char * | object_names, | ||
size_t * | err_objname_offset_ptr, | ||
size_t * | err_objname_length_ptr, | ||
const char ** | err_message_ptr | ||
) |
Specifies a list of objects to be protected (i.e.
not stripped) by the given transformer. For example, it is possible to strip all metadata, but protect sRGB
and iCCP
. These objects will be added to (not replace) any previously-specified list of objects. Only metadata objects can be protected.
transformer | the transformer object. |
object_names | a comma- or semicolon-separated enumeration of object names. |
err_objname_offset_ptr | in case of failure, shall point to the erroneous object within object_names . |
err_objname_length_ptr | in case of failure, shall store the length of the erroneous object. |
err_message_ptr | in case of failure, may point to an error message. |
int opng_transform_reset_objects | ( | opng_transformer_t * | transformer, |
const char * | object_names, | ||
size_t * | err_objname_offset_ptr, | ||
size_t * | err_objname_length_ptr, | ||
const char ** | err_message_ptr | ||
) |
Specifies a list of objects to be reset by the given transformer.
This list of objects will be added to (not replace) any previously-specified list of objects. Only image data objects can be reset.
transformer | the transformer object. |
object_names | a comma- or semicolon-separated enumeration of object names. |
err_objname_offset_ptr | in case of failure, shall point to the erroneous object within object_names . |
err_objname_length_ptr | in case of failure, shall store the length of the erroneous object. |
err_message_ptr | in case of failure, may point to an error message. |
int opng_transform_set_object | ( | opng_transformer_t * | transformer, |
const char * | object_name_eq_value, | ||
size_t * | err_objname_offset_ptr, | ||
size_t * | err_objname_length_ptr, | ||
const char ** | err_message_ptr | ||
) |
Specifies an object to be set to a given value by the given transformer.
Only image data objects can be reset.
transformer | the transformer object. |
object_name_eq_value | an expression in the form "name=value". |
err_objname_offset_ptr | in case of failure, shall point to the erroneous object within object_name_eq_value . |
err_objname_length_ptr | in case of failure, shall store the length of the erroneous object. |
err_message_ptr | in case of failure, may point to an error message. |
int opng_transform_strip_objects | ( | opng_transformer_t * | transformer, |
const char * | object_names, | ||
size_t * | err_objname_offset_ptr, | ||
size_t * | err_objname_length_ptr, | ||
const char ** | err_message_ptr | ||
) |
Specifies a list of objects to be stripped by the given transformer.
These objects will be added to (not replace) any previously-specified list of objects. Only metadata objects can be stripped.
transformer | the transformer object. |
object_names | a comma- or semicolon-separated enumeration of object names. |
err_objname_offset_ptr | in case of failure, shall point to the erroneous object within object_names . |
err_objname_length_ptr | in case of failure, shall store the length of the erroneous object. |
err_message_ptr | in case of failure, may point to an error message. |