Jo Engine  9
Jo Sega Saturn Engine
Data Structures | Macros | Functions
image.h File Reference

Jo Engine Image definition and tools. More...

Go to the source code of this file.

Data Structures

struct  jo_img
 15 bits image struct More...
 
struct  jo_img_8bits
 8 bits image struct More...
 
struct  jo_tile
 Struct of one tile (pos and size) More...
 

Macros

#define JO_TILE_COUNT(TILE_TABLE)
 Get tile count in table (see Tileset Demo) More...
 

Functions

void jo_replace_color (const jo_img *const img, const jo_color src_color, const jo_color dest_color)
 Add a sprite. More...
 
bool jo_bin_loader_from_stream (jo_img *img, char *stream, const jo_color transparent_color)
 Load a BIN image from stream. More...
 
int jo_sprite_add_bin_from_stream (char *stream, const jo_color transparent_color)
 Add a sprite from a BIN file. More...
 
void jo_free_img (jo_img *const img)
 Free an image loaded from CD. More...
 
static __jo_force_inline void jo_set_palette_register (const unsigned char palette_index, const jo_color color)
 Set palette index color. More...
 
static __jo_force_inline jo_color jo_get_palette_register (const unsigned char palette_index)
 Get palette color from index. More...
 

Detailed Description

Jo Engine Image definition and tools.

Author
Johannes Fetz
Bug:
No known bugs.

Data Structure Documentation

struct jo_img

15 bits image struct

Data Fields
jo_color * data
unsigned short height
unsigned short width
struct jo_img_8bits

8 bits image struct

Data Fields
unsigned char * data
unsigned short height
unsigned short width
struct jo_tile

Struct of one tile (pos and size)

Data Fields
unsigned short height
unsigned short width
unsigned short x
unsigned short y

Macro Definition Documentation

#define JO_TILE_COUNT (   TILE_TABLE)

Get tile count in table (see Tileset Demo)

Parameters
TILE_TABLEjo_tile[] TABLE

Function Documentation

bool jo_bin_loader_from_stream ( jo_img img,
char *  stream,
const jo_color  transparent_color 
)

Load a BIN image from stream.

Parameters
imgImage (set data to NULL for dynamic allocation)
streamRaw bin file contents
transparent_colorTransparent color (see colors.h). Use JO_COLOR_Transparent by default
Returns
true if succeeded otherwise false
void jo_free_img ( jo_img *const  img)

Free an image loaded from CD.

Parameters
imgPointer to an image struct
static __jo_force_inline jo_color jo_get_palette_register ( const unsigned char  palette_index)
static

Get palette color from index.

Parameters
palette_indexpalette Index from 1 to 255
Returns
color Color
void jo_replace_color ( const jo_img *const  img,
const jo_color  src_color,
const jo_color  dest_color 
)

Add a sprite.

Parameters
imgPointer to an image struct
src_colorColor to replace
dest_colorNew color
static __jo_force_inline void jo_set_palette_register ( const unsigned char  palette_index,
const jo_color  color 
)
static

Set palette index color.

Parameters
palette_indexpalette Index from 1 to 255
colorColor example for green: JO_COLOR_RGB(0, 63, 63)
int jo_sprite_add_bin_from_stream ( char *  stream,
const jo_color  transparent_color 
)

Add a sprite from a BIN file.

Parameters
streamRaw bin file contents
transparent_colorTransparent color (see colors.h). Use JO_COLOR_Transparent by default
Returns
Sprite Id or -1 if failed