use crate::validation::Validate;
use crate::{buffer, extensions, Extras, Index};
use gltf_derive::Validate;
use serde_derive::{Deserialize, Serialize};
pub const VALID_MIME_TYPES: &[&str] = &["image/jpeg", "image/png"];
#[derive(Clone, Debug, Deserialize, Serialize, Validate)]
pub struct Image {
#[serde(rename = "bufferView")]
#[serde(skip_serializing_if = "Option::is_none")]
pub buffer_view: Option<Index<buffer::View>>,
#[serde(rename = "mimeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mime_type: Option<MimeType>,
#[cfg(feature = "names")]
#[cfg_attr(feature = "names", serde(skip_serializing_if = "Option::is_none"))]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub extensions: Option<extensions::image::Image>,
#[serde(default)]
#[cfg_attr(feature = "extras", serde(skip_serializing_if = "Option::is_none"))]
#[cfg_attr(not(feature = "extras"), serde(skip_serializing))]
pub extras: Extras,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MimeType(pub String);
impl Validate for MimeType {}