class_docstr: Abstract decoder for :class:`~ffcv.fields.RGBImageField` that performs a crop and and a resize operation.
  
  It supports both variable and constant resolution datasets.
class_docstr_tok: ["Abstract","decoder","for",":","class",":","`","~ffcv.fields.RGBImageField","`","that","performs","a","crop","and","and","a","resize","operation",".","It","supports","both","variable","and","constant","resolution","datasets","."]
code: def declare_state_and_memory(
      self, previous_state: State
  ) -> Tuple[State, AllocationQuery]:
      widths = self.metadata["width"]
      heights = self.metadata["height"]
      # We convert to uint64 to avoid overflows
      self.max_width = np.uint64(widths.max())
      self.max_height = np.uint64(heights.max())
      output_shape = (self.output_size[0], self.output_size[1], 3)
      my_dtype = np.dtype("<u1")
  
      return (
          replace(
              previous_state,
              jit_mode=True,
              shape=output_shape,
              dtype=my_dtype,
          ),
          (
              AllocationQuery(output_shape, my_dtype),
              AllocationQuery(
                  (self.max_height * self.max_width * np.uint64(3),),
                  my_dtype,
              ),
          ),
      )
  
imports: from abc import ABCMeta, abstractmethod
  from dataclasses import replace
  from typing import Optional, Callable, TYPE_CHECKING, Tuple, Type
  import cv2
  import numpy
  from numba.typed import Dict
  from PIL.Image import Image
  from .base import Field, ARG_TYPE
  from ..pipeline.operation import Operation
  from ..pipeline.state import State
  from ..pipeline.compiler import Compiler
  from ..pipeline.allocation_query import AllocationQuery
  from ..libffcv import imdecode, memcpy, resize_crop
label_desc: Use image node_id 2 for calling the ResizedCropRGBImageDecoder obj's underlying member method code with example usage: obj.declare_state_and_memory(previous_state) and returns: replace,  AllocationQuery,  AllocationQuery