Lines Matching refs:subset
20 * Corrects image subset offsets and dimensions in order to perform a valid decode.
21 * Also indicates if the image subset should be placed at an offset within the
27 * @param subset As input, the subset that the client requested.
28 * As output, the image subset that we will decode.
29 * @param outX The left offset of the image subset within the output bitmap.
30 * @param outY The top offset of the image subset within the output bitmap.
32 * @return An indication of how the subset is contained in the image.
35 inline SubsetType adjust_subset_rect(const SkISize& imageDims, SkIRect* subset, int* outX,
38 int left = std::max(0, subset->fLeft);
39 int top = std::max(0, subset->fTop);
42 *outX = left - subset->fLeft;
43 *outY = top - subset->fTop;
45 // Make sure we don't decode pixels past the edge of the image or past the edge of the subset.
46 int width = std::min(imageDims.width() - left, subset->width() - *outX);
47 int height = std::min(imageDims.height() - top, subset->height() - *outY);
52 subset->setXYWH(left, top, width, height);
53 if ((*outX != 0) || (*outY != 0) || (width != subset->width()) ||
54 (height != subset->height())) {