001/*
002 * (C) Copyright 2006-2008 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id$
020 *
021 */
022package org.nuxeo.ecm.platform.pictures.tiles.api;
023
024import java.util.Map;
025
026import org.nuxeo.ecm.core.api.Blob;
027import org.nuxeo.ecm.platform.pictures.tiles.api.imageresource.ImageResource;
028
029/**
030 * Interface for the Service that generate the PictureTiles.
031 *
032 * @author tiry
033 */
034public interface PictureTilingService {
035
036    /**
037     * Gets the picture tiles from a blob.
038     *
039     * @param blob
040     * @param tileWidth
041     * @param tileHeight
042     * @param maxTiles
043     * @return
044     */
045    @Deprecated
046    PictureTiles getTilesFromBlob(Blob blob, int tileWidth, int tileHeight, int maxTiles);
047
048    /**
049     * Gets the picture tiles from a blob Tiles are lazily generated.
050     *
051     * @param blob
052     * @param tileWidth
053     * @param tileHeight
054     * @param maxTiles
055     * @param progressive
056     * @return
057     */
058    @Deprecated
059    PictureTiles getTilesFromBlob(Blob blob, int tileWidth, int tileHeight, int maxTiles, int xCenter, int yCenter,
060            boolean fullGeneration);
061
062    PictureTiles completeTiles(PictureTiles existingTiles, int xCenter, int yCenter);
063
064    PictureTiles getTiles(ImageResource resource, int tileWidth, int tileHeight, int maxTiles);
065
066    PictureTiles getTiles(ImageResource resource, int tileWidth, int tileHeight, int maxTiles, int xCenter,
067            int yCenter, boolean fullGeneration);
068
069    void setWorkingDirPath(String path);
070
071    Map<String, String> getBlobProperties();
072
073    String getBlobProperty(String docType);
074
075    String getBlobProperty(String docType, String defaultValue);
076
077    void removeCacheEntry(ImageResource resource);
078
079}