Loads the target pixel file.
352476
def load_tpf(self):
        '''
        

        '''

        if not self.loaded:
            if self._data is not None:
                data = self._data
            else:
                data = self._mission.GetData(
                         self.ID, season=self.season,
                         cadence=self.cadence,
                         clobber=self.clobber_tpf,
                         aperture_name=self.aperture_name,
                         saturated_aperture_name=self.saturated_aperture_name,
                         max_pixels=self.max_pixels,
                         saturation_tolerance=self.saturation_tolerance,
                         get_hires=self.get_hires,
                         get_nearby=self.get_nearby)
                if data is None:
                    raise Exception("Unable to retrieve target data.")
            self.cadn = data.cadn
            self.time = data.time
            self.model = np.zeros_like(self.time)
            self.fpix = data.fpix
            self.fraw = np.sum(self.fpix, axis=1)
            self.fpix_err = data.fpix_err
            self.fraw_err = np.sqrt(np.sum(self.fpix_err ** 2, axis=1))
            self.nanmask = data.nanmask
            self.badmask = data.badmask
            self.transitmask = np.array([], dtype=int)
            self.outmask = np.array([], dtype=int)
            self.aperture = data.aperture
            self.aperture_name = data.aperture_name
            self.apertures = data.apertures
            self.quality = data.quality
            self.Xpos = data.Xpos
            self.Ypos = data.Ypos
            self.mag = data.mag
            self.pixel_images = data.pixel_images
            self.nearby = data.nearby
            self.hires = data.hires
            self.saturated = data.saturated
            self.meta = data.meta
            self.bkg = data.bkg

            # Update the last breakpoint to the correct value
            self.breakpoints[-1] = len(self.time) - 1

            # Get PLD normalization
            self.get_norm()

            self.loaded = True
395272
public static Bitmap loadBitmap(String fileName, int scale) throws ImageLoadException {
        return loadBitmap(new FileSource(fileName), scale);
    }
671973
protected void loadWaterMarks() throws IOException {
        // Load source water marks from file
        if (file != null && file.exists()) {
            try {
                loadWaterMarks(file);
            } catch (IOException e) {
                if (fileOriginal != null && fileOriginal.exists()) {
                    loadWaterMarks(fileOriginal);
                }
            }
        }
    }
1004524
private void load(String filename)
	{
		try
		{
			load(new FileInputStream(filename));
		}
		catch (FileNotFoundException e)
		{
			e.printStackTrace();
		}
	}
522928
def load(self, data, size=None):
        """"""
        self.bind()
        if size is None:
            # ffi's sizeof understands arrays
            size = sizeof(data)
        if size == self.buffer_size:
            # same size - no need to allocate new buffer, just copy
            glBufferSubData(
                self.array_type,
                0,
                size,
                to_raw_pointer(data)
            )
        else:
            # buffer size has changed - need to allocate new buffer in the GPU
            glBufferData(
                self.array_type,
                size,
                to_raw_pointer(data),
                self.draw_type
            )
            self.buffer_size = size
        self.unbind()
1046328
def _load_img(handle, target_dtype=np.float32, size=None, **kwargs):
    """"""

    image_pil = PIL.Image.open(handle, **kwargs)

    # resize the image to the requested size, if one was specified
    if size is not None:
        if len(size) > 2:
            size = size[:2]
            log.warning("`_load_img()` received size: {}, trimming to first two dims!".format(size))
        image_pil = image_pil.resize(size, resample=PIL.Image.LANCZOS)

    image_array = np.asarray(image_pil)

    # remove alpha channel if it contains no information
    # if image_array.shape[-1] > 3 and 'A' not in image_pil.mode:
    # image_array = image_array[..., :-1]

    image_dtype = image_array.dtype
    image_max_value = np.iinfo(image_dtype).max  # ...for uint8 that's 255, etc.

    # using np.divide should avoid an extra copy compared to doing division first
    ndimage = np.divide(image_array, image_max_value, dtype=target_dtype)

    rank = len(ndimage.shape)
    if rank == 3:
        return ndimage
    elif rank == 2:
        return np.repeat(np.expand_dims(ndimage, axis=2), 3, axis=2)
    else:
        message = "Loaded image has more dimensions than expected: {}".format(rank)
        raise NotImplementedError(message)
28813
private void readBitmap() {
        // (sub)image position & size.
        header.currentFrame.ix = readShort();
        header.currentFrame.iy = readShort();
        header.currentFrame.iw = readShort();
        header.currentFrame.ih = readShort();

        int packed = read();
        // 1 - local color table flag interlace
        boolean lctFlag = (packed & 0x80) != 0;
        int lctSize = (int) Math.pow(2, (packed & 0x07) + 1);
        // 3 - sort flag
        // 4-5 - reserved lctSize = 2 << (packed & 7); // 6-8 - local color
        // table size
        header.currentFrame.interlace = (packed & 0x40) != 0;
        if (lctFlag) {
            // Read table.
            header.currentFrame.lct = readColorTable(lctSize);
        } else {
            // No local color table.
            header.currentFrame.lct = null;
        }

        // Save this as the decoding position pointer.
        header.currentFrame.bufferFrameStart = rawData.position();

        // False decode pixel data to advance buffer.
        skipImageData();

        if (err()) {
            return;
        }

        header.frameCount++;
        // Add image to frame.
        header.frames.add(header.currentFrame);
    }
361680
public void load() throws IOException {
		numericData = muffin.loadFile(fileName + "_Number");
		stringData = muffin.loadFile(fileName + "_String");
	}
436906
def _load_texture(file_name, resolver):
    
    file_data = resolver.get(file_name)
    image = PIL.Image.open(util.wrap_as_stream(file_data))
    return image
514039
public void load() {
		int resp = loadChooser.showOpenDialog(this);
		if (resp == JFileChooser.APPROVE_OPTION) {
			lastSelected = loadChooser.getSelectedFile();
			saveChooser.setCurrentDirectory(loadChooser.getCurrentDirectory());
			try {
				BufferedImage image = ImageIO.read(lastSelected);
				imagePanel.setImage(image);
			} catch (Exception e) {
				e.printStackTrace();
				JOptionPane.showMessageDialog(this, "Unable to load image "+lastSelected.getName()+" ");
			}
		}
	}
251606
def _load_general(data, targets, major_axis):
    """"""
    for d_src, d_targets, axis in zip(data, targets, major_axis): # pylint: disable=too-many-nested-blocks
        if isinstance(d_targets, nd.NDArray):
            d_src.copyto(d_targets)
        elif isinstance(d_src, (list, tuple)):
            for src, dst in zip(d_src, d_targets):
                src.copyto(dst)
        else:
            for slice_idx, d_dst in d_targets:
                if axis >= 0:
                    # copy slice
                    shape = d_src.shape
                    do_crop = (slice_idx.start != 0 or shape[axis] != slice_idx.stop)
                    # pylint: disable=no-member,protected-access
                    if do_crop:
                        if axis == 0:
                            d_src[slice_idx.start:slice_idx.stop].copyto(d_dst)
                        else:
                            if d_src.context == d_dst.context:
                                nd.slice_axis(d_src, axis=axis, begin=slice_idx.start,
                                              end=slice_idx.stop, out=d_dst)
                            else:
                                # on different device, crop and then do cross device copy
                                d_dst_copy = nd.slice_axis(d_src, axis=axis, begin=slice_idx.start,
                                                           end=slice_idx.stop)
                                d_dst_copy.copyto(d_dst)
                    else:
                        d_src.copyto(d_dst)
                    # pylint: enable=no-member,protected-access
                else:
                    d_src.copyto(d_dst)
898416
def _target_load(self, load):
        '''
        
        '''
        mp_call = _metaproxy_call(self.opts, 'target_load')
        return mp_call(self, load)
1235062
def _load_shader(filename):
    """"""
    curdir = op.dirname(op.realpath(__file__))
    glsl_path = op.join(curdir, 'glsl')
    path = op.join(glsl_path, filename)
    with open(path, 'r') as f:
        return f.read()
364587
def load_image_from_disk(img_spec):
    """"""

    if isinstance(img_spec, str):
        if pexists(realpath(img_spec)):
            hdr = nib.load(img_spec)
            # trying to stick to an orientation
            hdr = nib.as_closest_canonical(hdr)
            img = hdr.get_data()
        else:
            raise IOError('Given path to image does not exist!')
    elif isinstance(img_spec, np.ndarray):
        img = img_spec
    else:
        raise ValueError('Invalid input specified! '
                         'Input either a path to image data, or provide 3d Matrix directly.')

    return img
864473
@Override
   public void loadTiff(URL tiff, ImageProcessor imageProcessor, int... pages) throws VectorPrintException {
      try {
         if (log.isLoggable(Level.FINE)) {
            log.fine(String.format("loading tiff from %s", String.valueOf(tiff)));
         }
         if ("file".equals(tiff.getProtocol())) {
            loadTiff(new File(tiff.getFile()), imageProcessor, pages);
         } else {
            loadTiff(tiff.openStream(), imageProcessor, pages);
         }
      } catch (IOException ex) {
         throw new VectorPrintException(String.format("unable to load image %s", tiff.toString()), ex);
      }
   }
403139
def load(self, draw_bbox = False, **kwargs):
        '''  '''
        im = Image.new('RGBA', self.img_size)
        draw = None
        if draw_bbox:
            draw = ImageDraw.Draw(im)

        for sprite in self.images:
            data = sprite.load()
            sprite_im = Image.open(BytesIO(data))

            size = sprite.imgrect
            im.paste(sprite_im, (size[0], size[2]))
            if draw_bbox:
                draw.rectangle((size[0], size[2], size[1], size[3]), outline='red')

        del draw
        b = BytesIO()
        im.save(b, format = 'PNG')
        return b.getvalue()
1172858
public static Bitmap loadBitmap(Uri uri, Context context) throws ImageLoadException {
        return loadBitmap(new UriSource(uri, context));
    }