/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for 
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #                                      
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Clear.h
    Author:  Copyright  1994 Jason Howat
    Version: 1.01 (30 Jun 1994)
    Purpose: Clear file manipulation routines.
*/


#ifndef __dl_clear_h
#define __dl_clear_h

#ifdef __cplusplus
extern "C" {
#endif


#ifndef __dl_wimp_h
#include "Wimp.h"
#endif


typedef struct
{
  char          *creator;
  unsigned      creatorversion;

  unsigned      width,
                height;
  unsigned      bpp;

  palette_entry *palette;
  unsigned char *bitmap;
} clear_picture;


void Clear_Init(char *creator, unsigned version);
/*
Initialises the Clear library with details of the Clear file creating
program -- only needed if you use Clear_Save().  creator is the name of
the program.  version is the version number of the program * 100.
*/


clear_picture *Clear_Load(char *filename);
/*
Attempt to read a picture from the given Clear file.  Returns NULL if
there is an error.
*/


void Clear_Save(clear_picture *picture, char *filename);
/*
Write the given picture to a file.
*/


clear_picture *Clear_Create(unsigned width, unsigned height, unsigned bpp);
/*
Allocate memory for a picture of the given dimensions.  Returns NULL if
it fails.
*/


void Clear_Free(clear_picture *picture);
/*
Deallocate all memory used by the given picture.
*/


#ifdef __cplusplus
}
#endif


#endif
