Class: Magick::Image::View

### Home Classes Methods

### In Files

- lib/RMagick.rb

### Parent

Object

### Namespace

- CLASS Magick::Image::View::Pixels
- CLASS Magick::Image::View::Rows

### Methods

- ::new
- #[]
- #sync
- #update

### Files

- MANIFEST
- Makefile

### Class/Module Index

Quicksearch

- Magick
- Magick::DestroyedImageError
- Magick::Draw
- Magick::Enum
- Magick::FatalImageMagickError
- Magick::Geometry
- Magick::GeometryValue
- Magick::GradientFill
- Magick::HatchFill
- Magick::IPTC
- Magick::IPTC::Application
- Magick::IPTC::Envelope
- Magick::IPTC::ObjectData
- Magick::IPTC::Post_ObjectData_Descriptor
- Magick::IPTC::Pre_ObjectData_Descriptor
- Magick::Image
- Magick::Image::DrawOptions
- Magick::Image::Info
- Magick::Image::PolaroidOptions
- Magick::Image::View
- Magick::Image::View::Pixels
- Magick::Image::View::Rows
- Magick::ImageList
- Magick::ImageList::Montage
- Magick::ImageMagickError
- Magick::OptionalMethodArguments
- Magick::Pixel
- Magick::RVG
- Magick::RVG::Circle
- Magick::RVG::ClipPath
- Magick::RVG::Describable
- Magick::RVG::Duplicatable
- Magick::RVG::Ellipse
- Magick::RVG::Embellishable
- Magick::RVG::Group
- Magick::RVG::Image
- Magick::RVG::ImageConstructors
- Magick::RVG::Line
- Magick::RVG::Path
- Magick::RVG::PathData
- Magick::RVG::Pattern
- Magick::RVG::PolyShape
- Magick::RVG::Polygon
- Magick::RVG::Polyline
- Magick::RVG::PreserveAspectRatio
- Magick::RVG::Rect
- Magick::RVG::ShapeConstructors
- Magick::RVG::Stretchable
- Magick::RVG::StructureConstructors
- Magick::RVG::Stylable
- Magick::RVG::Text
- Magick::RVG::TextBase
- Magick::RVG::TextConstructors
- Magick::RVG::Transformable
- Magick::RVG::Use
- Magick::RVG::UseConstructors
- Magick::RVG::Utility
- Magick::RVG::Utility::DefaultTextStrategy
- Magick::RVG::Utility::GraphicContext
- Magick::RVG::Utility::LRTextStrategy
- Magick::RVG::Utility::RLTextStrategy
- Magick::RVG::Utility::TBTextStrategy
- Magick::RVG::Utility::TextAttributes
- Magick::RVG::Utility::TextStrategy
- Magick::TextureFill
- Object

No matching classes.

# Magick::Image::View

Magick::Image::View class

### Attributes

dirty[RW]
height[R]
width[R]
x[R]
y[R]

### Public Class Methods

new(img, x, y, width, height) click to toggle source

    # File lib/RMagick.rb, line 1061
    def initialize(img, x, y, width, height)
        img.check_destroyed
        if width <= 0 || height <= 0
            Kernel.raise ArgumentError, "invalid geometry (#{width}x#{height}+#{x}+#{y})"
        end
        if x < 0 || y < 0 || (x+width) > img.columns || (y+height) > img.rows
            Kernel.raise RangeError, "geometry (#{width}x#{height}+#{x}+#{y}) exceeds image boundary"
        end
        @view = img.get_pixels(x, y, width, height)
        @img = img
        @x = x
        @y = y
        @width = width
        @height = height
        @dirty = false
    end

### Public Instance Methods

[](*args) click to toggle source

    # File lib/RMagick.rb, line 1078
    def [](*args)
        rows = Rows.new(@view, @width, @height, args)
        rows.add_observer(self)
        return rows
    end

sync(force=false) click to toggle source

Store changed pixels back to image

    # File lib/RMagick.rb, line 1085
    def sync(force=false)
        @img.store_pixels(x, y, width, height, @view) if (@dirty || force)
        return (@dirty || force)
    end

update(rows) click to toggle source

Get update from Rows - if @dirty ever becomes true, don't change it back to false!

    # File lib/RMagick.rb, line 1092
    def update(rows)
        @dirty = true
        rows.delete_observer(self)      # No need to tell us again.
        nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.