home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
graphics
/
randjpeg_1
/
source
/
h
/
internal
next >
Wrap
Text File
|
1996-01-21
|
3KB
|
114 lines
/* internal.h
* AUTHOR: Cy Booker, cy@cheepnis.demon.co.uk
* LICENSE: FreeWare, Copyright (c) 1996 Cy Booker
* PURPOSE: common code
*/
#ifndef internal_h
#define internal_h
#include "main.h"
#include "OS:hourglass.h"
#include "OS:macros.h"
#include "OS:types.h"
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
typedef struct process_image process_image;
typedef struct rgbtuple rgbtuple;
typedef bits (*rgbtuple_fn)(rgbtuple *, int r, int g, int b);
struct process_image {
byte *buffer; /* i/o (must be word-aligned) */
int pixel_width; /* > 0 */
int pixel_height; /* > 0 */
int source_line_length; /* must be multiple of 4 */
int dest_line_length;
rgbtuple_fn fn;
};
struct rgbtuple {
int red;
int grn;
int blu;
};
extern rgbtuple default_wimp_palette_as_tuples[256];
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* defined in s.map
*/
extern bits map_scaled_rgb_to_8bpp_colour_number_quick(
rgbtuple *out,
int red,
int green,
int blue);
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* defined in s.mapchangefsi
*/
extern bits map_scaled_rgb_to_8bpp_colour_number_changefsi(
rgbtuple *out,
int red,
int green,
int blue);
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
extern void process_image_8bpp_burkes(const process_image *p);
extern void process_image_8bpp_dither2x2(const process_image *p);
extern void process_image_8bpp_floyd_steinberg(const process_image *p);
extern void process_image_8bpp_nearest(const process_image *p);
extern void process_image_8bpp_jarvis_judice_ninke(const process_image *p);
extern void process_image_8bpp_nearest(const process_image *p);
extern void process_image_8bpp_stucki(const process_image *p);
extern void process_image_8bpp_sierra3(const process_image *p);
extern void process_image_8bpp_sierra2(const process_image *p);
extern void process_image_8bpp_sierra2_4a(const process_image *p);
#define INPUT \
colour = source[x]; /* source pixel &ttbbggrr */\
red = (colour >> (0*8)) & 0xff; red |= red << 8; /* scale to internal representation */\
grn = (colour >> (1*8)) & 0xff; grn |= grn << 8;\
blu = (colour >> (2*8)) & 0xff; blu |= blu << 8
#define PROCESS \
dest[x] = (*fn)(&error, red, grn, blu); /* write pixel */\
red = error.red; /* error */\
grn = error.grn;\
blu = error.blu
#endif /* internal_h */