/* akvcam, virtual camera for Linux.
 * Copyright (C) 2018  Gonzalo Exequiel Pedone
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef AKVCAM_FRAME_TYPES_H
#define AKVCAM_FRAME_TYPES_H

#include <linux/types.h>

struct akvcam_frame;
typedef struct akvcam_frame *akvcam_frame_t;
typedef const struct akvcam_frame *akvcam_frame_ct;

static inline uint32_t akvcam_xyza(int x, int y, int z, int a)
{
    return ((a & 0xff) << 24) | ((x & 0xff) << 16) | ((y & 0xff) << 8) | (z & 0xff);
}

static inline uint32_t akvcam_xyz(int x, int y, int z)
{
    return akvcam_xyza(x, y, z, 255);
}

#endif // AKVCAM_FRAME_TYPES_H
