#include "LgiDefs.h"
#include "LgiClass.h"
#include "LgiOsDefs.h"
#include "Progress.h"
#include "GFile.h"
#include "GMem.h"
#include "Core.h"
#include "GContainers.h"
#include "GLibrary.h"
#include "GRect.h"
#include "GFont.h"
#include "GFilter.h"
Go to the source code of this file.
Defines | |
#define | LGI_DEFAULT_GAMMA 1.0 |
The default gamma curve (none) used by the gamma LUT GdcDevice::GetGamma. | |
#define | LGI_PI 3.141592654 |
The value of PI. | |
#define | LGI_DegToRad(i) ((i)*LGI_PI/180) |
Converts degrees to radians. | |
#define | LGI_RadToDeg(i) ((i)*180/LGI_PI) |
Converts radians to degrees. | |
#define | GDC_SET 0 |
Blending mode: overwrite. | |
#define | GDC_AND 1 |
Blending mode: bitwise AND with background. | |
#define | GDC_OR 2 |
Blending mode: bitwise OR with background. | |
#define | GDC_XOR 3 |
Blending mode: bitwise XOR with background. | |
#define | GDC_ALPHA 4 |
Blending mode: alpha blend with background. | |
#define | GDC_FILL_TO_DIFFERENT 0 |
GSurface::FloodFill to a different colour. | |
#define | GDC_FILL_TO_BORDER 1 |
GSurface::FloodFill to a certain colour. | |
#define | GDC_FILL_NEAR 2 |
GSurface::FloodFill while colour is near to the seed colour. | |
#define | GDC_REDUCE_TYPE 0 |
Used in GdcApp8Set::Blt when doing colour depth reduction to 8 bit. | |
#define | REDUCE_NONE 0 |
No conversion. | |
#define | REDUCE_NEAREST 1 |
Nearest colour pixels. | |
#define | REDUCE_HALFTONE 2 |
Halftone the pixels. | |
#define | REDUCE_ERROR_DIFFUSION 3 |
Error diffuse the pixels. | |
#define | REDUCE_DL1 4 |
Not used. | |
#define | GDC_HALFTONE_BASE_INDEX 1 |
Not used. | |
#define | GDC_PALETTE_TYPE 2 |
When in 8-bit defined the behaviour of GdcDevice::GetColour. | |
#define | PALTYPE_ALLOC 0 |
Allocate colours from the palette. | |
#define | PALTYPE_RGB_CUBE 1 |
Use an RGB cube. | |
#define | PALTYPE_HSL 2 |
Use a HSL palette. | |
#define | GDC_PROMOTE_ON_LOAD 3 |
Converts images to the specified bit-depth on load, does nothing if 0. | |
#define | Rgb15(r, g, b) ( ((r&0xF8)<<7) | ((g&0xF8)<<2) | ((b&0xF8)>>3)) |
Create a 15bit COLOUR from components. | |
#define | R15(c15) ( (uchar) ((c15>>10)&0x1F) ) |
Get the red component of a 15bit COLOUR. | |
#define | G15(c15) ( (uchar) ((c15>>5)&0x1F) ) |
Get the green component of a 15bit COLOUR. | |
#define | B15(c15) ( (uchar) ((c15)&0x1F) ) |
Get the blue component of a 15bit COLOUR. | |
#define | Rgb16(r, g, b) ( ((r&0xF8)<<8) | ((g&0xFC)<<3) | ((b&0xF8)>>3)) |
Create a 16bit COLOUR from components. | |
#define | R16(c16) ( (uchar) ((c16>>11)&0x1F) ) |
Get the red component of a 16bit COLOUR. | |
#define | G16(c16) ( (uchar) ((c16>>5)&0x3F) ) |
Get the green component of a 16bit COLOUR. | |
#define | B16(c16) ( (uchar) ((c16)&0x1F) ) |
Get the blue component of a 16bit COLOUR. | |
#define | R24(c24) ( ((c24)>>(C24R*8)) & 0xff ) |
Get the red component of a 24bit COLOUR. | |
#define | G24(c24) ( ((c24)>>(C24G*8)) & 0xff ) |
Get the green component of a 24bit COLOUR. | |
#define | B24(c24) ( ((c24)>>(C24B*8)) & 0xff ) |
Get the blue component of a 24bit COLOUR. | |
#define | Rgb24(r, g, b) ( (((r)&0xFF) << (C24R*8)) | (((g)&0xFF) << (C24G*8)) | (((b)&0xFF) << (C24B*8)) ) |
Create a 24bit COLOUR from components. | |
#define | R32(c32) ( (uchar) (c32 >> (C32R*8)) ) |
Get the red component of a 32bit COLOUR. | |
#define | G32(c32) ( (uchar) (c32 >> (C32G*8)) ) |
Get the green component of a 32bit COLOUR. | |
#define | B32(c32) ( (uchar) (c32 >> (C32B*8)) ) |
Get the blue component of a 32bit COLOUR. | |
#define | A32(c32) ( (uchar) (c32 >> (C32A*8)) ) |
Get the opacity/alpha component of a 32bit COLOUR. | |
Typedefs | |
typedef uint32 | COLOUR |
32bit colour of varing bit depth. If no associated depth is given, 24 bits is assumed. | |
typedef uint8 | ALPHA |
Alpha value, 0 - transparent, 255 - solid. | |
Enumerations | |
enum | GColourReducePalette |
Colour reduction option to define what palette to go to. | |
enum | GColourReduceMatch |
Colour reduction option to define how to deal with reduction error. | |
Functions | |
LgiFunc GSurface * | ConvertDC (GSurface *pDC, int Bits) |
Converts a context to a different bit depth. | |
LgiFunc GSurface * | LoadDC (char *Name) |
Loads a image from a file. | |
LgiFunc bool | WriteDC (char *Name, GSurface *pDC) |
Writes an image to a file. | |
LgiFunc COLOUR | CBit (int DstBits, COLOUR c, int SrcBits=24, GPalette *Pal=0) |
Converts a colour to a different bit depth. | |
LgiFunc COLOUR | GdcMixColour (COLOUR a, COLOUR b, double HowMuchA=0.5) |
blends 2 24bit colours by the amount specified | |
LgiFunc COLOUR | GdcGreyScale (COLOUR c, int Bits=24) |
Turns a colour into an 8 bit grey scale representation. | |
LgiFunc bool | GReduceBitDepth (GSurface *pDC, int Bits, GPalette *Pal=0, GReduceOptions *Reduce=0) |
Reduces a images colour depth. |
|
32bit colour of varing bit depth. If no associated depth is given, 24 bits is assumed.
COLOUR typedef description 31 24 23 16 15 8 7 0 |-|-|-|-|-|-|-|-| |-|-|-|-|-|-|-|-| |-|-|-|-|-|-|-|-| |-|-|-|-|-|-|-|-| Standard: 8bit mode: |------------------------ unused ---------------------| |---- index ----| 15bit mode: |----------------- unused ------------|T|-- red --|-- green ---|-- blue -| 16bit mode: |------------- unused -------------| |-- red --|--- green ----|-- blue -| 24bit mode: |---- unused ---| |----- blue ----| |---- green ----| |----- red -----| Note: In 15bit mode the T bit can toggle between 8-bit indexing and RGB |
|
Converts a context to a different bit depth.
|
|
Loads a image from a file. This function uses the compiled in codecs, some of which require external shared libraries / DLL's to function. Other just need the right source to be compiled in. Lgi comes with the following image codecs:
|