br_pixelmap
typedef
pixelmap.h
for precise declaration and ordering)
br_uint_8 type Individual pixel type
br_uint_8 flags
br_int_16 origin_x, origin_y Local origin (centre), relative to base_x, base_y
br_uint_16 width, height Size of pixel map (in pixels)
void * pixels A pointer to raw pixel data
br_int_16 row_bytes The difference in bytes between pixels at the same column of adjacent rows
br_uint_16 base_x, base_y Co-ordinates of the region of pixels in use
br_pixelmap * map A pointer to a colour map, used when pixel colours are indexed
char * identifier An optional name for texture maps and tables
void * user User data (application dependent)
void * device A device pointer, used if the pixel map originated from a device
BrZbSceneRenderBegin()
34
, BrZbSceneRender()
34
.
BrPixelmapDoubleBuffer()
44
, BrPixelmapDirtyRectangleCopy()
42
, BrPixelmapDirtyRectangleFill()
42
, BrScenePick2D()
84
.
br_material
151
.
All values are written with the most significant bit to the left.
The Encoding column represents the 32 bit value to be supplied as Members
Behaviour
This member defines the type of data stored for each pixel in the pixel map. The various types have values defined by the following symbols:br_uint_8 type
colour
to functions such as BrPixelmapPixelSet()
277pixels
. The dots represent further pixels. The ordering of bytes pixel maps is independent of word byte order, except in the case of depth buffers, in which pixels are read and written as 32 bit values. This means that in a 16 bit depth buffer the least significant 16 bits are lost.
Note, with respect to pixel maps used as textures, that zero pixels (irrespective of any palette information) are not rendered, and so have the effect of transparency. This only applies to textures and not to pixel map operations such as BrPixelmapCopy()
280.
br_uint_8 flags
BR_BMF_NO_ACCESS
which will be set if the pixel data is stored at pixels
. If not set then pixels
is invalid and there is no direct access to pixel data.
br_int_16 origin_x, origin_y
base_x
, base_y
). Thus a point plotted at (0,0) will be plotted at column origin_x
from base_x
. The co-ordinate origin also effectively defines the centre of projection when used as a rendering destination.
br_uint_16 width, height
void * pixels
flags
), this member points to an area of memory containing the raw pixel data. It either points to the start of the memory occupied by the pixel map or the last row_bytes
of it. However, it always points to the byte of the left hand pixel of the `first' row. For instance, in monochrome pixel maps it will point to the byte whose most significant bit represents the left hand pixel of the first row. In true colour pixel maps it will point to the least significant byte of the colour of the left hand pixel of the first row, which will be the blue component in BR_PMT_RGB_888
pixel maps and the alpha component in BR_PMT_RGBA_8888
pixel maps.
br_int_16 row_bytes
br_uint_16 base_x, base_y
base_y
as a number of row_bytes
, and base_x
as a smaller offset from this.
br_pixelmap * map
BR_PMT_INDEX_?
), this member points to a colour map. This is used to obtain the `true colour' corresponding to a particular index.
char * identifier
Null
if not required).
If the pixel map is loaded or imported, the identifier
will have been set using BrResStrDup()
49.
void * user
Null
upon allocation (if allocated by BRender), and not accessed by BRender thereafter.
void * device
A pointer to the pixel map to be filled.
Value to set each pixel to.
A pointer to the destination pixel map.
Co-ordinates of the rectangle's top left corner.
Rectangle width and height (in pixels).
Value to set each pixel to.
A pointer to the destination pixel map.
Co-ordinates of the line's endpoints.
Value to set each pixel in the line to.
A pointer to the destination pixel map.
Pixel co-ordinates.
Pixel value.
A pointer to the source pixel map from which to read the pixel.
Pixel co-ordinates.
Pixel value. If the point is off-screen, zero will be returned.
A pointer to the destination pixel map.
Co-ordinates of text's top left corner.
Value to set each text pixel to.
A pointer to a BRender font, or
The following pointers are available:
See
A string.
A pointer to the destination pixel map.
Co-ordinates of text's top left corner.
Value to set each text pixel to.
A pointer to a BRender font, or
The following pointers are available:
See
A format string (as for
A pointer to a pixel map.
A pointer to a BRender font, or
A string.
Returns the string width in pixels. If the
A pointer to a pixel map.
A pointer to a BRender font, or
A pointer to the destination pixel map.
A pointer to the source pixel map.
A pointer to the destination pixel map.
Co-ordinates of the destination rectangle's top left corner.
A pointer to the source pixel map.
Co-ordinates of the source rectangle's top left corner.
Rectangle width and height (in pixels).
Colour maps and shade tables that have been added to the registry may be accessed by BRender during rendering.
If any changes are made to colour maps or shade tables involved in rendering, they must be updated before the next rendering in which they are involved.
Note that while texture maps and shade tables are pixel maps, the reverse does not apply. A pixel map is only a texture map by virtue of being added to the registry as such. Similarly with a shade table. Most importantly, a pixel map cannot be both! A texture map must be removed from the registry for it to become just a pixel map, and only then could it be added as a shade table. The same applies with roles interchanged. Note that this just applies to the instance of the
A pointer to a texture map.
Returns a pointer to the added texture map, else
Operations
Description:
Fill a pixel map with a given value.BrPixelmapFill()
void BrPixelmapFill(br_pixelmap* dat, br_uint_32 colour)
br_pixelmap * dat
br_uint_32 colour
Description:
Fill a rectangular window in a pixel map with a given value.BrPixelmapRectangleFill()
void BrPixelmapRectangleFill(br_pixelmap* dst, br_int_16 x, br_int_16 y, br_uint_16 w, br_uint_16 h, br_uint_32 colour)
br_pixelmap * dst
br_int_16 x,y
br_uint_16 w,h
br_uint_32 colour
br_int_16 x,y;
br_uint_16 w,h;
br_pixelmap *offscreen;
...
BrPixelmapRectangleFill(offscreen,x,y,w,h,0);
Description:
Draw a line in a pixel map between (x1,y1) and (x2,y2), clipping it to the edges of the pixel map if necessary.BrPixelmapLine()
void BrPixelmapLine(br_pixelmap* dst, br_int_16 x1, br_int_16 y1, br_int_16 x2, br_int_16 y2, br_uint_32 colour)
br_pixelmap * dst
br_int_16 x1,y1,x2,y2
br_uint_32 colour
Description:
Set a pixel to a given value.BrPixelmapPixelSet()
void BrPixelmapPixelSet(br_pixelmap* dst, br_int_16 x, br_int_16 y, br_uint_32 colour)
br_pixelmap * dst
br_int_16 x,y
br_uint_32 colour
Description:
Get the value of a particular pixelBrPixelmapPixelGet()
br_uint_32 BrPixelmapPixelGet(const br_pixelmap* src, br_int_16 x, br_int_16 y)
const br_pixelmap * src
br_int_16 x,y
br_uint_32 colour
Description:
Write a string into a pixel map in a given font.BrPixelmapText()
void BrPixelmapText(br_pixelmap* dst, br_int_16 x, br_int_16 y, br_uint_32 colour, const br_font* font, const char* text)
br_pixelmap * dst
br_int_16 x,y
br_uint_32 colour
const br_font * font
Null
for the default font.BrFontFixed3x5
BrFontProp4x6
BrFontProp7x9
brfont.h
for precise declaration.const char * text
br_uint_32 colour;
br_pixelmap *pmap;
...
BrPixelmapText(pmap,0,0,colour,BrFontProp7x9,"Example text...");
Description:
Write a `BrPixelmapTextF()
printf
' formatted string into a pixel map in a given font. The function will accept format strings and arguments just as for the standard printf()
function.void BrPixelmapTextF(br_pixelmap* dst, br_int_16 x, br_int_16 y, br_uint_32 colour, const br_font* font, const char* fmt, ...)
br_pixelmap * dst
br_int_16 x, y
br_uint_32 colour
const br_font * font
Null
for the default font.BrFontFixed3x5
BrFontProp4x6
BrFontProp7x9
brfont.h
for precise declaration.const char * fmt
printf()
).
br_uint_32 colour;
br_pixelmap *pmap;
...
BrPixelmapTextF
( pmap,0,0,255,NULL,"Frames/Sec = %16g Polys/Sec = %16g"
, TIMING_FRAMES/((end_time-start_time)/(double)CLOCK_RATE)
, total_faces /((end_time-start_time)/(double)CLOCK_RATE)
);
Description:
Find the width of a string for a given font and pixel map.BrPixelmapTextWidth()
br_uint_16 BrPixelmapTextWidth(const br_pixelmap* dst, const br_font* font, const char* text)
const br_pixelmap * dst
const br_font * font
Null
for the default font.const char * text
br_uint_16
text
argument is Null
, the width of one character is returned.BrPixelmapText()
277
Description:
Find the height of a font for a given pixel map.BrPixelmapTextHeight()
br_uint_16 BrPixelmapTextHeight(const br_pixelmap* dst, const br_font* font)
const br_pixelmap * dst
const br_font * font
Null
for the default font.BrPixelmapText()
277
Copy/Assign
The br_pixelmap
272 structure should not be copied by structure assignment. Copies should only be made via construction. However, the pixels may be copied, in whole or in part using the following functions.
Description:
Copy the data in one pixel map to another. The source and destination pixel maps must have the same type and dimensions.BrPixelmapCopy()
void BrPixelmapCopy(br_pixelmap* dst, const br_pixelmap* src)
br_pixelmap * dst
const br_pixelmap * src
br_pixelmap *offscreen, *backdrop;
...
BrPixelmapCopy(offscreen, backdrop);
Description:
Copy a rectangular window from one pixel map to another.BrPixelmapRectangleCopy()
void BrPixelmapRectangleCopy (br_pixelmap* dst, br_int_16 dx, br_int_16 dy, const br_pixelmap* src, br_int_16 sx, br_int_16 sy, br_uint_16 w, br_uint_16 h)
br_pixelmap * dst
br_int_16 dx,dy
const br_pixelmap * src
br_int_16 sx,sy
br_uint_16 w,h
Access & Maintenance
Colour or texture maps and shade tables must be added to the registry if they are involved in rendering a scene. They should not be modified during rendering.br_pixelmap
272
Description:
Add a texture map to the registry, updating it as necessary. All texture maps must be added to the registry before they are subsequently involved in rendering.BrMapAdd()
br_pixelmap* BrMapAdd(br_pixelmap* pixelmap)
br_pixelmap * pixelmap
br_pixelmap *
Null
if unsuccessful.BrMapUpdate()
282,
BrMapAddMany()
282BrPixelmapLoad()
295BrMapFind()
289BrMapRemove()
282.
A pointer to an array of pointers to texture maps.
Number of texture maps to add to the registry.
Returns the number of texture maps added successfully.
Description:
Add a number of texture maps to the registry, updating them as necessary.BrMapAddMany()
br_uint_32 BrMapAddMany(br_pixelmap* const* pixelmaps, int n)
br_pixelmap * const * pixelmaps
int n
br_uint_32
BrMapUpdate()
282,
BrMapAdd()
281,
BrMapRemove()
282,
BrMapRemoveMany()
283
A pointer to a texture map.
Texture map update flags. In general,
Description:
Update a texture map.BrMapUpdate()
void BrMapUpdate(br_pixelmap* pixelmap, br_uint_16 flags)
br_pixelmap * pixelmap
br_uint_16 flags
BR_MAPU_ALL
should be used.BrMapAdd()
281.
A pointer to a texture map.
Returns a pointer to the item removed.
Description:
Remove a texture map from the registry.BrMapRemove()
br_pixelmap* BrMapRemove(br_pixelmap* pixelmap)
br_pixelmap * pixelmap
br_pixelmap *
BrMapAdd()
281
A pointer to an array of pointers to texture maps.
Number of texture maps to remove from the registry.
Returns the number of texture maps removed successfully.
Description:
Remove a number of texture maps from the registry.BrMapRemoveMany()
br_uint_32 BrMapRemoveMany(br_pixelmap* const* pixelmaps, int n)
br_pixelmap * const * pixelmaps
int n
br_uint_32
BrMapAddMany()
282
A pointer to a shade table.
Returns a pointer to the added shade table, else
Description:
Add a shade table to the registry, updating it as necessary. All shade tables must be added to the registry before they are used subsequently.BrTableAdd()
br_pixelmap* BrTableAdd(br_pixelmap* pixelmap)
br_pixelmap * pixelmap
br_pixelmap *
Null
if unsuccessful.BrTableUpdate()
284,
BrTableAddMany()
283,
BrPixelmapLoad()
295,
BrTableFind()
292,
BrTableRemove()
284
A pointer to an array of pointers to shade tables.
Number of shade tables to add to the registry.
Returns the number of shade tables added successfully.
Description:
Add a number of shade tables to the registry, updating them as necessary.BrTableAddMany()
br_uint_32 BrTableAddMany(br_pixelmap* const* pixelmaps, int n)
br_pixelmap * const * pixelmaps
int n
br_uint_32
BrTableUpdate()
284,
BrTableAdd()
283,
BrTableRemove()
284,
BrTableRemoveMany()
284
A pointer to a shade table.
Shade table update flags. In general,
Description:
Update a shade table.BrTableUpdate()
void BrTableUpdate(br_pixelmap* pixelmap, br_uint_16 flags)
br_pixelmap * pixelmap
br_uint_16 flags
BR_TABU_ALL
should be used.BrTableAdd()
283.
A pointer to a shade table.
Returns a pointer to the shade table removed.
Description:
Remove a shade table from the registry.BrTableRemove()
br_pixelmap* BrTableRemove(br_pixelmap* pixelmap)
br_pixelmap * pixelmap
br_pixelmap *
BrTableAdd()
283
A pointer to an array of pointers to shade tables.
Number of shade tables to remove from the registry.
Returns the number of shade tables removed successfully.
Description:
Remove a number of shade tables from the registry.BrTableRemoveMany()
br_uint_32 BrTableRemoveMany(br_pixelmap* const* pixelmaps, int n)
br_pixelmap * const * pixelmaps
int n
br_uint_32
BrTableAddMany()
283
Pixel map type.
Width in pixels.
Height in pixels.
A pointer to an existing block of memory. If
The calculation obtaining the minimum size required for the block of memory is non-obvious. It is Initialisation
The structure is initialised by the various construction functions. Pixel maps should not be created or initialised by any other means. Construction & Destruction
Apart from platform specific functions, pixel maps should only be constructed by the following BRender functions. Destruction should naturally be performed by the corresponding `free' function, usually BrPixelmapFree()
287. Note that texture maps and shade tables should be removed from the registry before destruction.
Description:
Allocate a new pixel map.BrPixelmapAllocate()
br_pixelmap* BrPixelmapAllocate(br_uint_8 type, br_uint_16 w, br_uint_16 h, void* pixels, int flags)
br_uint_8 type
br_uint_16 w
br_uint_16 h
void * pixels
Null
, the pixel memory is allocated automatically using BrResAllocate()
48row_bytes
*h
., and row_bytes
is not simply w
*bits-per-pixel/8. To determine row_bytes
, it is probably simplest to call this function with a dummy, non-Null
pointer (address of an automatic, say), and record the value of row_bytes
returned in the br_pixelmap
272pixels
is not accessed by this function.
int flags
Supply either
Returns a pointer to the new pixel map, or
A pointer to an existing pixel map.
Co-ordinates of the top left of the new pixel map in the existing pixel map.
Width and height of the new pixel map.
Returns a pointer to the new pixel map, or
A pointer to the source pixel map.
The type of matching pixel map required.
Returns a pointer to the matching pixel map.
A pointer to the source pixel map.
Returns a pointer to the new pixel map.
A pointer to a pixel map.
A pointer to a pixel map.
Returns the size of each pixel, in bits.
A pointer to a pixel map.
Returns a mask giving the available channels, being a combination of the following bit value symbols:
Search pattern.
Returns the number of texture maps matching the search pattern.
Search pattern.
A pointer to a call-back function.
An optional argument to pass to the call-back function.
Returns the first non-zero call-back return value, or zero if all matching texture maps are enumerated.
Search pattern.
Returns a pointer to the texture map if found, otherwise
Search pattern.
A pointer to an array of pointers to texture maps.
Maximum number of texture maps to find.
Returns the number of texture maps found. The pointer array is filled with pointers to the found texture maps.
A pointer to a call-back function.
For example, a call-back could be set up to return a default texture map if the desired texture map cannot be found in the registry.BR_PMAF_NORMAL
or BR_PMAF_INVERTED
. If the latter, the function will automatically set the pixels
member of the returned pixel map (whether supplied or not) to be at the start of the final row of pixel map memory (row_bytes
is negative).
br_pixelmap *
Null
if unsuccessful.
Description:
Allocate a pixel map as part of an existing pixel map. The new pixel map is clipped to the existing pixel map.BrPixelmapAllocateSub()
br_pixelmap* BrPixelmapAllocateSub(br_pixelmap* pm, br_uint_16 x, br_uint_16 y, br_uint_16 w, br_uint_16 h)
br_pixelmap * pm
br_uint_16 x,y
br_uint_16 w,h
br_pixelmap *
Null
if unsuccessful.
Description:
Given a pixel map, allocate either a depth buffer or an off-screen colour buffer with the same dimensions.BrPixelmapMatch()
br_pixelmap* BrPixelmapMatch(const br_pixelmap* src, int match_type)
const br_pixelmap * src
int match_type
br_pixelmap *
Description:
Create a pixel map of the same type and dimensions and copy the pixel data.BrPixelmapClone()
br_pixelmap* BrPixelmapClone(const br_pixelmap* src)
const br_pixelmap * src
br_pixelmap *
br_pixelmap *image, *working_copy;
...
image = BrPixelmapLoad("backdrop.pix");
working_copy = BrPixelmapClone(image);
Description:
Deallocate a pixel map and any associated memory.BrPixelmapFree()
void BrPixelmapFree(br_pixelmap* pmap)
br_pixelmap * pmap
Supplementary
Description:
Find the pixel size for a given pixel map.BrPixelmapPixelSize()
br_uint_16 BrPixelmapPixelSize(const br_pixelmap* pm)
const br_pixelmap * pm
br_uint_16
Description:
Find the channels available for a given pixel map.BrPixelmapChannels()
br_uint_16 BrPixelmapChannels(const br_pixelmap* pm)
const br_pixelmap * pm
br_uint_16
Description:
Count the number of registered texture maps whose names match a given search pattern. The search pattern can include the standard wild cards `*' and `?'.BrMapCount()
br_uint_32 BrMapCount(const char* pattern)
const char * pattern
br_uint_32
BrMapEnum()
289,
BrMapFind()
289
Description:
Calls a call-back function for every texture map matching a given search pattern. The call-back is passed a pointer to each matching item, and its second argument is an optional pointer supplied by the user. The search pattern can include the standard wild cards `*' and `?'. The call-back itself returns a BrMapEnum()
br_uint_32
348 value. The enumeration will halt at any stage if the return value is non-zero.
br_uint_32 BrMapEnum(const char* pattern, br_map_enum_cbfn* callback, void* arg)
const char * pattern
br_map_enum_cbfn * callback
void * arg
br_uint_32
br_uint_32 BR_CALLBACK test_callback(br_pixelmap* map, void* arg)
{ br_uint_32 count;
...
return(count);
}
...
{ br_uint_32 enum;
...
enum = BrMapEnum("map",&test_callback,NULL);
}
Description:
Find a texture map in the registry by name. A call-back function can be setup to be called if the search is unsuccessful. The search pattern can include the standard wild cards `*' and `?'.BrMapFind()
br_pixelmap* BrMapFind(const char* pattern)
const char * pattern
br_pixelmap *
Null
. If a call-back exists and is called, the call-back's return value is returned.BrMapFindHook()
290,
BrMapFindMany()
290
Description:
Find a number of texture maps in the registry by name. The search pattern can include the standard wild cards `*' and `?'.BrMapFindMany()
br_uint_32 BrMapFindMany(const char* pattern, br_pixelmap** pixelmaps, int max)
const char * pattern
br_pixelmap ** pixelmaps
int max
br_uint_32
BrMapFind()
289,
BrMapFindHook()
290
Description:
Functions to set up a call-back.BrMapFindHook()
br_map_find_cbfn* BrMapFindHook(br_map_find_cbfn* hook)
br_map_find_cbfn * hook
BrMapFind()
289 is unsuccessful and a call-back has been set up, the call-back is passed the search pattern as its only argument. The call-back should then return a pointer to a substitute or default texture map.
Result:
br_map_find_cbfn *
Returns a pointer to the old call-back function.
Example:
br_map BR_CALLBACK * test_callback(char* pattern) { br_map* default_map; ... return(default_map); } ... { br_map* map; ... BrMapFindHook(&test_callback); map = BrMapFind("non_existent_map"); }See Also:
BrMapFindFailedLoad()
291
Description:
This function is provided as a suitable function to supply to BrMapFindFailedLoad()
BrMapFindHook()
290.
Declaration:
br_pixelmap* BrMapFindFailedLoad(const char* name)
Arguments:
const char * name
The name supplied to BrMapFind()
289.
Effects: Attempts to load the texture map from the filing system using
name
as the filename. Searches in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined). If successful, sets this name as the identifier of the loaded texture map and adds the texture map to the registry.Result:
br_pixelmap *
Returns a pointer to the texture map, if found, else Null
.
Example:
BrMapFindHook(BrMapFindFailedLoad);
BrTableCount()
Declaration:
br_uint_32 BrTableCount(const char* pattern)
Arguments:
const char * pattern
Search pattern.
Result:
br_uint_32
Returns the number of shade tables matching the search pattern.
See Also:
BrTableEnum()
292
, BrTableFind()
292
Description:
Calls a call-back function for every shade table matching a given search pattern. The call-back is passed a pointer to each matching shade table, and its second argument is an optional pointer supplied by the user. The search pattern can include the standard wild cards `*' and `?'. The call-back itself returns a BrTableEnum()
br_uint_32
348 value. The enumeration will halt at any stage if the return value is non-zero.
Declaration:
br_uint_32 BrTableEnum(const char* pattern, br_table_enum_cbfn* callback, void* arg)
Arguments:
const char * pattern
Search pattern.
br_table_enum_cbfn * callback
A pointer to a call-back function.
void * arg
An optional argument to pass to the call-back function.
Result:
br_uint_32
Returns the first non-zero call-back return value, or zero if all matching shade tables are enumerated.
Example:
br_uint_32 BR_CALLBACK test_callback(br_pixelmap* table, void* arg) { br_uint_32 count; ... return(count); } ... { br_uint_32 enum; ... enum = BrTableEnum("Table",&test_callback,NULL); }
BrTableFind()
Declaration:
br_pixelmap* BrTableFind(const char* pattern)
Arguments:
const char * pattern
Search pattern.
Result:
br_pixelmap *
Returns a pointer to the shade table if found, otherwise Null
. If a call-back exists and is called, the call-back's return value is returned.
See Also:
BrTableFindHook()
293
, BrTableFindMany()
293
Search pattern.
A pointer to an array of pointers to shade tables.
Maximum number of shade tables to find.
Returns the number of shade tables found. The pointer array is filled with pointers to the found shade tables.
Description:
Find a number of shade tables in the registry by name. The search pattern can include the standard wild cards `*' and `?'.BrTableFindMany()
br_uint_32 BrTableFindMany(const char* pattern, br_pixelmap** pixelmaps, int max)
const char * pattern
br_pixelmap ** pixelmaps
int max
br_uint_32
BrTableFind()
292,
BrTableFindHook()
293
Description:
Functions to set up a call-back. If BrTableFindHook()
BrTableFind()
292 is unsuccessful and a call-back has been set up, the call-back it is passed the search pattern as its only argument. The call-back should then return a pointer to a substitute or default shade table.
For example, a call-back could be set up to return a default shade table if the desired shade table cannot be found in the registry.
The function BrTableFindFailedLoad()
294
is provided and will probably be sufficient in many cases.
Declaration:
br_table_find_cbfn* BrTableFindHook(br_table_find_cbfn* hook)
Arguments:
br_table_find_cbfn * hook
A pointer to a call-back function.
Result:
br_table_find_cbfn *
Returns a pointer to the old call-back function.
Example:
br_table BR_CALLBACK * test_callback(char* pattern) { br_table* default_table; ... return(default_table); } ... { br_table* table; ... BrTableFindHook(&test_callback); table = BrTableFind("non_existent_table"); }See Also:
BrTableFindFailedLoad()
294
Description:
This function is provided as a suitable function to supply to BrTableFindFailedLoad()
BrTableFindHook()
293.
Declaration:
br_pixelmap* BrTableFindFailedLoad(const char* name)
Arguments:
const char * name
The name supplied to BrTableFind()
292.
Effects: Attempts to load the shade table from the filing system using
name
as the filename. Searches in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined). If successful, sets this name as the identifier of the loaded shade table and adds the shade table to the registry.Result:
br_pixelmap *
Returns a pointer to the shade table, if found, else Null
.
Example:
BrTableFindHook(BrTableFindFailedLoad);
BrPixelmapFileCount()
Declaration:
br_uint_32 BrPixelmapFileCount(const char* filename, br_uint_16* num)
Arguments:
const char * filename
Name of the file containing the pixel maps to count.
br_uint_16 * num
Pointer to the variable in which to store the number of pixel maps counted in the file. If Null
, the file will still be located and appropriate success returned, but no count will be made.
Effects: Searches for
filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined). If a file is found, will count the number of pixel maps stored in it.Result:
br_uint_32
Returns zero if the file was found (even if it is not a pixel map file), non-zero otherwise.
Name of the file containing the pixel map to load.
Returns a pointer to the loaded pixel map, or
Description:
Load a pixel map. Note that they are not added to the registry.BrPixelmapLoad()
br_pixelmap* BrPixelmapLoad(const char* filename)
const char * filename
filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined).br_pixelmap *
Null
if unsuccessful.BrPixelmapLoadMany()
295,
BrPixelmapSave()
297
BrMapAdd()
281
, BrTableAdd()
283
.
Name of the file containing the pixel maps to load.
A non-
Maximum number of pixel maps to load.
Returns the number of pixel maps loaded successfully. The pointer array is filled with pointers to the loaded pixel maps.
Description:
Load a number of pixel maps. Note that they are not added to the registry.BrPixelmapLoadMany()
br_uint_32 BrPixelmapLoadMany(const char* filename, br_pixelmap** pixelmaps, br_uint_16 num)
const char * filename
br_pixelmap ** pixelmaps
Null
pointer to an array of pointers to pixel maps.br_uint_16 num
filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined).br_uint_32
BrPixelmapFileCount()
242 to determine the number of pixel maps in a file.
Name of the file containing the pixel map.
Either
Returns a pointer to the loaded pixel map.
Name of the file containing the pixel map.
Either
Returns a pointer to the loaded pixel map.
Name of the file containing the pixel map.
Either
Returns a pointer to the loaded pixel map.
Name of the file containing the pixel map.
Either
Returns a pointer to the loaded pixel map.
Name of the file to save the pixel map to.
A pointer to a pixel map.
Returns
Name of the file to save the pixel maps to.
A pointer to an array of pointers to pixel maps. If
Number of pixel maps to save.
Returns the number of pixel maps saved successfully.
Description:
Load a pixel map in the BMP format.BrFmtBMPLoad()
br_pixelmap* BrFmtBMPLoad(const char* name, br_uint_32 flags)
const char * name
br_uint_32 flags
BR_PMT_RGBX_888
or BR_PMT_RGBA_8888
, when the source pixel map uses 32 bits per pixel. Zero otherwise.filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined).br_pixelmap *
Description:
Load a pixel map in the GIF format.BrFmtGIFLoad()
br_pixelmap* BrFmtGIFLoad(const char* name, br_uint_32 flags)
const char * name
br_uint_32 flags
BR_PMT_RGBX_888
or BR_PMT_RGBA_8888
, when the source pixel map uses 32 bits per pixel. Zero otherwise.filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined).br_pixelmap *
Description:
Load a pixel map in the IFF format.BrFmtIFFLoad()
br_pixelmap* BrFmtIFFLoad(const char* name, br_uint_32 flags)
const char * name
br_uint_32 flags
BR_PMT_RGBX_888
or BR_PMT_RGBA_8888
, when the source pixel map uses 32 bits per pixel. Zero otherwise.filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined).br_pixelmap *
Description:
Load a pixel map in the TGA format.BrFmtTGALoad()
br_pixelmap* BrFmtTGALoad(const char* name, br_uint_32 flags)
const char * name
br_uint_32 flags
BR_PMT_RGBX_888
or BR_PMT_RGBA_8888
, when the source pixel map uses 32 bits per pixel. Zero otherwise.filename
, if no path specified with file looks in current directory, if not found tries, in order, the directories listed in BRENDER_PATH (if defined).br_pixelmap *
Description:
Save a pixel map to a file.BrPixelmapSave()
br_uint_32 BrPixelmapSave(const char* filename, const br_pixelmap* pixelmap)
const char * filename
const br_pixelmap * pixelmap
br_uint_32
Null
if the pixel map could not be saved.
Description:
Save a number of pixel maps to a file.BrPixelmapSaveMany()
br_uint_32 BrPixelmapSaveMany(const char* filename, const br_pixelmap* const* pixelmaps, br_uint_16 num)
const char * filename
const br_pixelmap * const * pixelmaps
Null
, all registered texture maps and shade tables are saved (irrespective of num
).br_uint_16 num
br_uint_32
Generated with CERN WebMaker