class Hpdf::Image

Overview

The image is used to display image to a page mainly. To create/load an image use:

Included Modules

Defined in:

hpdf/image.cr

Constructors

Instance Method Summary

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

def self.new(image : LibHaru::Image, doc : Doc) #

[View source]

Instance Method Detail

def bits_per_component : Number #

gets the number of bits used to describe each color component.


[View source]
def color_space : String #

gets the name of the image's color space. Usually one of "DeviceGray", "DeviceRGB", "DeviceCMYK" or "Indexed".


[View source]
def height : Number #

gets the height of the image of an image object.


[View source]
def mask_image=(mask : Image) #

sets the mask image.

  • mask image object which is used as image-mask. This image must be 1bit gray-scale color image.

[View source]
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 and 255.
  • rmax upper limit of Red. It must be between 0 and 255.
  • gmin lower limit of Green. It must be between 0 and 255.
  • gmax upper limit of Green. It must be between 0 and 255.
  • bmin lower limit of Blue. It must be between 0 and 255.
  • bmax upper limit of Blue. It must be between 0 and 255.

[View source]
def size : Size #

gets the size of the image of an image object.


[View source]
def to_unsafe : LibHaru::Image #

[View source]
def width : Number #

gets the width of the image of an image object.


[View source]