Module eg_pdf_image

Data Types

img_head_t()

img_head_t() = {jpeg_head | png_head, {integer(), integer(), integer(), integer()}}

Function Index

deflate_stream/1Compress a bit stream using the zlib/deflate algorithm.
get_head_info/1When called with a file path string, this returns a tuple of info on the jpeg at the file path location.
get_png_content/1opens the PNG file indicated by the calling parameter and returns a tuple like [Params, MoreParams, Palette, Image2 , Alpha_channel].
inflate_stream/1Decompress a bit stream using the zlib/deflate algorithm.
mk_images/4mk_images takes a list of images and turns them into PDF XObjects to go into the PDF document.
process_header/1It can also follow the following pattern:.

Function Details

deflate_stream/1

deflate_stream(Data::binary()) -> {ok, binary()}

Compress a bit stream using the zlib/deflate algorithm

get_head_info/1

get_head_info(File::file:name_all()) -> atom() | img_head_t()

When called with a file path string, this returns a tuple of info on the jpeg at the file path location. The tuple is like the following

{ jpeg_head, { Width(pixels), Height(pixels), Number_of_color_components(1, 3, 4), Data_precision(bits size)}}

get_png_content/1

get_png_content(File::file:name_all()) -> error | term()

opens the PNG file indicated by the calling parameter and returns a tuple like [Params, MoreParams, Palette, Image2 , Alpha_channel]. This has the Parameters that descibe the image and the content of the image as appropriate for the type of PNG. Palette has the color palatte for indexed color images. Image2 has the image pixels. Alpha_channel has the transparaency overlay to control the display of the Image2 pixels.

inflate_stream/1

inflate_stream(Data::binary()) -> {ok, binary()}

Decompress a bit stream using the zlib/deflate algorithm

mk_images/4

mk_images(T::Images, I::Count, Is::[], Os::[]) -> {Free, XObjects, O0s}

mk_images takes a list of images and turns them into PDF XObjects to go into the PDF document.

process_header/1

process_header(Any::binary()) -> img_head_t()

It can also follow the following pattern:

process_header(image content) ->{png_head,{Width, Height, Color_type, Data_precision}}, {params, Compression, Filter_method, Interface_method}, Palette, Image, Alpha_channel].

Same as get_head_info except it is called with a binary that holds the content of a JPG file. This returns a tuple of info on the jpeg. The tuple is like the following
{ jpeg_head, { Width(pixels), Height(pixels), Number_of_color_components(1, 3, 4), Data_precision(bits size)}}


Generated by EDoc