Loads an image from file. Open, loads and closes the file. \n * index specifies the image number between 0 and image_count-1. \n * Returns NULL if failed. * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. * * \verbatim im.FileImageLoad(file_name: string, [index: number]) -> image: imImage, error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Loads an image from file, but forces the image to be a bitmap. Open, loads and closes the file. \n * index specifies the image number between 0 and image_count-1. \n * Returns NULL if failed. * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. * * \verbatim im.FileImageLoadBitmap(file_name: string, [index: number]) -> image: imImage, error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Loads an image region from file. Open, loads and closes the file. \n * index specifies the image number between 0 and image_count-1. \n * Returns NULL if failed. * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. \n * For now, it works only for the ECW file format. * * \verbatim im.FileImageLoadRegion(file_name: string, index, bitmap, xmin, xmax, ymin, ymax, width, height: number, ) -> image: imImage, error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Saves the image to file. Open, saves and closes the file. \n * Returns error code. \n * Attributes from the image will be stored at the file. * * \verbatim im.FileImageSave(file_name: string, format: string, image: imImage) -> error: number [in Lua 5] \endverbatim * \verbatim image:Save(file_name: string, format: string) -> error: number [in Lua 5] \endverbatim * \ingroup imgfile
Loads an image from an already open file, but forces the image to be a bitmap.\n * The returned imagem will be always a Bitmap image, with color_space RGB, MAP, GRAY or BINARY, and data_type IM_BYTE. \n * index specifies the image number between 0 and image_count-1. \n * Returns NULL if failed. * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. * * \verbatim ifile:LoadBitmap([index: number]) -> image: imImage, error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Loads an image from an already open file, but forces the image to be a bitmap.\n * This function assumes that the image in the file has the same parameters as the given image. \n * The imagem must be a Bitmap image, with color_space RGB, MAP, GRAY or BINARY, and data_type IM_BYTE. \n * index specifies the image number between 0 and image_count-1. \n * Returns NULL if failed. * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. * * \verbatim ifile:LoadBitmapFrame(index: number, image: imImage) -> error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Loads an image from an already open file. Returns NULL if failed. \n * This will call \ref imFileReadImageInfo and \ref imFileReadImageData. \n * index specifies the image number between 0 and image_count-1. \n * The returned image will be of the same color_space and data_type of the image in the file. \n * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. * * \verbatim ifile:LoadImage([index: number]) -> image: imImage, error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Loads an image from an already open file. Returns NULL if failed. \n * This function assumes that the image in the file has the same parameters as the given image. \n * This will call \ref imFileReadImageInfo and \ref imFileReadImageData. \n * index specifies the image number between 0 and image_count-1. \n * The returned image will be of the same color_space and data_type of the image in the file. \n * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. * * \verbatim ifile:LoadImageFrame(index: number, image: imImage) -> error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Loads an image region from an already open file. Returns NULL if failed. \n * This will call \ref imFileReadImageInfo and \ref imFileReadImageData. \n * index specifies the image number between 0 and image_count-1. \n * The returned image will be of the same color_space and data_type of the image in the file, * or will be a Bitmap image. \n * Attributes from the file will be stored at the image. * See also \ref imErrorCodes. \n * For now, it works only for the ECW file format. * * \verbatim ifile:LoadRegion(index, bitmap, xmin, xmax, ymin, ymax, width, height: number) -> image: imImage, error: number [in Lua 5] \endverbatim * Default index is 0. * \ingroup imgfile
Saves the image to an already open file. \n * This will call \ref imFileWriteImageInfo and \ref imFileWriteImageData. \n * Attributes from the image will be stored at the file. * Returns error code. * * \verbatim ifile:SaveImage(image: imImage) -> error: number [in Lua 5] \endverbatim * \ingroup imgfile
Adds an alpha channel plane and sets its value to 0 (transparent). * * \verbatim image:AddAlpha() [in Lua 5] \endverbatim * \ingroup imgclass
Sets all image data to zero. But if color space is YCBCR, LAB or LUV, and data type is BYTE or USHORT, then * data is initialized with 128 or 32768 accordingly. Alpha is initialized as transparent (0). * * \verbatim image:Clear() [in Lua 5] \endverbatim * \ingroup imgclass
Creates a clone of the image. i.e. same attributes but ignore contents. * * \verbatim image:Clone() -> new_image: imImage [in Lua 5] \endverbatim * \ingroup imgclass
Copy image data and attributes from one image to another. \n * Images must have the same size and type. * * \verbatim image:Copy(dst_image: imImage) [in Lua 5] \endverbatim * \ingroup imgclass
Copies the image attributes from src to dst. * Includes the pallete if defined in both images. * * \verbatim image:CopyAttributes(dst_image: imImage) [in Lua 5] \endverbatim * \ingroup imgclass
Copy image data only fom one image to another. \n * Images must have the same size and type. * * \verbatim image:CopyData(dst_image: imImage) [in Lua 5] \endverbatim * \ingroup imgclass
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
Creates a new image. * See also \ref imDataType and \ref imColorSpace. Image data is cleared as \ref imImageClear. \n * In Lua the IM image metatable name is "imImage". * When converted to a string will return "imImage(%p) [width=%d,height=%d,color_space=%s,data_type=%s,depth=%d]" where %p is replaced by the userdata address, * and other values are replaced by the respective attributes. * If the image is already destroyed by im.ImageDestroy, then it will return also the suffix "-destroyed". * * \verbatim im.ImageCreate(width: number, height: number, color_space: number, data_type: number) -> image: imImage [in Lua 5] \endverbatim * \ingroup imgclass
Creates a new image based on an existing one. \n * If the addicional parameters are -1, the given image parameters are used. \n * The image atributes always are copied. HasAlpha is copied. * See also \ref imDataType and \ref imColorSpace. * * \verbatim im.ImageCreateBased(image: imImage, [width: number], [height: number], [color_space: number], [data_type: number]) -> image: imImage [in Lua 5] \endverbatim * The addicional parameters in Lua can be nil, * and they can also be functions with the based image as a parameter to return the respective value. * \ingroup imgclass
Destroys the image and frees the memory used. * image data is destroyed only if its data[0] is not NULL. \n * In Lua if this function is not called, the image is destroyed by the garbage collector. * * \verbatim im.ImageDestroy(image: imImage) [in Lua 5] \endverbatim * \verbatim image:Destroy() [in Lua 5] \endverbatim * \ingroup imgclass
Creates a copy of the image. * * \verbatim image:Duplicate() -> new_image: imImage [in Lua 5] \endverbatim * \ingroup imgclass
Returns an extended attribute as an integer. * \verbatim image:GetAttribInteger(attrib: string, [index: number]) -> value: number [in Lua 5] \endverbatim \ingroup imgclass
Returns an extended attribute as a real. * \verbatim image:GetAttribReal(attrib: string, [index: number]) -> value: number [in Lua 5] \endverbatim \ingroup imgclass
Returns an extended attribute as a string. * \verbatim image:GetAttribString(attrib: string) -> value: string [in Lua 5] \endverbatim \ingroup imgclass
Returns an extended attribute. \n * Returns NULL if not found. * See also \ref imDataType. * * \verbatim image:GetAttribute(attrib: string, [as_string: boolean]) -> data: table of numbers or string, data_type: number [in Lua 5] \endverbatim * If data_type is IM_BYTE, as_string can be used to return a string instead of a table. * \ingroup imgclass
Returns a list of the attribute names. \n * "attrib" must contain room enough for "attrib_count" names. Use "attrib=NULL" to return only the count. * * \verbatim image:GetAttributeList() -> data: table of strings [in Lua 5] \endverbatim * \ingroup imgclass
Initializes the image structure but does not allocates image data. * See also \ref imDataType and \ref imColorSpace. * The only addtional flag thar color_mode can has here is IM_ALPHA. * To release the image structure without releasing the buffer, * set "data[0]" to NULL before calling imImageDestroy. * \ingroup imgclass
Indicates that the image can be viewed in common graphic devices. * Data type must be IM_BYTE. Color mode can be IM_RGB, IM_MAP, IM_GRAY or IM_BINARY. * * \verbatim image:IsBitmap() -> is_bitmap: boolean [in Lua 5] \endverbatim * \ingroup imgclass
Changes a gray BYTE data (0,255) into a binary data (0,1), done in-place. * Color space is not changed. Data type must be IM_BYTE. * * \verbatim image:MakeBinary() [in Lua 5] \endverbatim * \ingroup imgclass
Changes a binary data (0,1) into a gray BYTE data (0,255), done in-place. * Color space is not changed. Data type must be IM_BYTE. * * \verbatim image:MakeGray() [in Lua 5] \endverbatim * \ingroup imgclass
Returns 1 if the images match in width, height, data type and color space. Returns 0 otherwise. * * \verbatim image:Match(image2: imImage) -> match: boolean [in Lua 5] \endverbatim * \ingroup imgclass
Returns 1 if the images match color mode and data type. Returns 0 otherwise. * * \verbatim image:MatchColor(image2: imImage) -> match: boolean [in Lua 5] \endverbatim * \ingroup imgclass
Returns 1 if the images match width, height and color space. Returns 0 otherwise. * * \verbatim image:MatchColorSpace(image2: imImage) -> match: boolean [in Lua 5] \endverbatim * \ingroup imgclass
Returns 1 if the images match width, height and data type. Returns 0 otherwise. * * \verbatim image:MatchDataType(image2: imImage) -> match: boolean [in Lua 5] \endverbatim * \ingroup imgclass
Returns 1 if the images match width and height. Returns 0 otherwise. * * \verbatim image:MatchSize(image2: imImage) -> match: boolean [in Lua 5] \endverbatim * \ingroup imgclass
Merges the image attributes from src to dst. \n * Attributes that exist in dst are not replaced. * Doens NOT include the pallete. * * \verbatim image:MergeAttributes(dst_image: imImage) [in Lua 5] \endverbatim * \ingroup imgclass
Removes the alpha channel plane if any. * * \verbatim image:RemoveAlpha() [in Lua 5] \endverbatim * \ingroup imgclass
Changes the buffer size. Reallocate internal buffers if the new size is larger than the original. * * \verbatim image:Reshape(width: number, height: number) [in Lua 5] \endverbatim * \ingroup imgclass
Sets the alpha channel plane to a constant. * * \verbatim image:SetAlpha(alpha: number) [in Lua 5] \endverbatim * \ingroup imgclass
Changes an extended attribute as an integer. * \verbatim image:SetAttribInteger(attrib: string, data_type: number, value: number) [in Lua 5] \endverbatim \ingroup imgclass
Changes an extended attribute as a real. * \verbatim image:SetAttribReal(attrib: string, data_type: number, value: number) [in Lua 5] \endverbatim \ingroup imgclass
Changes an extended attribute as a string. * \verbatim image:SetAttribString(attrib: string, value: string) [in Lua 5] \endverbatim \ingroup imgclass
Changes an extended attribute. \n * The data will be internally duplicated. \n * If data is NULL and count==0 the attribute is removed. \n * If count is -1 and data_type is IM_BYTE then data is zero terminated. * See also \ref imDataType. * * \verbatim image:SetAttribute(attrib: string, data_type: number, data: table of numbers or string) [in Lua 5] \endverbatim * If data_type is IM_BYTE, a string can be used as data. * \ingroup imgclass
Changes the image color space to binary * by just changing color_space and the palette. * Image must be MAP or GRAY/BYTE. * * \verbatim image:SetBinary() [in Lua 5] \endverbatim * \ingroup imgclass
Changes the image color space to gray * by just changing color_space and the palette. * Image must be BINARY or MAP. Palette is changed only if image was BINARY. * * \verbatim image:SetGray() [in Lua 5] \endverbatim * \ingroup imgclass
Changes the image color space to map * by just changing color_space. \n * Image must be BINARY or GRAY/BYTE. * * \verbatim image:SetMap() [in Lua 5] \endverbatim * \ingroup imgclass
Changes the image palette. * This will destroy the existing palette and replace it with the given palette pointer. * Only the pointer is stored, so the palette should be a new palette and it can not be a static array. * * \verbatim image:SetPalette(palette: imPalette) [in Lua 5] \endverbatim * \ingroup imgclass
\brief Image Representation Structure * * \par * An image representation than supports all the color spaces, * but planes are always unpacked and the orientation is always bottom up. * \ingroup imgclass
\file \brief Image Manipulation
See Copyright Notice in im_lib.d