NetSurf
tinct.h
Go to the documentation of this file.
1/*
2 * Copyright 2005 Richard Wilson <info@tinct.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/*
20 * Complete details on using Tinct are available from http://www.tinct.net.
21 */
22
23/** \file
24 * Tinct SWI numbers and flags for version 0.11
25 */
26
27#ifndef _NETSURF_RISCOS_TINCT_H_
28#define _NETSURF_RISCOS_TINCT_H_
29
30
31/**
32 * Plots an alpha-blended sprite at the specified coordinates.
33 *
34 * -> R2 Sprite pointer
35 * R3 X coordinate
36 * R4 Y coordinate
37 * R7 Flag word
38*/
39#define Tinct_PlotAlpha 0x57240
40
41
42/**
43 * Plots a scaled alpha-blended sprite at the specified coordinates.
44 *
45 * -> R2 Sprite pointer
46 * R3 X coordinate
47 * R4 Y coordinate
48 * R5 Scaled sprite width
49 * R6 Scaled sprite height
50 * R7 Flag word
51 */
52#define Tinct_PlotScaledAlpha 0x57241
53
54
55/**
56 * Plots a sprite at the specified coordinates with a constant 0xff value for
57 * the alpha channel, ie without a mask.
58 *
59 * -> R2 Sprite pointer
60 * R3 X coordinate
61 * R4 Y coordinate
62 * R7 Flag word
63 */
64#define Tinct_Plot 0x57242
65
66/**
67 * Plots a scaled sprite at the specified coordinates with a constant 0xff value
68 * for the alpha channel, ie without a mask.
69 *
70 * -> R2 Sprite pointer
71 * R3 X coordinate
72 * R4 Y coordinate
73 * R5 Scaled sprite width
74 * R6 Scaled sprite height
75 * R7 Flag word
76 */
77#define Tinct_PlotScaled 0x57243
78
79
80/**
81 * Converts a paletted sprite into its 32bpp equivalent. Sufficient memory must
82 * have previously been allocated for the sprite (44 + width * height * 4).
83 * As sprites with 16bpp or 32bpp do not have palettes, conversion cannot be
84 * performed on these variants. All sprites must be supplied with a full palette,
85 * eg 8bpp must have 256 palette entries.
86 *
87 * -> R2 Source sprite pointer
88 * R3 Destination sprite pointer
89 */
90#define Tinct_ConvertSprite 0x57244
91
92
93/**
94 * Returns the features available to the caller by specifying bits in the flag
95 * word. The features available are unique for each mode, although the current
96 * version of Tinct supports the same subset of features for all modes.
97 *
98 * -> R0 Feature to test for, or 0 for all features
99 * <- R0 Features available
100 */
101#define Tinct_AvailableFeatures 0x57245
102
103
104/**
105 * Compresses an image using a fast algorithm. Sufficient memory must have been
106 * previously allocated for the maximum possible compressed size. This value is
107 * equal to 28 + (width * height * 4) * 33 / 32.
108 *
109 * -> R0 Source sprite pointer
110 * R2 Output data buffer
111 * R3 Output bytes available
112 * R7 Flag word (currently 0)
113 * <- R0 Size of compressed data
114 */
115#define Tinct_Compress 0x57246
116
117
118/**
119 * Decompresses an image previously compressed. Sufficient memory must have been
120 * previously allocated for the decompressed data (44 + width * height * 4) where
121 * width and height are available at +0 and +4 of the compressed data respectively.
122 *
123 * -> R0 Input data buffer
124 * R2 Output data buffer
125 * R7 Flag word (currently 0)
126 * <- R0 Size of decompressed data
127 */
128#define Tinct_Decompress 0x57247
129
130
131/* Plotting flags
132*/
133#define tinct_READ_SCREEN_BASE 0x01 /** <-- Use when hardware scrolling */
134#define tinct_BILINEAR_FILTER 0x02 /** <-- Perform bi-linear filtering */
135#define tinct_DITHER 0x04 /** <-- Perform dithering */
136#define tinct_ERROR_DIFFUSE 0x08 /** <-- Perform error diffusion */
137#define tinct_DITHER_INVERTED 0x0C /** <-- Perform dithering with inverted pattern */
138#define tinct_FILL_HORIZONTALLY 0x10 /** <-- Horizontally fill clipping region with image */
139#define tinct_FILL_VERTICALLY 0x20 /** <-- Vertically fill clipping region with image */
140#define tinct_FORCE_PALETTE_READ 0x40 /** <-- Use after a palette change when out of the desktop */
141#define tinct_USE_OS_SPRITE_OP 0x80 /** <-- Use when printing */
142
143/* Compression flags
144*/
145#define tinct_OPAQUE_IMAGE 0x01 /** <-- Image is opaque, compress further */
146
147/* Shifts
148*/
149#define tinct_BACKGROUND_SHIFT 0x08
150
151/* Sprite mode tinct
152 *
153 * Mode is: 32bpp 8:8:8:8 XXBBGGRR mode (a RISC OS 3.5+ type)
154 * We put alpha in the unused XX channel and Tinct treats it as alpha.
155 */
156#define tinct_SPRITE_MODE (os_mode)0x301680b5
157
158/* Sprite mode alpha
159 *
160 * Mode is: 32bpp 8:8:8:8 AABBGGRR mode (a RISC OS 5 type)
161 */
162#define alpha_SPRITE_MODE (os_mode)0x78608051
163#endif