Class: Sketchup::ImageRep
- Inherits:
-
Object
- Object
- Sketchup::ImageRep
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb
Overview
References an image representation object.
Instance Method Summary collapse
-
#bits_per_pixel ⇒ Integer
The #bits_per_pixel method gets the number of bits per pixel in the image.
-
#color_at_uv(u, v, bilinear = false) ⇒ Sketchup::Color?
The #color_at_uv method returns a color corresponding to the UV texture coordinates.
- #colors ⇒ Array<Sketchup::Color>?
-
#data ⇒ String?
The #data method gets the pixel data for an image in a string of bytes.
-
#height ⇒ Integer
The #height method returns the height of an image.
-
#initialize(*args) ⇒ Sketchup::ImageRep
constructor
The #initialize method creates a new image object.
-
#load_file(filepath) ⇒ Object
The #load_file method loads image data from the specified file.
-
#row_padding ⇒ Integer
The #row_padding method returns the size of the row padding of an image in bytes.
-
#save_file(filepath) ⇒ Object
The #save_file method saves an image data object to an image file specified by a path.
- #set_data(width, height, bits_per_pixel, row_padding, pixel_data) ⇒ Sketchup::ImageRep
-
#size ⇒ Integer
The #size method gets the total size of the image data in bytes.
-
#width ⇒ Integer
The #width method returns the width of an image.
Constructor Details
#initialize ⇒ Sketchup::ImageRep #initialize(filepath) ⇒ Sketchup::ImageRep
The #initialize method creates a new image object. The image object will have no data if a path to the image is not provided.
122 123 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 122 def initialize(*args) end |
Instance Method Details
#bits_per_pixel ⇒ Integer
The #bits_per_pixel method gets the number of bits per pixel in the image.
28 29 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 28 def bits_per_pixel end |
#color_at_uv(u, v, bilinear = false) ⇒ Sketchup::Color?
The #color_at_uv method returns a color corresponding to the UV texture coordinates. 0.0, 0.0 maps to the bottom left and 1.0, 1.0 to the top right of the image.
54 55 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 54 def color_at_uv(u, v, bilinear = false) end |
#colors ⇒ Array<Sketchup::Color>?
68 69 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 68 def colors end |
#data ⇒ String?
The byte order of the pixels are RGB(A) on macOS and BGR(A) on Windows.
The #data method gets the pixel data for an image in a string of bytes.
84 85 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 84 def data end |
#height ⇒ Integer
The #height method returns the height of an image.
97 98 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 97 def height end |
#load_file(filepath) ⇒ Object
The #load_file method loads image data from the specified file.
136 137 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 136 def load_file(filepath) end |
#row_padding ⇒ Integer
The #row_padding method returns the size of the row padding of an image in bytes.
150 151 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 150 def row_padding end |
#save_file(filepath) ⇒ Object
The #save_file method saves an image data object to an image file specified by a path.
165 166 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 165 def save_file(filepath) end |
#set_data(width, height, bits_per_pixel, row_padding, pixel_data) ⇒ Sketchup::ImageRep
The byte order of the pixels are RGB(A) on macOS and BGR(A) on Windows.
The encoding of the pixel_data String parameter should be ASCII-8BIT. Any other encoding could corrupt the binary data. Using ‘Array#pack(“C*”)` gives correct encoding.
The #set_data method discards any existing data and sets new pixel data for the Sketchup::ImageRep.
237 238 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 237 def set_data(width, height, bits_per_pixel, row_padding, pixel_data) end |
#size ⇒ Integer
The #size method gets the total size of the image data in bytes.
250 251 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 250 def size end |
#width ⇒ Integer
The #width method returns the width of an image.
263 264 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb', line 263 def width end |