Picture rendering options

 Returns the +default_render_format+ of the associated +Alchemy::Picture+
 together with the +crop_from+ and +crop_size+ values

 @return [HashWithIndifferentAccess]
176840
def picture_url_options
      return {} if picture.nil?

      {
        format: picture.default_render_format,
        crop_from: crop_from.presence,
        crop_size: crop_size.presence
      }.with_indifferent_access
    end
836921
def to_format
      if !get? && has_errors? && !response_overridden?
        display_errors
      elsif has_view_rendering? || response_overridden?
        default_render
      else
        api_behavior
      end
    rescue ActionView::MissingTemplate
      api_behavior
    end
79464
def render
      raise ArgumentError, "Block required" unless block_given?
      raise Error, "Can't nest rendering" if rendering?

      $window.flush # Ensure that any drawing _before_ the render block is drawn to screen, rather than into the buffer.

      render_

      @rendering = true

      # Project onto the texture itself, using Gosu (inverted) coordinates.
      Gl.glPushMatrix
      Gl.glMatrixMode Gl::GL_PROJECTION
      Gl.glLoadIdentity
      Gl.glViewport 0, 0, width, height
      Gl.glOrtho 0, width, height, 0, -1, 1

      begin
        yield self
      ensure
        $window.flush # Force all the drawing to draw now!
        Gl.glBindFramebufferEXT Gl::GL_FRAMEBUFFER_EXT, 0

        @rendering = false

        Gl.glPopMatrix

        cache.refresh # Force lazy reloading of the cache.
      end

      self
    end
1305620
def render(format = :html, position = :prefix, colors = Screen.default_css_colors)
			case format
			when :html
				case position
				when :prefix
					style_code = css_style(colors)
					if style_code
						return %Q|<span style="#{style_code}">|
					else
						return ''
					end
				when :postfix
					style_code = css_style(colors)
					if style_code
						return '</span>'
					else
						return ''
					end
				end
			when :text
				return ''
			end
		end
1168746
def render(options=nil, deprecated_status_or_extra_options=nil, &block)
      if ::Rails::VERSION::STRING >= '2.0.0' && deprecated_status_or_extra_options.nil?
        deprecated_status_or_extra_options = {}
      end

      unless block_given?
        if @template.respond_to?(:finder)
          (class << @template.finder; self; end).class_eval do
            define_method :file_exists? do; true; end
          end
        else
          (class << @template; self; end).class_eval do
            define_method :file_exists? do; true; end
          end
        end
        (class << @template; self; end).class_eval do
          define_method :render_file do |*args|
            @first_render ||= args[0] unless args[0] =~ /^layouts/
            @_first_render ||= args[0] unless args[0] =~ /^layouts/
          end

          define_method :_pick_template do |*args|
            @_first_render ||= args[0] unless args[0] =~ /^layouts/
            PickedTemplate.new
          end
        end
      end

      super(options, deprecated_status_or_extra_options, &block)
    end
238552
def request_format
        format = request_params[:format]

        if format.nil? && context_scope.respond_to?(:request)
          request = context_scope.request
          format = request.format.to_sym.to_s if request.respond_to?(:format)
        end

        format = "json" unless format && respond_to?("to_#{format}")

        format
      end
1081532
def allow_image_cropping?(options = {})
      content && content.settings_value(:crop, options) && picture &&
        picture.can_be_cropped_to(
          content.settings_value(:size, options),
          content.settings_value(:upsample, options)
        )
    end
606571
def images(args={})
      hashes = con.describe_images('Owner' => 'self').body['imagesSet'].collect do |hash|
        h = {}
        h[:image_id]  = hash['imageId']
        h[:name]  = hash['name']
        h[:rootDeviceType] = hash['rootDeviceType']
        h
      end 
      puts Formatador.display_table(hashes)
    end
109695
def render_thumbnail_tag(document, image_options = {}, url_options = {})
      link_to image_tag(thumbnail_url(document)), url_for_document(document)
    end
190219
def to_commonmark(options = :DEFAULT, width = 120)
      opts = Config.process_options(options, :render)
      _render_commonmark(opts, width).force_encoding('utf-8')
    end
1372700
def to_hash
      h = {:width => width, :height => height, :bits => bits, :comment => comment}
      h.merge!(exif) if exif?
      h
    end
492654
def render_default(data, format=:markdown, name='render_default.md')
      # set instance vars so we're able to render data without a wiki or page.
      @format = format
      @name   = name

      chain = [:Metadata, :PlainText, :Emoji, :TOC, :RemoteCode, :Code, :Sanitize, :WSD, :Tags, :Render]

      filter_chain = chain.map do |r|
        Gollum::Filter.const_get(r).new(self)
      end

      process_chain data, filter_chain
    end
1001005
def add_output_option(option_name, *args)
      (@output_options ||= []).push(option_name)
      args.each { |ea| @output_options.push(Shellwords.escape(ea.to_s)) }

      # if we're a resize call, let's give the -size render hint to gm, but only when it's safe:
      # * we don't have input options yet,
      # * we're not cropping (because the -size will prevent the crop from working),
      # * and we have dimensions in the form of NNNxNNN
      if %w{-geometry -resize -sample -scale}.include?(option_name) &&
        @input_options.empty? &&
        !@output_options.include?('-crop')
        dimensions = args.first
        if dimensions.to_s =~ /\A(\d+x\d+)\z/
          @input_options.push('-size', dimensions)
        end
      end
      # Support call chaining:
      self
    end
1092743
def crop(size, crop_from = nil, crop_size = nil, upsample = false)
      raise "No size given!" if size.empty?
      render_to = sizes_from_string(size)
      if crop_from && crop_size
        top_left = point_from_string(crop_from)
        crop_dimensions = sizes_from_string(crop_size)
        xy_crop_resize(render_to, top_left, crop_dimensions, upsample)
      else
        center_crop(render_to, upsample)
      end
    end
1351113
def format(options = {})
      options = options.dup
      o = {}
      o[k = :color] = (v = options.delete(k)).nil?? true : v
      raise ArgumentError, "Unknown option(s): #{options.inspect}" if not options.empty?

      require_valid

      Colorize.colorize *[
        (own?? [[:list_method, :own_marker], OWN_MARKER[0]] : [[:list_method, :not_own_marker], OWN_MARKER[1]]),
        [[:list_method, :obj_module_name], obj_module_name],
        ([[:list_method, :owner_name], "(#{owner_name})"] if not own?),
        [[:list_method, :access], access],
        [[:list_method, :name], method_name],
        ([[:list_method, :visibility], " [#{visibility}]"] if not public?),
        [[:reset]],
      ].compact.flatten(1).reject {|v| v.is_a? Array and not o[:color]}
    end
484984
def hash(self):
        

        renderer_str = "{}|{}|{}|{}".format(
            self.renderer.__class__.__name__, self.renderer.colormap, self.renderer.fill_value,
            self.renderer.background_color
        )
        if isinstance(self.renderer, StretchedRenderer):
            renderer_str = "{}|{}|{}".format(renderer_str, self.renderer.method, self.renderer.colorspace)
        elif isinstance(self.renderer, UniqueValuesRenderer):
            renderer_str = "{}|{}".format(renderer_str, self.renderer.labels)

        return hash("{}/{}/{}".format(self.variable.pk, renderer_str, self.time_index))
1026372
def image(img = nil)
      return @image if img.nil?
      ImageGC.instance.add(img.id) if @options[:rm]
      @image = img
    end