Update of /cvsroot/perl-win32-gui/Win32-GUI-DIBitmap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32157
Added Files:
Changes DIBitmap.html DIBitmap.pm DIBitmap.xs MANIFEST
Makefile.PL Readme TYPEMAP
Log Message:
Added to repository
--- NEW FILE: Makefile.PL ---
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Win32::GUI::DIBitmap',
'VERSION_FROM' => 'DIBitmap.pm',
'XS' => { 'DIBitmap.xs' => 'DIBitmap.cpp' },
'LIBS' => ['Msvcprt.lib'], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'MYEXTLIB' => 'extlib/FreeImage.lib',
($] ge '5.005')
? (
'AUTHOR' => 'ROCHER Laurent ([EMAIL PROTECTED])',
'ABSTRACT' => 'Add new load/save image format and some image
manipulation',
)
: (),
);
sub MY::xs_c {
'
.xs.c:
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG)
$(XSUBPPARGS) $*.xs > $*.c
.xs.cpp:
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG)
$(XSUBPPARGS) $*.xs > $*.cpp
';
}
--- NEW FILE: DIBitmap.html ---
<HTML>
<HEAD>
<TITLE>DIBitmap.pm</TITLE>
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#package functions">PACKAGE FUNCTIONS</A></LI>
<UL>
<LI><A HREF="#freeimage library info functions">FreeImage
Library Info functions</A></LI>
<LI><A HREF="#fif functions">FIF functions</A></LI>
<LI><A HREF="#fif info functions">FIF info functions</A></LI>
<LI><A HREF="#colors functions">Colors functions</A></LI>
</UL>
<LI><A HREF="#dibitmap object">DIBITMAP OBJECT</A></LI>
<UL>
<LI><A HREF="#dibitmap new methods">DIBitmap New
methods</A></LI>
<LI><A HREF="#dibitmap save methods">DIBitmap Save
methods</A></LI>
<LI><A HREF="#dibitmap information methods">DIBitmap
information methods</A></LI>
<LI><A HREF="#dibitmap and gd">DIBitmap and GD</A></LI>
<LI><A HREF="#dibitmap pixels and background methods">DIBitmap
Pixels and Background methods</A></LI>
<LI><A HREF="#dibitmap convertion methods">DIBitmap Convertion
methods</A></LI>
<LI><A HREF="#dibitmap rotating and flipping">DIBitmap Rotating
and flipping</A></LI>
<LI><A HREF="#dibitmap upsampling / downsampling">DIBitmap
UpSampling / DownSampling</A></LI>
<LI><A HREF="#dibitmap color manipulation">DIBitmap Color
manipulation</A></LI>
<LI><A HREF="#dibitmap channel methods">DIBitmap Channel
methods</A></LI>
<LI><A HREF="#dibitmap copy/paste methods">DIBitmap Copy/Paste
methods</A></LI>
<LI><A HREF="#dibitmap devise context methods">DIBitmap Devise
Context methods</A></LI>
</UL>
<LI><A HREF="#mdibitmap object">MDIBITMAP OBJECT</A></LI>
<UL>
<LI><A HREF="#mdibitmap new methods">MDIBitmap New
methods</A></LI>
<LI><A HREF="#mdibitmap get methods">MDIBitmap Get
methods</A></LI>
<LI><A HREF="#mdibitmap lock methods">MDIBitmap Lock
methods</A></LI>
<LI><A HREF="#mdibitmap edit methods">MDIBitmap Edit
methods</A></LI>
</UL>
<LI><A HREF="#author">AUTHOR</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Win32::GUI::DIBitmap add new reading/writing bitmap formats to Win32::GUI
and some image manipulation.</P>
<P>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use Win32::GUI;
use Win32::GUI::DIBitmap;</PRE>
<PRE>
$W = new Win32::GUI::Window (
-title => "Win32::GUI::DIBitmap test",
-pos => [100, 100],
-size => [400, 400],
-name => "Window",
);</PRE>
<PRE>
$dib = newFromFile Win32::GUI::DIBitmap ('image.jpg');
$hbitmap = $dib->ConvertToBitmap();
undef $dib;</PRE>
<PRE>
$W->AddButton (
-pos => [100, 100],
-size => [200, 200],
-bitmap => $hbitmap,
-name => "Button",
-visible => 1,
);</PRE>
<PRE>
$W->Show();
Win32::GUI::Dialog();
sub Window_Terminate { -1 }</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Win32::GUI::DIBitmap add new reading/writing bitmap formats to Win32::GUI
and some image manipulation.</P>
<P>This package use FreeImage 3.5.1, an open source image library supporting
all common
bitmap formats (visit : <A
HREF="http://freeimage.sourceforge.net/">http://freeimage.sourceforge.net/</A>
).</P>
<P>Supports many formats, such as:</P>
<PRE>
Format Reading Writing Description
BMP Y Y Windows or OS/2 Bitmap [Export = 1 4 8 16 24 32]
ICO Y Y Windows Icon [Export = 1 4 8 16 24 32]
JPEG Y Y JPEG - JFIF Compliant [Export = 8 24]
JNG Y N JPEG Network Graphics
KOALA Y N C64 Koala Graphics
IFF Y N IFF Interleaved Bitmap
MNG Y N Multiple Network Graphics
PBM Y Y Portable Bitmap (ASCII) [Export = 1 8 24]
PBMRAW Y Y Portable Bitmap (RAW) [Export = 1 8 24]
PCD Y N Kodak PhotoCD
PCX Y N Zsoft Paintbrush
PGM Y Y Portable Greymap (ASCII) [Export = 1 8 24]
PGMRAW Y Y Portable Greymap (RAW) [Export = 1 8 24]
PNG Y Y Portable Network Graphics [Export = 1 4 8 24 32]
PPM Y Y Portable Pixelmap (ASCII) [Export = 1 8 24]
PPMRAW Y Y Portable Pixelmap (RAW) [Export = 1 8 24]
RAS Y N Sun Raster Image
TARGA Y Y Truevision Targa [Export = 8 16 24 32]
TIFF Y Y Tagged Image File Format [Export = 1 4 8 24 32]
WBMP Y Y Wireless Bitmap [Export = 1]
PSD Y N Adobe Photoshop
CUT Y N Dr. Halo
XBM Y N X11 Bitmap Format
XPM Y Y X11 Pixmap Format [Export = 8 24]
DDS Y N DirectX Surface
GIF Y Y Graphics Interchange Format [Export = 8]</PRE>
<P>FreeImage can handle multi-page file (TIFF and ICO support only).</P>
<P>
<HR>
<H1><A NAME="package functions">PACKAGE FUNCTIONS</A></H1>
<P>
<H2><A NAME="freeimage library info functions">FreeImage Library Info
functions</A></H2>
<DL>
<DT><STRONG><A NAME="item_GetVersion"><CODE>GetVersion</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return the FreeImage version string.</PRE>
<DT><STRONG><A NAME="item_GetCopyright"><CODE>GetCopyright</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return the FreeImage copyright string.</PRE>
</DL>
<P>
<H2><A NAME="fif functions">FIF functions</A></H2>
<DL>
<DT><STRONG><A NAME="item_Constante"><CODE>Constante</CODE></A></STRONG><BR>
<DD>
<PRE>
FIF = Format Identifier File.</PRE>
<PRE>
FIF_UNKNOWN = -1
FIF_BMP FIF_ICO FIF_JPEG FIF_JNG
FIF_KOALA FIF_LBM FIF_MNG FIF_PBM
FIF_PBMRAW FIF_PCD FIF_PCX FIF_PGM
FIF_PGMRAW FIF_PNG FIF_PPM FIF_PPMRAW
FIF_RAS FIF_TARGA FIF_TIFF FIF_WBMP
FIF_PSD FIF_IFF FIF_LBM FIF_CUT
FIF_XBM FIF_XPM FIF_DDS FIF_GIF</PRE>
<DT><STRONG><A NAME="item_GetFIFCount"><CODE>GetFIFCount</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return the max FIF value.</PRE>
<DT><STRONG><A NAME="item_GetFormatFromFIF"><CODE>GetFormatFromFIF</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
Return the string format from FIF value.</PRE>
<DT><STRONG><A NAME="item_GetFIFFromFormat"><CODE>GetFIFFromFormat</CODE>
(format)</A></STRONG><BR>
<DD>
<PRE>
Return FIF value from the string format.</PRE>
<DT><STRONG><A NAME="item_GetFIFFromMime"><CODE>GetFIFFromMime</CODE>
(mime)</A></STRONG><BR>
<DD>
<PRE>
Return FIF value from the Mime string.</PRE>
<DT><STRONG><A NAME="item_GetFIFFromFilename"><CODE>GetFIFFromFilename</CODE>
(filename)</A></STRONG><BR>
<DD>
<PRE>
Return FIF value from the filename string.</PRE>
<DT><STRONG><A NAME="item_GetFIFFromFile"><CODE>GetFIFFromFile</CODE>
(filename)</A></STRONG><BR>
<DD>
<PRE>
Return FIF value from file data.</PRE>
<DT><STRONG><A NAME="item_GetFIFFromData"><CODE>GetFIFFromData</CODE>
(data)</A></STRONG><BR>
<DD>
<PRE>
Return FIF value from memory data.</PRE>
</DL>
<P>
<H2><A NAME="fif info functions">FIF info functions</A></H2>
<DL>
<DT><STRONG><A NAME="item_FIFExtensionList"><CODE>FIFExtensionList</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
Return a coma separated string of extension filenname.</PRE>
<DT><STRONG><A NAME="item_FIFDescription"><CODE>FIFDescription</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
Return a description string of the format.</PRE>
<DT><STRONG><A NAME="item_FIFRegExpr"><CODE>FIFRegExpr</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
Return a regexp string for identify format.</PRE>
<DT><STRONG><A NAME="item_FIFMimeType"><CODE>FIFMimeType</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
Return a mime-type string of the format.</PRE>
<DT><STRONG><A NAME="item_FIFSupportsReading"><CODE>FIFSupportsReading</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
This format can be read ?</PRE>
<DT><STRONG><A NAME="item_FIFSupportsWriting"><CODE>FIFSupportsWriting</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
This format can be write ?</PRE>
<DT><STRONG><A
NAME="item_FIFSupportsExportBPP"><CODE>FIFSupportsExportBPP</CODE> (fif,
bpp)</A></STRONG><BR>
<DD>
<PRE>
This format can be write bpp image ?</PRE>
<DT><STRONG><A
NAME="item_FIFSupportsExportType"><CODE>FIFSupportsExportType</CODE> (fif,
type)</A></STRONG><BR>
<DD>
<PRE>
This format can export as image format type ?</PRE>
<DT><STRONG><A
NAME="item_FIFSupportsICCProfiles"><CODE>FIFSupportsICCProfiles</CODE>
(fif)</A></STRONG><BR>
<DD>
<PRE>
This format support ICC profile ?</PRE>
</DL>
<P>
<H2><A NAME="colors functions">Colors functions</A></H2>
<DL>
<DT><STRONG><A NAME="item_LookupX11Color"><CODE>LookupX11Color</CODE>
(string_color)</A></STRONG><BR>
<DD>
<PRE>
Return Color of string color or undef if error.
This color value can be an integer value or a [B,G,R,A] array.</PRE>
<DT><STRONG><A NAME="item_LookupSVGColor"><CODE>LookupSVGColor</CODE>
(string_color)</A></STRONG><BR>
<DD>
<PRE>
Return Color of string color or undef if error.
This color value can be an integer value or a [B,G,R,A] array.</PRE>
</DL>
<P>
<HR>
<H1><A NAME="dibitmap object">DIBITMAP OBJECT</A></H1>
<P>
<H2><A NAME="dibitmap new methods">DIBitmap New methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_new"><CODE>new</CODE> ([width=100, height=100,
bpp=24, redmask=0, bluemask=0, greemask=0, type=FIT_BITMAP])</A></STRONG><BR>
<DD>
<PRE>
Allocate a Win32::GUI::DIBitmap object.</PRE>
<PRE>
Image storage type availlable.</PRE>
<PRE>
FIT_UNKNOWN = 0 : unknown type
FIT_BITMAP = 1 : standard image : 1-, 4-, 8-, 16-, 24-, 32-bit
FIT_UINT16 = 2 : array of unsigned short : unsigned 16-bit
FIT_INT16 = 3 : array of short : signed 16-bit
FIT_UINT32 = 4 : array of unsigned long : unsigned 32-bit
FIT_INT32 = 5 : array of long : signed 32-bit
FIT_FLOAT = 6 : array of float : 32-bit IEEE floating point
FIT_DOUBLE = 7 : array of double : 64-bit IEEE floating point
FIT_COMPLEX = 8 : array of FICOMPLEX : 2 x 64-bit IEEE floating
point</PRE>
<DT><STRONG><A NAME="item_newFromFile"><CODE>newFromFile</CODE> (filename,
[flag])</A></STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::DIBBitmap from a image file.</PRE>
<PRE>
Some format have special load flag :</PRE>
<PRE>
Type | Flag | Description
-------+-------------------+--------------------------------------------------
ICO | ICO_MAKEALPHA | Convert to 32bpp and create an alpha channel
from the AND-mask when loading
JPEG | JPEG_FAST | Load file as fast as possible (sacrifing quality)
| JPEG_ACCURATE | Load file with the best quality (sacrifing speed)
PCD | PCD_BASE | Load picture sized 768 * 512.
PCD | PCD_BASEDIV4 | Load picture sized 384 * 256.
PCD | PCD_BASEDIV16 | Load picture sized 192 * 128.
PNG | PNG_IGNOREGAMMA | Avoid gamma correction
TARGA | TARGA_LOAD_RGB888 | Convert RGB555 and ARGB8888 to RGB888
TIFF | TIFF_CMYK | Load CMYK bitmap as 32 bit separated CMYK.</PRE>
<DT><STRONG><A NAME="item_newFromData"><CODE>newFromData</CODE> (data,
[flag])</A></STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::DIBitmap from memory data.</PRE>
<DT><STRONG><A NAME="item_newFromBitmap"><CODE>newFromBitmap</CODE>
(hbitmap)</A></STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::DIBitmap from a Win32::GUI::Bitmap.</PRE>
<DT><STRONG><A NAME="item_newFromDC"><CODE>newFromDC</CODE> (hdc, [x, y, w, h]
)</A></STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::DIBitmap from a Win32::GUI::DC.</PRE>
<PRE>
You can capture only a portion of the HDC with x,y,w,h option.</PRE>
<DT><STRONG><A NAME="item_newFromWindow"><CODE>newFromWindow</CODE> (hwnd,
[flag = 0])</A></STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::DIBitmap from a Win32::GUI::Window.</PRE>
<PRE>
flag = 0 : All the window is capture (with border)
flag = 1 : Only the Client window is capture</PRE>
</DL>
<P>
<H2><A NAME="dibitmap save methods">DIBitmap Save methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_SaveToFile"><CODE>SaveToFile</CODE> (filename, [fif,
flag])</A></STRONG><BR>
<DD>
<PRE>
Save a Win32::GUI::DIBitmap in a file.</PRE>
<PRE>
Some format have special save format :</PRE>
<PRE>
Type | Flag | Description
------+---------------------+--------------------------------------------------
BMP | BMP_SAVE_RLE | Compress bitmap using RLE
JPEG | JPEG_DEFAULT | Save with good quality (75:1)
| JPEG_QUALITYSUPERB | Save with superb quality (100:1)
| JPEG_QUALITYGOOD | Save with good quality (75:1)
| JPEG_QUALITYNORMAL | Save with normal quality (50:1)
| JPEG_QUALITYAVERAGE | Save with average quality (25:1)
| JPEG_QUALITYBAD | Save with bad quality (10:1)
PxM | PNM_DEFAULT | Save bitmap as a binary file
| PNM_SAVE_RAW | Save bitmap as a binary file
| PNM_SAVE_ASCII | Save bitmap as a ascii file
TIFF | TIFF_DEFAULT | Save using CCITFAX4 compression for 1bit and
PACKBITS for other
| TIFF_CMYK | Store tags for separated CMYK (conbine with
compresion flag)
| TIFF_PACKBITS | Save using PACKBITS compression
| TIFF_DEFLATE | Save using DEFLATE compression
| TIFF_ADOBE_DEFLATE | Save using Adobe DEFLATE compression
| TIFF_NONE | Save without compression
| TIFF_CCITTFAX3 | Save using CCITT Group 3 fax encoding
| TIFF_CCITTFAX4 | Save using CCITT Group 4 fax encoding
| TIFF_LZW | Save using LZW compression</PRE>
<PRE>
A tempory convertion is done for 16-32bit JPEG and 16bit PNG before
saving.</PRE>
<DT><STRONG><A NAME="item_SaveToData"><CODE>SaveToData</CODE> (fif,
[flag])</A></STRONG><BR>
<DD>
<PRE>
Save a Win32::GUI::DIBitmap in memory.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap information methods">DIBitmap information methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_GetWidth"><CODE>GetWidth</CODE> () or
<CODE>Width</CODE></A></STRONG><BR>
<DD>
<PRE>
Return the Width of the image.</PRE>
<DT><STRONG><A NAME="item_GetHeight"><CODE>GetHeight</CODE> () or
<CODE>Height</CODE></A></STRONG><BR>
<DD>
<PRE>
Return the Height of the image.</PRE>
<DT><STRONG><A NAME="item_GetColorsUsed"><CODE>GetColorsUsed</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return the number of color use in the image.</PRE>
<DT><STRONG><A NAME="item_GetBpp"><CODE>GetBpp</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Return the bit per pixel use in the image.</PRE>
<DT><STRONG><A NAME="item_GetRedMask"><CODE>GetRedMask</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return a bit pattern describing the red color copmponent of a pixel.</PRE>
<DT><STRONG><A NAME="item_GetGreenMask"><CODE>GetGreenMask</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return a bit pattern describing the green color copmponent of a pixel.</PRE>
<DT><STRONG><A NAME="item_GetBlueMask"><CODE>GetBlueMask</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return a bit pattern describing the blue color copmponent of a pixel.</PRE>
<DT><STRONG><A NAME="item_GetColorType"><CODE>GetColorType</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return the color type of the image.</PRE>
<PRE>
Values :
FIC_MINISWHITE = 0 : Monochrome bitmap, with first palette entry is white
FIC_MINISBLACK = 1 : Monochrome bitmap, with first palette entry is black
Palletised bitmap, with greyscale palette
FIC_RGB = 2 : RGB color model
FIC_PALETTE = 3 : Color map indexed
FIC_RGBALPHA = 4 : RGB color model with alpha channel
FIC_CMYK = 5 : CMYK color model</PRE>
<DT><STRONG><A NAME="item_GetPitch"><CODE>GetPitch</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Return pitch of data image.
Pitch it's the width of the bitmap in bytes, rounded to the next 32 bit
boundary.</PRE>
<DT><STRONG><A NAME="item_GetDotsPerMeterX"><CODE>GetDotsPerMeterX</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return dots per meter on X.</PRE>
<DT><STRONG><A NAME="item_GetDotsPerMeterY"><CODE>GetDotsPerMeterY</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return dots per meter on Y.</PRE>
<DT><STRONG><A NAME="item_GetInfoHeader"><CODE>GetInfoHeader</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return a windows BITMAPINFOHEADER struct.</PRE>
<DT><STRONG><A NAME="item_GetInfo"><CODE>GetInfo</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Return a window BITMAPINFO struct.</PRE>
<DT><STRONG><A NAME="item_GetSize"><CODE>GetSize</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Return memory size of data for the image</PRE>
<DT><STRONG><A NAME="item_GetBits"><CODE>GetBits</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Return data of the image</PRE>
<DT><STRONG><A NAME="item_IsTransparent"><CODE>IsTransparent</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Image is transparent.</PRE>
<DT><STRONG><A NAME="item_GetImageType"><CODE>GetImageType</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return image type.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap and gd">DIBitmap and GD</A></H2>
<DL>
<DT><STRONG><A NAME="item_newFromGD"><CODE>newFromGD</CODE> (gd,
newGD=0)</A></STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::DIBitmap from a GD image
New object have same size and format, gd image copy into.</PRE>
<PRE>
Flag newGD is for new GD version (> 2.0) with trueColor bitmap.
Default value force 8 bit bitmap.</PRE>
<DT><STRONG><A NAME="item_CopyFromGD"><CODE>CopyFromGD</CODE> (gd,
newGD=0)</A></STRONG><BR>
<DD>
<PRE>
Copy GD image into Win32::GUI::DIBitmap.
GD and Win32::GUI::DIBitmap must have same size and format.</PRE>
<DT><STRONG><A NAME="item_CopyToGD"><CODE>CopyToGD</CODE> (gd,
newGD=0)</A></STRONG><BR>
<DD>
<PRE>
Copy Win32::GUI::DIBitmap into GD image.
GD and Win32::GUI::DIBitmap must have same size and format.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap pixels and background methods">DIBitmap Pixels and
Background methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_GetPixel"><CODE>GetPixel</CODE> (x,
y)</A></STRONG><BR>
<DD>
<PRE>
Return pixel value color at x, y or undef if error.
For image with BPP <= 8 return palette index color.
For image with BPP > 8 return color value.
This color value can be an integer value or a [B,G,R,A] array.</PRE>
<DT><STRONG><A NAME="item_SetPixel"><CODE>SetPixel</CODE> (x, y, color | Blue,
Green, Red, [Alpha])</A></STRONG><BR>
<DD>
<PRE>
Set pixel value color at x, y.
Return boolean value.
For image with BPP <= 8, it's palette color index.
For image with BPP > 8, arguments can an integer color value or B,G,R,[A]
values.</PRE>
<DT><STRONG><A NAME="item_HasBackgroundColor"><CODE>HasBackgroundColor</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Indicate if image have Background Color.</PRE>
<DT><STRONG><A NAME="item_GetBackgroundColor"><CODE>GetBackgroundColor</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Return Background Color or undef if error.
This color value can be an integer value or a [B,G,R,A] array.</PRE>
<DT><STRONG><A NAME="item_SetBackgroundColor"><CODE>SetBackgroundColor</CODE>
(color | Blue, Green, Red, [Alpha])</A></STRONG><BR>
<DD>
<PRE>
Set Background Color.
Return boolean value.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap convertion methods">DIBitmap Convertion methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_ConvertToBitmap"><CODE>ConvertToBitmap</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new Win32::GUI::Bitmap.</PRE>
<DT><STRONG><A NAME="item_ConvertTo4its"><CODE>ConvertTo4its</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 4 bits Win32::GUI::DIBitmap.</PRE>
<DT><STRONG><A NAME="item_ConvertTo8Bits"><CODE>ConvertTo8Bits</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 8 bits (grayscale)
Win32::GUI::DIBitmap.
See ColorQuantize for convert to 8 bits colors.</PRE>
<DT><STRONG><A NAME="item_ConvertTo16Bits555"><CODE>ConvertTo16Bits555</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 16 bits Win32::GUI::DIBitmap (555
format).</PRE>
<DT><STRONG><A NAME="item_ConvertTo16Bits565"><CODE>ConvertTo16Bits565</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 16 bits Win32::GUI::DIBitmap (565
format).</PRE>
<DT><STRONG><A NAME="item_ConvertTo24Bits"><CODE>ConvertTo24Bits</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 24 bits Win32::GUI::DIBitmap.</PRE>
<DT><STRONG><A NAME="item_ConvertTo32Bits"><CODE>ConvertTo32Bits</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 32 bits Win32::GUI::DIBitmap.</PRE>
<DT><STRONG><A NAME="item_ColorQuantize"><CODE>ColorQuantize</CODE> ([flag =
FIQ_WUQUANT])</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 8 bits (colorscale)
Win32::GUI::DIBitmap.
None 24 bits image are converted to 24bits before.</PRE>
<PRE>
Flag possible value :
FIQ_WUQUANT = Xiaolin Wu color quantization algorithm
FIQ_NNQUANT = NeuQuant neural-net quantization algorithm by Anthony
Dekker</PRE>
<DT><STRONG><A NAME="item_Threshold"><CODE>Threshold</CODE> (T)</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 1 bit Win32::GUI::DIBitmap using a
Threshold between 0..255.</PRE>
<DT><STRONG><A NAME="item_Dither"><CODE>Dither</CODE> ([flag =
FID_FS])</A></STRONG><BR>
<DD>
<PRE>
Convert a Win32::GUI::DIBitmap to a new 1 bit Win32::GUI::DIBitmap.</PRE>
<PRE>
Flag possible value :
FID_FS = Floyd and Steinberg error diffusion algorithm.
FID_BAYER4x4 = Bayer ordered dispersed dot dithering (order 2 - 4*4
matrix)
FID_BAYER8x8 = Bayer ordered dispersed dot dithering (order 3 - 8*8
matrix)
FID_CLUSTER6x6 = Ordered clustered dot dithering (order 3 - 6*6 matrix)
FID_CLUSTER8x8 = Ordered clustered dot dithering (order 4 - 8*8 matrix)
FID_CLUSTER16x16 = Ordered clustered dot dithering (order 8 - 16*16
matrix)</PRE>
<DT><STRONG><A
NAME="item_ConvertToStandardType"><CODE>ConvertToStandardType</CODE>
([scale_linear=TRUE])</A></STRONG><BR>
<DD>
<DT><STRONG><A NAME="item_ConvertToType"><CODE>ConvertToType</CODE> (type,
[scale_linear=TRUE])</A></STRONG><BR>
<DD>
<PRE>
For type see new method.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap rotating and flipping">DIBitmap Rotating and
flipping</A></H2>
<DL>
<DT><STRONG><A NAME="item_Rotate"><CODE>Rotate</CODE> (angle)</A></STRONG><BR>
<DD>
<PRE>
Create a new rotated Win32::GUI::DIBitmap (8,24,32 bits only)</PRE>
<PRE>
This function rotates an 8-bit greyscale, 24- or 32-bit image by means of 3
shears. The angle
of rotation is specified by the angle parameter in degrees. Rotation occurs
around the center
of the image area. Rotated image retains size and aspect ratio of source
image (destination
image size is usually bigger), so that this function should be used when
rotating an image by
90°, 180° or 270°.</PRE>
<DT><STRONG><A NAME="item_RotateEx"><CODE>RotateEx</CODE> (angle, x_shift,
y_shift, x_origin, y_origin, use_mask)</A></STRONG><BR>
<DD>
<PRE>
Create a new rotated/translated Win32::GUI::DIBitmap (8,24,32 bits only)</PRE>
<PRE>
This function performs a rotation and / or translation of an 8-bit greyscale,
24- or 32-bit
image, using a 3rd order (cubic) B-Spline. The rotated image will have the
same width and
height as the source image, so that this function is better suited for
computer vision and
robotics.
The angle of rotation is specified by the angle parameter in degrees.
Horizontal and vertical
image translations (in pixel units) are specified by the x_shift and y_shift
parameters.
Rotation occurs around the center specified by x_origin and y_origin, also
given in pixel units.
When use_mask is set to TRUE, the irrelevant part of the image is set to a
black color,
otherwise, a mirroring technique is used to fill irrelevant pixels.</PRE>
<DT><STRONG><A NAME="item_FlipHorizontal"><CODE>FlipHorizontal</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Flip DIBitmap dib horizontally along the vertical axis.</PRE>
<DT><STRONG><A NAME="item_FlipVertical"><CODE>FlipVertical</CODE>
()</A></STRONG><BR>
<DD>
<PRE>
Flip DIBitmap vertically along the horizontal axis.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap upsampling / downsampling">DIBitmap UpSampling /
DownSampling</A></H2>
<DL>
<DT><STRONG><A NAME="item_Rescale"><CODE>Rescale</CODE> (new_width, new_heigth,
filter=FILTER_BOX)</A></STRONG><BR>
<DD>
<PRE>
Create a new size Win32::GUI::DIBitmap (32 bits only)</PRE>
<PRE>
This function performs resampling (or scaling, zooming) of a 32-bit image to
the desired destination width and height.
Resampling refers to changing the pixel dimensions (and therefore display
size) of an image.
When you downsample (or decrease the number of pixels), information is
deleted from the image. When you upsample (or increase the number of pixels),
new pixels are added based
on color values of existing pixels. You specify an interpolation filter to
determine how pixels are added or deleted.</PRE>
<PRE>
The following filters can be used as resampling filters:
FILTER_BOX = Box, pulse, Fourier window, 1st order (constant)
B-Spline
FILTER_BILINEAR = Bilinear filter
FILTER_BSPLINE = 4th order (cubic) B-Spline
FILTER_BICUBIC = Mitchell and Netravali's two-param cubic filter
FILTER_CATMULLROM = Catmull-Rom spline, Overhauser spline
FILTER_LANCZOS3 = Lanczos-windowed sinc filter</PRE>
</DL>
<P>
<H2><A NAME="dibitmap color manipulation">DIBitmap Color manipulation</A></H2>
<DL>
<DT><STRONG><A NAME="item_AdjustGamma"><CODE>AdjustGamma</CODE>
(gamma)</A></STRONG><BR>
<DD>
<PRE>
Adjust Gamma of Win32::GUI::DIBitmap (8,24,32 bits only)</PRE>
<PRE>
The gamma parameter represents the gamma value to use (gamma > 0).
A value of 1.0 leaves the image alone, less than one darkens it, and greater
than one lightens it.</PRE>
<DT><STRONG><A NAME="item_AdjustBrightness"><CODE>AdjustBrightness</CODE>
(percentage)</A></STRONG><BR>
<DD>
<PRE>
Adjust Brightness of Win32::GUI::DIBitmap (8,24,32 bits only)</PRE>
<PRE>
Adjusts the brightness of a 8-, 24- or 32-bit image by a certain amount.
This amount is given by the percentage parameter, where percentage is a value
between [-100..100].
A value 0 means no change, less than 0 will make the image darker and greater
than 0 will make the image brighter.</PRE>
<DT><STRONG><A NAME="item_AdjustContrast"><CODE>AdjustContrast</CODE>
(percentage)</A></STRONG><BR>
<DD>
<PRE>
Adjust ContrastCreate of Win32::GUI::DIBitmap (8,24,32 bits only)</PRE>
<PRE>
Adjusts the contrast of a 8-, 24- or 32-bit image by a certain amount.
This amount is given by the percentage parameter, where percentage is a value
between [-100..100].
A value 0 means no change, less than 0 will decrease the contrast and greater
than 0 will increase the contrast of the image.</PRE>
<DT><STRONG><A NAME="item_Invert"><CODE>Invert</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Inverts each pixel data.</PRE>
<DT><STRONG><A NAME="item_GetHistogram"><CODE>GetHistogram</CODE>
(channel)</A></STRONG><BR>
<DD>
<PRE>
Return a histogram array[0..255] of a Win32::GUI::DIBitmap (8,24,32 bits
only)</PRE>
<PRE>
Computes the image histogram.
For 24-bit and 32-bit images, histogram can be computed from red, green, blue
and black channels.
For 8-bit images, histogram is computed from the black channel.</PRE>
</DL>
<P>
<H2><A NAME="dibitmap channel methods">DIBitmap Channel methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_Channel_Constante"><CODE>Channel
Constante</CODE></A></STRONG><BR>
<DD>
<PRE>
FICC_RGB = 0 : Use red, green and blue channels
FICC_RED = 1 : Use red channel
FICC_GREEN = 2 : Use green channel
FICC_BLUE = 3 : Use blue channel
FICC_ALPHA = 4 : Use alpha channel
FICC_BLACK = 5 : Use black channel
FICC_REAL = 6 : Complex images: use real part
FICC_IMAG = 7 : Complex images: use imaginary part
FICC_MAG = 8 : Complex images: use magnitude
FICC_PHASE = 9 : Complex images: use phase</PRE>
<DT><STRONG><A NAME="item_GetChannel"><CODE>GetChannel</CODE>
(channel)</A></STRONG><BR>
<DD>
<PRE>
Return a 8bits channel Win32::GUI::DIBitmap.</PRE>
<PRE>
Retrieves the red, green, blue or alpha channel of a 24 or 32-bit BGR[A]
image.
Channel is the color channel to extract.</PRE>
<PRE>
24,32 only</PRE>
<DT><STRONG><A NAME="item_SetChannel"><CODE>SetChannel</CODE> (channel,
8bit_image)</A></STRONG><BR>
<DD>
<PRE>
Set the red, green, blue or alpha channel of a 24 or 32-bit BGR[A] image.
Channel is the color channel to set.</PRE>
<PRE>
24,32 only</PRE>
<DT><STRONG><A NAME="item_GetComplexChannel"><CODE>GetComplexChannel</CODE>
(channel)</A></STRONG><BR>
<DD>
<PRE>
Return a complex channel Win32::GUI::DIBitmap.</PRE>
<PRE>
Retrieves the red, green, blue or alpha channel of a 24 or 32-bit BGR[A]
image.
Channel is the color channel to extract.</PRE>
<PRE>
24,32 only</PRE>
<DT><STRONG><A NAME="item_SetComplexChannel"><CODE>SetComplexChannel</CODE>
(channel, 8bit_image)</A></STRONG><BR>
<DD>
<PRE>
Set the red, green, blue or alpha channel of a 24 or 32-bit BGR[A] image.
Channel is the complex channel to set.</PRE>
<PRE>
24,32 only</PRE>
</DL>
<P>
<H2><A NAME="dibitmap copy/paste methods">DIBitmap Copy/Paste methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_Clone"><CODE>Clone</CODE> ()</A></STRONG><BR>
<DD>
<PRE>
Clone a Win32::GUI::DIBitmap to a new Win32::GUI::Bitmap.</PRE>
<DT><STRONG><A NAME="item_Copy"><CODE>Copy</CODE> (left, top, right,
botton)</A></STRONG><BR>
<DD>
<PRE>
Return a new Win32::GUI::Bitmap with a sub part Win32::GUI::DIBitmap (8, 16,
24 or 32 only).</PRE>
<PRE>
Left specifies the left position of the cropped rectangle.
Top specifies the top position of the cropped rectangle.
Right specifies the right position of the cropped rectangle.
Bottom specifies the bottom position of the cropped rectangle.</PRE>
<DT><STRONG><A NAME="item_Paste"><CODE>Paste</CODE> (source_image, left, top,
alpha)</A></STRONG><BR>
<DD>
<PRE>
Returns TRUE if successful, FALSE otherwise ( 8, 16, 24 or 32 only).</PRE>
<PRE>
Alpha blend or combine a sub part image with the current dib image.
The bit depth must be greater than or equal to the bit depth of source
image.</PRE>
<PRE>
Alpha is alpha blend factor.
The source and destination images are alpha blended if alpha=0..255.
If alpha > 255, then the source image is combined to the destination
image.</PRE>
<DT><STRONG><A NAME="item_Composite"><CODE>Composite</CODE> ([useFileBkg=FALSE,
imageBkg=undef appBkColor=undef)</A></STRONG><BR>
<DD>
</DL>
<P>
<H2><A NAME="dibitmap devise context methods">DIBitmap Devise Context
methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_CopyToDC"><CODE>CopyToDC</CODE> (hdc, [xd=0, yd=0,
w=0, h=0, xs=0, ys=0])</A></STRONG><BR>
<DD>
<PRE>
Copy Win32::GUI::DIBitmap to a Win32::GUI::DC.</PRE>
<PRE>
Specify the destination rectangle with xd,yd,w,h option.
Specify the begining of the image with xs,ys option.
The image copy keep the same size.</PRE>
<DT><STRONG><A NAME="item_AlphaCopyToDC"><CODE>AlphaCopyToDC</CODE> (hdc,
[xd=0, yd=0, w=0, h=0, xs=0, ys=0])</A></STRONG><BR>
<DD>
<PRE>
Copy Win32::GUI::DIBitmap to a Win32::GUI::DC with transparency / alpha
channel support.</PRE>
<PRE>
Specify the destination rectangle with xd,yd,w,h option.
Specify the begining of the image with xs,ys option.
The image copy keep the same size.</PRE>
<DT><STRONG><A NAME="item_StretchToDC"><CODE>StretchToDC</CODE> (hdc, [xd=0,
yd=0, wd=0, hd=0, xs=0, ys=0, ws=0, hs=0, flag=SRCCOPY])</A></STRONG><BR>
<DD>
<PRE>
Copy Win32::GUI::DIBitmap to a Win32::GUI::DC.</PRE>
<PRE>
Specify the destination rectangle with xd,yd,wd,hd option.
Specify the image source rectangle ith xs,ys,ws,hs option.
The image copy is resize if necessary.</PRE>
<PRE>
For flag option, see StretchDIBits win32 function.</PRE>
<DT><STRONG><A NAME="item_AlphaStretchToDC"><CODE>AlphaStretchToDC</CODE> (hdc,
[xd=0, yd=0, wd=0, hd=0, xs=0, ys=0, ws=0, hs=0)</A></STRONG><BR>
<DD>
<PRE>
Copy Win32::GUI::DIBitmap to a Win32::GUI::DC with transparency / alpha
channel support.</PRE>
<PRE>
Specify the destination rectangle with xd,yd,wd,hd option.
Specify the image source rectangle ith xs,ys,ws,hs option.
The image copy is resize if necessary.</PRE>
</DL>
<P>
<HR>
<H1><A NAME="mdibitmap object">MDIBITMAP OBJECT</A></H1>
<P>
<H2><A NAME="mdibitmap new methods">MDIBitmap New methods</A></H2>
<DL>
<DT><STRONG><CODE>new</CODE> (filename, fif=-1,
keep_cache_in_memory=0)</STRONG><BR>
<DD>
<PRE>
Create a new Win32::GUI::MDIBBitmap in edit mode.</PRE>
<DT><STRONG><CODE>newFromFile</CODE> (filename, read_only=1,
keep_cache_in_memory=0)</STRONG><BR>
<DD>
<PRE>
Create a Win32::GUI::MDIBBitmap from a image file.</PRE>
</DL>
<P>
<H2><A NAME="mdibitmap get methods">MDIBitmap Get methods</A></H2>
<DL>
<DT><STRONG><A
NAME="item_GetPageCount"><CODE>GetPageCount</CODE></A></STRONG><BR>
<DD>
<PRE>
Return page count.</PRE>
<DT><STRONG><A
NAME="item_GetLockedPageNumbers"><CODE>GetLockedPageNumbers</CODE></A></STRONG><BR>
<DD>
<PRE>
Return a list of locked page index.</PRE>
</DL>
<P>
<H2><A NAME="mdibitmap lock methods">MDIBitmap Lock methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_LockPage"><CODE>LockPage</CODE> ([index =
0])</A></STRONG><BR>
<DD>
<PRE>
Lock and return a page (Win32::GUI::DIBitmap object).</PRE>
<DT><STRONG><A NAME="item_UnlockPage"><CODE>UnlockPage</CODE>
(Win32::GUI::DIBitmap, [update = 0])</A></STRONG><BR>
<DD>
<PRE>
Unlock a locked page (Win32::GUI::DIBitmap object).
Update indicate if the page must be updated.</PRE>
</DL>
<P>
<H2><A NAME="mdibitmap edit methods">MDIBitmap Edit methods</A></H2>
<DL>
<DT><STRONG><A NAME="item_AppendPage"><CODE>AppendPage</CODE>
(Win32::GUI::DIBitmap)</A></STRONG><BR>
<DD>
<PRE>
Append a Win32::GUI::DIBitmap to a Win32::GUI::MDIBBitmap.</PRE>
<DT><STRONG><A NAME="item_InsertPage"><CODE>InsertPage</CODE>
(Win32::GUI::DIBitmap, [index = 0])</A></STRONG><BR>
<DD>
<PRE>
Insert a Win32::GUI::DIBitmap in a Win32::GUI::MDIBBitmap.</PRE>
<DT><STRONG><A NAME="item_DeletePage"><CODE>DeletePage</CODE> ([index =
0])</A></STRONG><BR>
<DD>
<PRE>
Delete a page from a Win32::GUI::MDIBBitmap.</PRE>
<DT><STRONG><A NAME="item_MovePage"><CODE>MovePage</CODE> (to_index,
[from_index = 0])</A></STRONG><BR>
<DD>
<PRE>
Move a page in a Win32::GUI::MDIBBitmap.</PRE>
</DL>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<PRE>
Laurent Rocher ([EMAIL PROTECTED])
HomePage : <A
HREF="http://perso.club-internet.fr/rocherl/Win32GUI.html">http://perso.club-internet.fr/rocherl/Win32GUI.html</A></PRE>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P>Win32::GUI</P>
</BODY>
</HTML>
--- NEW FILE: MANIFEST ---
Readme
Changes
DIBitmap.pm
DIBitmap.xs
TYPEMAP
Makefile.PL
MANIFEST
--- NEW FILE: Changes ---
Revision history for Perl extension FreeImage.
0.15 28 / 11 / 2004
- Use FreeImage 3.5.1 (GIF support and LZW compression, improvements,
bug fix, ...)
- New Win32::GUI::DIBitmap method
-> GetFIFMimeType
-> ConvertTo4Bits
0.14 21 / 02 / 2004
- Use FreeImage 3.2.0
- New Win32::GUI::DIBitmap method
-> Image internal format
-> Pixel and and Background methods
+ SetPixel
+ GetPixel
+ HasBackgroundColor
+ GetBackgroundColor
+ SetBackgroundColor
-> Conversion with new internal type
-> Chanel processing
+ GetComplexChannel
+ SetComplexChannel
0.13 08 / 12 / 2003
- Correct memory leak in NewFromWindow, newFromDC [Thank to Steve Pick]
0.12 17 / 11 / 2003
- Use FreeImage 3.0.4
0.11 11 / 11 / 2003
- Use FreeImage 3.0.3
0.10 28 / 10 / 2003
- Use FreeImage 3.0.2
0.09 24 / 10 / 2003
- Use FreeImage 3.0.1
0.08 28 / 09 / 2003
- Use FreeImage 3.0.0
- New format : XBM, XPM
- New Win32::GUI::DIBitmap method
-> Conversion
+ Threshold : Convert to 1 bit
+ Dither : Convert to 1 bit
-> Color manipulation
+ AdjustGamma
+ AdjustBrightness
+ AdjustContrast
+ Invert : Invert effect
+ GetHistogram : Get Color histogram
-> Chanel processing
+ GetChannel
+ SetChannel
-> Copy/Paste
+ Copy
+ Paste
-> Rotation / flipping
+ Rotate : Create a rotated Bitmap (>= 8 bits only)
+ RotateEx : Create a rotated/translated Bitmap (>= 8 bits
only)
+ FlipVerticaly : Flip Verticaly effect
+ FlipHorizontaly : Flip Horizontaly effect
-> UpSampling / DownSampling
+ Rescale : Create a rescaled Bitmap (32 bits only)
- New TIFF save format option.
- New sample : read image from zipfile.
0.07 24 / 04 / 2003
- New Win32::GUI::DIBitmap method
+ newFromGD
+ CopyFromGD, CopyToGD : Must have Same Size and BPP.
- UPDATE 1 : Add switch for old GD version
- UPDATE 2 : Correct upside down bitmap bug
0.06 28 / 05 / 2002
- Use FreeImage 2.5.3
- Add FreeImage Multipaging interface
0.05 14 / 01 / 2002
- Use FreeImage 2.5.0
- Add FreeImage Multipaging interface (experimental in this release)
- New Win32::GUI::DIBitmap method
+ Clone
+ AlphaCopyToDC
+ AlphaStrechToDC
0.04 29 / 10 / 2001
- Use FreeImage 2.4.2
- Fix bug in jpeg plug-in
0.03 18 / 08 / 2001
- Correct Bug when capture screen if display isn't in 32 bits
- Add new function GetColorType
- ColorQuantize work if image isn't in 24 bits
- Add more Documentation
0.02 15 / 08 / 2001
- Use FreeImage 2.4.1
- Some little change
0.01 21 / 03 / 2001
- original version; created by h2xs 1.19
- First build Win32::GUI::DIBitmap
--- NEW FILE: Readme ---
Win32::GUI::DIBitmap 0.14
=========================
Win32::GUI::DIBitmap add new reading/writing bitmap formats to Win32::GUI
and some image manipulation.
INSTALLATION
Download FreeImage source code at http://freeimage.sourceforge.net/
Build the FreeImage static lib with MSVC project.
Copy the FreeImage.lib and FreeImage.h in the extlib directory.
To install this module type the following:
perl Makefile.PL
make
make install
DEPENDENCIES
This module requires these other modules and libraries:
Win32::GUI
FreeImage lirary (http://freeimage.sourceforge.net/)
WEB PAGE AND PPM REPOSITORY
See: http://perso.club-internet.fr/rocherl/Win32GUI.html
COPYRIGHT AND LICENCE
Copyright 2003 by Laurent Rocher ([EMAIL PROTECTED]).
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>.
--- NEW FILE: DIBitmap.xs ---
/**********************************************************************/
/* D I B i t m a p . x s */
/**********************************************************************/
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#define FREEIMAGE_LIB
#include ".\extlib\FreeImage.h"
/*--------------------------------------------------------------------*/
// #define IO_HANDLER_DEBUG
#define BREAK_POINT __asm { int 3 };
/*--------------------------------------------------------------------*/
[...2810 lines suppressed...]
##################################################################
##################################################################
#
# Free routine
#
#
# DESTROY
#
void
DESTROY(mdib)
Win32::GUI::MDIBitmap mdib
CODE:
FreeImage_CloseMultiBitmap(mdib);
#
#
##################################################################
--- NEW FILE: DIBitmap.pm ---
package Win32::GUI::DIBitmap;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use Carp 'croak','carp';
require Exporter;
require DynaLoader;
require AutoLoader;
@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw (
FIF_UNKNOWN
FIF_BMP
FIF_CUT
[...1022 lines suppressed...]
Insert a Win32::GUI::DIBitmap in a Win32::GUI::MDIBBitmap.
=item C<DeletePage> ([index = 0])
Delete a page from a Win32::GUI::MDIBBitmap.
=item C<MovePage> (to_index, [from_index = 0])
Move a page in a Win32::GUI::MDIBBitmap.
=head1 AUTHOR
Laurent Rocher ([EMAIL PROTECTED])
HomePage : http://perso.club-internet.fr/rocherl/Win32GUI.html
=head1 SEE ALSO
Win32::GUI
=cut
--- NEW FILE: TYPEMAP ---
TYPEMAP
LPCTSTR T_PV
LPCSTR T_PV
LPTSTR T_PV
DWORD T_IV
UINT T_IV
BOOL T_IV
FREE_IMAGE_FORMAT T_IV
FREE_IMAGE_QUANTIZE T_IV
FREE_IMAGE_COLOR_TYPE T_IV
FREE_IMAGE_DITHER T_IV
FREE_IMAGE_FILTER T_IV
FREE_IMAGE_COLOR_CHANNEL T_IV
FREE_IMAGE_TYPE T_IV
Win32::GUI::DIBitmap T_PTROBJ
Win32::GUI::DIBitmap::Ext T_PTROBJ
Win32::GUI::MDIBitmap T_PTROBJ
HBITMAP T_HANDLE
HDC T_HANDLE
HWND T_HANDLE
GD::Image T_PTROBJ
################################################################################
INPUT
T_HANDLE
if(SvROK($arg)) {
if(hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0) != NULL)
$var = ($type) SvIV(*(hv_fetch((HV*)SvRV($arg), \"-handle\", 7,
0)));
else
$var = NULL;
} else
$var = ($type) SvIV($arg);
################################################################################
OUTPUT
T_HANDLE
sv_setiv($arg, (IV) $var);