class Hpdf::Image
- Hpdf::Image
- Reference
- Object
Overview
The image is used to display image to a page mainly. To create/load an image use:
- PNG
Doc#load_png_image_from_file
- RAW
Doc#load_raw_image_from_file
orDoc#load_raw_image_from_mem
- JPEG
Doc#load_jpeg_image_from_file
Included Modules
Defined in:
hpdf/image.crConstructors
Instance Method Summary
-
#bits_per_component : Number
gets the number of bits used to describe each color component.
-
#color_space : String
gets the name of the image's color space.
-
#height : Number
gets the height of the image of an image object.
-
#mask_image=(mask : Image)
sets the mask image.
-
#set_color_mask(*, rmin : UInt8 = 0, rmax : UInt8 = 0, gmin : UInt8 = 0, gmax : UInt8 = 0, bmin : UInt8 = 0, bmax : UInt8 = 0)
sets the transparent color of the image by the RGB range values.
-
#size : Size
gets the size of the image of an image object.
- #to_unsafe : LibHaru::Image
-
#width : Number
gets the width of the image of an image object.
Instance methods inherited from module Hpdf::Helper
bool(val : Bool) : Int32
bool,
nilable_str(v : Pointer(UInt8)) : String | Nil
nilable_str,
real(val : Number) : LibHaru::Real
real,
uint(val : Number) : LibHaru::UInt
uint,
uint16(val : Number) : UInt16
uint16
Constructor Detail
Instance Method Detail
def color_space : String
#
gets the name of the image's color space.
Usually one of "DeviceGray"
, "DeviceRGB"
, "DeviceCMYK"
or
"Indexed"
.
sets the mask image.
- mask image object which is used as image-mask. This image must be 1bit gray-scale color image.
def set_color_mask(*, rmin : UInt8 = 0, rmax : UInt8 = 0, gmin : UInt8 = 0, gmax : UInt8 = 0, bmin : UInt8 = 0, bmax : UInt8 = 0)
#
sets the transparent color of the image by the RGB range values. The color within the range is displayed as a transparent color. The Image must be RGB color space.
- rmin lower limit of Red. It must be between
0
and255
. - rmax upper limit of Red. It must be between
0
and255
. - gmin lower limit of Green. It must be between
0
and255
. - gmax upper limit of Green. It must be between
0
and255
. - bmin lower limit of Blue. It must be between
0
and255
. - bmax upper limit of Blue. It must be between
0
and255
.