class GPhoto2::CameraFile
- GPhoto2::CameraFile
- Reference
- Object
Included Modules
Defined in:
gphoto2/camera_file.crConstant Summary
-
BUFFER_SIZE =
256 * 1024
-
Initial buffer size used in
#read
. -
PREVIEW_FILENAME =
"capture_preview.jpg"
-
The preview data is assumed to be a jpg.
Constructors
-
.new(camera : GPhoto2::Camera, path : Path | String)
NOTE allocates memory.
-
.new(camera : GPhoto2::Camera)
NOTE allocates memory.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. -
#close : Nil
NOTE frees allocated memory.
-
#data : Pointer(UInt8)
Returns pointer file data.
-
#delete : Nil
Deletes file from the camera.
-
#finalize
Finalizes object by freeing allocated memory.
- #folder
-
#info : CameraFileInfo
Returns an object containing information about the file.
- #name
-
#path : Path
Returns file path.
-
#preview?
Returns
true
if file is a preview. -
#read : Bytes
Reads file directly from the camera.
-
#save(path : Path | String = default_filename) : Nil
Saves file
#data
at given pathname. -
#size : UInt64
Returns file size (in bytes).
-
#to_s
Returns file
#path
. -
#to_slice : Bytes
Returns file
#data
asBytes
.
Instance methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraFile)
ptr : Pointer(T)
ptr,
ptr? : Pointer(T) | Nil
ptr?,
to_unsafe : Pointer(T)
to_unsafe,
wrapped : T
wrapped
Constructor methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraFile)
new(ptr : Pointer(T) | Nil = nil)
new
Constructor Detail
Instance Method Detail
def ==(other : self)
#
Description copied from class Reference
Returns true
if this reference is the same as other. Invokes same?
.