NetSurf
Functions
image.c File Reference
#include <stdbool.h>
#include <swis.h>
#include <stdlib.h>
#include <oslib/colourtrans.h>
#include <oslib/osspriteop.h>
#include "utils/nsoption.h"
#include "utils/log.h"
#include "riscos/image.h"
#include "riscos/gui.h"
#include "riscos/wimp.h"
#include "riscos/tinct.h"
Include dependency graph for image.c:

Go to the source code of this file.

Functions

static bool image_redraw_tinct (osspriteop_id header, int x, int y, int req_width, int req_height, int width, int height, colour background_colour, bool repeatx, bool repeaty, bool alpha, unsigned int tinct_options)
 Plot an image at the given coordinates using tinct. More...
 
static bool image_redraw_os (osspriteop_id header, int x, int y, int req_width, int req_height, int width, int height, bool tile)
 Plot an image at the given coordinates using os_spriteop. More...
 
static void image__override_sprite_mode (osspriteop_area *area, image_type type, os_mode old, os_mode new)
 Override a sprite's mode. More...
 
bool image_redraw (osspriteop_area *area, int x, int y, int req_width, int req_height, int width, int height, colour background_colour, bool repeatx, bool repeaty, bool background, image_type type)
 Plot an image at the given coordinates using the method specified. More...
 

Function Documentation

◆ image__override_sprite_mode()

static void image__override_sprite_mode ( osspriteop_area *  area,
image_type  type,
os_mode  old,
os_mode  new 
)
inlinestatic

Override a sprite's mode.

Only replaces mode if existing mode matches old.

Parameters
[in]areaThe sprite area containing the sprite.
[in]typeRequested plot mode.
[in]oldExisting sprite mode to check for.
[in]newSprite mode to set if existing mode is expected.

Definition at line 179 of file image.c.

References IMAGE_PLOT_TINCT_ALPHA, and type.

Referenced by image_redraw().

Here is the caller graph for this function:

◆ image_redraw()

bool image_redraw ( osspriteop_area *  area,
int  x,
int  y,
int  req_width,
int  req_height,
int  width,
int  height,
colour  background_colour,
bool  repeatx,
bool  repeaty,
bool  background,
image_type  type 
)

Plot an image at the given coordinates using the method specified.

Parameters
areaThe sprite area containing the sprite
xLeft edge of sprite
yTop edge of sprite
req_widthThe requested width of the sprite
req_heightThe requested height of the sprite
widthThe actual width of the sprite
heightThe actual height of the sprite
background_colourThe background colour to blend to
repeatxRepeat the image in the x direction
repeatyRepeat the image in the y direction
backgroundUse background image settings (otherwise foreground)
typeThe plot method to use
Returns
true on success, false otherwise

Definition at line 209 of file image.c.

References alpha_SPRITE_MODE, height, image__override_sprite_mode(), IMAGE_PLOT_OS, IMAGE_PLOT_TINCT_ALPHA, IMAGE_PLOT_TINCT_OPAQUE, image_redraw_os(), image_redraw_tinct(), nsoption_int, os_alpha_sprite_supported, ro_gui_wimp_read_eig_factors(), tinct_options, tinct_SPRITE_MODE, tinct_USE_OS_SPRITE_OP, type, and width.

Referenced by ro_plot_bitmap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ image_redraw_os()

static bool image_redraw_os ( osspriteop_id  header,
int  x,
int  y,
int  req_width,
int  req_height,
int  width,
int  height,
bool  tile 
)
static

Plot an image at the given coordinates using os_spriteop.

Parameters
headerThe sprite header
xLeft edge of sprite
yTop edge of sprite
req_widthThe requested width of the sprite
req_heightThe requested height of the sprite
widthThe actual width of the sprite
heightThe actual height of the sprite
tileWhether to tile the sprite
Returns
true on success, false otherwise

Definition at line 99 of file image.c.

References height, NSLOG, ro_warn_user(), and width.

Referenced by image_redraw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ image_redraw_tinct()

static bool image_redraw_tinct ( osspriteop_id  header,
int  x,
int  y,
int  req_width,
int  req_height,
int  width,
int  height,
colour  background_colour,
bool  repeatx,
bool  repeaty,
bool  alpha,
unsigned int  tinct_options 
)
static

Plot an image at the given coordinates using tinct.

Parameters
headerThe sprite header
xLeft edge of sprite
yTop edge of sprite
req_widthThe requested width of the sprite
req_heightThe requested height of the sprite
widthThe actual width of the sprite
heightThe actual height of the sprite
background_colourThe background colour to blend to
repeatxRepeat the image in the x direction
repeatyRepeat the image in the y direction
alphaUse the alpha channel
tinct_optionsThe base option set to use
Returns
true on success, false otherwise

Definition at line 50 of file image.c.

References NSLOG, print_active, tinct_BACKGROUND_SHIFT, tinct_FILL_HORIZONTALLY, tinct_FILL_VERTICALLY, tinct_options, Tinct_PlotScaled, Tinct_PlotScaledAlpha, and tinct_USE_OS_SPRITE_OP.

Referenced by image_redraw().

Here is the caller graph for this function: