diff options
-rw-r--r-- | html/en/history.html | 11 | ||||
-rw-r--r-- | include/im_image.h | 20 | ||||
-rw-r--r-- | mak.vc9/im.sln | 45 | ||||
-rw-r--r-- | mak.vc9/im_copy.vcproj | 1 | ||||
-rw-r--r-- | mak.vc9/im_info.vcproj | 1 | ||||
-rw-r--r-- | mak.vc9/im_view.vcproj | 1 | ||||
-rw-r--r-- | src/im.def | 1 | ||||
-rw-r--r-- | src/im_image.cpp | 11 | ||||
-rw-r--r-- | src/lua5/imlua_image.c | 25 |
9 files changed, 105 insertions, 11 deletions
diff --git a/html/en/history.html b/html/en/history.html index 76df670..47bd86d 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -12,8 +12,13 @@ <h2>History of Changes</h2> <h3 dir="ltr"> - CVS (23/11/2009</h3> + CVS (25/Dec/2009)</h3> <ul dir="ltr"> + <li><span style="color: #0000FF">New:</span> function <strong> + imImageCopyPlane</strong>.</li> + <li dir="ltr"> + <span style="color: #008000">Changed:</span> libTIFF updated to version + 3.9.2.</li> <li dir="ltr"><span style="color: #008000"><span style="color: #ff0000">Fixed:</span><span style="color: #000000"> invalid memory access in <strong> imAnalyzeFindRegions</strong> when more than 16k regions where found.</span></span></li> @@ -42,8 +47,8 @@ version 3.5.</li> <li><span style="color: #008000">Changed:</span> libJPEG updated to version 7.</li> - <li><span style="color: #008000">Changed:</span> libEXIF updated to version 0.6.17.<br> - <span style="color: #008000">Changed:</span> libTIFF updated to version + <li><span style="color: #008000">Changed:</span> libEXIF updated to version 0.6.17.</li> + <li><span style="color: #008000">Changed:</span> libTIFF updated to version 3.9.1.</li> <li><span style="color: #008000">Changed:</span> library im_fftw3 to use an external library.</li> diff --git a/include/im_image.h b/include/im_image.h index 12dbad8..28c5369 100644 --- a/include/im_image.h +++ b/include/im_image.h @@ -129,6 +129,20 @@ void imImageCopy(const imImage* src_image, imImage* dst_image); * \ingroup imgclass */ void imImageCopyData(const imImage* src_image, imImage* dst_image); +/** Copies the image attributes from src to dst. + * Includes the pallete when a MAP or GRAY image. + * + * \verbatim image:CopyAttributes(dst_image: imImage) [in Lua 5] \endverbatim + * \ingroup imgclass */ +void imImageCopyAttributes(const imImage* src_image, imImage* dst_image); + +/** Copy one image plane fom one image to another. \n + * Images must have the same size and type. + * + * \verbatim image:CopyPlane(src_plane: number, dst_image: imImage, dst_plane: number) [in Lua 5] \endverbatim + * \ingroup imgclass */ +void imImageCopyPlane(const imImage* src_image, int src_plane, imImage* dst_image, int dst_plane); + /** Creates a copy of the image. * * \verbatim image:Duplicate() -> new_image: imImage [in Lua 5] \endverbatim @@ -190,12 +204,6 @@ int imImageIsBitmap(const imImage* image); * \ingroup imgclass */ void imImageSetPalette(imImage* image, long* palette, int palette_count); -/** Copies the image attributes from src to dst. - * - * \verbatim image:CopyAttributes(dst_image: imImage) [in Lua 5] \endverbatim - * \ingroup imgclass */ -void imImageCopyAttributes(const imImage* src_image, imImage* dst_image); - /** Returns 1 if the images match width and height. Returns 0 otherwise. * * \verbatim image:MatchSize(image2: imImage) -> match: boolean [in Lua 5] \endverbatim diff --git a/mak.vc9/im.sln b/mak.vc9/im.sln index 2a2d791..06da12a 100644 --- a/mak.vc9/im.sln +++ b/mak.vc9/im.sln @@ -61,6 +61,8 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + DebugGTK|Win32 = DebugGTK|Win32 + DebugGTK|x64 = DebugGTK|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection @@ -68,89 +70,132 @@ Global {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.Debug|Win32.ActiveCfg = Debug|Win32 {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.Debug|Win32.Build.0 = Debug|Win32 {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.Debug|x64.ActiveCfg = Debug|x64 + {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.DebugGTK|Win32.ActiveCfg = Debug|x64 + {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.DebugGTK|x64.ActiveCfg = Debug|x64 + {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.DebugGTK|x64.Build.0 = Debug|x64 {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.Release|Win32.ActiveCfg = Debug|Win32 {5A761929-07C3-48BD-8E4A-B37EC5C72C42}.Release|x64.ActiveCfg = Debug|x64 {CB863607-6B6C-0000-0000-000000000000}.Debug|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000000000}.Debug|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-0000-000000000000}.Debug|x64.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-0000-000000000000}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-0000-000000000000}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB863607-6B6C-0000-0000-000000000000}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000000000}.Release|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000000000}.Release|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-0000-000000000000}.Release|x64.ActiveCfg = Debug|Win32 {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.Debug|Win32.ActiveCfg = Debug|Win32 {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.Debug|Win32.Build.0 = Debug|Win32 {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.Debug|x64.ActiveCfg = Debug|Win32 + {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.Release|Win32.ActiveCfg = Debug|Win32 {CB868607-6B6C-4CDF-9B6D-27AA925AE473}.Release|x64.ActiveCfg = Debug|Win32 {CB96E607-6B6C-0000-0000-000000000000}.Debug|Win32.ActiveCfg = Debug|Win32 {CB96E607-6B6C-0000-0000-000000000000}.Debug|Win32.Build.0 = Debug|Win32 {CB96E607-6B6C-0000-0000-000000000000}.Debug|x64.ActiveCfg = Debug|Win32 + {CB96E607-6B6C-0000-0000-000000000000}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB96E607-6B6C-0000-0000-000000000000}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB96E607-6B6C-0000-0000-000000000000}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB96E607-6B6C-0000-0000-000000000000}.Release|Win32.ActiveCfg = Debug|Win32 {CB96E607-6B6C-0000-0000-000000000000}.Release|x64.ActiveCfg = Debug|Win32 {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.Debug|Win32.ActiveCfg = Debug|Win32 {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.Debug|Win32.Build.0 = Debug|Win32 {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.Debug|x64.ActiveCfg = Debug|Win32 + {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.Release|Win32.ActiveCfg = Debug|Win32 {CB80E607-6B6C-4ADF-9B6D-27AA925AE493}.Release|x64.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.Debug|Win32.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.Debug|Win32.Build.0 = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.Debug|x64.ActiveCfg = Debug|Win32 + {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.Release|Win32.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA925AE463}.Release|x64.ActiveCfg = Debug|Win32 {CB80E607-6B6C-345F-9B6D-27AA9123E493}.Debug|Win32.ActiveCfg = Debug|Win32 {CB80E607-6B6C-345F-9B6D-27AA9123E493}.Debug|Win32.Build.0 = Debug|Win32 {CB80E607-6B6C-345F-9B6D-27AA9123E493}.Debug|x64.ActiveCfg = Debug|Win32 + {CB80E607-6B6C-345F-9B6D-27AA9123E493}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB80E607-6B6C-345F-9B6D-27AA9123E493}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB80E607-6B6C-345F-9B6D-27AA9123E493}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB80E607-6B6C-345F-9B6D-27AA9123E493}.Release|Win32.ActiveCfg = Debug|Win32 {CB80E607-6B6C-345F-9B6D-27AA9123E493}.Release|x64.ActiveCfg = Debug|Win32 {43564684-75A9-41FE-847B-BF8514C14571}.Debug|Win32.ActiveCfg = Debug|Win32 {43564684-75A9-41FE-847B-BF8514C14571}.Debug|Win32.Build.0 = Debug|Win32 {43564684-75A9-41FE-847B-BF8514C14571}.Debug|x64.ActiveCfg = Debug|Win32 + {43564684-75A9-41FE-847B-BF8514C14571}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {43564684-75A9-41FE-847B-BF8514C14571}.DebugGTK|x64.ActiveCfg = Debug|Win32 {43564684-75A9-41FE-847B-BF8514C14571}.Release|Win32.ActiveCfg = Debug|Win32 {43564684-75A9-41FE-847B-BF8514C14571}.Release|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000001234}.Debug|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000001234}.Debug|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-0000-000000001234}.Debug|x64.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-0000-000000001234}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-0000-000000001234}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000001234}.Release|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-000000001234}.Release|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-0000-000000001234}.Release|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-678900001234}.Debug|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-678900001234}.Debug|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-0000-678900001234}.Debug|x64.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-0000-678900001234}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-0000-678900001234}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-678900001234}.Release|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-0000-678900001234}.Release|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-0000-678900001234}.Release|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-1234-000000001234}.Debug|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-1234-000000001234}.Debug|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-1234-000000001234}.Debug|x64.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-1234-000000001234}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-1234-000000001234}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-1234-000000001234}.Release|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-1234-000000001234}.Release|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-1234-000000001234}.Release|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-7689-000000001234}.Debug|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-7689-000000001234}.Debug|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-7689-000000001234}.Debug|x64.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-7689-000000001234}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB863607-6B6C-0000-7689-000000001234}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-7689-000000001234}.Release|Win32.ActiveCfg = Debug|Win32 {CB863607-6B6C-0000-7689-000000001234}.Release|Win32.Build.0 = Debug|Win32 {CB863607-6B6C-0000-7689-000000001234}.Release|x64.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Debug|Win32.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Debug|Win32.Build.0 = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Debug|x64.ActiveCfg = Debug|Win32 + {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.DebugGTK|Win32.Build.0 = Debug|Win32 + {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.DebugGTK|x64.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Release|Win32.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Release|Win32.Build.0 = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Release|x64.ActiveCfg = Debug|Win32 {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|Win32.ActiveCfg = Debug|Win32 {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|Win32.Build.0 = Debug|Win32 {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|x64.ActiveCfg = Debug|Win32 + {909637FA-8229-45A9-9F42-53D8ED5F91C5}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {909637FA-8229-45A9-9F42-53D8ED5F91C5}.DebugGTK|Win32.Build.0 = Debug|Win32 + {909637FA-8229-45A9-9F42-53D8ED5F91C5}.DebugGTK|x64.ActiveCfg = Debug|Win32 {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Release|Win32.ActiveCfg = Debug|Win32 {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Release|Win32.Build.0 = Debug|Win32 {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Release|x64.ActiveCfg = Debug|Win32 {328002C9-0726-4BB5-AD09-1BA1DC96F912}.Debug|Win32.ActiveCfg = Debug|Win32 {328002C9-0726-4BB5-AD09-1BA1DC96F912}.Debug|Win32.Build.0 = Debug|Win32 {328002C9-0726-4BB5-AD09-1BA1DC96F912}.Debug|x64.ActiveCfg = Debug|Win32 + {328002C9-0726-4BB5-AD09-1BA1DC96F912}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {328002C9-0726-4BB5-AD09-1BA1DC96F912}.DebugGTK|Win32.Build.0 = Debug|Win32 + {328002C9-0726-4BB5-AD09-1BA1DC96F912}.DebugGTK|x64.ActiveCfg = Debug|Win32 {328002C9-0726-4BB5-AD09-1BA1DC96F912}.Release|Win32.ActiveCfg = Debug|Win32 {328002C9-0726-4BB5-AD09-1BA1DC96F912}.Release|Win32.Build.0 = Debug|Win32 {328002C9-0726-4BB5-AD09-1BA1DC96F912}.Release|x64.ActiveCfg = Debug|Win32 {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.Debug|Win32.ActiveCfg = Debug|Win32 {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.Debug|Win32.Build.0 = Debug|Win32 {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.Debug|x64.ActiveCfg = Debug|Win32 + {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.DebugGTK|Win32.ActiveCfg = Debug|Win32 + {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.DebugGTK|Win32.Build.0 = Debug|Win32 + {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.DebugGTK|x64.ActiveCfg = Debug|Win32 {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.Release|Win32.ActiveCfg = Debug|Win32 {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.Release|Win32.Build.0 = Debug|Win32 {99675DC2-A7EE-4BC8-B7E7-CD437D4FAC3B}.Release|x64.ActiveCfg = Debug|Win32 diff --git a/mak.vc9/im_copy.vcproj b/mak.vc9/im_copy.vcproj index d9bc064..c538ec6 100644 --- a/mak.vc9/im_copy.vcproj +++ b/mak.vc9/im_copy.vcproj @@ -69,6 +69,7 @@ OutputFile="$(OutDir)\$(ProjectName).exe" LinkIncremental="1" AdditionalLibraryDirectories="D:\LNG\WMFSDK9\lib;../lib" + GenerateManifest="false" GenerateDebugInformation="true" ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb" SubSystem="1" diff --git a/mak.vc9/im_info.vcproj b/mak.vc9/im_info.vcproj index 7cdd700..ffd3943 100644 --- a/mak.vc9/im_info.vcproj +++ b/mak.vc9/im_info.vcproj @@ -69,6 +69,7 @@ OutputFile="$(OutDir)\$(ProjectName).exe" LinkIncremental="1" AdditionalLibraryDirectories="D:\LNG\WMFSDK9\lib;../lib" + GenerateManifest="false" GenerateDebugInformation="true" ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb" SubSystem="1" diff --git a/mak.vc9/im_view.vcproj b/mak.vc9/im_view.vcproj index e7642c7..6ae9671 100644 --- a/mak.vc9/im_view.vcproj +++ b/mak.vc9/im_view.vcproj @@ -69,6 +69,7 @@ OutputFile="$(OutDir)\$(ProjectName).exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib;../../iup/lib;../../cd/lib" + GenerateManifest="false" GenerateDebugInformation="true" ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb" SubSystem="1" @@ -118,6 +118,7 @@ EXPORTS imImageSetPalette imImageCopy imImageCopyData + imImageCopyPlane imImageCreateBased imImageAddAlpha imDibToHBitmap diff --git a/src/im_image.cpp b/src/im_image.cpp index 1fb993d..7bbeff1 100644 --- a/src/im_image.cpp +++ b/src/im_image.cpp @@ -2,7 +2,7 @@ * \brief Image Manipulation * * See Copyright Notice in im_lib.h - * $Id: im_image.cpp,v 1.4 2009/08/13 22:34:25 scuri Exp $ + * $Id: im_image.cpp,v 1.5 2009/12/25 22:43:50 scuri Exp $ */ #include <stdlib.h> @@ -302,6 +302,15 @@ void imImageCopyData(const imImage* src_image, imImage* dst_image) } } +void imImageCopyPlane(const imImage* src_image, int src_plane, imImage* dst_image, int dst_plane) +{ + assert(src_image); + assert(dst_image); + assert(imImageMatch(src_image, dst_image)); + + memcpy(dst_image->data[src_plane], src_image->data[dst_plane], src_image->plane_size); +} + imImage* imImageDuplicate(const imImage* image) { assert(image); diff --git a/src/lua5/imlua_image.c b/src/lua5/imlua_image.c index 40b1e9c..32a3080 100644 --- a/src/lua5/imlua_image.c +++ b/src/lua5/imlua_image.c @@ -2,7 +2,7 @@ * \brief IM Lua 5 Binding * * See Copyright Notice in im_lib.h - * $Id: imlua_image.c,v 1.5 2009/09/25 18:40:31 scuri Exp $ + * $Id: imlua_image.c,v 1.6 2009/12/25 22:43:50 scuri Exp $ */ #include <string.h> @@ -167,6 +167,28 @@ static int imluaImageCopyData (lua_State *L) } /*****************************************************************************\ + image:CopyPlane() +\*****************************************************************************/ +static int imluaImageCopyPlane(lua_State *L) +{ + imImage* src_image = imlua_checkimage(L, 1); + int src_plane = luaL_checkint(L, 2); + imImage* dst_image = imlua_checkimage(L, 3); + int dst_plane = luaL_checkint(L, 4); + + imlua_match(L, src_image, dst_image); + + if (src_plane < 0 || src_plane >= src_image->depth) + luaL_argerror(L, 2, "invalid source channel, out of bounds"); + + if (dst_plane < 0 || dst_plane >= dst_image->depth) + luaL_argerror(L, 4, "invalid destiny channel, out of bounds"); + + imImageCopyPlane(src_image, src_plane, dst_image, dst_plane); + return 0; +} + +/*****************************************************************************\ image:Duplicate() \*****************************************************************************/ static int imluaImageDuplicate (lua_State *L) @@ -992,6 +1014,7 @@ static const luaL_reg imimage_metalib[] = { {"Reshape", imluaImageReshape}, {"Copy", imluaImageCopy}, {"CopyData", imluaImageCopyData}, + {"CopyPlane", imluaImageCopyPlane}, {"Duplicate", imluaImageDuplicate}, {"Clone", imluaImageClone}, {"SetAttribute", imluaImageSetAttribute}, |