Actions

Difference between revisions of "Advanced functions"

From XnView Wiki

(Created page with 'gflResize The gflResize function allows to resize a picture. GFL_ERROR gflResize( GFL_BITMAP * src, GFL_BITMAP ** dst, GFL_INT32 width, GFL_INT32 height, GF…')
 
m (Reverted edits by Akajavim (Talk) to last revision by WikiSysop)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
gflResize
== gflResize ==


The gflResize function allows to resize a picture.  
The gflResize function allows to resize a picture.  


GFL_ERROR <b>gflResize</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  GFL_INT32 width, 
  GFL_INT32 height, 
  GFL_UINT32 method, 
  GFL_UINT32 flags
);


GFL_ERROR gflResize(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst, 
  GFL_INT32 width, 
  GFL_INT32 height, 
  GFL_UINT32 method, 
  GFL_UINT32 flags
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
:width
::New width.
:height
::New height.
:method
::{|
|GFL_RESIZE_QUICK || Quick
|-
|GFL_RESIZE_BILINEAR || Bilinear
|}
:flags
::Reserved, must be 0.


src
'''Return value'''
Pointer to a GFL_BITMAP structure.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.  
width
New width.
height
New height.
method
GFL_RESIZE_QUICK Quick
GFL_RESIZE_BILINEAR Bilinear


flags
== gflResizeCanvas ==
Reserved, must be 0.
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 
 
See also
 
gflResizeCanvas, gflCrop, gflRotate, gflRotateFine, gflFlipHorizontal, gflFlipVertical
 
gflResizeCanvas


The gflResizeCanvas function allows to resize the canvas of a picture.  
The gflResizeCanvas function allows to resize the canvas of a picture.  


GFL_ERROR <b>gflResizeCanvas</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  GFL_INT32 width, 
  GFL_INT32 height, 
  GFL_CANVASRESIZE mode, 
  const GFL_COLOR* color
);


GFL_ERROR gflResizeCanvas(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst, 
  GFL_INT32 width, 
  GFL_INT32 height, 
  GFL_CANVASRESIZE mode, 
  const GFL_COLOR * color
);
 
Parameters  
 
src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.
width
New width.
height
New height.
mode
GFL_CANVASRESIZE_CENTER Center
GFL_CANVASRESIZE_TOPLEFT Top-Left
GFL_CANVASRESIZE_TOPRIGHT Top-Right
GFL_CANVASRESIZE_BOTTOMLEFT Bottom-Left
GFL_CANVASRESIZE_BOTTOMRIGHT Bottom-Right
 
color
Pointer to a GFL_COLOR structure to receive the background color.
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 
 
See also
 
gflResize, gflCrop, gflRotate, gflRotateFine, gflFlipHorizontal, gflFlipVertical
 
gflCrop
 
The gflCrop function crop a picture.
 


GFL_ERROR gflCrop(
:src
  GFL_BITMAP * src, 
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
  GFL_BITMAP ** dst, 
:dst
  const GFL_RECT * rect
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
);
:width
::New width.
:height
::New height.
:mode
::{|
|GFL_CANVASRESIZE_CENTER || Center
|-
|GFL_CANVASRESIZE_TOPLEFT || Top-Left
|-
|GFL_CANVASRESIZE_TOPRIGHT || Top-Right
|-
|GFL_CANVASRESIZE_BOTTOMLEFT || Bottom-Left
|-
|GFL_CANVASRESIZE_BOTTOMRIGHT || Bottom-Right
|}
:color
::Pointer to a [[Structures#GFL_COLOR|GFL_COLOR]] structure to receive the background color.


Parameters
'''Return value'''
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].


src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.
rect
Crop rectangle.


Return value
== gflCrop ==


The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.  
The gflCrop function crops a picture.  


GFL_ERROR <b>gflCrop</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  const GFL_RECT* rect
);


'''Parameters'''


See also
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
:rect
::Crop rectangle.


gflResize, gflResizeCanvas, gflRotate, gflRotateFine, gflFlipHorizontal, gflFlipVertical
'''Return value'''
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].


gflAutoCrop
== gflAutoCrop ==


The gflAutoCrop function performs a automatic crop on a picture.  
The gflAutoCrop function performs a automatic crop on a picture.  


GFL_ERROR <b>gflAutoCrop</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  const GFL_COLOR* color,
  GFL_INT32 tolerance
);


GFL_ERROR gflAutoCrop(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst, 
  const GFL_COLOR * color,
  GFL_INT32 tolerance
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
:color
::Pointer to a [[Structures#GFL_COLOR|GFL_COLOR]] structure used to set the background color to search.
::Can be NULL, the background color is the color at x=0, y=0.
:tolerance
::Color tolerance.


src
'''Return value'''
Pointer to a GFL_BITMAP structure.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].  
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.
color
Pointer to a GFL_COLOR structure used to set the background color to search.
Can be NULL, the background color is the color at x=0, y=0.
tolerance
Color tolerance.  


Return value


The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
== gflRotate ==
 
 
 
See also
 
gflCrop, gflResize, gflResizeCanvas, gflRotate, gflRotateFine, gflFlipHorizontal, gflFlipVertical
 
gflRotate


The gflRotate function applies a rotation on a picture.  
The gflRotate function applies a rotation on a picture.  


GFL_ERROR <b>gflRotate</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  GFL_INT32 angle, 
  const GFL_COLOR* color
);


GFL_ERROR gflRotate(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst, 
  GFL_INT32 angle, 
  const GFL_COLOR * color
);
 
Parameters  
 
src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.
angle
Angle of rotation in degrees.
color
Pointer to a GFL_COLOR structure used to set the background color.
Can be NULL, the background color is (0,0,0).
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
:angle
::Angle of rotation in degrees.
:color
::Pointer to a [[Structures#GFL_COLOR|GFL_COLOR]] structure used to set the background color.
::Can be NULL, the background color is (0,0,0).


'''Return value'''
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].


See also


gflResize, gflResizeCanvas, gflCrop, gflFlipHorizontal, gflFlipVertical, gflRotateFine,
== gflRotateFine ==
 
gflRotateFine


The gflRotateFine function applies a rotation on a picture.  
The gflRotateFine function applies a rotation on a picture.  


GFL_ERROR <b>gflRotateFine</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  double angle, 
  const GFL_COLOR* color
);


GFL_ERROR gflRotateFine(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst, 
  double angle, 
  const GFL_COLOR * color
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
:angle
::Angle of rotation in degrees.
:color
::Pointer to a [[Structures#GFL_COLOR|GFL_COLOR]] structure used to set the background color.
::Can be NULL, the background color is (0,0,0).


src
'''Return value'''
Pointer to a GFL_BITMAP structure.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.
angle
Angle of rotation in degrees.
color
Pointer to a GFL_COLOR structure used to set the background color.
Can be NULL, the background color is (0,0,0).  


Return value
== gflFlipHorizontal ==
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 
 
See also
 
gflResize, gflResizeCanvas, gflCrop, gflFlipHorizontal, gflFlipVertical, gflRotate,
 
gflFlipHorizontal


The gflFlipHorizontal function applies a horizontal flip on picture.  
The gflFlipHorizontal function applies a horizontal flip on picture.  


GFL_ERROR <b>gflFlipHorizontal</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst
);


GFL_ERROR gflFlipHorizontal(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.


src
'''Return value'''
Pointer to a GFL_BITMAP structure.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].  
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.  


Return value


The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
== gflFlipVertical ==
 
 
 
See also
 
gflResize, gflResizeCanvas, gflCrop, gflRotate, gflRotateFine, gflFlipVertical
 
gflFlipVertical


The gflFlipVertical function applies a vertical flip on picture.  
The gflFlipVertical function applies a vertical flip on picture.  


GFL_ERROR <b>gflFlipVertical</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst
);


GFL_ERROR gflFlipVertical(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst
);
 
Parameters  
 
src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 


See also
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.


gflResize, gflResizeCanvas, gflCrop, gflRotate, gflRotateFine, gflFlipHorizontal
'''Return value'''
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].


gflChangeColorDepth
== gflChangeColorDepth ==


The gflChangeColorDepth function changes the picture type.  
The gflChangeColorDepth function changes the picture type.  


GFL_ERROR <b>gflChangeColorDepth</b>(
  GFL_BITMAP* src, 
  GFL_BITMAP** dst, 
  GFL_MODE mode, 
  GFL_MODE_PARAMS params
);


GFL_ERROR gflChangeColorDepth(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_BITMAP ** dst, 
  GFL_MODE mode, 
  GFL_MODE_PARAMS params
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. NULL if on the same instance.
:mode
::{|
|GFL_MODE_TO_BINARY || Binary (8 bits)
|-
|GFL_MODE_TO_4GREY || 4 Greyscale (8 bits)
|-
|GFL_MODE_TO_8GREY || 8 Greyscale (8 bits)
|-
|GFL_MODE_TO_16GREY || 16 Greyscale (8 bits)
|-
|GFL_MODE_TO_32GREY || 32 Greyscale (8 bits)
|-
|GFL_MODE_TO_64GREY || 64 Greyscale (8 bits)
|-
|GFL_MODE_TO_128GREY || 128 Greyscale (8 bits)
|-
|GFL_MODE_TO_216GREY || 216 Greyscale (8 bits)
|-
|GFL_MODE_TO_256GREY || 256 Greyscale (8 bits)
|-
|GFL_MODE_TO_8COLORS || 8 Colors (8 bits)
|-
|GFL_MODE_TO_16COLORS || 16 Colors (8 bits)
|-
|GFL_MODE_TO_32COLORS || 32 Colors (8 bits)
|-
|GFL_MODE_TO_64COLORS || 64 Colors (8 bits)
|-
|GFL_MODE_TO_128GREY || 128 Colors (8 bits)
|-
|GFL_MODE_TO_216COLORS || 216 Colors (8 bits)
|-
|GFL_MODE_TO_256COLORS || 256 Colors (8 bits)
|-
|GFL_MODE_TO_RGB || Red-Green-Blue (24 bits)
|-
|GFL_MODE_TO_RGBA || Red-Green-Blue-Alpha (32 bits)
|-
|GFL_MODE_TO_BGR || Blue-Green-Red (24 bits)
|-
|GFL_MODE_TO_ABGR || Alpha-Blue-Green-Red (32 bits)
|-
|GFL_MODE_TO_BGRA || Blue-Green-Red-Alpha (32 bits)
|}
:params
::Indicates a dither to be used for colors, greyscale & binary.
::{|
|GFL_MODE_NO_DITHER || No dithering
|-
|GFL_MODE_ADAPTIVE || Adaptive without dithering
|-
|GFL_MODE_PATTERN_DITHER || Pattern dithering
|-
|GFL_MODE_HALTONE45_DITHER || HalfTone 45 dithering
|-
|GFL_MODE_HALTONE90_DITHER || HalfTone 90 dithering
|-
|GFL_MODE_FLOYD_STEINBERG || Floyd-Steinberg dithering
|}


src
'''Return value'''
Pointer to a GFL_BITMAP structure.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].
dst
Address of a pointer to a GFL_BITMAP structure.
NULL if on the same instance.  
mode
GFL_MODE_TO_BINARY Binary (8 bits)
GFL_MODE_TO_4GREY 4 Greyscale (8 bits)
GFL_MODE_TO_8GREY 8 Greyscale (8 bits)
GFL_MODE_TO_16GREY 16 Greyscale (8 bits)
GFL_MODE_TO_32GREY 32 Greyscale (8 bits)
GFL_MODE_TO_64GREY 64 Greyscale (8 bits)
GFL_MODE_TO_128GREY 128 Greyscale (8 bits)
GFL_MODE_TO_216GREY 216 Greyscale (8 bits)
GFL_MODE_TO_256GREY 256 Greyscale (8 bits)
GFL_MODE_TO_8COLORS 8 Colors (8 bits)
GFL_MODE_TO_16COLORS 16 Colors (8 bits)
GFL_MODE_TO_32COLORS 32 Colors (8 bits)
GFL_MODE_TO_64COLORS 64 Colors (8 bits)
GFL_MODE_TO_128GREY 128 Colors (8 bits)
GFL_MODE_TO_216COLORS 216 Colors (8 bits)
GFL_MODE_TO_256COLORS 256 Colors (8 bits)
GFL_MODE_TO_RGB Red-Green-Blue (24 bits)
GFL_MODE_TO_RGBA Red-Green-Blue-Alpha (32 bits)
GFL_MODE_TO_BGR Blue-Green-Red (24 bits)
GFL_MODE_TO_ABGR Alpha-Blue-Green-Red (32 bits)
GFL_MODE_TO_BGRA Blue-Green-Red-Alpha (32 bits)


params
== gflMerge ==
Indicates a dither to be used for colors, greyscale & binary. GFL_MODE_NO_DITHER No dithering
GFL_MODE_ADAPTIVE Adaptive without dithering
GFL_MODE_PATTERN_DITHER Pattern dithering
GFL_MODE_HALTONE45_DITHER HalfTone 45 dithering
GFL_MODE_HALTONE90_DITHER HalfTone 90 dithering
GFL_MODE_FLOYD_STEINBERG Floyd-Steinberg dithering
 
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 
 
See also
 
gflGetColorAt, gflGetNumberOfColorsUsed
 
gflMerge


The gflMerge function allows to merge a list of picture.  
The gflMerge function allows to merge a list of picture.  


GFL_ERROR <b>gflMerge</b>(
  const GFL_BITMAP* src[], 
  const GFL_POINT origin[], 
  const GFL_UINT32 opacity[], 
  GFL_INT32  num_bitmap, 
  GFL_BITMAP** dst
);


GFL_ERROR gflMerge(
'''Parameters'''
  const GFL_BITMAP * src[], 
  const GFL_POINT origin[], 
  const GFL_UINT32 opacity[], 
  GFL_INT32  num_bitmap, 
  GFL_BITMAP ** dst
);


Parameters
:src
::Address of an array of pointer to [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:origin
::Address of an array of [[Structures#GFL_POINT|GFL_POINT]] structure, origin to insert for each picture.
::If NULL, origin used is (0,0).
:opacity
::Address of an array of opacity, for each picture.
:num_bitmap
::Number of picture to merge.
:dst
::Address of a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.


src
'''Remark'''
Address of an array of pointer to GFL_BITMAP structure.
:gflMerge works only in 24 or 32bits.
origin
Address of an array of GFL_POINT structure, origin to insert for each picture.
If NULL, origin used is (0,0).
opacity
Address of an array of opacity, for each picture.
num_bitmap
Number of picture to merge.
dst
Address of a pointer to a GFL_BITMAP structure.  


Remark
'''Return value'''
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].


gflMerge works only in 24 or 32bits.


 
== gflBitblt ==
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 
gflBitblt


The gflBitblt function performs a block transfert between two pictures.  
The gflBitblt function performs a block transfert between two pictures.  


GFL_ERROR <b>gflBitblt</b>(
  const GFL_BITMAP* src, 
  const GFL_RECT* rect, 
  const GFL_BITMAP* dst, 
  GFL_INT32 x_dest, 
  GFL_INT32 y_dest
);


GFL_ERROR gflBitblt(
'''Parameters'''
  const GFL_BITMAP * src, 
  const GFL_RECT * rect, 
  const GFL_BITMAP * dst, 
  GFL_INT32  x_dest, 
  GFL_INT32  y_dest
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure, used as source.
:rect
::Pointer to a [[Structures#GFL_RECT|GFL_RECT]] structure. Area to copy.
:dst
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure, used as destination.
:x_dest
::X position in the destination picture.
:y_dest
::Y position in the destination picture.


src
'''Return value'''
Pointer to a GFL_BITMAP structure, used as source.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].  
rect
Pointer to a GFL_RECT structure. Area to copy.
dst
Pointer to a GFL_BITMAP structure, used as destination.
x_dest
X position in the destination picture.
y_dest
Y position in the destination picture.  


Return value


The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
== gflBitbltEx ==


The gflBitbltEx function performs a block transfert between two pictures with alpha blending.


gflBitblt
GFL_ERROR <b>gflBitbltEx</b>(
  const GFL_BITMAP* src, 
  const GFL_RECT* rect, 
  const GFL_BITMAP* dst, 
  GFL_INT32 x_dest, 
  GFL_INT32 y_dest
);


The gflBitblt function performs a block transfert between two pictures with alpha blending.
'''Parameters'''


:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure, used as source. Must be 32bits.
:rect
::Pointer to a [[Structures#GFL_RECT|GFL_RECT]] structure. Area to copy.
:dst
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure, used as destination.
:x_dest
::X position in the destination picture.
:y_dest
::Y position in the destination picture.


GFL_ERROR gflBitbltEx(
'''Return value'''
  const GFL_BITMAP * src, 
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].
  const GFL_RECT * rect, 
  const GFL_BITMAP * dst, 
  GFL_INT32  x_dest, 
  GFL_INT32  y_dest
);


Parameters
== gflGetColorAt ==
 
src
Pointer to a GFL_BITMAP structure, used as source. Must be 32bits.
rect
Pointer to a GFL_RECT structure. Area to copy.
dst
Pointer to a GFL_BITMAP structure, used as destination.
x_dest
X position in the destination picture.
y_dest
Y position in the destination picture.
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
 
 
gflGetColorAt


The gflGetColorAt function gets the color at a position of the picture.  
The gflGetColorAt function gets the color at a position of the picture.  


GFL_ERROR <b>gflGetColorAt</b>(
  GFL_BITMAP* src, 
  GFL_INT32 x, 
  GFL_INT32 y, 
  GFL_COLOR* color
);


GFL_ERROR gflGetColorAt(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_INT32 x, 
  GFL_INT32 y, 
  GFL_COLOR * color
);


Parameters
:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:x
::X position.
:y
::Y position.
:color
::Pointer to a [[Structures#GFL_COLOR|GFL_COLOR]] structure to obtain the result.


src
'''Return value'''
Pointer to a GFL_BITMAP structure.
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].  
x
X position.
y
Y position.
color
Pointer to a GFL_COLOR structure to obtain the result.  


Return value


The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.
== gflSetColorAt ==
 
 
See also
 
gflGetNumberOfColorsUsed, gflSetColorAt
 
gflSetColorAt


The gflSetColorAt function allows to set a color at a position of the picture.  
The gflSetColorAt function allows to set a color at a position of the picture.  


GFL_ERROR <b>gflSetColorAt</b>(
  GFL_BITMAP* src, 
  GFL_INT32 x, 
  GFL_INT32 y, 
  const GFL_COLOR* color
);


GFL_ERROR gflSetColorAt(
'''Parameters'''
  GFL_BITMAP * src, 
  GFL_INT32 x, 
  GFL_INT32 y, 
  const GFL_COLOR * color
);
 
Parameters  
 
src
Pointer to a GFL_BITMAP structure.
x
X position.
y
Y position.
color
Pointer to a GFL_COLOR structure.
 
Return value
 
The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


:src
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure.
:x
::X position.
:y
::Y position.
:color
::Pointer to a [[Structures#GFL_COLOR|GFL_COLOR]] structure.


See also
'''Return value'''
:The function returns GFL_NO_ERROR if it is successful or a value of [[Error|GFL_ERROR]].


gflGetNumberOfColorsUsed, gflGetColorAt
[[Category: GFLSDK Reference Manual]]

Latest revision as of 15:25, 22 November 2010

gflResize

The gflResize function allows to resize a picture.

GFL_ERROR gflResize(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  GFL_INT32 width,  
  GFL_INT32 height,  
  GFL_UINT32 method,  
  GFL_UINT32 flags
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
width
New width.
height
New height.
method
GFL_RESIZE_QUICK Quick
GFL_RESIZE_BILINEAR Bilinear
flags
Reserved, must be 0.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.

gflResizeCanvas

The gflResizeCanvas function allows to resize the canvas of a picture.

GFL_ERROR gflResizeCanvas(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  GFL_INT32 width,  
  GFL_INT32 height,  
  GFL_CANVASRESIZE mode,  
  const GFL_COLOR* color
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
width
New width.
height
New height.
mode
GFL_CANVASRESIZE_CENTER Center
GFL_CANVASRESIZE_TOPLEFT Top-Left
GFL_CANVASRESIZE_TOPRIGHT Top-Right
GFL_CANVASRESIZE_BOTTOMLEFT Bottom-Left
GFL_CANVASRESIZE_BOTTOMRIGHT Bottom-Right
color
Pointer to a GFL_COLOR structure to receive the background color.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflCrop

The gflCrop function crops a picture.

GFL_ERROR gflCrop(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  const GFL_RECT* rect
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
rect
Crop rectangle.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.

gflAutoCrop

The gflAutoCrop function performs a automatic crop on a picture.

GFL_ERROR gflAutoCrop(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  const GFL_COLOR* color, 
  GFL_INT32 tolerance
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
color
Pointer to a GFL_COLOR structure used to set the background color to search.
Can be NULL, the background color is the color at x=0, y=0.
tolerance
Color tolerance.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflRotate

The gflRotate function applies a rotation on a picture.

GFL_ERROR gflRotate(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  GFL_INT32 angle,  
  const GFL_COLOR* color
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
angle
Angle of rotation in degrees.
color
Pointer to a GFL_COLOR structure used to set the background color.
Can be NULL, the background color is (0,0,0).

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflRotateFine

The gflRotateFine function applies a rotation on a picture.

GFL_ERROR gflRotateFine(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  double angle,  
  const GFL_COLOR* color
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
angle
Angle of rotation in degrees.
color
Pointer to a GFL_COLOR structure used to set the background color.
Can be NULL, the background color is (0,0,0).

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.

gflFlipHorizontal

The gflFlipHorizontal function applies a horizontal flip on picture.

GFL_ERROR gflFlipHorizontal(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflFlipVertical

The gflFlipVertical function applies a vertical flip on picture.

GFL_ERROR gflFlipVertical(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.

gflChangeColorDepth

The gflChangeColorDepth function changes the picture type.

GFL_ERROR gflChangeColorDepth(
  GFL_BITMAP* src,  
  GFL_BITMAP** dst,  
  GFL_MODE mode,  
  GFL_MODE_PARAMS params
);

Parameters

src
Pointer to a GFL_BITMAP structure.
dst
Address of a pointer to a GFL_BITMAP structure. NULL if on the same instance.
mode
GFL_MODE_TO_BINARY Binary (8 bits)
GFL_MODE_TO_4GREY 4 Greyscale (8 bits)
GFL_MODE_TO_8GREY 8 Greyscale (8 bits)
GFL_MODE_TO_16GREY 16 Greyscale (8 bits)
GFL_MODE_TO_32GREY 32 Greyscale (8 bits)
GFL_MODE_TO_64GREY 64 Greyscale (8 bits)
GFL_MODE_TO_128GREY 128 Greyscale (8 bits)
GFL_MODE_TO_216GREY 216 Greyscale (8 bits)
GFL_MODE_TO_256GREY 256 Greyscale (8 bits)
GFL_MODE_TO_8COLORS 8 Colors (8 bits)
GFL_MODE_TO_16COLORS 16 Colors (8 bits)
GFL_MODE_TO_32COLORS 32 Colors (8 bits)
GFL_MODE_TO_64COLORS 64 Colors (8 bits)
GFL_MODE_TO_128GREY 128 Colors (8 bits)
GFL_MODE_TO_216COLORS 216 Colors (8 bits)
GFL_MODE_TO_256COLORS 256 Colors (8 bits)
GFL_MODE_TO_RGB Red-Green-Blue (24 bits)
GFL_MODE_TO_RGBA Red-Green-Blue-Alpha (32 bits)
GFL_MODE_TO_BGR Blue-Green-Red (24 bits)
GFL_MODE_TO_ABGR Alpha-Blue-Green-Red (32 bits)
GFL_MODE_TO_BGRA Blue-Green-Red-Alpha (32 bits)
params
Indicates a dither to be used for colors, greyscale & binary.
GFL_MODE_NO_DITHER No dithering
GFL_MODE_ADAPTIVE Adaptive without dithering
GFL_MODE_PATTERN_DITHER Pattern dithering
GFL_MODE_HALTONE45_DITHER HalfTone 45 dithering
GFL_MODE_HALTONE90_DITHER HalfTone 90 dithering
GFL_MODE_FLOYD_STEINBERG Floyd-Steinberg dithering

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.

gflMerge

The gflMerge function allows to merge a list of picture.

GFL_ERROR gflMerge(
  const GFL_BITMAP* src[],  
  const GFL_POINT origin[],  
  const GFL_UINT32 opacity[],  
  GFL_INT32  num_bitmap,  
  GFL_BITMAP** dst
);

Parameters

src
Address of an array of pointer to GFL_BITMAP structure.
origin
Address of an array of GFL_POINT structure, origin to insert for each picture.
If NULL, origin used is (0,0).
opacity
Address of an array of opacity, for each picture.
num_bitmap
Number of picture to merge.
dst
Address of a pointer to a GFL_BITMAP structure.

Remark

gflMerge works only in 24 or 32bits.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflBitblt

The gflBitblt function performs a block transfert between two pictures.

GFL_ERROR gflBitblt(
  const GFL_BITMAP* src,  
  const GFL_RECT* rect,  
  const GFL_BITMAP* dst,  
  GFL_INT32 x_dest,  
  GFL_INT32 y_dest
);

Parameters

src
Pointer to a GFL_BITMAP structure, used as source.
rect
Pointer to a GFL_RECT structure. Area to copy.
dst
Pointer to a GFL_BITMAP structure, used as destination.
x_dest
X position in the destination picture.
y_dest
Y position in the destination picture.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflBitbltEx

The gflBitbltEx function performs a block transfert between two pictures with alpha blending.

GFL_ERROR gflBitbltEx(
  const GFL_BITMAP* src,  
  const GFL_RECT* rect,  
  const GFL_BITMAP* dst,  
  GFL_INT32 x_dest,  
  GFL_INT32 y_dest
);

Parameters

src
Pointer to a GFL_BITMAP structure, used as source. Must be 32bits.
rect
Pointer to a GFL_RECT structure. Area to copy.
dst
Pointer to a GFL_BITMAP structure, used as destination.
x_dest
X position in the destination picture.
y_dest
Y position in the destination picture.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.

gflGetColorAt

The gflGetColorAt function gets the color at a position of the picture.

GFL_ERROR gflGetColorAt(
  GFL_BITMAP* src,  
  GFL_INT32 x,  
  GFL_INT32 y,  
  GFL_COLOR* color
);

Parameters

src
Pointer to a GFL_BITMAP structure.
x
X position.
y
Y position.
color
Pointer to a GFL_COLOR structure to obtain the result.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.


gflSetColorAt

The gflSetColorAt function allows to set a color at a position of the picture.

GFL_ERROR gflSetColorAt(
  GFL_BITMAP* src,  
  GFL_INT32 x,  
  GFL_INT32 y,  
  const GFL_COLOR* color
);

Parameters

src
Pointer to a GFL_BITMAP structure.
x
X position.
y
Y position.
color
Pointer to a GFL_COLOR structure.

Return value

The function returns GFL_NO_ERROR if it is successful or a value of GFL_ERROR.