mightymandel v16

GPU-based Mandelbrot set explorer

png.c File Reference

(v16)

#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include "crc.h"
#include "png.h"
+ Include dependency graph for png.c:

Go to the source code of this file.

Macros

#define INT(l)   { l >> 24 & 0xff, l >> 16 & 0xff, l >> 8 & 0xff, l & 0xff }

Functions

int png_iTXt_length (const char *keyword, const char *text)
 Determine length of a serialized PNG iTXt chunk.
bool png_iTXt (const char *keyword, const char *text, unsigned char *chunk, int length)
 Serialize a PNG iTXt chunk.

Macro Definition Documentation

#define INT (   l)    { l >> 24 & 0xff, l >> 16 & 0xff, l >> 8 & 0xff, l & 0xff }

Function Documentation

bool png_iTXt ( const char *  keyword,
const char *  text,
unsigned char *  chunk,
int  length 
)

Serialize a PNG iTXt chunk.

http://www.w3.org/TR/PNG/#5Chunk-layout http://www.w3.org/TR/PNG/#11iTXt

Parameters
keywordThe keyword for the chunk.
textThe text for the chunk.
chunkBuffer for output.
lengthLength of the buffer.
Returns
true if the buffer was large enough, false otherwise.

Definition at line 20 of file png.c.

References crc(), and INT.

+ Here is the call graph for this function:

int png_iTXt_length ( const char *  keyword,
const char *  text 
)

Determine length of a serialized PNG iTXt chunk.

Parameters
keywordThe keyword for the chunk.
textThe text for the chunk.
Returns
The length of the chunk.

Definition at line 12 of file png.c.