NAME
SMS::Image - common image conversion functions for use in SMS applications.
SYNOPSIS
use SMS::Image qw(png_to_ota);
# Read PNG data from file, convert into OTA bitmap, and write back to file.
my $png;
my $buf; # temporary buffer
open(F,'<test.png') || die;
binmode(F);
while(read F, $buf, 1024) {
$png .= $buf;
}
close(F);
my $ota;
&png_to_ota(\$png,\$ota);
open(F,'>test.ota') || die;
binmode(F);
print F $ota;
close(F);
DESCRIPTION
SMS::Image contains common image conversion functions for use in SMS applications.
FUNCTIONS
All functions have no return value.
- gif_to_ota(\$gif,\$ota)
-
Converts monochrome GIF image into an OTA bitmap. The module Image::Magick must be installed in order to use this function.
Parameters:
1. Reference to GIF image buffer. 2. Reference to receive buffer for OTA bitmap.
- ota_to_gif(\$ota,\$gif)
-
Converts a monochrome OTA bitmap into a monochrome GIF image.
Parameters:
1. Reference to OTA image buffer. 2. Reference to receive buffer for GIF bitmap.
- png_to_ota(\$png,\$ota)
-
Converts monochrome PNG image into an OTA bitmap. The module Image::Magick must be installed in order to use this function.
Parameters:
1. Reference to PNG image buffer. 2. Reference to receive buffer for OTA bitmap.
- ota_to_png(\$ota,\$png)
-
Converts a monochrome OTA bitmap into a monochrome PNG image.
Parameters:
1. Reference to OTA image buffer. 2. Reference to receive buffer for PNG bitmap.
- raw_to_ota(\$raw,$width,$height,$bits_per_pixel,\$ota)
-
Converts a raw binary image into an OTA bitmap. The raw binary image is a buffer of pixels from left to right and top to bottom where the top left pixel is the lowest order bit and the bottom right pixel is the highest order bit.
Parameters:
1. Reference to raw binary image buffer. 2. Image width. 3. Image height. 4. Color depth (currently only a value of 1 is supported). 5. Reference to receive buffer for OTA bitmap.
Returns boolean result.
- ota_to_raw(\$ota,\$raw)
-
Converts an OTA bitmap into a raw binary image. The raw binary image is a buffer of pixels from left to right and top to bottom where the top left pixel is the lowest order bit and the bottom right pixel is the highest order bit. Only single image monoschrome OTA bitmaps are currently supported.
Parameters:
1. Reference to OTA bitmap buffer. 2. Reference to receive buffer for raw binary image.
Returns array of image width, image height, color depth.
HISTORY
- Version 0.01 2001-11-05
-
Initial version
- Version 0.02 2001-11-07
-
Added support for GIF to OTA bitmap conversion and vice versa.
AUTHOR
Craig Manley c.manley@skybound.nl
COPYRIGHT
Copyright (C) 2001 Craig Manley <c.manley@skybound.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under under the same terms as Perl itself. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.