Version: 1.0
Loading...
Searching...
No Matches
Palette read/save functions

Detailed Description

The functions in this section are used for reading and saving palette files.

Functions

OC_STATUS ocularLoadPalette (const char *filename, OcPalette *palette)
 
void ocularFreePalette (OcPalette *palette)
 Frees a palette.
 
OC_STATUS read_gimp_palette (const char *filename, OcPalette *palette_data)
 
OC_STATUS save_gimp_palette (const char *filename, const OcPalette *palette)
 
OC_STATUS read_riff_palette (const char *filename, OcPalette *palette)
 
OC_STATUS save_riff_palette (const char *filename, const OcPalette *palette)
 
OC_STATUS read_aco_palette (const char *filename, OcPalette *palette)
 
OC_STATUS save_aco_palette (const char *filename, const OcPalette *palette)
 
OC_STATUS read_paintnet_palette (const char *filename, OcPalette *palette_data)
 
OC_STATUS save_paintnet_palette (const char *filename, const OcPalette *palette)
 
OC_STATUS read_act_palette (const char *filename, OcPalette *palette)
 
OC_STATUS save_act_palette (const char *filename, const OcPalette *palette)
 
OC_STATUS read_ase_palette (const char *filename, OcPalette *palette)
 

Function Documentation

◆ ocularLoadPalette()

OC_STATUS ocularLoadPalette ( const char * filename,
OcPalette * palette )

Automatically detect palette format from a file and load palette.

Parameters
filenameThe path to the palette file.
paletteThe palette to load the data into.
Returns
OC_STATUS_OK if successful, otherwise an error code (see core.h)

◆ ocularFreePalette()

void ocularFreePalette ( OcPalette * palette)

Frees a palette.

Parameters
paletteThe palette to free.

◆ read_gimp_palette()

OC_STATUS read_gimp_palette ( const char * filename,
OcPalette * palette_data )

Read a GIMP palette file.

Parameters
filenameThe path to the GIMP palette file.
palette_dataThe palette to load the data into.

◆ save_gimp_palette()

OC_STATUS save_gimp_palette ( const char * filename,
const OcPalette * palette )

Save palette data to a GIMP palette file.

Parameters
filenameThe path to the file to write to.
paletteThe palette to save.

◆ read_riff_palette()

OC_STATUS read_riff_palette ( const char * filename,
OcPalette * palette )

Read a Microsoft RIFF palette file.

Parameters
filenameThe path to the RIFF palette file.
paletteThe palette to load the data into.

◆ save_riff_palette()

OC_STATUS save_riff_palette ( const char * filename,
const OcPalette * palette )

Save palette data to a Microsoft RIFF palette file.

Parameters
filenameThe path to the file to write to.
paletteThe palette to save.

◆ read_aco_palette()

OC_STATUS read_aco_palette ( const char * filename,
OcPalette * palette )

Read an Adobe Color Swatch (.aco) file.

Parameters
filenameThe path to the ACO file.
paletteThe palette to load the data into.

◆ save_aco_palette()

OC_STATUS save_aco_palette ( const char * filename,
const OcPalette * palette )

Save palette data to an Adobe Color Swatch (.aco) file. Currently only supports RGB colorspace

Parameters
filenameThe path to the file to write to.
paletteThe palette to save.

◆ read_paintnet_palette()

OC_STATUS read_paintnet_palette ( const char * filename,
OcPalette * palette_data )

Read a Paint.NET palette file.

Parameters
filenameThe path to the Paint.NET palette file.
palette_dataThe palette to load the data into.

◆ save_paintnet_palette()

OC_STATUS save_paintnet_palette ( const char * filename,
const OcPalette * palette )

Save palette data to a Paint.NET palette file.

Parameters
filenameThe path to the file to write to.
paletteThe palette to save.

◆ read_act_palette()

OC_STATUS read_act_palette ( const char * filename,
OcPalette * palette )

Read an Adobe Color Table (.act) file.

Parameters
filenameThe path to the ACT file.
paletteThe palette to load the data into.

◆ save_act_palette()

OC_STATUS save_act_palette ( const char * filename,
const OcPalette * palette )

Save palette data to an Adobe Color Table (.act) file.

Parameters
filenameThe path to the file to write to.
paletteThe palette to save.

◆ read_ase_palette()

OC_STATUS read_ase_palette ( const char * filename,
OcPalette * palette )

Read an Adobe Swatch Exchange (.ase) file. Currently only supports RGB and Grayscale color spaces.

Parameters
filenameThe path to the ASE file.
paletteThe palette to load the data into.