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_fileorDoc#load_png_image - JPEG
Doc#load_jpeg_image_from_fileorDoc#load_jpeg_image - RAW
Doc#load_raw_image_from_file,Doc#load_raw_image_from_mem, orDoc#load_raw1_bit_image
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.
-
#size2 : Size
gets the size of the image via an out-parameter variant of
#size. -
#smask=(smask : Image)
attaches a soft-mask image to this image for per-pixel opacity control.
- #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
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.
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
0and255. - rmax upper limit of Red. It must be between
0and255. - gmin lower limit of Green. It must be between
0and255. - gmax upper limit of Green. It must be between
0and255. - bmin lower limit of Blue. It must be between
0and255. - bmax upper limit of Blue. It must be between
0and255.
gets the size of the image via an out-parameter variant of #size.
Both methods return the same value; this one exists for completeness.
attaches a soft-mask image to this image for per-pixel opacity control. The soft mask must be a grayscale image: white = fully opaque, black = fully transparent.
- smask the grayscale
Imageto use as a soft mask.