Difference between revisions of "Allocation"
From XnView Wiki
(Created page with '== gflAllockBitmap == The gflAllockBitmap function allocates a picture, and return a pointer on a GFL_BITMAP structure. GFL_BITMAP* <b>gflAllockBitmap</b>( GFL_BITMAP_T…') |
|||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
== gflAllockBitmap == | == gflAllockBitmap == | ||
The gflAllockBitmap function allocates a picture, and | The gflAllockBitmap function allocates a picture, and returns a pointer on a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. | ||
GFL_BITMAP* <b>gflAllockBitmap</b>( | GFL_BITMAP* <b>gflAllockBitmap</b>( | ||
GFL_BITMAP_TYPE bitmap_type, | |||
GFL_INT32 width, | |||
GFL_INT32 height, | |||
GFL_UINT32 line_padding, | |||
const GFL_COLOR* color | |||
); | ); | ||
'''Parameters''' | '''Parameters''' | ||
bitmap_type | :bitmap_type | ||
Type of picture wanted. GFL_BINARY 0x0001 Binary (8 bits) | ::Type of picture wanted. | ||
GFL_GREY 0x0002 Grey scale (8 bits) | ::{| | ||
GFL_COLORS 0x0004 Colors with colormap (8 bits) | |GFL_BINARY || 0x0001 || Binary (8 bits) | ||
GFL_RGB 0x0008 TrueColors - Red/Green/Blue (24 bits) | |- | ||
GFL_RGBA 0x0010 TrueColors - Red/Green/Blue/Alpha (32 bits) | |GFL_GREY || 0x0002 || Grey scale (8 bits) | ||
GFL_BGR 0x0020 TrueColors - Blue/Green/Red (24 bits) | |- | ||
GFL_ABGR 0x0040 TrueColors - Alpha/Blue/Green/Red (32 bits) | |GFL_COLORS || 0x0004 || Colors with colormap (8 bits) | ||
GFL_BGRA 0x0100 TrueColors - Blue/Green/Red/Alpha (32 bits) | |- | ||
GFL_ARGB 0x0200 TrueColors - Alpha/Red/Green/Blue (32 bits) | |GFL_RGB || 0x0008 || TrueColors - Red/Green/Blue (24 bits) | ||
|- | |||
|GFL_RGBA || 0x0010 || TrueColors - Red/Green/Blue/Alpha (32 bits) | |||
|- | |||
|GFL_BGR || 0x0020 || TrueColors - Blue/Green/Red (24 bits) | |||
|- | |||
|GFL_ABGR || 0x0040 || TrueColors - Alpha/Blue/Green/Red (32 bits) | |||
|- | |||
|GFL_BGRA || 0x0100 || TrueColors - Blue/Green/Red/Alpha (32 bits) | |||
|- | |||
|GFL_ARGB || 0x0200 || TrueColors - Alpha/Red/Green/Blue (32 bits) | |||
|} | |||
:width | |||
::Width of the picture wanted. | |||
:height | |||
::Height of the picture wanted. | |||
:line_padding | |||
::Pad for a pixel line. | |||
::For a value of 4, each line of pixels has a multiple of 4 bytes (32 bits). | |||
: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''' | |||
:A pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure or NULL. | |||
'''See also''' | |||
:[[#gflFreeBitmap|gflFreeBitmap]], [[#gflFreeBitmapData|gflFreeBitmapData]] | |||
== gflAllockBitmapEx == | |||
The gflAllockBitmapEx function allocates a picture, and returns a pointer on a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. | |||
GFL_BITMAP* <b>gflAllockBitmapEx</b>( | |||
GFL_BITMAP_TYPE bitmap_type, | |||
GFL_INT32 width, | |||
GFL_INT32 height, | |||
GFL_UINT16 bits_per_component, | |||
GFL_UINT32 line_padding, | |||
const GFL_COLOR* color | |||
); | |||
gflFreeBitmap, gflFreeBitmapData | '''Parameters''' | ||
:bitmap_type | |||
::Type of picture wanted. | |||
::{| | |||
|GFL_BINARY || 0x0001 || Binary (8 bits) | |||
|- | |||
|GFL_GREY || 0x0002 || Grey scale (8 bits) | |||
|- | |||
|GFL_COLORS || 0x0004 || Colors with colormap (8 bits) | |||
|- | |||
|GFL_RGB || 0x0008 || TrueColors - Red/Green/Blue (24 bits) | |||
|- | |||
|GFL_RGBA || 0x0010 || TrueColors - Red/Green/Blue/Alpha (32 bits) | |||
|- | |||
|GFL_BGR || 0x0020 || TrueColors - Blue/Green/Red (24 bits) | |||
|- | |||
|GFL_ABGR || 0x0040 || TrueColors - Alpha/Blue/Green/Red (32 bits) | |||
|- | |||
|GFL_BGRA || 0x0100 || TrueColors - Blue/Green/Red/Alpha (32 bits) | |||
|- | |||
|GFL_ARGB || 0x0200 || TrueColors - Alpha/Red/Green/Blue (32 bits) | |||
|} | |||
:width | |||
::Width of the picture wanted. | |||
:height | |||
::Height of the picture wanted. | |||
:bits_per_component | |||
::Bits per component wanted. Can be 8 or 16. | |||
:line_padding | |||
::Pad for a pixel line. | |||
::For a value of 4, each line of pixels has a multiple of 4 bytes (32 bits). | |||
: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''' | |||
:A pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure or NULL. | |||
'''See also''' | |||
:[[#gflFreeBitmap|gflFreeBitmap]], [[#gflFreeBitmapData|gflFreeBitmapData]] | |||
== gflFreeBitmap == | |||
The gflFreeBitmap function frees a [[Structures|GFL_BITMAP]] structure, and his content. | |||
void <b>gflFreeBitmap</b>( | |||
GFL_BITMAP* bitmap | |||
); | |||
'''Parameters''' | |||
:bitmap | |||
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. | |||
'''See also''' | |||
:[[#gflAllockBitmap|gflAllockBitmap]], [[#gflFreeBitmapData|gflFreeBitmapData]] | |||
== gflFreeBitmapData == | |||
The gflFreeBitmapData function frees the content of a [[Strutures|GFL_BITMAP]] structure. | |||
void <b>gflFreeBitmapData</b>( | |||
GFL_BITMAP* bitmap | |||
); | |||
'''Parameters''' | |||
:bitmap | |||
::Pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. | |||
'''See also''' | |||
:[[#gflAllockBitmap|gflAllockBitmap]], [[#gflFreeBitmap|gflFreeBitmap]] | |||
== gflCloneBitmap == | |||
The gflCloneBitmap function allows to clone a bitmap, and returns a pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure. | |||
GFL_BITMAP* <b>gflCloneBitmap</b>( | |||
const GFL_BITMAP* bitmap | |||
); | |||
'''Parameters''' | |||
:bitmap | |||
::Pointer to a [[Structures|GFL_BITMAP]] structure. | |||
'''Return value''' | |||
:A pointer to a [[Structures#GFL_BITMAP|GFL_BITMAP]] structure or NULL. | |||
'''See also''' | |||
:[[#gflAllockBitmap|gflAllockBitmap]], [[#gflFreeBitmap|gflFreeBitmap]], [[#gflFreeBitmapData|gflFreeBitmapData]] | |||
== gflMemoryAlloc == | |||
The gflMemoryAlloc function allocates memory. | |||
void* <b>gflMemoryAlloc</b>( | |||
GFL_UINT32 size | |||
); | |||
'''Parameters''' | |||
:size | |||
::Size wanted. | |||
'''Return value''' | |||
:The function returns NULL if an error occurs. | |||
'''See also''' | |||
:[[#gflMemoryRealloc|gflMemoryRealloc]], [[#gflMemoryFree |gflMemoryFree]] | |||
== gflMemoryRealloc == | |||
The gflMemoryRealloc function reallocates a memory area. | |||
void* <b>gflMemoryRealloc</b>( | |||
void* ptr, | |||
GFL_UINT32 size | |||
); | |||
'''Parameters''' | |||
:ptr | |||
::Pointer to a memory area allocated. | |||
:size | |||
::New size. | |||
'''Return value''' | |||
:The function returns NULL if an error occurs. | |||
'''See also''' | |||
:[[#gflMemoryAlloc|gflMemoryAlloc]], [[#gflMemoryFree |gflMemoryFree]] | |||
== gflMemoryFree == | |||
The gflMemoryFree function frees memory. | |||
void <b>gflMemoryFree</b>( | |||
void* ptr | |||
); | |||
'''Parameters''' | |||
:ptr | |||
::Pointer to a memory area allocated. | |||
'''See also''' | |||
:[[#gflMemoryAlloc|gflMemoryAlloc]], [[#gflMemoryRealloc|gflMemoryRealloc]] | |||
[[Category: GFLSDK Reference Manual]] |
Latest revision as of 15:25, 22 November 2010
gflAllockBitmap
The gflAllockBitmap function allocates a picture, and returns a pointer on a GFL_BITMAP structure.
GFL_BITMAP* gflAllockBitmap( GFL_BITMAP_TYPE bitmap_type, GFL_INT32 width, GFL_INT32 height, GFL_UINT32 line_padding, const GFL_COLOR* color );
Parameters
- bitmap_type
- Type of picture wanted.
GFL_BINARY 0x0001 Binary (8 bits) GFL_GREY 0x0002 Grey scale (8 bits) GFL_COLORS 0x0004 Colors with colormap (8 bits) GFL_RGB 0x0008 TrueColors - Red/Green/Blue (24 bits) GFL_RGBA 0x0010 TrueColors - Red/Green/Blue/Alpha (32 bits) GFL_BGR 0x0020 TrueColors - Blue/Green/Red (24 bits) GFL_ABGR 0x0040 TrueColors - Alpha/Blue/Green/Red (32 bits) GFL_BGRA 0x0100 TrueColors - Blue/Green/Red/Alpha (32 bits) GFL_ARGB 0x0200 TrueColors - Alpha/Red/Green/Blue (32 bits)
- width
- Width of the picture wanted.
- height
- Height of the picture wanted.
- line_padding
- Pad for a pixel line.
- For a value of 4, each line of pixels has a multiple of 4 bytes (32 bits).
- 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
- A pointer to a GFL_BITMAP structure or NULL.
See also
gflAllockBitmapEx
The gflAllockBitmapEx function allocates a picture, and returns a pointer on a GFL_BITMAP structure.
GFL_BITMAP* gflAllockBitmapEx( GFL_BITMAP_TYPE bitmap_type, GFL_INT32 width, GFL_INT32 height, GFL_UINT16 bits_per_component, GFL_UINT32 line_padding, const GFL_COLOR* color );
Parameters
- bitmap_type
- Type of picture wanted.
GFL_BINARY 0x0001 Binary (8 bits) GFL_GREY 0x0002 Grey scale (8 bits) GFL_COLORS 0x0004 Colors with colormap (8 bits) GFL_RGB 0x0008 TrueColors - Red/Green/Blue (24 bits) GFL_RGBA 0x0010 TrueColors - Red/Green/Blue/Alpha (32 bits) GFL_BGR 0x0020 TrueColors - Blue/Green/Red (24 bits) GFL_ABGR 0x0040 TrueColors - Alpha/Blue/Green/Red (32 bits) GFL_BGRA 0x0100 TrueColors - Blue/Green/Red/Alpha (32 bits) GFL_ARGB 0x0200 TrueColors - Alpha/Red/Green/Blue (32 bits)
- width
- Width of the picture wanted.
- height
- Height of the picture wanted.
- bits_per_component
- Bits per component wanted. Can be 8 or 16.
- line_padding
- Pad for a pixel line.
- For a value of 4, each line of pixels has a multiple of 4 bytes (32 bits).
- 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
- A pointer to a GFL_BITMAP structure or NULL.
See also
gflFreeBitmap
The gflFreeBitmap function frees a GFL_BITMAP structure, and his content.
void gflFreeBitmap( GFL_BITMAP* bitmap );
Parameters
- bitmap
- Pointer to a GFL_BITMAP structure.
See also
gflFreeBitmapData
The gflFreeBitmapData function frees the content of a GFL_BITMAP structure.
void gflFreeBitmapData( GFL_BITMAP* bitmap );
Parameters
- bitmap
- Pointer to a GFL_BITMAP structure.
See also
gflCloneBitmap
The gflCloneBitmap function allows to clone a bitmap, and returns a pointer to a GFL_BITMAP structure.
GFL_BITMAP* gflCloneBitmap( const GFL_BITMAP* bitmap );
Parameters
- bitmap
- Pointer to a GFL_BITMAP structure.
Return value
- A pointer to a GFL_BITMAP structure or NULL.
See also
gflMemoryAlloc
The gflMemoryAlloc function allocates memory.
void* gflMemoryAlloc( GFL_UINT32 size );
Parameters
- size
- Size wanted.
Return value
- The function returns NULL if an error occurs.
See also
gflMemoryRealloc
The gflMemoryRealloc function reallocates a memory area.
void* gflMemoryRealloc( void* ptr, GFL_UINT32 size );
Parameters
- ptr
- Pointer to a memory area allocated.
- size
- New size.
Return value
- The function returns NULL if an error occurs.
See also
gflMemoryFree
The gflMemoryFree function frees memory.
void gflMemoryFree( void* ptr );
Parameters
- ptr
- Pointer to a memory area allocated.
See also