Main Page   File List   Globals  

libinfo.c File Reference

Library functions. More...

#include "libinfo.h"

Include dependency graph for libinfo.c:

Include dependency graph

Go to the source code of this file.

Functions

int LIReadDefIcon (char *filename)
 Read images from a default icon.

int LIReadNewIcon (char *filename)
 Read images from a NewIcon.

int LISetXPMTransparency (int colour)
 Set transparent colour for XPM output.

int LIWriteXPM (char *filename, int image)
 Write icon image to XPM image.

int LIWritePPM (char *filename, int image)
 Write icon image to PPM image.

void LICleanUp (void)
 Release memory and clean up.

char * LIGetVersion (void)
 Get the library version.

char * LIGetDate (void)
 Get the library release date.

char * LIGetCopyright (void)
 Get the library copyright.

u16 Get16 (u8 *p)
u32 Get32 (u8 *p)
int Read8 (u8 *buf, int len)
int ReadHeader ()
int WritePPM (char *filename, int width, int height, int ncols, u8 *palette, int image)
int WriteXPM (char *filename, int width, int height, int ncols, u8 *palette, int image)
int ReadIcon (int image)
char * ReadString ()
int StartTooltypes ()
u8 * GetTooltype (char *name)
u8 * DecompressNewicon (u8 *src, char *name, int len, int bits)
int ReadNewicon (int image, char *name)

Variables

int transparent = -1
u8 mwb_palette []


Detailed Description

Library functions.

libinfo - a library to read Amiga icon files.

Copyright (C) 2003 Gary Harris <garyjharris@users.sourceforge.net>.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

libinfo recognizes the default Workbench and NewIcons formats.

libinfo is based on:

amicon: an Amiga icon to ppm/xpm convertor. Copyright 2001 Adam Sampson <azz@gnu.org>

Definition in file libinfo.c.


Function Documentation

void LICleanUp void   ) 
 

Release memory and clean up.

Returns:
Nil.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 209 of file libinfo.c.

References LIBitmapSelected, LIBitmapUnselected, and LIPalette.

char* LIGetCopyright void   ) 
 

Get the library copyright.

Returns:
The library copyright.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 257 of file libinfo.c.

char* LIGetDate void   ) 
 

Get the library release date.

Returns:
Library creation date.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 242 of file libinfo.c.

char* LIGetVersion void   ) 
 

Get the library version.

Returns:
The version number.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 226 of file libinfo.c.

int LIReadDefIcon char *  filename  ) 
 

Read images from a default icon.

Parameters:
filename - The path to the icon.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 68 of file libinfo.c.

References LI_SELECTED, LI_UNSELECTED, and LIErrorString.

int LIReadNewIcon char *  filename  ) 
 

Read images from a NewIcon.

Parameters:
filename - The path to the icon.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
4/12/03
Remarks:
4/12/03 - Added missing code that prevents a crash due to spurious num_tooltypes values.

Definition at line 103 of file libinfo.c.

References LI_SELECTED, LI_UNSELECTED, and LIErrorString.

int LISetXPMTransparency int  colour  ) 
 

Set transparent colour for XPM output.

Parameters:
colour - the colour to make transparent.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 144 of file libinfo.c.

References LIErrorString, and LINumColours.

int LIWritePPM char *  filename,
int  image
 

Write icon image to PPM image.

Parameters:
filename - path to output image.
image - constant identifying the image to write. LI_UNSELECTED or LI_SELECTED.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 192 of file libinfo.c.

References LIHeight, LINumColours, LIPalette, and LIWidth.

int LIWriteXPM char *  filename,
int  image
 

Write icon image to XPM image.

Parameters:
filename - path to output image.
image - constant identifying the image to write. LI_UNSELECTED or LI_SELECTED.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 170 of file libinfo.c.

References LIHeight, LINumColours, LIPalette, and LIWidth.


Variable Documentation

u8 mwb_palette[]
 

Initial value:

 {
    149, 149, 149,
    0, 0, 0,
    255, 255, 255,
    59, 103, 162,
    123, 123, 123,
    175, 175, 175,
    170, 144, 124,
    255, 169, 151
}
Magic Workbench palette

Definition at line 40 of file libinfo.c.


Generated on Tue Dec 23 15:34:26 2003 for LibInfo by doxygen1.3