paul@118 | 1 | /* |
paul@118 | 2 | * Common image-related functions. |
paul@118 | 3 | * |
paul@118 | 4 | * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> |
paul@118 | 5 | * |
paul@118 | 6 | * This program is free software: you can redistribute it and/or modify |
paul@118 | 7 | * it under the terms of the GNU General Public License as published by |
paul@118 | 8 | * the Free Software Foundation, either version 3 of the License, or |
paul@118 | 9 | * (at your option) any later version. |
paul@118 | 10 | * |
paul@118 | 11 | * This program is distributed in the hope that it will be useful, |
paul@118 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@118 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@118 | 14 | * GNU General Public License for more details. |
paul@118 | 15 | * |
paul@118 | 16 | * You should have received a copy of the GNU General Public License |
paul@118 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@118 | 18 | */ |
paul@118 | 19 | |
paul@118 | 20 | #include "image.h" |
paul@118 | 21 | |
paul@118 | 22 | |
paul@118 | 23 | |
paul@119 | 24 | /* Obtain the position for the stored region from the given frame. */ |
paul@119 | 25 | |
paul@119 | 26 | position_t *image_get_stored_position(stored_regions_t *r, int frame) |
paul@118 | 27 | { |
paul@119 | 28 | return &r->pos[frame]; |
paul@119 | 29 | } |
paul@118 | 30 | |
paul@119 | 31 | /* Obtain the image data for the stored region from the given frame. */ |
paul@119 | 32 | |
paul@119 | 33 | uint8_t *image_get_stored_region(stored_regions_t *r, int frame) |
paul@119 | 34 | { |
paul@119 | 35 | return r->image + r->size * frame; |
paul@118 | 36 | } |