class CryMagick::Image
- CryMagick::Image
- Reference
- Object
Defined in:
crymagick/image.crcrymagick/image/info.cr
Constructors
Class Method Summary
- .build(path : String, tempfile = nil, &)
-
.create(ext : String = "", validate : Bool = Configuration.validate_on_create, &)
Creates tempfile and yields it for writing.
- .import_pixels(blob : Array(Int), columns : Int, rows : Int, depth : Int, map : String | Symbol, format : String = "png")
- .import_pixels(blob : Slice(Int), columns : Int, rows : Int, depth : Int, map : String | Symbol, format : String = "png")
-
.open(path : String, ext : String? = nil)
Creates new Image from given path
-
.read(file : String, ext : String = "")
Reads given string-based file with optional extension.
- .read(file : IO, ext : String = "")
Instance Method Summary
- #==(other : Image)
- #[](value)
- #collapse!(frame : Int32 = 0)
- #colorspace
- #combine_options(&)
- #composite(other_image, output_ext = type.downcase, mask : String? = nil, &)
- #composite(other_image, output_ext = type.downcase, mask : String? = nil)
- #data
- #destroy!
- #details
- #dimensions
- #exif
-
#format(_format, page : String | Int = "0", read_options : Hash(String, String) = {} of String => String, &)
This is used to change the format of the image.
- #format(_format, page : String = "0", read_options : Hash(String, String) = {} of String => String)
- #frames
- #get_pixels
-
#hash
Generates an
UInt64
hash value for this object. - #height
- #human_size
- #identify
- #identify(&)
- #layer?
- #layers
- #mime_type
- #mogrify(page : Int32? = nil)
- #mogrify(page : Int32? = nil, &)
- #pages
- #path : String
- #resolution(unit : String = "")
- #run_command(tool_name : String, *args)
- #signature
- #size
- #tempfile : File?
- #tempfile!
- #type
- #valid?
- #validate!
- #width
- #write(output_to : String)
- #write(output : IO)
Macro Summary
Constructor Detail
Class Method Detail
Creates tempfile and yields it for writing.
Creates new Image from given path
TODO allow to pass url
Reads given string-based file with optional extension.
Instance Method Detail
This is used to change the format of the image. That is, from "tiff to jpg" or something like that.
Once you run it, the instance is pointing to a new file with a new extension!
DANGER: This renames the file that the instance is pointing to. So, if you manually opened the file with Image.new(file_path)... Then that file is DELETED! If you used Image.open(file) then you are OK. The original file will still be there. But, any changes to it might not be...
page = -1 for all frames
TODO fix converting several frames - point current image to first one (now it points to empty img)
Generates an UInt64
hash value for this object.
This method must have the property that a == b
implies a.hash == b.hash
.
The hash value is used along with #==
by the Hash
class to determine if two objects
reference the same hash key.
Subclasses must not override this method. Instead, they must define hash(hasher)
,
though usually the macro def_hash
can be used to generate this method.